Skip to content

fix(javascript): preserve uncertain with-scope member writes - #7914

Merged
morluto merged 4 commits into
mainfrom
codex/with-member-write-uncertainty
Oct 29, 2026
Merged

morluto merged 4 commits into
mainfrom
codex/with-member-write-uncertainty

Conversation

@morluto

@morluto morluto commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #7418. A member write inside with can 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

  • Semantic owner: JavaScript binding lookup and value evaluation; consumers are member effects and semantic graph projection.
  • Contribution scope: existing static analysis, no new target execution or provider authority; maintainer scope decision not applicable.
  • CLI and MCP: no input or catalog changes; value and trace Evidence now report uncertainty.
  • Provider/platform compatibility: no provider involved. Target source remains read-only.
  • Generated metadata, packaging, installation, cleanup: no changes.

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.
  • Follow-up: the source assignment suite passed 16 tests, and the focused public CLI/MCP test passed with nested object and array initializer seeds. Targeted oxlint completed with two pre-existing warnings in the projection file.
  • No real provider coverage was applicable; tests use static JavaScript source.

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

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T23:04:02.647917Z aaeb40d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue remains.

Summary

Preserves uncertainty for member writes through with scopes while keeping unrelated properties precise.

  • JavaScript analysis marks possibly captured member writes as uncertain.
  • The MCP unknowns test keeps its imports together.

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]
Loading

Reviews (3) · Last reviewed commit: "fix(tests): remove duplicate MCP test im..." · Reviewed by Greptile

@morluto
morluto merged commit 95f0625 into main Oct 29, 2026
41 checks passed
@morluto
morluto deleted the codex/with-member-write-uncertainty branch October 29, 2026 01:23
@morluto morluto mentioned this pull request Nov 11, 2026
3 tasks done
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] analyze-javascript-application retains a stale literal after a member assignment inside with

1 participant