Skip to content

fix(javascript): retain proven property presence at reads - #12477

Merged
morluto merged 2 commits into
mainfrom
fix/javascript-captured-property-presence
Nov 19, 2026
Merged

morluto merged 2 commits into
mainfrom
fix/javascript-captured-property-presence

Conversation

@morluto

@morluto morluto commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Keep a JavaScript property dependency resolved when the source establishes the property at the read and a later write to that property changes the merged object value. Fixes #7559. This builds on the read-time IR design in #7716 and also covers ordinary member reads.

Change

The value evaluator records proven own data-slot presence using its existing capture timing and effect-path index. It indexes each direct object literal once and checks the requested path. The graph consumes that read-time fact for both property reads and destructuring. The existing fallback still handles operations without proof.

Earlier relevant writes, getters, opaque effects, and ambiguous paths retain the existing uncertainty. Restoring the dependency edge can make it traversable while a separate aggregate graph edge still makes the overall trace ambiguous.

Evidence and validation

  • Four focused regressions reproduced the missed dependency and four controls retained their original results on the base. The candidate passed all 333 focused tests, including the graph projection paths.

  • The compiled CLI regression verifies that the ordinary read and destructuring edges remain resolved and the default trace traverses the destructuring dependency.

  • A 14-case control matrix retained uncertainty for earlier deletes, receiver or binding replacements, getters, and opaque effects. Validation used authored source and did not execute analyzed applications.

  • The patch preserves public CLI and MCP contracts. The shared IR gains an optional proof consumed by its existing graph projection.

  • npm run check:ci:fast passed on the published revision, including type checking, lint, and formatting.

At a1ff085335, the collector retains leaf proof in pattern evaluation order and asks the effect log for its recorded-effect check. All 340 focused tests, the compiled CLI default-trace regression, and check:fast passed on the corrected revision. Earlier uncertain pattern effects still limit the proof.

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.

The read-time IR and projection boundary builds on the destructuring work in #7716. This change adds an indexed own-slot proof and uses it for ordinary member reads as well.

Co-authored-by: SII-YDD <[email protected]>
@morluto
morluto marked this pull request as ready for review November 19, 2026 18:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T19:06:50.937537Z a1ff085 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 Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new blocking issue was found.

Summary

Retains property dependencies proven at the read, even when later writes change the merged object value.

  • Earlier property reads keep their graph links after later writes.

Reviews (3) · Last reviewed commit: "fix(javascript): retain destructuring pr..." · Reviewed by Greptile

@morluto
morluto enabled auto-merge (squash) November 19, 2026 19:07
@morluto
morluto merged commit 1dc22f1 into main Nov 19, 2026
40 of 41 checks passed
@morluto
morluto deleted the fix/javascript-captured-property-presence branch November 19, 2026 19:17
@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] A later scalar property assignment makes an earlier destructuring dependency ambiguous

1 participant