[PR #752] [MERGED] fix(javascript): keep mutated object initializer values unknown #2214

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

📋 Pull Request Information

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

Base: main ← Head: fix/javascript-member-mutation-values-20261006


📝 Commits (5)

  • e0b5961 fix(javascript): keep mutated object initializer values unknown
  • 3300837 fix(javascript): retain copied slots while following nested mutations
  • 6a355b0 fix(javascript): retain facts for unchanged object properties
  • 611f23f docs(javascript): state untracked mutation channels
  • 6b7412f Merge origin/main to pick up merged semantic fixes (#764, #769, #794)

📊 Changes

7 files changed (+340 additions, -1 deletions)

View changed files

📝 docs/javascript-application-workflows.md (+10 -0)
➕ src/domain/javascriptSemanticAnalysis.member_mutations.test.ts (+117 -0)
📝 src/domain/javascriptSemanticAnalysis.ts (+3 -0)
➕ src/domain/javascriptSemanticMemberMutations.ts (+140 -0)
➕ src/domain/javascriptSemanticMutationValues.ts (+65 -0)
📝 src/domain/javascriptSemanticState.ts (+1 -0)
📝 src/domain/javascriptSemanticValues.ts (+4 -1)

📄 Description

What changes

Keep affected initializer-derived object and array slots unknown after explicit property mutations. The public JavaScript application analysis command previously reported a definite "initial" return value for a function that first assigns options.mode = "updated" and then returns options.mode.

The analysis remains execution-free. Mutation tracking follows lexical aliases and nested shared references, including destructuring and spreads, while preserving primitive copies, shallow spread source slots, unrelated shadowed bindings and immutable controls. It conservatively invalidates affected property paths rather than inventing the value after a write, while retaining facts about unchanged properties.

Verification

  • Real built rea analyze-javascript-application against an extracted application: direct, nested-spread and conditional shared-reference fixtures publish stale literals on main and unknown fields after the fix.

  • Native Node execution provides the independent runtime result for both conditional branches. A shallow spread copy retains the original object's scalar slot in the CLI result before and after; conditional object branches remain unknown.

  • New regression file: 16 failures on main with five controls passing; The current regression file passes 34 tests, including unaffected-property and shared-reference controls added after hosted CI exposed an overly broad invalidation.

  • Fourteen focused semantic, graph and exported-return projection files: 281 tests pass, including the original graph assertion retaining three TOKEN seed matches.

  • Production TypeScript build, npm run check, npm run check:fast, and git diff --check pass. Lint retains 122 existing warnings and reports zero errors.

  • Node 24.18.0 and the current lockfile's direct package versions, with three integrity-verified leaf packages installed in an isolated runtime. No package or lockfile source changes.

  • The complete native package verifier passes on signed head 6a355b0f4c in 71.87 seconds: real npm-packed installs into two isolated temporary prefixes, CLI/MCP workflows, setup/readback/update and startup checks. Its owned temporary npm cache and prefixes were cleaned afterward; no user-global installation was changed.

No CLI/MCP schema or generated catalog changes. Full deterministic coverage remains with hosted CI.

AI assistance: implemented and independently source reviewed with Codex on behalf of @rudycelekli before publication.


🔄 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/752 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/javascript-member-mutation-values-20261006` --- ### 📝 Commits (5) - [`e0b5961`](https://github.com/morluto/rea/commit/e0b59618338c7e3dcf13d2536be6bcff73aa860c) fix(javascript): keep mutated object initializer values unknown - [`3300837`](https://github.com/morluto/rea/commit/3300837adf95e290fac04f88a6268feb556dfc0f) fix(javascript): retain copied slots while following nested mutations - [`6a355b0`](https://github.com/morluto/rea/commit/6a355b0f4c49ae487b567f0ed168cf4ea1c9802c) fix(javascript): retain facts for unchanged object properties - [`611f23f`](https://github.com/morluto/rea/commit/611f23f3b00948434a45d12556bad51f455986db) docs(javascript): state untracked mutation channels - [`6b7412f`](https://github.com/morluto/rea/commit/6b7412fccb5d1f748870e4f3df1fdf8f23d4facf) Merge origin/main to pick up merged semantic fixes (#764, #769, #794) ### 📊 Changes **7 files changed** (+340 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/javascript-application-workflows.md` (+10 -0) ➕ `src/domain/javascriptSemanticAnalysis.member_mutations.test.ts` (+117 -0) 📝 `src/domain/javascriptSemanticAnalysis.ts` (+3 -0) ➕ `src/domain/javascriptSemanticMemberMutations.ts` (+140 -0) ➕ `src/domain/javascriptSemanticMutationValues.ts` (+65 -0) 📝 `src/domain/javascriptSemanticState.ts` (+1 -0) 📝 `src/domain/javascriptSemanticValues.ts` (+4 -1) </details> ### 📄 Description ## What changes Keep affected initializer-derived object and array slots unknown after explicit property mutations. The public JavaScript application analysis command previously reported a definite `"initial"` return value for a function that first assigns `options.mode = "updated"` and then returns `options.mode`. The analysis remains execution-free. Mutation tracking follows lexical aliases and nested shared references, including destructuring and spreads, while preserving primitive copies, shallow spread source slots, unrelated shadowed bindings and immutable controls. It conservatively invalidates affected property paths rather than inventing the value after a write, while retaining facts about unchanged properties. ## Verification - Real built `rea analyze-javascript-application` against an extracted application: direct, nested-spread and conditional shared-reference fixtures publish stale literals on main and unknown fields after the fix. - Native Node execution provides the independent runtime result for both conditional branches. A shallow spread copy retains the original object's scalar slot in the CLI result before and after; conditional object branches remain unknown. - New regression file: 16 failures on main with five controls passing; The current regression file passes 34 tests, including unaffected-property and shared-reference controls added after hosted CI exposed an overly broad invalidation. - Fourteen focused semantic, graph and exported-return projection files: 281 tests pass, including the original graph assertion retaining three TOKEN seed matches. - Production TypeScript build, `npm run check`, `npm run check:fast`, and `git diff --check` pass. Lint retains 122 existing warnings and reports zero errors. - Node 24.18.0 and the current lockfile's direct package versions, with three integrity-verified leaf packages installed in an isolated runtime. No package or lockfile source changes. - The complete native package verifier passes on signed head 6a355b0f4c49ae487b567f0ed168cf4ea1c9802c in 71.87 seconds: real npm-packed installs into two isolated temporary prefixes, CLI/MCP workflows, setup/readback/update and startup checks. Its owned temporary npm cache and prefixes were cleaned afterward; no user-global installation was changed. No CLI/MCP schema or generated catalog changes. Full deterministic coverage remains with hosted CI. AI assistance: implemented and independently source reviewed with Codex on behalf of @rudycelekli before publication. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:15: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#2214
No description provided.