[PR #929] [MERGED] fix(javascript): retain recovered call argument positions #2355

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

📋 Pull Request Information

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

Base: main ← Head: fix/javascript-recovered-call-arguments


📝 Commits (1)

  • 70024a0 fix(javascript): retain recovered call argument positions

📊 Changes

2 files changed (+43 additions, -0 deletions)

View changed files

➕ src/domain/javascript/javascriptSemanticAnalysis.recoveredArguments.test.ts (+40 -0)
📝 src/domain/javascript/javascriptSemanticCalls.ts (+3 -0)

📄 Description

Summary

Handle null argument slots in Babel's error-recovered call AST without crashing or renumbering readable arguments. Discovered by the randomized source-rejection test in #926; relates to #740's boundary guardrails.

Problem and expected behavior

0(,) is recovered into a call with a null argument. Semantic analysis previously read its location and threw. Recovered syntax should return partial evidence and preserve original positions for surviving arguments and parameter flows.

Change and scope

Admit null slots in the private argument collector and skip their unavailable locations. Existing call, optional-call and constructor analysis retains readable arguments at their original indexes.

Contract and boundary impact

  • Semantic owner and earliest changed stage: JavaScript semantic call collection after Babel parsing.
  • CLI and MCP/tool-catalog contract: existing schemas and complete inventory unchanged.
  • Provider, bridge, target-format, or platform compatibility: inert JavaScript syntax recovery; no provider protocol change.
  • Evidence, artifact, provenance, or reconstruction contract: preserve readable source locations, argument indexes and partial parser coverage.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata, package, or installation impact: none.

Evidence and regression coverage

  • Tests added: ordinary, optional and constructor calls; multiple null slots; positional parameter flow.

  • Base reproduction: all five new cases failed with the same null-location exception before the fix.

  • User-visible output: a recovered semantic IR with partial coverage and surviving argument positions, rather than an exception.

  • Remaining proof gaps: source tests establish parsing/semantic behavior; hosted platform checks run before merge.

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity and source provenance remain preserved.

  • Incomplete outcomes remain visible.

Validation performed

  • Focused Vitest semantic suites: 317 cases in 17 files passed, including the original randomized rejection test and five deterministic regressions.
  • npm run check -- --output-logs=errors-only: all five static gates passed.
  • Final diff and producer AST reviewed; original parameter indexes are retained across null slots.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: no engine claim changes; CI validates the supported native baselines.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no code execution, new configuration, permission fields or host data; bounded local verification.

Review checklist

  • One focused outcome and Conventional Commit title.
  • Related issue and observed CI failure linked.
  • Tests exercise the actual producer boundary and fail on the base.
  • Existing contracts and generated metadata remain applicable.
  • User-visible behavior described above.
  • Final diff checked for secrets and unrelated changes.

🔄 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/929 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/javascript-recovered-call-arguments` --- ### 📝 Commits (1) - [`70024a0`](https://github.com/morluto/rea/commit/70024a0ad41c464a710aac3fd6956814d6f8a895) fix(javascript): retain recovered call argument positions ### 📊 Changes **2 files changed** (+43 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `src/domain/javascript/javascriptSemanticAnalysis.recoveredArguments.test.ts` (+40 -0) 📝 `src/domain/javascript/javascriptSemanticCalls.ts` (+3 -0) </details> ### 📄 Description ## Summary Handle null argument slots in Babel's error-recovered call AST without crashing or renumbering readable arguments. Discovered by the randomized source-rejection test in #926; relates to #740's boundary guardrails. ## Problem and expected behavior `0(,)` is recovered into a call with a null argument. Semantic analysis previously read its location and threw. Recovered syntax should return partial evidence and preserve original positions for surviving arguments and parameter flows. ## Change and scope Admit null slots in the private argument collector and skip their unavailable locations. Existing call, optional-call and constructor analysis retains readable arguments at their original indexes. ## Contract and boundary impact - Semantic owner and earliest changed stage: JavaScript semantic call collection after Babel parsing. - CLI and MCP/tool-catalog contract: existing schemas and complete inventory unchanged. - Provider, bridge, target-format, or platform compatibility: inert JavaScript syntax recovery; no provider protocol change. - Evidence, artifact, provenance, or reconstruction contract: preserve readable source locations, argument indexes and partial parser coverage. - Process execution, authorization, cleanup, or containment impact: none. - Generated metadata, package, or installation impact: none. ## Evidence and regression coverage - Tests added: ordinary, optional and constructor calls; multiple null slots; positional parameter flow. - Base reproduction: all five new cases failed with the same null-location exception before the fix. - User-visible output: a recovered semantic IR with partial coverage and surviving argument positions, rather than an exception. - Remaining proof gaps: source tests establish parsing/semantic behavior; hosted platform checks run before merge. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity and source provenance remain preserved. - [x] Incomplete outcomes remain visible. ## Validation performed - Focused Vitest semantic suites: 317 cases in 17 files passed, including the original randomized rejection test and five deterministic regressions. - `npm run check -- --output-logs=errors-only`: all five static gates passed. - Final diff and producer AST reviewed; original parameter indexes are retained across null slots. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: no engine claim changes; CI validates the supported native baselines. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no code execution, new configuration, permission fields or host data; bounded local verification. ## Review checklist - [x] One focused outcome and Conventional Commit title. - [x] Related issue and observed CI failure linked. - [x] Tests exercise the actual producer boundary and fail on the base. - [x] Existing contracts and generated metadata remain applicable. - [x] User-visible behavior described above. - [x] Final diff checked for secrets and unrelated changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:17:45 +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#2355
No description provided.