Repository navigation
test(bench): make the availability bench obey the gate, and guard gold-not-in-store - #639
Conversation
…d-not-in-store - Scripted capture candidates now open learning rows `When <symptom>: <fact>`, the shape the shipped prompt asks for and #423's write gate enforces: 16 of 16 candidates reach the store instead of 4 of 16. - The tag lane runs on seeded pre-ADR-0009 legacy rows, because capture now refuses restatable candidates (ADR 0009, `fa9bade`) and no new row can carry the tag; read-time drop, row marking, and the tree-ownership controls are non-vacuous again (6 rows marked, exactly 6 dropped at read time). - Gold-not-in-store is reported separately from gold-not-retrieved, excluded from the scored denominator, and owned by its own control line (#629). Closes #629
|
Main-thread push: Verified with the version CI pins rather than whatever is on a local PATH: Flagging it because the fixer round ran typecheck, the full unit suite and comment-lint but not |
WhollyMindless
left a comment
There was a problem hiding this comment.
Note
🤖 gpt-6.2-sol responding on behalf of WhollyMindless
One nonblocking correction to the scan-count control. I evaluated its predicate with one healthy refusal. It returns false for verdicts=1, restatements=1, and zero newly tagged rows, the combination the capture test expects. The zero-refusal fixture passes. Checking that verdicts equal refusals and that the pass writes zero tagged rows would make the assertion match its stated purpose.
There was a problem hiding this comment.
Full review — APPROVE at head acf088f6c9e72f31ab83467998a2734b551400e9
Head note: this round was briefed against e34eec1; the branch head has since
moved to acf088f, a merge of main (6e6acec) into the branch. The merge is
provably trivial: its tree is byte-identical to the trivial merge tree of
e34eec1 + 6e6acec (git merge-tree --write-tree == actual tree
8c8a345), main never touched the two bench files between the branch point
and 6e6acec, and the net diff base→head still touches exactly two bench
files. Everything below measures acf088f, which contains e34eec1 unmodified.
No workflow runs this bench — #608's PR #640 is the CI fix, and it is
deliberately not in this pull. The bar this restores is real but manual:
bun bench/runners/availability-policy-compare.ts, exit 1 with named lines.
Shape pass (item 16) — disclosure
Route read: #629 body + the architect's ruling comment (deliberately — the
ruling is the acceptance standard), and the PR body via issue://639, which
also carried the main-thread formatting note. The diff was not opened before
the write-up; the shape space below was drawn from the ticket and the base
tree at 8114cc8. Artifact: .dev/639-shape.md (harness side).
Problem as I framed it: the scripted capture reply predates the symptom-first
gate and, independently, ADR 0009 moved the availability verdict from tag to
refusal — so no row this pass can write will ever carry restatable, and the
policy arms act on a population capture no longer produces. The ceiling control
blends never-stored golds into misses and prints PASS over a shrunk score.
Alternatives I wrote down, either able to replace the author's:
- A — env-disable the symptom gate (
OPENCODE_MEMORY_SYMPTOM=off,
gate.ts:322): ~2 lines, but measures a path no user takes and does nothing
about layer 2 (restatement refusals aren't gated by that var) — cannot close
the ticket. - B — bypass capture: seed the 16 gold rows directly like the background,
keep the retrieval arms. Medium rewrite; forfeits fixture↔prompt fidelity
and the conservation control, and makes the ruling's mutation probe
meaningless. Honest shape for a retrieval-only harness; answers a different
question.
Invariants I required: denominator honesty with absence named; fixture fidelity
to the shipped prompt/write path; non-vacuity (populations pinned non-empty,
drop-set by identity, never by ts); the ruling's mutation must bite; zero
shipped src/ change; the committed results artifact equals a fresh run.
Expected redundancy: the AVAIL_DUMP missing-set predicate and the src/ capture/available.ts verdict — a guard re-implementing either would have been
the duplication block.
Verdict on the space: the author's shape is C (gate-obeying re-authoring)
with the seeded-legacy population — the branch my write-up predicted, including
the two questions I said it hinged on (population pinned non-empty? drop-set
naming rows?), both verified below. The guard reuses the scorer's own row
lookup rather than re-deriving the AVAIL_DUMP predicate; the case bank
(143 cases) rides unchanged and re-decides 143/143. No duplication found.
Claims vs my measurements (fresh clone, fresh OPENCODE_MEMORY_DIR per run)
| claim | measured |
|---|---|
| green run exit 0, 27 PASS / 0 FAIL | exit 0, 27 PASS / 0 FAIL, 7.75 s |
| 16/16 scripted candidates reach the store | PASS — conservation: all 16 scripted candidates reached the store |
ceiling 16/21, unretrievable m01, m04, m07, m08, m14 |
exact |
| guard: 21 of 21 scored, 0 absent, own line | exact |
| drop-at-read keeps 10/10, 197 of 203, drops exactly the 6 legacy rows | exact |
| marking: 6 marked, 0 unsupported; tree emptied → 0 | exact (6 marked of 202; 0 … prose emptied, 0 … tree emptied) |
legacy lane 6/6 with restatable |
exact |
mutation: delete m10's When opener → exit 1, conservation FAIL naming the CSV prose, guard FAIL ABSENT: m10, ceiling 14/19, blind list byte-identical |
reproduced (edit proven in place before running): exit 1; LOST: the export endpoint streams CSV; large exports O; 19 of 21 … ABSENT: m10; ceiling line and results ceiling both 14/19; m01, m04, m07, m08, m14 cmp-identical green vs mutated |
One reporting gap, not a defect: the mutated run has three FAILs, not the
two the table names — the drop-at-read line also goes red (keeps 9/10)
because that control additionally pins gold presence. Consistent, redundant
with the guard, but the table reads as if only two lines move.
Vacuity probes — the tag lane is not theatre
- Probe A, remove a seeded row (
slice(0,5)): exit 1 —
legacy tag lane … 5 of 6 pre-policy rows loaded backFAILs, and the byte
controlWIN vs no check at allalso goes red (27,27,27,32,32 vs 27,27,27,32,32). An empty population fails the lane check and the
markedAll.length > 0pin; nothing passes vacuously. - Probe B, keep six rows but make one no longer restatable (appended new
claim, tags intact): the drop-at-read identity assertion itself goes red —
the 5 it drops are exactly the legacy restatable ones— while the lane check
stays green (6 tagged) and marking stays green (5 > 0). The assertion compares
the verdict-derived drop set against the seeded population by row identity; if
it were count arithmetic or a population self-comparison it would have stayed
green. This is the proof the control measures the verdict, not its own fixture.
Scope, and the main-thread commit
- Net diff base→head:
bench/runners/availability-policy-compare.tsand
bench/availability-results.mdonly — no shippedsrc/, notest/, no
manifest, no workflow. The extraction question stays where it belongs (#638);
nothing here pre-empts it. The six scripted symptoms are session observations;
the scan line readsverdicts=0 restatements=0, i.e. the shipped refusal
matcher keeps all 16 because each rides a clause the tree does not state. git diff a81141a e34eec1: formatting-only, proven — with all whitespace
stripped the two files differ by exactly one character, a trailing comma biome
drops when unwrapping an argument list (54259→54258 chars); zero token change.- Committed results = fresh run: every scored line in
bench/availability-results.mdmatched my regeneration byte-for-byte. The one
delta is line 215's generator-conditional clause — the committed run carries
(git object unavailable here; the vendored copy is what ran), my full clone
has the362655cobject so the generator correctly omits it, and on my run
that control actually verified the vendored copy against the real historical
module (PASS without the disclosure). Not a hand-edit; the file self-reports
its own environment difference.
Cells the tests do not cover (stated per item 16)
- The tag-vs-delete byte delta now rests entirely on the six seeded legacy
rows: a live pass under ADR 0009 writes no restatable rows, so on captured
output the arms are structurally identical. The report and header say this
plainly ("the honest shape of the comparison now") and the ruling blesses it
as measurement honesty — but a reader should know the policy separation being
measured is a property of the seeded population, not of the rows this pass
wrote. - The doc-lane denominator (6) has no absent guard — by construction it
cannot need one (doc rows are built from fixture strings, never from the
store), but the asymmetry is worth knowing. - Retrieval-miss growth is reported, not gated: the blind list moving (say,
m02 reblinding) shifts the ceiling number with the control still green. By
design — that is #405's scorer/dataset finding, reported and not this bench's
to fix. Absence is what is now gated. - The empty-tree check's second clause
markedProseGone <= markedAll.lengthis
a weak inequality; the strict half ismarkedAllGone === 0(measured 0).
Nits (non-blocking)
- The guard's red-run text counts queries but names golds: the mutated run
prints2 golds never arrived — ABSENT: m10(two queries, one gold). Only
ever surfaces on a red run; reword at the next touch. - The PR's mutation table should name the third consistent FAIL (above).
Not verified this round
typecheck, the full unit suite, lint:comments and e2e were not re-run here:
CI is green on this head and this round was told not to re-trigger it; the
documented environmental baselines (pi node-launcher under the shell's Node
20.20.2; comment-lint committed history at 6e33179) were likewise not
re-derived. Everything claimed about bench behavior was measured directly in a
throwaway clone with its own store directories.
Verdict: APPROVE at acf088f6c9e72f31ab83467998a2734b551400e9. The bench
obeys the gate, the guard is named and non-inert, the green is non-vacuous under
both probes, the scope is exactly the ruling's, and the artifact regenerates
itself. Merging remains the owner's.
|
Architect Accepted — the scan-count control measures the wrong thing, and the shape it forbids is the healthy one.
The invariant that holds in both shapes and still fails on a leak:
Those go red when a refused candidate is written to the store ( A fix round follows on this branch, and the assertion's comment will say which number means what instead of describing an equality that only holds by fixture accident. |
… refusals
The control asserted `restatements === tagged.length`, so a healthy
refusal (verdicts=1, restatements=1, zero stored tagged rows — the shape
pinned by test/capture/capture-available.test.ts) read red, and the
control went green only when the fixture contained no candidate at all:
it measured the fixture, not the code. Extract the predicate as
scanControlHolds({verdicts, restatements, taggedRows}) in
bench/lib/scan-control.ts, assert `verdicts === restatements &&
taggedRows === 0` at the live call site with all three counts printed on
failure, and pin the five shapes — healthy refusal, zero candidates,
refused-row leak, unrefused escape, tagged-without-verdicts —
deterministically in test/capture/bench-scan-control.test.ts, without
an inference server.
Found in review by WhollyMindless on #639 (COMMENTED at acf088f).
Ticket: #629. PR: #639.
The comment policy keeps code comments free of issue numbers and review narrative: a comment that cites a ticket rots the day the ticket closes. Restate both header blocks forward-looking — what scanControlHolds guarantees and what makes it red, including why an equality against the tagged-row count measures the fixture rather than the code. Credit and ticket history stay where they belong: the previous commit's message and the review thread on #639. Ticket: #629. PR: #639.
There was a problem hiding this comment.
Delta review — head 0403356e9380a120e037e2679efed701f170c02a (range acf088f..0403356). Everything below was run against that sha in a fresh clone; I did not re-litigate what acf088f already carried.
WhollyMindless — your finding is the thing this round implements, and it holds up under a fresh read, not just as a report. Number(scan.restatements) === tagged.length reads 1 === 0 on the healthy refusal that test/capture/capture-available.test.ts:864-865 pins (verdicts=1, restatements=1, and no stored row carrying the tag), and it goes green vacuously whenever the fixture holds no matched candidate. The committed bench witness is the second half of your case: the last recorded real run reported verdicts=0 restatements=0 with 0 tagged rows, so the old control passed on the zero shape and could never have caught the divergence it claimed to guard. 7586ea8 fixes both halves, and 0403356 keeps it inside the comment policy. Thank you.
1. Predicate correctness — verified by mutation, not by reading
bench/lib/scan-control.ts: verdicts === restatements && taggedRows === 0. I ran the bank against five mutants of the predicate to test whether each of the five shapes is load-bearing or decorative:
| mutant | bank result |
|---|---|
| baseline (head predicate) | 5 pass / 0 fail |
drop the count equality (taggedRows === 0) |
1 fail — red when a matched candidate escaped unrefused |
drop the tag guard (verdicts === restatements) |
2 fail — refused candidate leaked, stored tagged rows behind no verdicts |
the rejected predicate (restatements === taggedRows && verdicts >= taggedRows) |
2 fail — a healthy refusal holds, refused candidate leaked |
add fixture-dependence (verdicts > 0 && …) |
1 fail — zero candidates holds |
one-sided (verdicts >= restatements && …) |
1 fail — a matched candidate escaped unrefused |
No shape is a tautology: each kills at least one mutant, the zero-candidates shape is the sole guard against a predicate that quietly requires a candidate (i.e. the fixture-measuring trap in a new costume), and the healthy-refusal shape is the sole guard that kills the predicate you flagged.
On (2,1,0) → false: defensible as a guard rather than a shape pin, and the code says why. src/runtime/capture.ts:1049-1052 keeps the two counters apart precisely so "a future consequence that is not refusal must not silently reuse the count" — pinning the asymmetry is what makes that sentence enforced instead of aspirational. A divergence pin that no current producer emits is worth a line here because the whole reason the fields are two numbers is that future code may separate them.
2. The producer — your read confirmed
src/runtime/capture.ts:843-846:
const avail = availability().check(c.content);
if (avail) {
availVerdicts++;
restatements++;
Adjacent statements in the same if (avail) block, nothing between them that can throw, and grep over src/ shows no other writer of either counter (only :1054-1055, the emit). So verdicts === restatements is an identity today — not a lucky coincidence in the fixture — and the only reachable reds at the live call site are (a) a refused candidate reaching the store, or (b) a future non-refusal consequence incrementing one counter and not the other. tagged is the right population for (a): it is filtered from stored (auto-capture rows this pass wrote, bench/runners/availability-policy-compare.ts:367,417), so the six seeded legacy restatable rows cannot trip it, and the fresh run confirms 0 stored rows carry the tag alongside 6 legacy rows present in the arms.
3. Blast radius — clean
bench/lib/scan-control.ts | 32 +++++++++++++++++++
bench/runners/availability-policy-compare.ts | 26 ++++++++++------
test/capture/bench-scan-control.test.ts | 46 ++++++++++++++++++++++++++++
3 files changed, 95 insertions(+), 9 deletions(-)
git diff --name-only acf088f..0403356 | grep -v -E '^(bench|test)/' → empty. Nothing under src/, no workflow, no fixture. The failure message still names all three counts it evaluates: verdicts=… (candidates the check matched), restatements=… (refused because of it), ${tagged.length} stored rows carry the tag — visible verbatim in the run output quoted below.
4. Gates, at the head, from commands
bun run lint→lint rc=0(Checked 573 files … Found 978 warnings— warnings-only pool, unchanged in kind; the two new files are clean on their own:Checked 2 files …with no diagnostics).COMMENT_LINT_BASE=6e6acecd28ead30fb4030e2e3d5e33832173dc37 bun run lint:comments→rc=0,comment-lint: clean (118 added comment line(s) checked against COMMENT_LINT_BASE).bun test test/capture/bench-scan-control.test.ts test/capture/capture-available.test.ts→36 pass / 0 fail / 117 expect() calls — Ran 36 tests across 2 files. [3.33s].bun x tsc --noEmit -p tsconfig.json→rc=0(the delta adds a module; the body's typecheck claim still stands at this head).- CI spot-check, not taken on faith:
gh run list --json headSha,conclusion→ci=completed/successat0403356;gh pr checks 639→lint=pass test=pass coverage=pass test-windows=pass smoke=pass smoke-stable=pass oh-my-pi (ubuntu-latest)=pass oh-my-pi (windows-latest)=pass pi (ubuntu-latest)=pass pi (windows-latest)=pass(10/10). Theci=completed/failureentry on7586ea8is exactly the gate this round exists for: itslintjob's Comment policy step failed withbench/lib/scan-control.ts: (issue reference)andtest/capture/bench-scan-control.test.ts: (issue reference)— reproduced locally at that sha (rc=1, same two lines), and0403356clears it. - I also ran the bench the control lives in, since it is fully scripted and needs no inference server:
bun bench/runners/availability-policy-compare.ts→real 0m7.575s,exit=0, 27PASS/ 0FAIL, including
PASS — the scan line separates its numbers: verdicts=0 (candidates the check matched), restatements=0 (refused because of it), 0 stored rows carry the tag — RED when a refused candidate is stored (tagged > 0) or a matched candidate escaped unrefused (verdicts > restatements).
One limit worth stating plainly, because a green bench can be misread: the live fixture holds no matched candidate, so the runner's control is satisfied via the zero shape. The run proves the predicate is no longer falsely red; it does not exercise (1,1,0). Coverage of the healthy-refusal shape is test/capture/bench-scan-control.test.ts plus test/capture/capture-available.test.ts, exactly as the header comment says, and the runner reports rather than asserts whether the fixture happens to contain a refused candidate. That split is the right one — the fixture property is not a claim about the code.
5. Comment policy as intent, not redaction
Diffing 7586ea8..0403356: what was removed is provenance — (issue #629, review on PR #639) and WhollyMindless found it in review on #639 — plus a shift from past-tense narrative (the predicate the control shipped with … read red) to forward-looking contract (Comparing either count with the number of tagged rows is deliberately NOT part of the contract … an equality against the tag count reads red on that correct behaviour and green only when the fixture holds no candidate at all: it measures the fixture, not the code). The reasoning that actually costs something to recover — the (1,1,0) shape, the pointer to the test file that pins it, and why a tag-count equality measures the fixture instead of the code — survives in both files, at equal or greater length. The credit did not vanish, it moved to where the policy says history belongs: git log (7586ea8: "Found in review by WhollyMindless on #639 (COMMENTED at acf088f)"). This is the policy doing its job, not a linter eating a lesson.
6. Findings (non-blocking)
- The PR description is silent about this round. The body still describes only the three items of
a81141a(gate-obeying candidates, legacy tag lane, gold-not-in-store guard); it never mentions that the scan-count control's invariant changed fromrestatements === tagged.lengthtoverdicts === restatements && taggedRows === 0, norbench/lib/scan-control.ts, nor the new shape bank. It does not contradict the new invariant — line 19 ("no row a capture pass writes can ever carry therestatabletag again") is exactly whattaggedRows === 0encodes — but a reader who reviews from the description alone cannot see the fix that this round made. Two numbers in it are also pre-delta artifacts:bun run test … 2198 pass / 23 skippredates the five new cases (inference — I deliberately did not re-run the full suite; I measured only the two files above), andbench/availability-results.mdis described as "regenerated by the run and committed", while the committed witness at this head still carries the old control-line wording ("RED if a refused candidate is reported as a stored row, or if either field drifts") because neither delta commit refreshed it. My run at0403356reproduces every number byte-for-byte (verdicts=0,restatements=0, 0 tagged, 27 PASS / 0 FAIL, ceiling16/21, unretrievablem01, m04, m07, m08, m14) and differs in only two lines: that control line, and the environment-dependentthe pinned baseline is the real moduleparenthetical (my clone has the362655cobject, the committing environment did not). Description-only drift, and description drift is what a later round has to rediscover — worth a body edit, not a code change. I did not touch the body. - The bank never pins
restatements > verdicts. The equality covers both directions, but a one-sided refactor in the other direction survives:return verdicts <= restatements && taggedRows === 0passes all five shapes (5 pass / 0 fail, measured). That mutant models a refusal counted with no matching verdict — the reuse the two-counter split exists to catch. One arm,scanControlHolds({verdicts: 0, restatements: 1, taggedRows: 0})→false, closes it. - The missing-field arm is unpinned, though it is the fail-closed one.
Number(scan.verdicts)on a scan line that no longer carries the field isNaN, andNaN === NaNisfalse, so a producer rename reads red rather than green. That behaviour is currently correct and entirely unasserted; a sixth shape (verdicts: Number(undefined)) would pin the direction the control fails in. Nit only — the length checkscanLine.length === 1already runs first.
Verdict
Approve. At 0403356: the predicate encodes the contract the producer actually has (§2), the five shapes are each load-bearing under mutation (§1), the change is confined to bench/ and test/ and its failure message still prints all three counts (§3), lint, lint:comments at CI's base, tsc, the focused tests and all 10 CI jobs are green — and the real bench, offline, exits 0 with the rewritten control line reading PASS (§4). The provenance cleanup preserved the reasoning and moved the credit to git (§5). The three findings are a body edit and two one-line test arms; none of them is a defect in what this delta changed.
Closes #629. Implements the architect's ruling on that ticket: the bench obeys the gate — no exemption, no documented bypass.
What was broken
bench/runners/availability-policy-compare.tswas red onmain, and its ceiling control printedPASSover a measurement that had silently shrunk:The
?golds never reached the store, yet they sat in the same list — and the same denominator — as genuine retrieval misses. The control whose stated job was to notice a family gone blind printedPASSexactly when six of its ten golds were missing.Reproduced on this branch's base
8114cc8:bun bench/runners/availability-policy-compare.ts(~8 s here, ~24 s on the reporter's run), exit 1, conservation naming 12 lost candidates, the?-markedPASSceiling line, andev=write_blocked … reason=symptom_missing× 6 in the evidence trail (plus 6 restatement refusals upstream of the gate — see below).The root cause had a second layer the ticket could not see
The ticket bisected to
8781894(#423, symptom-first write gate) and that is the first bad commit — but between then andmain,fa9bade(ADR 0009 superseding ADR 0008) moved the availability verdict's consequence from tag to refusal: a restatable candidate is now refused before the gate, so no row a capture pass writes can ever carry therestatabletag again. The bench'stagarm, byte columns, row-marking control and tree-ownership control were all still measuring the pre-ADR-0009 world where capture stored restatable rows tagged. Undermainthey could not pass honestly even with symptom-first fixtures: 6 of the 16 scripted candidates are verbatim tree restatements and are refused at capture by design.What this change does (the ruling, implemented)
When <symptom>: <fact>where their type requires it; the symptom clauses are session observations the tree does not state — which is what keeps a symptom-first row over a documented fact a new claim the refusal matcher keeps (new-clause-rides-restatementin the case bank). 16 of 16 scripted candidates now reach the store — conservation green, not adjusted down.restatable, exactly the pre-fa9baderows the refusal commit deliberately left in place. Real stores hold these; the arms (tag/drop-at-read/delete-*) now act on them, so the read-time-drop control drops exactly 6 named rows and the row-marking control has 6 rows to verify. Both previously-failing controls pass with their rows actually present: read-time drop keeps 10/10 transport facts, drops exactly the 6 legacy restatable rows and nothing else; every marked row is supported by the tracked tree, and emptying the README prose takes the marks 6 → 0. No control is deliberately left red: neither claimed regression (read-time drop, row marking) reproduced once its rows existed.gold-not-in-store is named, not blended: 21 of 21 transport queries score because their gold reached the store; 0 golds never arrived), never a silent miss inside the retrieval score. The ceiling sentence names its own real denominator.Mutation evidence (actually run)
Ruling's mutation — delete the
Whenopener from one scriptedlearningcandidate (m10, a gold whose two queries retrieve):LOST: the export endpoint streams CSV; large exports O…19 of 21 … ABSENT: m10Guard non-inertness — the retrieval verdicts are untouched by the bench failure: the unretrievable-golds list (the
#405scorer/dataset finding) is byte-identical in the green and mutated runs (m01, m04, m07, m08, m14in both). The score moved only by the mutated gold's own two queries leaving the scored set as named bench failure, and two control lines went red naming it. As the bench shipped, the same edit shifted the reported ceiling while the control line readPASS— the reproduction above is that behavior with six golds already gone.Gates run
bun x tsc --noEmit -p tsconfig.json— clean (exit 0).bun run test(bun test ./test/ --parallel=4 --timeout=20000) — 2198 pass / 23 skip / 0 fail. (The documented environmental baselineintegration/pi/node-launcher.test.tsunder the shell's Node 20.20.2 belongs to the pi integration leg and was not run here.)bun scripts/comment-lint.ts --base=6e33179af00aef5da2b6d2586071755e82f7aa85— clean (301 added comment lines checked).bun bench/runners/availability-policy-compare.ts— exit 0, 27 PASS / 0 FAIL;bench/availability-results.mdregenerated by the run and committed.CI honesty
No workflow runs this bench. #608 is the open ticket for
mainnever being tested, and this bench being red since8781894— on top of a number quoted in reviews — is its evidence. This pull deliberately does not add a CI job for the bench; that belongs to #608. Until then, the regression bar this fix restores is real but manual:bun bench/runners/availability-policy-compare.tsfails loudly (exit 1, named lines) when a gold never reaches the store, but only when someone runs it.Second round: the scan-count control, at
0403356A review on the first head found the scan-count control asserted
restatements === tagged.length.That equality holds only when the fixture contains no refusal: a healthy refusal reports
verdicts=1,restatements=1and zero stored rows carrying the tag — the shapetest/capture/capture-available.test.tspins — so the control read red on correct behaviour andgreen only when the fixture held no candidate at all. It measured the fixture, not the code, and
could not detect the leak it existed to detect.
The control now asserts the invariant that holds in both shapes:
Under ADR 0009 every candidate the availability check matched is refused by it and none reaches the
store, so the two counts are the same population and nothing carries the tag. Red means either a
refused candidate reached the store, or a matched candidate escaped unrefused.
src/runtime/capture.tsincrements both counters in the same branch, so equality is an identity today and the split exists so
a future non-refusal consequence cannot silently reuse one count.
bench/lib/scan-control.ts— the predicate, extracted because the runner executes top-to-bottom onimport and so cannot host an importable case bank (same placement as
bench/lib/legacy-tokenizer.ts).test/capture/bench-scan-control.test.ts— five shapes, no inference server: healthy refusal1/1/0, zero candidates0/0/0, leaked refusal1/1/1, escaped candidate2/1/0, stored rows withno scan verdicts
0/0/1. Mutation-checked: dropping either arm, restoring the old equality, orweakening equality to an ordering each turns at least one case red.
Measured at
0403356: focused files36 pass / 0 fail; the bench itself rerun scripted with nomodel calls —
27 PASS / 0 FAIL, exit 0, ceiling16/21, unretrievablem01, m04, m07, m08, m14;CI all ten jobs green. The full-suite figure elsewhere in this description predates this round.
What this deliberately does not catch:
verdictsandrestatementsare compared for equality but thebank does not pin a
restatements > verdictsshape, so weakening===to<=in the predicate wouldsurvive the current cases. Noted on the review; one added case closes it whenever this file is next
touched.