[PR #1539] [MERGED] fix(javascript): avoid argument limits when expanding escaped receivers #2955

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

📋 Pull Request Information

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

Base: main ← Head: fix/javascript-wide-escape-worklist


📝 Commits (1)

  • fe076d9 fix(javascript): avoid argument limits when expanding escaped receivers

📊 Changes

3 files changed (+38 additions, -3 deletions)

View changed files

📝 src/domain/javascript/javascriptSemanticAnalysis.member_mutations.test.ts (+0 -2)
📝 src/domain/javascript/javascriptSemanticMemberMutations.ts (+2 -1)
📝 tests/acceptance/applications/javascriptReturnedReferences.test.ts (+36 -0)

📄 Description

A valid 1.49 MB JavaScript source can return an object with enough properties to exceed V8's function-argument limit when an escaped receiver expands its references. The compiled CLI exits 1 and stdio MCP returns execution_failure with RangeError: Maximum call stack size exceeded.

Append expanded references individually, preserving their order and the existing binding/path cache. Public CLI/MCP regressions cover both 160,000-element object and array returns, retain uncertainty for a reference at the end, preserve an unrelated literal, and compare complete Evidence identities. No reference quota or result truncation is introduced.

The adjacent mutation suite also contained an inherited two-second elapsed-time assertion that failed at 2,093.89 ms on the constrained host. Remove that machine-load assertion while keeping the complete 2,000-write semantic case. Controlled performance measurements remain separate from deterministic correctness checks.

Closes #1538. Related to #1065.

Validation:

  • npm run test:focused -- tests/acceptance/applications/javascriptReturnedReferences.test.ts — 2 public CLI/stdio MCP workflows passed.
  • npm run test:local -- src/domain/javascript/javascriptSemanticAnalysis.member_mutations.test.ts src/domain/javascript/javascriptSemanticMutationInitializers.test.ts src/domain/javascript/javascriptSemanticAnalysis.member_depth.test.ts — 172 tests passed.
  • npm run check:fast — strict typecheck and lint passed.
  • Independent public before/after probe — the identical 1,489,023-byte input changes from CLI/MCP failure to successful complete return projection; CLI/MCP Evidence IDs match, retained summary binding, close, expired-reference rejection, subsequent ping and unchanged input checks pass. Full CLI JSON is not retained on disk.
  • Complete serialized semantic IR matched the main 46c9cba0 control byte-for-byte for 18 adjacent binding, scope, path, callable, iterator and mutation fixtures.

No real Hopper/Ghidra verification was performed for this provider-neutral JavaScript change. This does not establish a fix for the private exit-134 report in #1387 or all remaining #1462 responsiveness work.


🔄 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/1539 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/10/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/javascript-wide-escape-worklist` --- ### 📝 Commits (1) - [`fe076d9`](https://github.com/morluto/rea/commit/fe076d919d5262e539cd8ed0ee2b1e9d9807d547) fix(javascript): avoid argument limits when expanding escaped receivers ### 📊 Changes **3 files changed** (+38 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascript/javascriptSemanticAnalysis.member_mutations.test.ts` (+0 -2) 📝 `src/domain/javascript/javascriptSemanticMemberMutations.ts` (+2 -1) 📝 `tests/acceptance/applications/javascriptReturnedReferences.test.ts` (+36 -0) </details> ### 📄 Description A valid 1.49 MB JavaScript source can return an object with enough properties to exceed V8's function-argument limit when an escaped receiver expands its references. The compiled CLI exits 1 and stdio MCP returns `execution_failure` with `RangeError: Maximum call stack size exceeded`. Append expanded references individually, preserving their order and the existing binding/path cache. Public CLI/MCP regressions cover both 160,000-element object and array returns, retain uncertainty for a reference at the end, preserve an unrelated literal, and compare complete Evidence identities. No reference quota or result truncation is introduced. The adjacent mutation suite also contained an inherited two-second elapsed-time assertion that failed at 2,093.89 ms on the constrained host. Remove that machine-load assertion while keeping the complete 2,000-write semantic case. Controlled performance measurements remain separate from deterministic correctness checks. Closes #1538. Related to #1065. Validation: - `npm run test:focused -- tests/acceptance/applications/javascriptReturnedReferences.test.ts` — 2 public CLI/stdio MCP workflows passed. - `npm run test:local -- src/domain/javascript/javascriptSemanticAnalysis.member_mutations.test.ts src/domain/javascript/javascriptSemanticMutationInitializers.test.ts src/domain/javascript/javascriptSemanticAnalysis.member_depth.test.ts` — 172 tests passed. - `npm run check:fast` — strict typecheck and lint passed. - Independent public before/after probe — the identical 1,489,023-byte input changes from CLI/MCP failure to successful complete return projection; CLI/MCP Evidence IDs match, retained summary binding, close, expired-reference rejection, subsequent ping and unchanged input checks pass. Full CLI JSON is not retained on disk. - Complete serialized semantic IR matched the main `46c9cba0` control byte-for-byte for 18 adjacent binding, scope, path, callable, iterator and mutation fixtures. No real Hopper/Ghidra verification was performed for this provider-neutral JavaScript change. This does not establish a fix for the private exit-134 report in #1387 or all remaining #1462 responsiveness work. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:12:14 +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#2955
No description provided.