Repository navigation
Conversation
…ation 001851f threads capture-time ordering through member-mutation references, so a guarded mutation nested in a logical expression shares its statement list with the preceding reassignment and the analysis proves the mutation cannot reach the earlier alias target. The if-guarded form keeps its own block body, retains no same-list proof, and stays unknown-coverage, so the table now states each row's expected shared presence explicitly and asserts the mutation itself stays recorded on the alias binding in every case.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Closing in favor of b8a8190, which covers this correctly and picks the better direction. I had read the short-circuit precision as the intended outcome of 001851f and updated the expectation to match; the guarded-mutation rule in b8a8190 (no statement position for logical-RHS and conditional-branch mutations) is the right call: it keeps presence stable across semantically equivalent guarded forms ( |
Summary
main has been red on Test shard 1/4 since 001851f ("preserve capture-time guards and ordering"):
JavaScriptSemanticGraphBuilder.test.ts > preserves possible alias mutation uncertainty in queries: short-circuit mutationexpectsunknown-coveragebut the graph now reportspresentfor the shared slot. The new presence is the correct outcome of that commit's capture-time ordering: the reassignmentalias = { mode: "other" }and the guarded mutationflag && (alias.mode = "updated")share one statement list, so the analysis proves the mutation cannot reach the earlier alias target. The test table now states each row's expected shared presence explicitly and additionally asserts the mutation itself stays recorded on the alias binding in every row.Problem and expected behavior
Smallest trigger:
npm run teston main at 001851f and later (reproduced deterministically on Linux and Windows, 15/15 and 8/8 local runs; main CI run 38003459598 failed the same test at 08ec2bf, and PR #1382's shard hit it too).Root cause chain, from bisecting 39dabd0 (passes) to 001851f (fails):
directMutationPositionnow climbs from the assignment to its enclosing statement, so a mutation nested inside a logical expression receives a position in the program's statement list instead of no position at all.positionPrecedesthen proves the preceding reassignment dominates the mutation, and the member mutation is attributed only to the reassigned object; the shared slot keeps its capturedpresentvalue.unknown-coverage. Both outcomes match the semantics documented in thereference_lifetimestests added by the same commit.Violated invariant: the test table's single hardcoded
unknown-coverageexpectation encoded the pre-001851fd conservative behavior and was not updated with that change.Change and scope
src/application/javascript/JavaScriptSemanticGraphBuilder.test.tsonly: the seven-row table gains an explicit expected-shared-presence column (unknown-coveragefor the six rows whose reassignment or proof is conditional,presentfor the short-circuit row), and the assertions add the alias slot stayingunknown-coveragein every row, proving the guarded mutation is still recorded on the current alias target. No product code changes.Contract and boundary impact
Evidence and regression coverage
unknown-coveragein six rows andpresentonly in the short-circuit row; the alias slot isunknown-coveragein all seven.javascriptSemanticAnalysis.reference_lifetimes.test.tsstays 79/79 green; the four remaining JavaScript failures in my local full-directory run are the known Windows-only?/#filename NTFS artifacts, untouched by this change.npm run check:fastpasses.