[PR #668] [CLOSED] fix(javascript): preserve array index positions #2151

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/668
Author: @rudycelekli
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: fix/rea-array-projection-20261006


📝 Commits (1)

  • 2ca8375 fix(javascript): preserve array index positions

📊 Changes

2 files changed (+65 additions, -3 deletions)

View changed files

📝 src/domain/javascriptSemanticAnalysis.dataflow.test.ts (+47 -0)
📝 src/domain/javascriptSemanticValues.ts (+18 -3)

📄 Description

What changed

Preserve JavaScript array positions in static value recovery. Array holes keep an explicit unknown slot; a spread with unknown length ends the fixed-index prefix. Canonical numeric member keys (including "1") now project array items without accepting "01" as an array index.

Real consumer reproduction

The complete built public analyzeJavaScriptApplication workflow analyzes an owned main.mjs. Before, const [first,,third] = ["zero",,"two"] omitted the value for third, and ["zero","one"][1] omitted the member value. A native Node process reports "two"/"one"; the repaired serialized semantic graph agrees on all three retained bindings. Separate regressions ensure an unknown spread does not shift a trailing literal into an earlier index, and noncanonical property spellings remain unknown.

Verification

  • Added regression group fails before; after focused dataflow/graph tests: 26 passed.
  • npm run check, npm run check:fast, npm run build:cached passed.
  • Built public application workflow/native Node comparison: three values agree.
  • git diff --check passed.

No schema or tool changes. Unknown holes and spread length remain unknown; this does not claim exact array length or evaluate source code during analysis. Hopper/Ghidra were not exercised: this changes provider-independent static JavaScript semantics. AI assistance was used for investigation, implementation and verification.


🔄 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/668 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/rea-array-projection-20261006` --- ### 📝 Commits (1) - [`2ca8375`](https://github.com/morluto/rea/commit/2ca8375e666978b16a124a4c165fbf91a1acfeb2) fix(javascript): preserve array index positions ### 📊 Changes **2 files changed** (+65 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascriptSemanticAnalysis.dataflow.test.ts` (+47 -0) 📝 `src/domain/javascriptSemanticValues.ts` (+18 -3) </details> ### 📄 Description ## What changed Preserve JavaScript array positions in static value recovery. Array holes keep an explicit unknown slot; a spread with unknown length ends the fixed-index prefix. Canonical numeric member keys (including `"1"`) now project array items without accepting `"01"` as an array index. ## Real consumer reproduction The complete built public `analyzeJavaScriptApplication` workflow analyzes an owned `main.mjs`. Before, `const [first,,third] = ["zero",,"two"]` omitted the value for `third`, and `["zero","one"][1]` omitted the member value. A native Node process reports `"two"`/`"one"`; the repaired serialized semantic graph agrees on all three retained bindings. Separate regressions ensure an unknown spread does not shift a trailing literal into an earlier index, and noncanonical property spellings remain unknown. ## Verification - Added regression group fails before; after focused dataflow/graph tests: 26 passed. - `npm run check`, `npm run check:fast`, `npm run build:cached` passed. - Built public application workflow/native Node comparison: three values agree. - `git diff --check` passed. No schema or tool changes. Unknown holes and spread length remain unknown; this does not claim exact array length or evaluate source code during analysis. Hopper/Ghidra were not exercised: this changes provider-independent static JavaScript semantics. AI assistance was used for investigation, implementation and verification. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:14:56 +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#2151
No description provided.