Repository navigation
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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; the nested-read finding is fixed and no new blocking issue was found. SummaryFixes nested destructuring reads by checking the property path relative to the evaluated source.
Reviews (4) · Last reviewed commit: "fix(javascript): resolve pattern-relativ..." · Reviewed by Greptile |
…bject slot state
When projecting semantic graph object operations, lookups for target slots previously used the merged binding value across the entire program. When a scalar property assignment occurred after destructuring (e.g. config.mode = 'loose' after const { mode } = config), the merged slot state acquired unknown-coverage presence, downgrading the earlier read's destructuring edge to candidate and emitting a spurious ambiguous-target unknown.
Track preceding member writes within the same callable context and evaluate reads against the binding's initializer value when no preceding write has affected the property path, preserving resolved destructuring provenance.
6557893 to
f3786f9
Compare
…rget binding state Resolve function callable node IDs using context.callableNodes and evaluate destructuring read-position slot state using the producer's target binding facts. This preserves resolved dependencies inside functions while keeping destructuring relations uncertain when affected by alias writes or loop-carried mutations.
f3786f9 to
0887da2
Compare
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
Summary
Fixes #7559.
When building semantic graphs for JavaScript applications, destructuring dependencies (
destructuresedges) are projected by evaluating the property slot of the target object. When a scalar property assignment occurred after destructuring (e.g.,config.mode = "loose"afterconst { mode } = config;), the object's merged slot state acquiredpresence: "unknown-coverage", which caused the earlier read's destructuring edge to downgrade fromresolvedtocandidate.This change evaluates target slots against the binding's initializer value when no preceding write has affected the property path within the same callable context, keeping the earlier
destructuresdependencyresolvedand traversable in default queries.Problem and expected behavior
In code such as:
trace-javascript-semanticswith a backward-provenance seed formodereturnedstatus: "ambiguous"with 3 nodes and 2definesrelations, omitting thedestructuresrelation because default query traversal filters candidate edges.The expected contract (
docs/javascript-application-workflows.md:257-259) specifies:Because
projectSemanticObjectsevaluated target slots using the merged whole-program value frombinding.valuerather than the slot state at the operation's read position, the subsequent assignmentconfig.mode = "loose"downgraded the earlier read's destructuring edge to candidate and emitted a spuriousambiguous-targetunknown.Change and scope
src/application/javascript/JavaScriptSemanticGraphObjectProjection.ts:binding.initializerValuewhen no preceding write has affected the property path, preserving the resolved slot presence from the initializer.objectTargetto accept an optionalreadPositionValueoverride.src/application/javascript/JavaScriptSemanticGraphDestructuring.test.ts:destructuresrelation remainsresolved, nodestructuresunknowns are emitted, and backward-provenance query successfully traverses throughdestructuresto the property slot when a property is mutated after destructuring.destructuresrelation remainscandidatewhen the mutation precedes destructuring.Contract and boundary impact
projectSemanticObjectsinJavaScriptSemanticGraphObjectProjection.ts; affects semantic graph relationship resolution and semantic query traversal.candidateresolution and spuriousambiguous-targetunknowns on earlier destructuring operations.Expected effects:
Evidence and regression coverage
src/application/javascript/JavaScriptSemanticGraphDestructuring.test.ts: Addedretains resolved destructuring relation when a property is mutated after destructuringandkeeps destructuring relation candidate when a property is mutated before destructuring.relations[0].resolutionwas"candidate", an unknown was emitted ingraph.unknowns, andqueryJavaScriptSemanticGraphomitteddestructuresfrom default backward provenance traversal.trace-javascript-semanticsdefault query traversesdestructuresedge directly to property slot without requiringinclude_ambiguous_dynamic_edges: true.For evidence-bearing changes:
Validation performed
npx vitest run src/application/javascript/JavaScriptSemanticGraphDestructuring.test.ts- 14 passed.npx vitest run src/application/javascript/- 25 test files passed (622 tests passed).npx vitest run src/domain/javascript/- 162 test files passed (4429 tests passed).npm run check:fast- turbo typecheck & lint passed (2 successful).npm run verify:module-boundaries- checked 3432 source files successfully.npm run verify:test-discovery- discovered all 2871 test files exactly once.Compatibility, safety, and release
Author readiness
Human owner: @highmachs
Before merge
type(scope): outcome.