[PR #4272] [CLOSED] fix(javascript): preserve canonical rest-array property keys #6150

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4272
Author: @maxazure
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: fix/rest-array-property-identity-4242


📝 Commits (1)

  • 77de779 fix(javascript): preserve canonical rest-array property keys

📊 Changes

2 files changed (+83 additions, -2 deletions)

View changed files

📝 src/domain/javascript/javascriptSymbolicBindings.ts (+6 -2)
📝 tests/boundary/cli/electronWrappedCallPaths.test.ts (+77 -0)

📄 Description

Summary

Fixes #4242. Preserve named rest-array property identity during lexical substitution instead of treating "01" as positional index 1.

Problem and expected behavior

A returned closure sending items["01"] ?? "FALLBACK", with rest arguments "FIRST", "SECOND", incorrectly acquired the inferred IPC channel SECOND. Only canonical array indices may select positional values. The noncanonical expression now stays unknown; the "1" control still resolves to SECOND.

Change and scope

Reuse the existing semanticArrayIndex owner in symbolic array lookup. Keep existing unknown reasons and missing-argument behavior. Add one public-CLI four-case regression in the existing wrapped-call-path suite. No new parser, undefined propagation, or fallback inference.

Related ownership review found no other digit-only parser in symbolic lookup. Separate ambient-write/data-effect analyses already reject leading-zero aliases and are outside this change.

Contract and boundary impact

  • Semantic owner and earliest changed stage: domain symbolic property lookup, consuming the existing canonical-index owner.
  • Contribution scope fit and linked maintainer decision: ordinary static-analysis correctness fix; separate scope decision not applicable.
  • CLI and MCP/tool-catalog contract: unchanged schemas and commands; corrected inferred values.
  • Provider, bridge, target-format, or platform compatibility: no provider or bridge changes; inert CommonJS fixtures tested on Linux.
  • Evidence, artifact, provenance, or reconstruction contract: preserve written dynamic expressions, observed evidence, and static candidate/inferred qualifications.
  • Target selection, authority, upstream behavior, and cleanup: no new target authority or execution; existing test-owned temporary directories and process cleanup.
  • Generated metadata, package, or installation impact: none; dependency/lockfile unchanged.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Updated the existing CLI wrapped-call-path suite with noncanonical, canonical, literal-fallback, and dynamic-key controls.
  • Executed the issue's four-case public CLI reproduction on base 6183544e8b42b65feaf4f674f860b1fb3b0c95eb, then after the fix. The new regression failed before the fix because the noncanonical terminal was SECOND instead of absent.
  • After: noncanonical has no inferred literal channel or terminal and retains the observed dynamic expression. Canonical remains SECOND; literal fallback remains FALLBACK; dynamic key remains unresolved.
  • Remaining gaps: no full suite, published-package test, real Electron execution, or macOS/Windows verification.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Cloud Linux, pinned Node 24.18.0 / npm 11.16.0, locked npm ci:

  • npm run build:cached — passed before baseline replay; focused tests rebuilt after the fix.
  • npm run test:focused -- src/domain/javascript/javascriptSymbolicBindings.test.ts src/domain/javascript/electronWrappedCallPaths.test.ts src/domain/javascript/javascriptSemanticAnalysis.dataflow.test.ts tests/boundary/cli/electronWrappedCallPaths.test.ts — 170 passed across 4 files.
  • npm run check:fast — passed.
  • npm run check — passed, including architecture guards.
  • npm run verify:test-discovery — 1376 files discovered exactly once.
  • git diff --check and normal pre-commit formatting/lint hooks — passed; hooks left the tested diff unchanged.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; removes an incorrect inferred literal.
  • Real Hopper/Ghidra, browser, or OS coverage: Linux static CLI workflows only; no real providers exercised.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: analysis never executes fixture code or loads Electron; no new execution or network capability.

Author readiness

Human owner: @maxazure

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

🔄 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/4272 **Author:** [@maxazure](https://github.com/maxazure) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/rest-array-property-identity-4242` --- ### 📝 Commits (1) - [`77de779`](https://github.com/morluto/rea/commit/77de7795cc9829937c65c3e01f89b8a06c1a17a3) fix(javascript): preserve canonical rest-array property keys ### 📊 Changes **2 files changed** (+83 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascript/javascriptSymbolicBindings.ts` (+6 -2) 📝 `tests/boundary/cli/electronWrappedCallPaths.test.ts` (+77 -0) </details> ### 📄 Description ## Summary Fixes #4242. Preserve named rest-array property identity during lexical substitution instead of treating `"01"` as positional index 1. ## Problem and expected behavior A returned closure sending `items["01"] ?? "FALLBACK"`, with rest arguments `"FIRST", "SECOND"`, incorrectly acquired the inferred IPC channel `SECOND`. Only canonical array indices may select positional values. The noncanonical expression now stays unknown; the `"1"` control still resolves to `SECOND`. ## Change and scope Reuse the existing `semanticArrayIndex` owner in symbolic array lookup. Keep existing unknown reasons and missing-argument behavior. Add one public-CLI four-case regression in the existing wrapped-call-path suite. No new parser, undefined propagation, or fallback inference. Related ownership review found no other digit-only parser in symbolic lookup. Separate ambient-write/data-effect analyses already reject leading-zero aliases and are outside this change. ## Contract and boundary impact - Semantic owner and earliest changed stage: domain symbolic property lookup, consuming the existing canonical-index owner. - Contribution scope fit and linked maintainer decision: ordinary static-analysis correctness fix; separate scope decision not applicable. - CLI and MCP/tool-catalog contract: unchanged schemas and commands; corrected inferred values. - Provider, bridge, target-format, or platform compatibility: no provider or bridge changes; inert CommonJS fixtures tested on Linux. - Evidence, artifact, provenance, or reconstruction contract: preserve written dynamic expressions, observed evidence, and static candidate/inferred qualifications. - Target selection, authority, upstream behavior, and cleanup: no new target authority or execution; existing test-owned temporary directories and process cleanup. - Generated metadata, package, or installation impact: none; dependency/lockfile unchanged. Expected effects: - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Updated the existing CLI wrapped-call-path suite with noncanonical, canonical, literal-fallback, and dynamic-key controls. - Executed the issue's four-case public CLI reproduction on base `6183544e8b42b65feaf4f674f860b1fb3b0c95eb`, then after the fix. The new regression failed before the fix because the noncanonical terminal was `SECOND` instead of absent. - After: noncanonical has no inferred literal channel or terminal and retains the observed dynamic expression. Canonical remains `SECOND`; literal fallback remains `FALLBACK`; dynamic key remains unresolved. - Remaining gaps: no full suite, published-package test, real Electron execution, or macOS/Windows verification. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed Cloud Linux, pinned Node 24.18.0 / npm 11.16.0, locked `npm ci`: - `npm run build:cached` — passed before baseline replay; focused tests rebuilt after the fix. - `npm run test:focused -- src/domain/javascript/javascriptSymbolicBindings.test.ts src/domain/javascript/electronWrappedCallPaths.test.ts src/domain/javascript/javascriptSemanticAnalysis.dataflow.test.ts tests/boundary/cli/electronWrappedCallPaths.test.ts` — 170 passed across 4 files. - `npm run check:fast` — passed. - `npm run check` — passed, including architecture guards. - `npm run verify:test-discovery` — 1376 files discovered exactly once. - `git diff --check` and normal pre-commit formatting/lint hooks — passed; hooks left the tested diff unchanged. ## Compatibility, safety, and release - Breaking changes or migration steps: none; removes an incorrect inferred literal. - Real Hopper/Ghidra, browser, or OS coverage: Linux static CLI workflows only; no real providers exercised. - Package or release metadata impact: none. - Security, privacy, process, or containment review: analysis never executes fixture code or loads Electron; no new execution or network capability. ## Author readiness Human owner: @maxazure - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01: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#6150
No description provided.