Repository navigation
test(javascript): bound member-path propagation by alias states instead of elapsed time - #11635
Conversation
…ad of elapsed time The eight elapsed-time bounds in the reference-lifetime tests measured wall time. Seven become alias-state allowances at twice each case's measured count, using the production member-mutation allowance that charges every scheduled alias state. With 2859527's path normalization or its covering antichain removed, each bounded case needs more than four times as many states, so the analysis refuses it and the test fails. The shallow-copy bound guarded no mechanism that a mutant could remove, so it is deleted and its uncertainty assertion stays. Refs #10513
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Low impact] The test-only changes appear safe to merge. SummaryReplaces elapsed-time checks with deterministic alias-state allowances in
Validation limits: tests and mutation probes were not rerun. Supersession could not be checked because GitHub access required authentication. Reviews (1) · Last reviewed commit: "test(javascript): bound member-path prop..." · Reviewed by Greptile |
Summary
Refs #10513.
javascriptSemanticAnalysis.reference_lifetimes.test.tshad eightperformance.now() - start < 2000bounds. They measured wall time on a shared runner and never showed which mechanism kept member-path propagation small. Seven become deterministic alias-state allowances. Each fails when the mechanism from 2859527 it guards is removed. The eighth guarded no mechanism a mutant could remove, so it is deleted; its semantic assertion stays.Problem and expected behavior
An elapsed bound passes on a fast machine even after a regression, and can fail on a loaded one without one. A bound should fail exactly when the propagation work it guards grows.
Change and scope
The tests pass an allowance to
analyzeJavaScriptSemantics(source, undefined, { aliasStates, source: "request" }). This is the production member-mutation allowance (JavaScriptSemanticWorkMeter), which charges every alias state the member-mutation traversal schedules and refuses the source when the count exceeds it. Each bound is twice the states the case schedules today, recorded in a comment. A refusal fails the test.node[key]:toLowerCase/mutate/ writenode.next: writeuse/ writem0.value/ writemodeobservablePaths.normalizein the alias traversal. The mutant usedcurrent.pathunchanged.if (!covering.retain(path, captureContexts)) continue;. The mutant retained every path.alias0[0]staysunknown.unknownassertion.On the task's "counter on the member-path normalization": no new counter was added. The existing production meter already counts the work both mechanisms bound, and these probes show it detects removal of either. A test-only counter would duplicate it.
Not included: the other elapsed-time bounds on #10513 (34 assertions in 25 files on main after this change).
Contract and boundary impact
docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/domain/javascript/javascriptSemanticAnalysis.reference_lifetimes.test.ts.npx vitest run <file> -t bounds. The normalize mutant fails 6 of the 12 (linked list, scalar member,node.next, and all three 9-member rows). The covering mutant fails 8 (setter, cyclic, threenode[key]rows, two 9-member write rows, destructuring). Together they fail all 12. Unmodified, all 113 tests in the file pass.For evidence-bearing changes:
Validation performed
npm run test:local -- src/domain/javascript/javascriptSemanticAnalysis.reference_lifetimes.test.ts: 113 passed.npx vitest run src/domain/javascript/javascriptSemanticAnalysis.reference_lifetimes.test.ts -t boundsunder each mutant: 6 failed (normalize) and 8 failed (covering), as listed above.npm run check:fast: passed.npx oxfmton the changed file.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.