[PR #302] [MERGED] feat(javascript): add binding and constant-value semantic IR #1938

Closed
opened 2026-10-16 21:12:40 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/302
Author: @N0zoM1z0
Created: 7/17/2026
Status: ✅ Merged
Merged: 7/17/2026
Merged by: @N0zoM1z0

Base: main ← Head: agent/javascript-semantic-ir


📝 Commits (1)

  • 3d71bb5 feat(javascript): add binding and constant-value semantic IR

📊 Changes

78 files changed (+4730 additions, -59 deletions)

View changed files

📝 docs/api/assets/hierarchy.js (+1 -1)
📝 docs/api/assets/navigation.js (+1 -1)
📝 docs/api/assets/search.js (+1 -1)
📝 docs/api/classes/application_PermissionAuthority.PermissionPathError.html (+1 -1)
📝 docs/api/classes/application_ProcessCaptureError.ProcessCaptureError.html (+1 -1)
📝 docs/api/classes/application_ProjectPermissionStore.ProjectPermissionStoreError.html (+1 -1)
📝 docs/api/classes/browser_BrowserProcessStartup.BrowserStartupError.html (+1 -1)
📝 docs/api/classes/domain_permissionPolicy.PermissionGrantError.html (+1 -1)
📝 docs/api/classes/ghidra_GhidraLauncher.GhidraLaunchError.html (+1 -1)
📝 docs/api/classes/ghidra_GhidraSessionError.GhidraSessionError.html (+1 -1)
📝 docs/api/classes/ghidra_protocol.GhidraRemoteError.html (+1 -1)
➕ docs/api/functions/domain_javascriptSemanticAnalysis.analyzeJavaScriptSemantics.html (+45 -0)
➕ docs/api/functions/domain_javascriptSemanticIr.failedJavaScriptSemanticIr.html (+40 -0)
➕ docs/api/functions/domain_javascriptSemanticIr.semanticBinding.html (+45 -0)
➕ docs/api/functions/domain_javascriptSemanticIr.semanticReferenceAt.html (+46 -0)
➕ docs/api/functions/domain_javascriptSemanticProjection.collectSemanticCallable.html (+44 -0)
➕ docs/api/functions/domain_javascriptSemanticProjection.collectSemanticModuleLink.html (+45 -0)
➕ docs/api/functions/domain_javascriptSemanticProjection.collectSemanticReferences.html (+45 -0)
➕ docs/api/functions/domain_javascriptSemanticProjection.immutableSemanticBindings.html (+44 -0)
➕ docs/api/functions/domain_javascriptSemanticProjection.immutableSemanticScopes.html (+44 -0)

...and 58 more files

📄 Description

What

  • add a provider-neutral, execution-free JavaScript Semantic IR for lexical scopes, bindings, references, callables, and module links
  • propagate bounded literals, templates, object/array projections, aliases, destructuring, and module provenance
  • fail closed for parse recovery, dynamic properties, cycles, ambiguity, incomplete scopes, and explicit collection/value limits
  • generate TypeDoc pages and add deterministic, regression, boundary, and property-based tests

Why

Electron analysis needs binding-aware semantics before it can reliably distinguish imported Electron APIs, local shadows, aliases, and constant IPC/channel values. The existing AST-only analysis could recognize syntax shapes but could not preserve this provider-neutral semantic evidence.

Impact

This is additive domain infrastructure and does not change the caller-visible Electron graph or grant execution authority. Follow-up work can consume the IR for CommonJS/ESM graph composition and Electron-specific provenance without placing provider-specific code in the domain layer.

Root cause

REA lacked a bounded lexical binding model and constant-value lattice, so aliasing, destructuring, shadowing, and dynamic-property uncertainty could not be represented precisely.

Checks

  • npm run check
  • npm run knip
  • npm run jscpd
  • npm run scan:todos
  • npm run verify:package
  • npx vitest run tests/javascriptSemanticAnalysis.test.ts --coverage.enabled=false

verify:application-workflows was also probed; it correctly requires operator-provided --left and --right app/ASAR paths and therefore is not runnable target-free.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/302 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 7/17/2026 **Status:** ✅ Merged **Merged:** 7/17/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `agent/javascript-semantic-ir` --- ### 📝 Commits (1) - [`3d71bb5`](https://github.com/morluto/rea/commit/3d71bb551e3353df23afa5832883e5074fe0f2d0) feat(javascript): add binding and constant-value semantic IR ### 📊 Changes **78 files changed** (+4730 additions, -59 deletions) <details> <summary>View changed files</summary> 📝 `docs/api/assets/hierarchy.js` (+1 -1) 📝 `docs/api/assets/navigation.js` (+1 -1) 📝 `docs/api/assets/search.js` (+1 -1) 📝 `docs/api/classes/application_PermissionAuthority.PermissionPathError.html` (+1 -1) 📝 `docs/api/classes/application_ProcessCaptureError.ProcessCaptureError.html` (+1 -1) 📝 `docs/api/classes/application_ProjectPermissionStore.ProjectPermissionStoreError.html` (+1 -1) 📝 `docs/api/classes/browser_BrowserProcessStartup.BrowserStartupError.html` (+1 -1) 📝 `docs/api/classes/domain_permissionPolicy.PermissionGrantError.html` (+1 -1) 📝 `docs/api/classes/ghidra_GhidraLauncher.GhidraLaunchError.html` (+1 -1) 📝 `docs/api/classes/ghidra_GhidraSessionError.GhidraSessionError.html` (+1 -1) 📝 `docs/api/classes/ghidra_protocol.GhidraRemoteError.html` (+1 -1) ➕ `docs/api/functions/domain_javascriptSemanticAnalysis.analyzeJavaScriptSemantics.html` (+45 -0) ➕ `docs/api/functions/domain_javascriptSemanticIr.failedJavaScriptSemanticIr.html` (+40 -0) ➕ `docs/api/functions/domain_javascriptSemanticIr.semanticBinding.html` (+45 -0) ➕ `docs/api/functions/domain_javascriptSemanticIr.semanticReferenceAt.html` (+46 -0) ➕ `docs/api/functions/domain_javascriptSemanticProjection.collectSemanticCallable.html` (+44 -0) ➕ `docs/api/functions/domain_javascriptSemanticProjection.collectSemanticModuleLink.html` (+45 -0) ➕ `docs/api/functions/domain_javascriptSemanticProjection.collectSemanticReferences.html` (+45 -0) ➕ `docs/api/functions/domain_javascriptSemanticProjection.immutableSemanticBindings.html` (+44 -0) ➕ `docs/api/functions/domain_javascriptSemanticProjection.immutableSemanticScopes.html` (+44 -0) _...and 58 more files_ </details> ### 📄 Description ## What - add a provider-neutral, execution-free JavaScript Semantic IR for lexical scopes, bindings, references, callables, and module links - propagate bounded literals, templates, object/array projections, aliases, destructuring, and module provenance - fail closed for parse recovery, dynamic properties, cycles, ambiguity, incomplete scopes, and explicit collection/value limits - generate TypeDoc pages and add deterministic, regression, boundary, and property-based tests ## Why Electron analysis needs binding-aware semantics before it can reliably distinguish imported Electron APIs, local shadows, aliases, and constant IPC/channel values. The existing AST-only analysis could recognize syntax shapes but could not preserve this provider-neutral semantic evidence. ## Impact This is additive domain infrastructure and does not change the caller-visible Electron graph or grant execution authority. Follow-up work can consume the IR for CommonJS/ESM graph composition and Electron-specific provenance without placing provider-specific code in the domain layer. ## Root cause REA lacked a bounded lexical binding model and constant-value lattice, so aliasing, destructuring, shadowing, and dynamic-property uncertainty could not be represented precisely. ## Checks - npm run check - npm run knip - npm run jscpd - npm run scan:todos - npm run verify:package - npx vitest run tests/javascriptSemanticAnalysis.test.ts --coverage.enabled=false `verify:application-workflows` was also probed; it correctly requires operator-provided `--left` and `--right` app/ASAR paths and therefore is not runnable target-free. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:12:40 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#1938
No description provided.