[PR #671] [CLOSED] fix(javascript): respect object property overwrite order #2154

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

📋 Pull Request Information

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

Base: main ← Head: fix/rea-object-values-20261006


📝 Commits (2)

  • 413e205 fix(javascript): respect object property overwrite order
  • 0622582 test(javascript): cover uncertain spread discriminants

📊 Changes

3 files changed (+129 additions, -13 deletions)

View changed files

📝 src/domain/javascriptSemanticAnalysis.dataflow.test.ts (+55 -0)
📝 src/domain/javascriptSemanticValues.ts (+33 -11)
📝 tests/boundary/filesystem/javascriptExportShapeComparison.test.ts (+41 -2)

📄 Description

What changed

Object-literal value recovery now follows declaration order: the last named key wins; an unknown spread or computed key invalidates earlier exact values; a later named assignment can restore an exact value. Methods/accessors replace a prior primitive with an unknown value. Literal computed keys remain usable. A non-shorthand __proto__ setter is excluded from own-property evidence, while { __proto__ } shorthand remains an own property.

Consumer evidence

On an owned application file, the complete built public analyzeJavaScriptApplication workflow previously emitted "old" for { key: "old", key: "new" }.key; native Node emits "new". After the repair, the serialized graph reports the final value and a later post-spread override. Unknown-spread and dynamic-key values are retained as unknown instead of falsely exact; the native shorthand __proto__ control also agrees.

Verification

  • Three new object-boundary regression cases failed before the patch.
  • Focused dataflow, semantic graph, and public export-shape comparison tests — 45 passed after the CI repair. The guaranteed post-spread discriminator control retains its /depth unknown assertion; a separate trailing-spread case verifies two unpaired unknown variants and no definite changes.
  • npm run check, npm run check:fast, npm run build:cached — passed.
  • Complete built application/native Node comparison — exact final/override/shorthand controls agree; uncertain overwrite values have no exact literal.
  • Native Node overwrite counterexample confirms trailing spread replaces type, while a post-spread type remains guaranteed.
  • git diff --check — passed.

The initial hosted shard 3 failure was an existing comparison fixture assuming the pre-spread discriminator stayed exact. Its corrected fixtures and added consumer regression passed locally; all 18 hosted checks on updated head 0622582e169fe3d4c226eac457b27f354fb03a07 passed, including all four shards and aggregate coverage.

No new tool, schema, or execution authority. This is conservative static analysis, not an object evaluator. Hopper/Ghidra verification was not run because no binary provider behavior changes. 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/671 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/rea-object-values-20261006` --- ### 📝 Commits (2) - [`413e205`](https://github.com/morluto/rea/commit/413e20587eb9ede92005c099f16ce88e3e4e07a9) fix(javascript): respect object property overwrite order - [`0622582`](https://github.com/morluto/rea/commit/0622582e169fe3d4c226eac457b27f354fb03a07) test(javascript): cover uncertain spread discriminants ### 📊 Changes **3 files changed** (+129 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascriptSemanticAnalysis.dataflow.test.ts` (+55 -0) 📝 `src/domain/javascriptSemanticValues.ts` (+33 -11) 📝 `tests/boundary/filesystem/javascriptExportShapeComparison.test.ts` (+41 -2) </details> ### 📄 Description ## What changed Object-literal value recovery now follows declaration order: the last named key wins; an unknown spread or computed key invalidates earlier exact values; a later named assignment can restore an exact value. Methods/accessors replace a prior primitive with an unknown value. Literal computed keys remain usable. A non-shorthand `__proto__` setter is excluded from own-property evidence, while `{ __proto__ }` shorthand remains an own property. ## Consumer evidence On an owned application file, the complete built public `analyzeJavaScriptApplication` workflow previously emitted `"old"` for `{ key: "old", key: "new" }.key`; native Node emits `"new"`. After the repair, the serialized graph reports the final value and a later post-spread override. Unknown-spread and dynamic-key values are retained as unknown instead of falsely exact; the native shorthand `__proto__` control also agrees. ## Verification - Three new object-boundary regression cases failed before the patch. - Focused dataflow, semantic graph, and public export-shape comparison tests — 45 passed after the CI repair. The guaranteed post-spread discriminator control retains its `/depth` unknown assertion; a separate trailing-spread case verifies two unpaired unknown variants and no definite changes. - `npm run check`, `npm run check:fast`, `npm run build:cached` — passed. - Complete built application/native Node comparison — exact final/override/shorthand controls agree; uncertain overwrite values have no exact literal. - Native Node overwrite counterexample confirms trailing spread replaces `type`, while a post-spread `type` remains guaranteed. - `git diff --check` — passed. The initial hosted shard 3 failure was an existing comparison fixture assuming the pre-spread discriminator stayed exact. Its corrected fixtures and added consumer regression passed locally; all 18 hosted checks on updated head `0622582e169fe3d4c226eac457b27f354fb03a07` passed, including all four shards and aggregate coverage. No new tool, schema, or execution authority. This is conservative static analysis, not an object evaluator. Hopper/Ghidra verification was not run because no binary provider behavior changes. 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:57 +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#2154
No description provided.