Repository navigation
fix(javascript): preserve uncertain with-scope member writes - #7914
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
[Medium impact] The PR appears safe to merge; no blocking issue remains. SummaryPreserves uncertainty for member writes through
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Uncertain binding lookup] --> B[Possible member write]
B --> C[Affected value becomes unknown]
D[Retained initializer value] --> E[Candidate literal definitions]
C --> E
E --> F[Forward trace with explicit uncertainty]
Reviews (3) · Last reviewed commit: "fix(tests): remove duplicate MCP test im..." · Reviewed by Greptile |
2 tasks done
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #7418. A member write inside
withcan target an outer binding even when the dynamic environment makes its identity uncertain. The affected property and return are now unknown rather than retaining a stale literal; unrelated properties remain precise.Change and scope
The member-effect collector retains the lookup owner's possible binding and marks its receiver as possible. The semantic IR also retains the single initializer's pre-effect value when member writes exist. Graph projection connects invalidated initializer literals, including nested object and array descendants, to uncertain slots as candidates and exposes the uncertainty to forward traces. Current slots are indexed by name once per container. This also covers ordinary member writes where the former literal previously disappeared from the graph.
Initializer provenance is retained for single, unprojected initializers with member writes; this change does not claim complete historical provenance for multiple initializers, projected initializers, or all escape effects.
Contract and boundary impact
Validation performed
npm run test:focused -- tests/acceptance/applications/withMemberMutationCli.test.ts— passed on Node 24.22.1 in an isolated checkout. The public CLI analysis and MCP trace exercise assignment, update, delete, alias, ordinary write, and unaffected sibling cases.npm run test:local -- src/application/javascript/JavaScriptSemanticGraphBuilder.test.ts src/application/javascript/JavaScriptSemanticGraphAssignments.test.ts src/domain/javascript/javascriptSemanticAnalysis.reference_lifetimes.test.ts— 202 tests passed.Compatibility, safety, and release
No breaking input change or migration. Evidence becomes more conservative for affected values and traces. No package metadata change or new execution authority.
Author readiness
Human owner: @morluto