[PR #1292] [MERGED] fix(javascript): preserve uncertainty after references escape to calls #2772

Closed
opened 2026-10-17 21:10:04 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1292
Author: @Y0UW1SH
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @morluto

Base: main ← Head: fix/javascript-comparison-accuracy


📝 Commits (10+)

  • 71cbf17 fix(javascript): preserve uncertainty after references escape to calls
  • d5ba2c6 fix(javascript): preserve copied reference boundaries
  • fce1f9c fix(javascript): use canonical ordering and share CLI fixtures
  • fe9c7c7 chore: integrate upstream README alignment
  • d400632 fix(javascript): preserve capture lifetimes and bound reference traversal
  • 02b7777 fix(javascript): track iterator root escapes and preserve static captures
  • e2f3b1a fix(javascript): scope comparison unknowns to their evidence
  • 71960c3 fix(javascript): track parameter origins at function body entry
  • f1dd93f Merge main into fix/javascript-comparison-accuracy
  • c3701e0 chore: merge main into JavaScript reference uncertainty fix

📊 Changes

17 files changed (+2574 additions, -220 deletions)

View changed files

📝 docs/javascript-application-workflows.md (+17 -7)
📝 src/domain/javascript/javascriptSemanticAnalysis.member_mutations.test.ts (+371 -0)
➕ src/domain/javascript/javascriptSemanticAnalysis.reference_lifetimes.test.ts (+313 -0)
📝 src/domain/javascript/javascriptSemanticAnalysis.ts (+89 -3)
➕ src/domain/javascript/javascriptSemanticIterationSources.ts (+163 -0)
📝 src/domain/javascript/javascriptSemanticMemberMutations.ts (+618 -162)
➕ src/domain/javascript/javascriptSemanticMutationInitializers.test.ts (+63 -0)
➕ src/domain/javascript/javascriptSemanticMutationInitializers.ts (+228 -0)
📝 src/domain/javascript/javascriptSemanticMutationValues.ts (+57 -39)
➕ src/domain/javascript/javascriptSemanticPropertyPaths.ts (+37 -0)
📝 src/domain/javascript/javascriptSemanticState.ts (+19 -1)
📝 src/domain/javascript/javascriptSemanticValues.ts (+133 -5)
📝 src/server/registerApplicationTools/compareExportShapes.ts (+3 -1)
📝 src/server/registerApplicationTools/helpers.ts (+4 -2)
📝 tests/acceptance/applications/applicationWorkflowCli.test.ts (+246 -0)
📝 tests/boundary/filesystem/javascriptExportShapeComparison.test.ts (+58 -0)
📝 tests/boundary/mcp/applicationExportShapeMcp.test.ts (+155 -0)

📄 Description

Object and array return shapes could remain literal after a helper, method, constructor, or tagged template could mutate a shared reference. Export comparisons could then report definite changes from incomplete evidence.

Preserve call-site uncertainty across aliases, awaited arguments, logical assignments, destructuring defaults, and genuinely shared children. Rest copies exclude consumed keys and known array prefixes. Spread copies respect later explicit overwrites and known array offsets. Accessors and uncertain or custom iteration remain conservative, including observed shared array-prototype changes.

Keep copied primitive slots and unrelated source values known. Deduplicate reference traversal, preserve current-main alias assignment ordering, and record a session unknown when partial comparisons produce no differing projections.

Tested:

  • npm run test:changed -- --base origin/main: 1,074 tests passed across 66 files; 1 skipped.
  • npm run test:focused -- tests/acceptance/applications/applicationWorkflowCli.test.ts tests/boundary/filesystem/javascriptExportShapeComparison.test.ts tests/boundary/mcp/applicationExportShapeMcp.test.ts: 69 tests passed across 3 files.
  • npm run check:ci and npm run docs:check.
  • Authored runtime controls for the four copy-boundary regressions.
  • Regressions for custom iteration, shared prototype changes, getters and setters, nested spread termination, and unaffected source values.
  • GitHub Actions on fe9c7c75: all 22 CI jobs and Real JavaScript recovery passed. Full suite: 6,144 tests passed; 89 skipped. Includes coverage/timing, build, documentation, static checks, Windows/Linux/macOS package checks, and real Apple artifact CLI/MCP E2E.

Not tested: real Hopper, Ghidra, or IDA provider execution.


🔄 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/1292 **Author:** [@Y0UW1SH](https://github.com/Y0UW1SH) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/javascript-comparison-accuracy` --- ### 📝 Commits (10+) - [`71cbf17`](https://github.com/morluto/rea/commit/71cbf17e40f74c846000af0f5f1e214582c6da98) fix(javascript): preserve uncertainty after references escape to calls - [`d5ba2c6`](https://github.com/morluto/rea/commit/d5ba2c690b337fb7a6dc472cc79e5c12e2613532) fix(javascript): preserve copied reference boundaries - [`fce1f9c`](https://github.com/morluto/rea/commit/fce1f9cb992165b7b6c23279912ecd97d0fa8c47) fix(javascript): use canonical ordering and share CLI fixtures - [`fe9c7c7`](https://github.com/morluto/rea/commit/fe9c7c75e1adc5ca1f68c510f37752bf03826c10) chore: integrate upstream README alignment - [`d400632`](https://github.com/morluto/rea/commit/d400632da90d1333dcbba59ce6bb50fa522dabb8) fix(javascript): preserve capture lifetimes and bound reference traversal - [`02b7777`](https://github.com/morluto/rea/commit/02b7777a7a9752c9bd2f0b94243a0153f2b7e690) fix(javascript): track iterator root escapes and preserve static captures - [`e2f3b1a`](https://github.com/morluto/rea/commit/e2f3b1a47468c1bd59fed1f6cdabf84416063a28) fix(javascript): scope comparison unknowns to their evidence - [`71960c3`](https://github.com/morluto/rea/commit/71960c376de61f4f372a06908a8c4f8a67897e65) fix(javascript): track parameter origins at function body entry - [`f1dd93f`](https://github.com/morluto/rea/commit/f1dd93f947e508b49570ec2849aed8d71c657da8) Merge main into fix/javascript-comparison-accuracy - [`c3701e0`](https://github.com/morluto/rea/commit/c3701e03f94d5761e3f3a67dd22e5ae37dc9f827) chore: merge main into JavaScript reference uncertainty fix ### 📊 Changes **17 files changed** (+2574 additions, -220 deletions) <details> <summary>View changed files</summary> 📝 `docs/javascript-application-workflows.md` (+17 -7) 📝 `src/domain/javascript/javascriptSemanticAnalysis.member_mutations.test.ts` (+371 -0) ➕ `src/domain/javascript/javascriptSemanticAnalysis.reference_lifetimes.test.ts` (+313 -0) 📝 `src/domain/javascript/javascriptSemanticAnalysis.ts` (+89 -3) ➕ `src/domain/javascript/javascriptSemanticIterationSources.ts` (+163 -0) 📝 `src/domain/javascript/javascriptSemanticMemberMutations.ts` (+618 -162) ➕ `src/domain/javascript/javascriptSemanticMutationInitializers.test.ts` (+63 -0) ➕ `src/domain/javascript/javascriptSemanticMutationInitializers.ts` (+228 -0) 📝 `src/domain/javascript/javascriptSemanticMutationValues.ts` (+57 -39) ➕ `src/domain/javascript/javascriptSemanticPropertyPaths.ts` (+37 -0) 📝 `src/domain/javascript/javascriptSemanticState.ts` (+19 -1) 📝 `src/domain/javascript/javascriptSemanticValues.ts` (+133 -5) 📝 `src/server/registerApplicationTools/compareExportShapes.ts` (+3 -1) 📝 `src/server/registerApplicationTools/helpers.ts` (+4 -2) 📝 `tests/acceptance/applications/applicationWorkflowCli.test.ts` (+246 -0) 📝 `tests/boundary/filesystem/javascriptExportShapeComparison.test.ts` (+58 -0) 📝 `tests/boundary/mcp/applicationExportShapeMcp.test.ts` (+155 -0) </details> ### 📄 Description Object and array return shapes could remain literal after a helper, method, constructor, or tagged template could mutate a shared reference. Export comparisons could then report definite changes from incomplete evidence. Preserve call-site uncertainty across aliases, awaited arguments, logical assignments, destructuring defaults, and genuinely shared children. Rest copies exclude consumed keys and known array prefixes. Spread copies respect later explicit overwrites and known array offsets. Accessors and uncertain or custom iteration remain conservative, including observed shared array-prototype changes. Keep copied primitive slots and unrelated source values known. Deduplicate reference traversal, preserve current-main alias assignment ordering, and record a session unknown when partial comparisons produce no differing projections. Tested: - `npm run test:changed -- --base origin/main`: 1,074 tests passed across 66 files; 1 skipped. - `npm run test:focused -- tests/acceptance/applications/applicationWorkflowCli.test.ts tests/boundary/filesystem/javascriptExportShapeComparison.test.ts tests/boundary/mcp/applicationExportShapeMcp.test.ts`: 69 tests passed across 3 files. - `npm run check:ci` and `npm run docs:check`. - Authored runtime controls for the four copy-boundary regressions. - Regressions for custom iteration, shared prototype changes, getters and setters, nested spread termination, and unaffected source values. - GitHub Actions on `fe9c7c75`: all 22 CI jobs and Real JavaScript recovery passed. Full suite: 6,144 tests passed; 89 skipped. Includes coverage/timing, build, documentation, static checks, Windows/Linux/macOS package checks, and real Apple artifact CLI/MCP E2E. Not tested: real Hopper, Ghidra, or IDA provider execution. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:10:04 +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#2772
No description provided.