Repository navigation
feat(capture): refuse restatable candidates, spend capture on unavailable facts - #493
Conversation
…able facts A capture candidate whose every assertion the tracked tree states verbatim, or whose only content is a command the project's gates declare, is now refused at capture time and logged with the file or gate named. The availability check keeps its hardened matcher and its fail-open shape; only the consequence moves from tag to refusal, per ADR 0009 superseding ADR 0008. Nothing is deleted from existing stores and the retrieval demotion stays for legacy tagged rows.
WhollyMindless
left a comment
There was a problem hiding this comment.
Note
🤖 GPT-6.2 Astra responding on behalf of WhollyMindless
Capture can discard a newly learned value when another environment uses the same value. I reproduced this through the capture harness with a canned model reply and a tracked README containing just these lines:
Staging export pool: cobalt-workers.
Production export pool: ask operations at rollout.
For the candidate Production export pool: cobalt-workers., base 06b51b5 stored one row. Head fa9bade stored zero and emitted in_tracked_file pointing to the README. As a control, the verbatim staging candidate was also refused on the head, as intended.
In available.ts, claims splits at the colon and allRestatable finds each fragment independently. The README contains both fragments, but only the session supplied the production mapping. Could the refusal require evidence that the label and value belong together? This pair would make a regression test for the transport requirement in #389.
…open bank A guided candidate whose content is verbatim in a tracked file is refused and logged with guided=true: the recall layer's guided exemption does not extend upstream, and nothing pins that until now. The scan line gains a candidates field so a dead matcher is distinguishable from an empty session, and the fail-open paths (no git, unopenable tracked path, oversized file, truncated scan, nowhere-in-tree) are enumerated in one table with a control row that must refuse.
There was a problem hiding this comment.
Review: defect-level pass, round 3
Reviewed head 4f93057 against origin/main (06b51b5), read-only; all runs in scratch exports.
Blockers
B1 — A figure the tree does not state can ride a refusal, on both paths
The shipped contract says refusal fires only "with no figure the tree does not carry" (src/capture/runtime.ts:901; src/capture/available.ts:44-46). Two mechanisms violate it, both verified end-to-end.
(a) in_tracked_file: claims() fragments dotted figures. claims() splits on . ; : , (src/capture/available.ts:457) and allRestatable matches each fragment independently (src/capture/available.ts:585-587, 694). A decimal, version or IP splits into fragments that each match elsewhere, word-bounded and same-polarity, while the whole candidate appears nowhere:
- tree
The budget is 1 second per call.+Retry after 5 seconds.refuses candidateThe budget is 1.5 seconds. - tree
The fix landed in 1 release per week.+Set workers to 4.+Use pool size 3.refusesThe fix landed in 1.4.3. - tree
The staging host is 10 ms from the edge.+Limit the pool to 20.+Drain takes 30 s, then 40 s to warm.refusesThe staging host is 10.20.30.40.
Through the capture harness the first case stores nothing: rows=0 refusals=1 reason=in_tracked_file where=README.md. These are transport-class rows — a corrected number seen in tool output, the exact class the store's only measured benefit (base4: empty 0/5, seeded 5/5) exists to carry — and fragment matching is the failure class that killed the original rule (ADR 0008). The word-level fragment hole was closed; the sentence-level one survives because VETO 2 is wired only to the gate path.
(b) declared_gate: the figure veto self-certifies on the candidate's own span. introducesNewNumber(content, spans.join(" ")) (src/capture/available.ts:736) compares the candidate's figures against the candidate's own backticked spans, not the gate's declaration — the docstring at src/capture/available.ts:236-237 says the figure must be "in the command itself", meaning the declared command. Combined with operand-position matching, which ignores everything after the script name (src/capture/available.ts:432), a figure smuggled inside the backticks vouches for itself:
test: bun testdeclared →Run \bun test --timeout 5000`.REFUSEDdeclared_gate where=package.json scripts.test`; the timeout appears nowhere.deploy: rsync dist/ box:/srvdeclared →Run \npm run deploy --bwlimit=100`.` REFUSED; the cap appears nowhere.
The veto-only shape is not broken as a shape — the veto still only removes — but it checks the wrong text, so it fails to remove these refusals.
Unblock condition (one mechanism, both paths): make the candidate's figures a precondition of refusal, checked against tree evidence. For (a): require numericTokens(content) ⊆ numericTokens(haystack) before the in_tracked_file refusal. For (b): compare against the matched gate's label/declared command instead of spans.join(" "). numericTokens keeps dotted numbers whole (src/core/tokenize.ts:33-38 splits on [^a-z0-9_.]+), so the single check catches every case above; a genuine verbatim restatement still refuses, because its figures are in the tree by definition. Add one case-bank entry per mechanism (decimal-corrected fact; declared command with a figure-bearing flag).
Nits (do not hold merge)
- N1 — the pin proof is misattributed in the PR body. "An export of
fa9badewith the plausible one-line exemption lands four failures" reproduces only with the round-2 test file:fa9badesource +fa9bade's own tests = 2 failures;fa9badesource + head's test file = exactly the four listed. Two of the four (a guided candidate that restates the tree is refused too, anda pass that checks names what it readvia the absentcandidates=field) do not exist onfa9bade. The seam is genuinely pinned on head — I watched the guided pin fail there — but the body should name which export ran. Same ambiguity in the fail-before tally: 15/11 isfa9bade's test file onmain; head's test file onmainis 14 pass / 13 fail. - N2 —
src/capture/available.ts:208: "Measured on the round-3 case" is investigation narration keyed to this PR's review rounds; the file's other evidence comments anchor to shas (362655c,05482ba). Anchor it or drop the round label.
Repro evidence
Step 1, gap on main (06b51b5 export, node_modules symlinked, canned reply, real write gate, temp store, candidate verbatim from a tracked README.md):
[step0] rows stored for a verbatim README restatement: 1
[step0] auto_capture_restatable lines: 1 reason=in_tracked_file where=README.md
[step0] stored row tags: ["auto-capture","restatable"]
Step 2, same probe on head 4f93057:
[step0] rows stored for a verbatim README restatement: 0
[step0] auto_capture_restatable lines: 1 reason=in_tracked_file where=README.md
[step0] stored row tags: null
Step 3, watched pin: head export + if (c.guided) continue; before the availability check (src/capture/runtime.ts:909), then bun test test/capture/capture-available.test.ts:
error: expect(received).toBe(expected) // Expected: 1 Received: 0
at test/capture/capture-available.test.ts:577:28
(fail) capture availability refusal > a guided candidate that restates the tree is refused too
(plus a substring of the OPPOSITE rule… and a guided row that contradicts… — 3 fails on head; the crude continue drops guided rows entirely, which is what the two row-asserting tests catch.)
Fail-before on main: head's test file gives 14 pass / 13 fail; failures are contract-level (expect((await rowsWith(scope)).length).toBe(0) received 1), not harness breakage.
Probed and could not break
- Guided seam on head: exemption breaks the guided pin; the scan line survives it (
candidates=emitted with the index unbuilt) — the round-2 denominator works. - Scan line: a pass with candidates produces no line only when the pass is abandoned before its first candidate, where nothing is written either. The lesson-filter-to-empty path is unreachable from canned model replies (
failuredoes not survive candidate parsing); every pass that reaches the loop emits the line. - Pure restatement plus one non-filler token (
…strictly below. Done.) is kept — keep direction, by design; the filler whitelist fails safe. - Gate mention without backticks is kept — deliberate, documented.
- Polarity and warning vetoes (opposite-rule substring, Stop-assuming / Drop-the-assumption, dual-role verbs), control-character flattening, and the case-sensitive-scrubber span: all pinned, all held; no refusal found through them.
- Fail-open bank (no git, unreadable tracked path, oversized file, truncated scan, nowhere-in-tree): each keeps, the control refuses.
- Suite on the branch: 1708 pass / 22 skip / 0 fail (14,633 expects). Typecheck clean. CI green on head (lint, smoke, test, test-windows). No e2e run: this change does not alter delivery timing and the push gate covered it.
- Prose audit on the 493 added lines: no issue numbers, no review IDs; dates only in ADR status lines; ratios in the test header match the file's existing house style; README identical to
main(4024 words both). One narration nit (N2).
Verdict
REQUEST CHANGES — one blocker (B1), unblock condition above. The refusal architecture, the guided pin, the fail-open enumeration and the scan denominator all held under everything I could throw; B1 is a matcher hole, not a design problem.
What remains unfixed or deferred regardless of B1: the post-ship refusal-correctness audit (explicitly deferred in the body); AC 4 and the real-model half of AC 3, pending the owner's benchmark-tests/ocsi/ harness; false rows, owned by the #386 sibling; retirement of the restatable tag, deferred until no tagged row survives in a store; read-time availability for already-stored rows (P3), unchanged.
…le tokens Fragment matching split dotted figures: 1.5 reassembled from `1 second` + `5 seconds`, a version from 1, 4 and 3, an address from four integers, and the corrected number — the transport class — rode the refusal. The text path now requires numericTokens(candidate) ⊆ numericTokens(tree); the gate path compares figures against the declared command, never the candidate's own spans, so a row cannot vouch for its own --timeout. Five bank cases and one runtime case pin the repros; true restatements with whole-token figures still refuse.
…merely present Matching every claim somewhere let two lines conspire: with `Staging export pool: cobalt-workers.` and `Production export pool: ask operations at rollout.` tracked, `Production export pool: cobalt-workers.` was refused, though only the session paired that label with that value. Reported as a transport loss; no digits, so the figure check cannot see it. The text path and the gate residual now walk the claims in the candidate's order and require only assertion punctuation and whitespace between them, with the file joiner breaking contiguity. Every uncertainty in the walk declines a refusal.
There was a problem hiding this comment.
Delta review (round 4): B1 and both nits verified fixed — APPROVE
Reviewed 4f93057 → 23f4abb (delta only; untouched code not re-reviewed). All runs read-only in scratch exports.
B1 — verified fixed, both paths
My full repro bank, run against 4f93057 (fail-before, watched) and 23f4abb:
=== 4f93057 ===
dec1: REFUSED in_tracked_file // The budget is 1.5 seconds.
dec2: REFUSED in_tracked_file // The budget is 1.5.
ver1: REFUSED in_tracked_file // The fix landed in 1.4.3.
ip1: REFUSED in_tracked_file // The staging host is 10.20.30.40.
gatespan: REFUSED declared_gate // Run `npm run deploy 3`.
gateto: REFUSED declared_gate // Run `bun test --timeout 5000`.
gatebw: REFUSED declared_gate // Run `npm run deploy --bwlimit=100`.
wm: REFUSED in_tracked_file // Production export pool: cobalt-workers.
=== 23f4abb ===
(all eight: kept)
Controls that must keep refusing are unchanged on both heads: verbatim README restatement, whole-figure restatement (The timeout is 5000 ms.), same-line label/value pair, plain gate mention. The WhollyMindless cross-line case is kept on 23f4abb with its same-line control still refusing — the relation moved, not the matcher. Bank diff deletes zero lines: no pre-existing case was re-tagged to accommodate the fix.
Contiguity attack — no false refusal found
The new walk (restatedContiguously, src/capture/available.ts:638) was the risk surface. Probes:
- Greedy anchor, no backtracking: tree
Production export pool: staging list.\nProduction export pool: cobalt-workers., candidate verbatim-equal to line 2 → kept. The walk anchors claim 1 at the earliest occurrence and never retries, so a decoy earlier line lets a true restatement escape. This is the fail-open direction and the docstring claims it ("its own greediness — declines a refusal"); confirmed true, and it costs a duplicate row, not a fact. A bank case pinning the decoy behavior would be cheap insurance, not a blocker. - Overlap acceptance: a second claim starting inside the first hit's span produces an empty gap slice and is accepted (
src/capture/available.ts:610-617, 647). Verified with treeThe owner of the pool is ops budget.againstThe owner of the pool is ops, ops budget.→ refused. Sound: the region the empty gap skips is the first claim's own text, so the tree still states the candidate's word sequence as one contiguous run. No foreign word can hide in an accepted gap. - Three-claim assembly across two lines: true two-line restatement refuses; the re-paired variant keeps because the gap carries the first line's value words. Cross-file: the
\0joiner blocks — kept. Order: value-before-label trees keep. Gate residual: the verb left by span-stripping (Run) breaks chains, so even the pre-existing residual-pairing class kept in my probe — more conservative than the old matcher. - Reverse (precision) side: dotted-figure restatements (
Release 1.4.3 ships Monday.) still refuse;verbatim-restatementandsame-line-label-value-pairingbank controls refuse. One formatting limit noted below.
Green
- Bank + fail-open files: 41 pass / 0 fail (33 bank cases incl. the 8 new, 6 fail-open paths + controls).
- Full suite on
23f4abb: 1718 pass / 22 skip / 0 fail (14,647 expects). Typecheck clean. CI on head: lint, smoke, test, test-windows all pass. No e2e rerun here — the push gate ran it (48/48) and this delta does not alter delivery timing.
Prose audit (delta added lines only)
247 added lines: no dates, no review IDs, no round narration — N2's round-3 comment is gone, reworded to the invariant with a test-file anchor. The 8 #493 references are all in bench/fixtures/availability-cases.ts source: annotations, matching the file's existing style (#389, #397 entries predate this PR). README unchanged at 4024 words.
Nits (do not hold merge)
- The body's contract-flip tally is one test stale:
main× head'scapture-available.test.tsmeasures 14 pass / 15 fail (29 tests) — the twelfth-round cross-line runtime test also fails onmain(the old matcher refuses that candidate, sorefusalForis 1 where 0 is expected). The stated 14/14 matches07bdc61's 28-test file. Same labeling discipline N1 asked for, applied one commit behind. - Comma-grouped figures: tree
The timeout is 5,000 ms.vs candidateThe timeout is 5000 ms.→ kept, becausenumericTokenssplits on the comma. Formatting-only difference now keeps a row; fail-open, pre-existing tokenizer behavior, one line in the bank would document it.
Verdict
APPROVE. B1's two mechanisms are closed by the figure-subset check and the declaration-side comparison; the contiguity relation closes the cross-line class without opening a false-refusal path I could find; both round-2 nits are fixed.
What remains unfixed or deferred, stated plainly: the post-ship refusal-correctness audit (monthly auto_capture_restatable where-drift count) is explicitly deferred; AC 4 and the real-model half of AC 3 await the owner's benchmark-tests/ocsi/ harness; false rows stay owned by the #386 sibling; retiring the restatable tag awaits a store with no tagged rows; read-time availability for already-stored rows (P3) is unchanged. CI green on head includes the push-gate e2e; this review did not rerun e2e.
WhollyMindless
left a comment
There was a problem hiding this comment.
Note
🤖 GPT-6.2 Astra responding on behalf of WhollyMindless
The staging/production case from my earlier review is fixed on 31464b7. The original probe now stores the production mapping and refuses the verbatim staging control.
One command case still loses the session's fact. With "deploy": "deploy-tool publish" in package.json and no tracked mention of canary, I supplied the capture harness with the candidate “Run npm run deploy -- --target canary.” Base 06b51b5 stored it. This head stored zero rows and logged declared_gate against package.json scripts.deploy, the same verdict as the bare npm run deploy control.
The numeric check protects a timeout such as 5000, but gateHit accepts the script name and the residual check then strips the entire command span, including --target canary. Could the gate keep a candidate when its forwarded arguments are absent from the declaration? The plain invocation would still be a provable restatement.
Stripping the command span before reading the residual took a forwarded argument with it: with `deploy: "deploy-tool publish"` declared, `npm run deploy -- --target canary` earned the same declared_gate verdict as the bare invocation, and the canary target — the session's own fact — was refused with the command it rode. The gate now requires every word of every span to be a word the declaration states (script name and command together), so an argument the manifest never mentions keeps its row and the plain invocation stays a provable restatement.
WhollyMindless
left a comment
There was a problem hiding this comment.
Note
🤖 GPT-6.2 Astra responding on behalf of WhollyMindless
My earlier capture probe passes on 83bf979. An undeclared --target canary now survives, and the bare invocation is still refused. One case still loses information: swapping two declared values between options.
- Manifest script:
deploy-tool publish --target staging --fallback canary - Captured command:
npm run deploy -- --target canary --fallback staging
With that script under scripts.deploy, the capture harness stored the candidate on base 06b51b5. This head stored zero rows and logged declared_gate against package.json scripts.deploy. The bare npm run deploy control was refused as expected.
spanCarriesUndeclared checks membership in a set. Both values are present, but the manifest specifies the opposite target and fallback. Could the gate check forwarded arguments in order and keep the candidate when it cannot establish the option/value pairing?
There was a problem hiding this comment.
Delta review (round 5): WM's forwarded-arg fix verified; one false refusal remains in its vouch set — REQUEST CHANGES
Reviewed 23f4abb → 31464b7 (merge of main) → 83bf979, delta only. Scratch exports, read-only.
Round 4 verified fixed
WM's exact repro and the claimed controls, run on both heads:
=== 31464b7 ===
wm-canary: REFUSED declared_gate // Run `npm run deploy -- --target canary`. (deploy: "deploy-tool publish")
=== 83bf979 ===
wm-canary: kept // same tree, same candidate
ctl-bare: REFUSED declared_gate // Ship with `npm run deploy`.
ctl-prod: REFUSED declared_gate // deploy: "deploy-tool publish --prod", candidate `npm run deploy --prod`
My wider residual probes on head: a second undeclared command (aws sso login --profile prod) keeps; the declared command quoted verbatim, with and without its own figure, still refuses; and one bonus class closed — Run \deploy task`.(a runner word in non-leading position) refused on31464b7, keeps on head, because only the leading runner prefix strips. The veto-only shape holds: spanCarriesUndeclared` can return the candidate to the keep side, never the reverse. Bank diff deletes no expectations.
Blocker B2 — the vouch set unions sibling steps wherever where names a step kind, not a command
src/capture/available.ts:868-871 builds the declaration as the tokens of every gate label sharing the matched gate's where. For package.json (scripts.X) and Makefile targets (target X) that where identifies exactly one command — name plus command, as the docstring at src/capture/available.ts:464-467 justifies. But Makefile recipes all share ${file} recipe and workflow run: lines all share ${file} run (parseGates, src/capture/available.ts:410,416), so on those files the set is every word any step in the file states. A sibling step then vouches for an extension the matched command's own declaration never mentions:
.github/workflows/ci.ymlwithrun: npm run buildandrun: docker push app --prod→ candidateRun \npm run build --prod`.REFUSEDdeclared_gateon83bf979. The workflow never states that build takes--prod`; the pairing is the session's, and a row recording an observed flag combination is transport.Makefilewith recipesrsync dist box:/srvandtar czf backup.tgz dist→Run \rsync dist box:/srv tar`.REFUSED;tar` vouches from the other recipe.
This is the same failure mode round 4 was written to close — a word the declaration does not state riding the refusal of the command it rode — reached now through the union's scope rather than the span's self-certification. The ADR's own sentence is the standard: the declaration, not the session, must own every pairing a refusal is credited with stating; on shared-where files the shipped rule is "any word any step states".
Unblock condition (one branch): union same-where labels only where the where identifies a single command (scripts.X, target X); for the step-kind wheres (recipe, run) vouch with the matched label's tokens alone. Checked against the controls: the bare invocation matches the script-name label (per-script where, union intact), a verbatim command matches its own label, and gate-forwarded-arg-declared matches the command label that states --prod — all still refuse; both repros above flip to kept. One bank case per shared-where kind (a workflow pair, a recipe pair) to pin it.
For the record: this shape existed on 23f4abb too, and my round-3 probe missed it because the verb left by span-stripping broke that candidate's residual chain — the Run \npm run deploy` after the migration…` form kept for the wrong reason. WM's finding exposed the class; round 4 closed it for per-command wheres; this is the remaining half.
Green
- Bank + fail-open: 43 pass / 0 fail (35 bank cases incl.
gate-forwarded-arg-undeclared/gate-forwarded-arg-declared, 6 fail-open paths + controls). - Full suite on
83bf979: 1721 pass / 22 skip / 0 fail (14,652 expects). Typecheck clean. CI on head: lint, smoke, test, test-windows all pass. No e2e rerun here — the push gate covers it.
Prose audit (23f4abb..83bf979 added lines)
136 added lines (113 from the fix, 23 from the merge of main, which carries only the already-reviewed #495 Windows test change): no dates, no review IDs, no round narration; the 2 #493 references are bank source: annotations, matching the file's existing style. README unchanged at 4024 words.
Verdict
REQUEST CHANGES — one blocker (B2), unblock condition above, everything else in round 4 verified good. This supersedes nothing approved: my prior APPROVED stood for the contiguity work at 23f4abb; B2 is in code shipped after it.
What remains unfixed or deferred, unchanged from before: the post-ship refusal-correctness audit is explicitly deferred; AC 4 and the real-model half of AC 3 await the owner's benchmark-tests/ocsi/ harness; false rows stay owned by the #386 sibling; retiring the restatable tag awaits a store with no tagged rows; read-time availability for already-stored rows (P3) is unchanged.
Every Makefile recipe shares one `where`, and so does every workflow `run:` line, so the set that lets a script name and its command vouch together also let a sibling step vouch for a word it never states: with `run: npm run build` and `run: docker push app --prod`, the row `npm run build --prod` was refused, and with two recipes the word `tar` travelled from the backup recipe into the ship one. A step-kind declaration now vouches with its matched label alone; per-script declarations still vouch name and command together.
There was a problem hiding this comment.
Delta review (round 6): B2 verified closed; B3 confirmed — REQUEST CHANGES
Reviewed 83bf979 → 33c0dcd, delta only. Scratch exports, read-only.
B2 — verified closed
Both of my repros, watched across the two heads:
=== 83bf979 ===
b2-workflow: REFUSED declared_gate // workflow run: npm run build + run: docker push app --prod; candidate `npm run build --prod`
b2-recipe: REFUSED declared_gate // recipes rsync dist box:/srv + tar czf backup.tgz dist; candidate `rsync dist box:/srv tar`
=== 33c0dcd ===
b2-workflow: kept
b2-recipe: kept
Controls refuse on both heads, before and after: bare npm run deploy, declared --prod, same-step workflow flag (gate-workflow-same-step-flag), verbatim command quote. The Gate.solo narrowing (src/capture/available.ts:363,416,422,880-886) is the shape B2 asked for: step-kind wheres vouch with the matched label alone, per-script wheres keep name+command union. The bank diff deletes no expectations.
B3 — confirmed blocker: the vouch set is a bag; the declaration's option→value pairing is refused away
Reproduced through the capture harness on 33c0dcd (canned candidate, real write gate, temp store), manifest deploy: "deploy-tool publish --target staging --fallback canary":
[b3] b3-swap: rows=0 refusals=1 reason=declared_gate where=package.json scripts.deploy // Run `npm run deploy -- --target canary --fallback staging`.
[b3] b3-bare: rows=0 refusals=1 reason=declared_gate where=package.json scripts.deploy // Ship with `npm run deploy`.
The swapped row stores nothing; the log claims the next session can read it from scripts.deploy — which states the opposite binding. Predicate-level variants on head show the reach: every operand whose word order differs from the declaration is refused —
b3-swap: REFUSED // --target canary --fallback staging (values swapped between options)
b3-reorder-flags: REFUSED // --beta --alpha against declared --alpha --beta
b3-drop-value: REFUSED // --target --fallback (options stripped from their values)
b3-correct-pair: REFUSED // --target staging (contiguous prefix — this refusal is correct)
b3-exact-full: REFUSED // verbatim operand — correct
Severity judgment. The swap is transport-class, by the same reasoning that made the cross-line label/value pair a blocker in round 3: every word exists in the tree, and the pairing is the fact the session brought — here, which option carries which value, observed by running the command. The refusal is not merely conservative: declared_gate asserts availability the manifest does not provide. Unlike B2 this needs no coincidence — any operand reorder reaches it, so its reach is wider than the class round 5 closed.
Ordered-pair matching is not too strict a bar, because the bar is contiguity, not exact-command equality. The line to draw:
- Refuse when the operand — the span's tokens after the runner prefix and the matched command name are consumed — appears as a contiguous token run in the declaration (the same label set round 6 already assembles: name+command for per-script wheres, matched label alone for step-kind). This keeps every legitimate refusal: bare invocation (empty operand, vacuously contiguous), same-step single flag (
prodis a run in the command), contiguous prefix (--target staging), verbatim quote modulonormformatting. - Keep when the operand's sequence is not stated contiguously: swapped values, options separated from values, reordered flags.
Reordering valueless flags (--beta --alpha against --alpha --beta) then keeps even where the order is semantically meaningless. That is the right side to err: the matcher cannot establish order-irrelevance for an arbitrary tool, a keep costs one redundant row, and a wrong refusal costs the fact — the same trade the contiguity invariant already makes on the text path, one level down.
Minimum rule (veto-only, uncertainty → keep). In the gate path, for each span: take the stripped form (runners(span) last), remove the matched label's tokens at the position gateHit matched (it already knows the shape: whole-form, operand-position, prefix, suffix), and require the remaining tokens to form a contiguous run inside any vouching label's token list (solo: the matched label only). Empty operand → refuse. Any failure → return null, keep. The existing spanCarriesUndeclared stays as the cheap word-membership pre-filter; this bounds the order the membership ignores.
Checked against everything that must not break: declared-command-restated (empty operand), make-target-restated (empty), gate-forwarded-arg-declared (prod contiguous in the command), gate-workflow-same-step-flag (whole-form match, empty), verbatim command with its own figure (empty) — all still refuse; gate-forwarded-arg-undeclared and the figure self-cert cases stay kept via their existing vetoes, and the three B3 keeps follow from the new rule.
Unblock condition: the operand-contiguity rule above, plus three bank cases pinning the line — swapped pairing (keep), contiguous prefix (refuse), valueless-flag reorder (keep).
Green
- Bank + fail-open: 46 pass / 0 fail (38 bank cases incl. the three round-6 B2 pins, 6 fail-open paths + controls).
- Full suite on
33c0dcd: 1725 pass / 22 skip / 0 fail (14,658 expects). Typecheck clean. CI on head: lint, smoke, test, test-windows all pass. No e2e rerun here — the push gate covers it.
Prose audit (83bf979..33c0dcd added lines)
98 added lines: no dates, no review IDs, no round narration; the 3 #493 references are bank source: annotations, matching the file's existing style. README unchanged at 4024 words.
Verdict
REQUEST CHANGES — one blocker (B3), rule and unblock condition above. B2's fix is verified good and stays.
What remains unfixed or deferred, unchanged: the post-ship refusal-correctness audit is explicitly deferred; AC 4 and the real-model half of AC 3 await the owner's benchmark-tests/ocsi/ harness; false rows stay owned by the #386 sibling; retiring the restatable tag awaits a store with no tagged rows; read-time availability for already-stored rows (P3) is unchanged.
…rd bag Set membership let a span whose every word is declared refuse with the wrong pairing: with `--target staging --fallback canary` declared, `--target canary --fallback staging` was refused, and so were flag reorders and operands stripped of their values. The gate path now asks the tree path's question — the operand a span adds must be a contiguous token run inside the declaration that vouches for it — so the bare invocation and a declared prefix stay refusals and anything the check cannot establish in order keeps its row. The membership pre-filter is gone: contiguity implies it.
WhollyMindless
left a comment
There was a problem hiding this comment.
Note
🤖 GPT-6.2 Astra responding on behalf of WhollyMindless
d3f7b5d preserves the swapped target/fallback case from my last review. One false refusal remains when a memory mentions two scripts. In the capture harness I declared scripts.build = "compiler" and scripts.deploy = "deploy-tool publish --target staging --fallback canary".
| Candidate text | Rows stored |
|---|---|
Run npm run build -- --target staging. |
1 |
Run npm run deploy. Run npm run build -- --target staging. |
0 |
The second case logged declared_gate against package.json scripts.deploy. Only the deploy declaration contains --target staging. Adding the bare deploy command hides the information about build.
In operandsDeclared, matched is selected per span, but labels is computed once from the first gate. Could each span check its operands against its own matched declaration? The two rows above would make a regression test.
The vouch label set was computed once, from the first span that hit a gate, so a second mention lent its declaration's words to the first: with `build: "compiler"` and `deploy: "deploy-tool publish --target staging …"`, the row `Run `npm run deploy`. Run `npm run build -- --target staging`.` checked the build operand against the deploy command, which happens to state it, and refused — the bare deploy mention hid the build information. Labels now come from each span's own matched declaration, which also lets a row whose every operand is vouched by its own script refuse, as the tree does state it in full.
WhollyMindless
left a comment
There was a problem hiding this comment.
Note
🤖 GPT-6.2 Astra responding on behalf of WhollyMindless
bf11254 resolves my outstanding change request. On d3f7b5d, adding a bare npm run deploy before npm run build -- --target staging dropped the build memory. I reran the same capture probe on this head. Both the build-only candidate and the two-command candidate now store one row each. The swapped target/fallback probe still stores its row, and the bare deploy control still produces a declared_gate refusal.
All 78 focused availability tests passed locally. My verification covers capture behavior with scripted candidates. The real-model transport and cost measurements remain with the maintainer.
There was a problem hiding this comment.
Final pass (round 8): B3/B4 verified closed, both-declared refusal sound — but the scoping audit found a live false refusal the class still owes (B5) — REQUEST CHANGES
Reviewed 33c0dcd → d3f7b5d → bf11254, delta only. Scratch exports, read-only. Outside approval at this head noted; B5 below is a site it did not cover.
Job 1 — B3 and B4 verified closed
Watched across the heads:
=== 33c0dcd === j1-b3-swap: REFUSED declared_gate where=package.json scripts.deploy
=== bf11254 === j1-b3-swap: kept // Run `npm run deploy -- --target canary --fallback staging`
=== d3f7b5d === j1-b4-pair: REFUSED declared_gate where=package.json scripts.deploy
=== bf11254 === j1-b4-pair: kept // Run `npm run deploy`. Run `npm run build -- --target staging`.
j1-b4-single: kept on both heads
All six controls refuse on bf11254: bare invocation, verbatim command, declared --prod, same-step workflow flag, contiguous prefix --target staging, both-declared pair. The operand-contiguity rule (operandsDeclared, src/capture/available.ts:520) is the shape B3 asked for, and the per-span matched = gateHit([span], gates) ?? gate is B4's. The bank diff deletes no expectations.
Job 2 — the both-declared refusal is sound
gate-multi-span-both-declared: manifest build: "compiler --fast", deploy: "deploy-tool publish --target staging"; candidate Run \npm run deploy -- --target staging`. Run `npm run build -- --fast`.Every element is derivable: each operand is a contiguous run in its own script's declaration, and the residual isRuntwice — the imperative framing the filler rule already treats as non-assertive for single-span refusals ("Ship with X"). Thed3f7b5d` keep was the bug itself: the build operand checked against the deploy labels, absent there, kept for a reason that no longer exists. This is not the veto-only polarity breaking under cover of a bugfix — veto-only protects uncertainty, and here both operands are positively established against their own declarations; there is nothing left for the keep side to protect. One honest caveat examined and dismissed: the row orders the two commands, which the manifest does not — list order of two independent invocations carries no stronger claim than the filler framing does, and the single-span counterpart already refuses on that basis. Ruling: refusal correct; the bank case stays.
Job 3 — scoping-class audit
B2 (union across a shared where) and B4 (labels from the first span) share one shape: state computed once, consumed per-item. I walked every once-computed set, union, or shared key in src/capture/available.ts and the refusal block in runtime.ts. Enumeration and verdicts:
| Site | Scope as shipped | Verdict |
|---|---|---|
hayFigures (available.ts:838), consumed at :873 |
global — every tracked file | B5: live false refusal, below |
restatedContiguously walk + \0 joiner |
per-file region; joiner breaks chains | sound — cross-file pair probe keeps |
parseGates where-kinds (:399-423) |
scripts.X and target X are per-command (union correct); recipe and run are solo |
sound — no shared-key kind left non-solo; compose, .gitlab-ci.yml, Dockerfile, and block-scalar run: | are not parsed at all → no gate → fail-open keep (probes keep) |
operandsDeclared / vouchLabels (:461) |
per-span, own declaration | sound — B4's fix, verified |
gateHit first match (:907) |
first gate for the candidate | fail-open — a narrower vouch set only removes refusals |
introducesNewNumber(content, gate.label) (:923) |
first matched label only | over-keep nit (fail-open): build: "compiler --timeout 3000" + verbatim npm run build --timeout 3000 keeps (probed). Deliberately do not widen it to the vouch union — widening the known set makes the veto fire less, which adds refusals and breaks the veto-only polarity. Leave it; note it for the deferred refusal audit |
runners() strip (:443) |
leading prefix, per-span | sound — trailing runner word keeps (round-4 probe) |
fileAt/findClause citation (:877-882) |
first claim's hit, inside the matched region | sound once B5 scopes figures to that region |
runtime.ts lazy index (:826) + per-candidate check |
tree facts once per pass | sound — tree state, not per-item proof state |
| greedy-anchor decoy | per-candidate | documented fail-open keep |
B5 — the figure veto reads the whole tree; the refusal cites one file
The text path (:867-873) requires figuresWithin(content, hayFigures) — figures from every tracked file — and restatedContiguously(haystack, needed) — which is per-file, the \0 joiner guaranteeing the matched region lives entirely inside the cited file. The guard is therefore wider than the proof it guards, and a figure outside the region rides the refusal:
README.md: "The budget is 1, 5 seconds of margin."
docs.md: "Requires Node 1.5 or newer."
candidate: "The budget is 1.5 seconds."
bf11254: REFUSED in_tracked_file where=README.md
claims() splits 1.5 into 1 and 5; README's 1, 5 chains across the punctuation gap; the region README offers never states 1.5 — only docs.md does, about Node. The refusal record tells the next session to restate the budget from a file that states 1, 5. This is the same contradiction B2 and B3 were blocked on — the cited source must own every part of the candidate — and it is exactly the reassembly class round 1's B1(a) established as a blocker; the veto was that fix, and its scope is what is wrong. The doc comment at :256-264 calls the haystack scope deliberate ("aimed at the whole tracked-file haystack instead of one declaration") — right against a candidate self-certifying its figure, wrong across files.
The same-file variant (both sentences in README) also refuses on head, which proves per-file scoping is not enough: the region README matched still does not contain 1.5.
Minimum rule (veto-only: shrinking the known set only removes refusals). Scope the guard to the proof: have restatedContiguously return the matched region (first hit start → last hit end), and check figuresWithin(content, new Set(numericTokens(region))) at :873 instead of hayFigures. Hand-checked against everything that must not break: a true dotted restatement (README states The budget is 1.5 seconds.) — region contains the figure, still refuses; the round-2 figure bank cases (all expect keep) — region ⊆ haystack, the veto still fires; the verbatim whole-figure and same-line-pair controls — their figures sit inside their matched sentences, still refuse; the entire gate path is untouched. Unblock condition: the region-scoped veto plus three bank pins — cross-file figure keep, same-file cross-sentence keep, true dotted refuse.
Green
- Bank + fail-open: 53 pass / 0 fail (38 bank cases incl. the B3 reorder pins and the B4 pair trio, fail-open paths + controls).
- Full suite on
bf11254: 1732 pass / 22 skip / 0 fail (14,667 expects). Typecheck clean. CI on head: lint, smoke, test, test-windows all pass. No e2e rerun here — the push gate covers it.
Prose audit (33c0dcd..bf11254 added lines)
207 added lines: no dates, no review IDs, no round narration; the 7 #493 references are bank source: annotations, matching the file's existing style. README unchanged at 4024 words.
Verdict
REQUEST CHANGES — one blocker (B5), rule and unblock condition above. B3's and B4's fixes are verified good and stay; the class is otherwise exhausted — the table is the enumeration, every other once-computed site is per-item or fail-open, and B5 is the last global set the matcher consumes per-refusal.
What remains unfixed or deferred, unchanged: the post-ship refusal-correctness audit is explicitly deferred (the :923 over-keep belongs there); AC 4 and the real-model half of AC 3 await the owner's benchmark-tests/ocsi/ harness; false rows stay owned by the #386 sibling; retiring the restatable tag awaits a store with no tagged rows; read-time availability for already-stored rows (P3) is unchanged.
The figure veto compared the candidate against every number the tracked tree states, so a figure in one sentence cleared a refusal that cited another: with `The budget is 1, 5 seconds of margin.` the claims chain across the comma and match a row saying `1.5 seconds`, and a `Node 1.5` anywhere — another file, or another sentence of the same one — made the refusal go out. The contiguity check now returns the region it matched and the figures are compared against that region, which is the passage the verdict actually cites.
WhollyMindless
left a comment
There was a problem hiding this comment.
Note
🤖 GPT-6.2 Astra responding on behalf of WhollyMindless
5845da6 fixes both reported B5 cases in my matcher probe. There is still a false refusal when the unrelated number falls inside the matched passage. I used a tracked README.md with this exact text:
The supported releases are 1, 5 for production. The minimum runtime is 1.5 for tooling.
availabilityIndex(repo).check("The supported releases are 1.5 for production.") correctly returned null (keep). Appending the README’s verbatim second sentence changed the verdict to in_tracked_file. The verbatim two-sentence README control also returned in_tracked_file, as expected.
The appended sentence establishes the minimum runtime. It supplies no evidence that release 1.5 is supported in production. new Set(numericTokens(...)) lets one occurrence of 1.5 vouch for both assertions. Could the matcher verify each numeric occurrence against its corresponding source text, or keep the candidate when that alignment is uncertain?
|
Note 🤖 GPT-6.2 Astra responding on behalf of WhollyMindless I’d like to put a finish line on our review of #493. The revisions have fixed the command and cross-file cases we reproduced, and all four checks pass on I suggest we close out the one remaining example from our latest review: adding the true sentence about runtime For newly discovered cases or broader matcher changes, let’s use separate issues so each can be prioritized on its merits. We’ll keep our next pass to the agreed scope and leave the merge decision with you. |
There was a problem hiding this comment.
Final confirm (round 9): B5 verified closed, citation question answered — but the region slice cuts figures mid-token (B6, live false refusal) — REQUEST CHANGES
Reviewed bf11254 → 5845da6, delta only. Scratch exports, read-only.
B5 — verified closed
Watched across the two heads:
=== bf11254 === === 5845da6 ===
b5-crossfile: REFUSED in_tracked_file b5-crossfile: kept
b5-samefile: REFUSED in_tracked_file b5-samefile: kept
fig-dotted-true: REFUSED fig-dotted-true: REFUSED (must stay)
fig-start-edge: REFUSED fig-start-edge: REFUSED (must stay)
The mechanism is the minimum rule as written: restatedContiguously returns {start, end} (src/capture/available.ts:735-759), figures check numericTokens(haystack.slice(region.start, region.end)), where resolves from fileAt(region.start), the gate path compares against gate.label and ignores the region, hayFigures is gone. The three bank pins (figure-region-cross-file, figure-region-same-file-distant, figure-region-dotted-restated) are the three I asked for; the bank diff deletes no expectations.
Step 2 — the citation cannot lie, but the slice can invent a figure
The citation question first, answered by construction: the region is always inside ONE file — gapIsPunctuation rejects the \0 joiner, so a chain whose second hit lives in another file returns null, and a clause cannot straddle the joiner. Figures are then checked inside the region slice, so cited file ⊇ region ⊇ vouching figures. Probe: chain in README, the figure's whole token in docs.md → cite-file: kept. fileAt(region.start) cannot name a file that lacks the vouching figure.
The boundary question found the live one. findClause admits a hit whose neighbouring char is any non-word char — including ., which numericTokens treats as figure-continuation. The two boundary notions disagree exactly at the dot inside a number, so haystack.slice(region.start, region.end) can cut a dotted figure in half and re-tokenize the half as a whole figure the tree never states:
on 5845da6:
trunc-nodot: REFUSED in_tracked_file where=README.md // tree "The cost is 11.5." row "The cost is 11"
trunc-ver-nodot: REFUSED in_tracked_file where=README.md // tree "Requires Python 3.12" row "Requires Python 3"
frag-after-dot: REFUSED in_tracked_file where=README.md // tree "Timeout 30.5 seconds." row "5 seconds."
frag-ip: REFUSED in_tracked_file where=docs.md // tree "Bind to 10.20.30.40 now." row "30.40 now."
The refusal for Requires Python 3 cites a README stating 3.12. 3 is not in the tree — it is an artifact of slicing 3.12 at the claim's end. The veto's own doc (:247-248: "numericTokens keeps dotted numbers whole, so versions and addresses are single figures and cannot be assembled out of separate integers") is the standard, and the slice violates it one level down from B5: B5 let a figure from outside the region vouch; B6 lets a half-figure inside the region vouch. The row is transport-class by the B3 reasoning — the session's figure differs from the tree's at the same position (prod runs Python 3, dev pins 3.12), and the refusal record asserts a restatement the cited passage does not provide.
Reach, stated honestly: narrower than B5. The row's claim must END at the tree's figure dot (the tokenizer keeps the row's own trailing dot inside its figure token — numericTokens("The cost is 11.") is ["11."], not ["11"] — which is why dotted rows keep and only dotless tails refuse), or START right after it (the fragment shapes above). Dotless memory rows are common; the version shape is the plausible one.
Minimum rule (veto-only). Snap the region bounds outward over figure characters before slicing: while (start > 0 && /[0-9.]/.test(hay[start - 1])) start--; while (end < hay.length && /[0-9.]/.test(hay[end])) end++; — or, equivalently and without the trailing-dot quirk below, extract the region's figures as the whole tokens of hay whose extent intersects [start, end) instead of re-tokenizing the slice. Polarity: snapping can only veto refusals, never add one — a candidate whose region ends mid-figure states the truncated token, which the snapped set excludes; a candidate stating the full dotted figure has its claims split on . by claims(), so its region already covers the whole token and the snap is a no-op there. One accepted side effect: a dotless row The cost is 11 against a tree that really states The cost is 11. keeps (the snap pulls the sentence-final dot into the token, ["11."]) — a redundant row, the cheap side.
Checked against everything that must not break: figure-region-dotted-restated, fig-dotted-true, fig-start-edge, the whole-figure and same-line controls — their figures sit inside the region interior, snap is a no-op, all still refuse; the three B5 pins keep via their existing veto; the gate path never reads the region. Unblock condition: the snap (or token-intersection extraction) plus three bank pins — dotless tail truncation keep, version truncation keep, figure-tail fragment keep.
Scoping-class table (exhaustion evidence, updated)
| Site | Scope | Verdict |
|---|---|---|
figure check vs region (:878-886) |
slice of matched region | B6 — slice cuts figures at .; snap rule above |
restatedContiguously + \0 joiner |
per-file region | sound — cross-file chain and cite-file probes keep |
parseGates where-kinds |
scripts.X/target X per-command; recipe/run solo |
sound — no shared-key kind non-solo; compose/gitlab/Dockerfile/block-run: unparsed → fail-open |
operandsDeclared/vouchLabels |
per-span, own declaration | sound — B4 fix, verified round 8 |
gateHit first match |
first gate | fail-open — narrower vouch set only removes refusals |
introducesNewNumber(content, gate.label) |
first matched label only | over-keep, measured, deferred by ruling — widening would add refusals, breaks veto-only |
runners() strip |
leading prefix, per-span | sound — trailing runner word keeps |
fileAt(region.start) citation |
first hit, region single-file | sound — cannot name a file lacking the vouching figure |
runtime.ts lazy index |
tree facts once per pass | sound — tree state, not proof state |
| greedy-anchor decoy | per-candidate | documented fail-open keep |
Apart from B6 the class stays exhausted — B6 is not a new instance shape but the figure check's own boundary definition, and the snap closes it at the same site round 8 introduced.
Green
- Bank + fail-open: 56 pass / 0 fail (48 bank cases incl. the three B5 pins, fail-open paths + controls).
- Full suite on
5845da6: 1735 pass / 22 skip / 0 fail (14,671 expects). Typecheck clean. CI on head: lint, smoke, test, test-windows all pass. No e2e rerun here — the push gate covers it.
Prose audit (bf11254..5845da6 added lines)
67 added lines: no dates, no review IDs, no round narration; the 3 #493 references are bank source: annotations, matching the file's existing style. README unchanged at 4024 words.
Verdict
REQUEST CHANGES — one blocker (B6), snap rule and unblock condition above. B5's fix is verified good and stays; the where citation is proven sound.
What remains unfixed or deferred, unchanged: the post-ship refusal-correctness audit (including the measured introducesNewNumber(content, gate.label) over-keep); AC 4 and the real-model half of AC 3 await the owner's benchmark-tests/ocsi/ harness; false rows stay owned by the #386 sibling; retiring the restatable tag awaits a store with no tagged rows; read-time availability for already-stored rows (P3) is unchanged.
|
Note 🤖 GPT-6.2 Astra responding on behalf of WhollyMindless For the author and reviewer: we tested one small change on diff --git a/src/capture/available.ts b/src/capture/available.ts
index ddfb90d..b074b8c 100644
--- a/src/capture/available.ts
+++ b/src/capture/available.ts
@@ -571,7 +571,9 @@ function gateHit(spans: string[], gates: Gate[]): Gate | null {
*/
function claims(text: string): string[] {
const out: string[] = [];
- for (const part of text.split(/[.;:,\n]/)) {
+ // A dot or comma between digits belongs to the claim (1.5, 3.12, 1,000).
+ const separators = /[;:\n]|(?<!\d)[.,]|[.,](?!\d)/;
+ for (const part of text.split(separators)) {
const c = part.trim();
if (!c) continue;
const words = c.split(/[^a-z0-9']+/).filter(Boolean);
@@ -684,10 +686,18 @@ function findClause(hay: string, clause: string, start = 0): number {
const before = i > 0 ? hay.charCodeAt(i - 1) : 32;
const after =
i + clause.length < hay.length ? hay.charCodeAt(i + clause.length) : 32;
+ // A match may not start at the 5 in 30.5 or end at the 3 in 3.12.
+ const end = i + clause.length;
+ const cutsStart =
+ /^\d/.test(clause) && /\d[.,]$/.test(hay.slice(Math.max(0, i - 2), i));
+ const cutsEnd =
+ /\d$/.test(clause) && /^[.,]\d/.test(hay.slice(end, end + 2));
const sentence = sentenceSpan(hay, i, clause.length);
if (
!/\w/.test(String.fromCharCode(before)) &&
!/\w/.test(String.fromCharCode(after)) &&
+ !cutsStart &&
+ !cutsEnd &&
cueNegated(sentence.text) === reversed &&
// A later occurrence may state the claim plainly, so a vetoed hit is
// skipped rather than ending the search.Five regression tests failed on the unmodified head and passed with this patch:
With those tests included, the three focused capture/availability suites passed locally (92/92), and |
The claim splitter cut `1.5` in half while the tokenizer kept dotted numbers whole, and a match was admitted whenever its neighbour was any non-word character — the dot inside a number among them. Each half then re-tokenized as a whole figure the tree never states: a row saying `Requires Python 3` matched inside `Requires Python 3.12` and the region slice handed back `3` as a figure, and a row saying `1.5 for production` chained across two sentences that state `1`, `5` and a `1.5` about something else. Claims now split only at boundaries outside a figure run, and a hit is admitted only when no figure run crosses either edge, so fragments and half-figures cannot be produced at all. Both rules narrow what can match, so they can only remove refusals.
There was a problem hiding this comment.
Final confirm (round 10): root fix verified — APPROVE at 141e8a9
Reviewed 5845da6 → 141e8a9, delta only. Scratch exports, read-only. Nothing merged, nothing pushed.
Spine invariant, one sentence: a figure is one token — the claim splitter never splits inside it, an admitted hit never cuts it, and a refusal cites only the passage that states it whole.
The five pins flipped, controls hold
Watched across the two heads:
=== 5845da6 === === 141e8a9 ===
pin-trunc-tail: REFUSED in_tracked_file pin-trunc-tail: kept // "The cost is 11" vs tree "The cost is 11.5."
pin-trunc-ver: REFUSED in_tracked_file pin-trunc-ver: kept // "Requires Python 3" vs tree "Requires Python 3.12"
pin-frag-dot: REFUSED in_tracked_file pin-frag-dot: kept // "5 seconds." from "Timeout 30.5 seconds."
pin-frag-ip: REFUSED in_tracked_file pin-frag-ip: kept // "30.40 now." from "10.20.30.40 now."
pin-one-occ: REFUSED in_tracked_file pin-one-occ: kept // WM's production/runtime pairing
Must-hold controls, all refuse on head: figure-atomic-version-restated (Requires Python 3.12 verbatim), dotted restatement, stated-whole 5000 ms, same-line label/value pair, and the gate family (bare invocation, declared --prod, verbatim command). The bank diff deletes no expectations.
WM close-out pair — passes; diff-equivalence ruling
(a) The supported releases are 1.5 for production. The minimum runtime is 1.5 for tooling. against their two-sentence README (1, 5 production, 1.5 tooling): kept on head (refused on 5845da6). (b) the verbatim two-sentence control: refused in_tracked_file. Shipped R1 keeps (a) one step earlier than WM's design — the atomic claim …are 1.5 for production never matches the 1, 5 text at all, so no veto is needed.
Equivalence. R1/R2 implement the same root fix with different boundary definitions, and the shipped pair is stronger at hit edges and weaker at claim granularity, with both deviations on the fail-open side. Stronger: hitCoversFigures (src/capture/available.ts:745) rejects a hit crossing any maximal [0-9a-z_.] run that bears a digit, while WM's cutsStart/cutsEnd recognize only [.,] beside a digit — probed: tree Set value 3.beta now. with row Set value 3 now is kept on head, but WM's diff admits the hit (.beta is not [.,]\d) and its region slice re-tokenizes 3 as a whole figure, refusing a row whose figure the tree states only inside 3.beta. Weaker: splitClaims (:596) never splits on a comma, so comma-joined claims are longer and harder to match — a shipped refusal implies a WM refusal, not conversely; the cost is a redundant row, never a lost fact. One shape where WM's diff is right and head defers: the dotless row Requires Python 3.12 against a tree ending 3.12. — WM's splitter ends the claim before the sentence-final dot and refuses the true restatement; head reads 3.12. as the token and keeps. That is the declared deferral, and closing it would widen vouching, which the veto-only polarity refuses. Net: head covers everything WM's diff covers, plus the letter-edge class, minus one correct refusal polarity forbids chasing.
Step 3 — spine probes: no wrong refusal survives
| Probe | Head | Judgment |
|---|---|---|
e.g. adjacent to figure, verbatim |
REFUSED | correct — true restatement |
ellipsis Wait... 5 seconds. vs Wait ... 5 seconds. |
REFUSED | correct — region states the claim |
ordinal 1. Run deploy (dot joins the figure run) |
REFUSED | correct — and an improvement: 5845da6 kept it |
ordinal crossed: 1. Run build vs tree 2. Run build |
kept | correct — wrong pairing |
1.e5 verbatim / truncated Use 1 mode |
REFUSED / kept | correct both ways |
underscore run Set limit_2 now vs limit_2.5 |
kept | correct |
dot-letter Set value 3 now vs 3.beta |
kept | correct — the class WM's diff would refuse |
trailing-dot row Requires Python 3.12 vs 3.12. |
kept | known deferral, fail-open |
comma-grouped 5000 vs 5,000 |
kept | known deferral, fail-open |
Use e.g. vs tree Use e, g modes. |
REFUSED | degenerate; pre-existing lexical behavior, identical on 5845da6, not a round-9 regression — noted for the refusal audit |
One honest observation for the deferred audit: claims() drops one-word fragments, so a row whose only difference from a matched claim is that dropped word (an ellipsis-isolated verb swap) is verified only on its multi-word claims. That granularity predates this PR and shapes here are degenerate; it belongs with the refusal-correctness audit, not this delta.
Scoping-class table (exhaustion evidence, final)
| Site | Scope | Verdict |
|---|---|---|
figure check vs region (:955-963) |
matched region, figures whole | sound — root fix makes half-figures unrepresentable |
restatedContiguously + \0 joiner |
per-file region | sound — cross-file and cite-file probes keep |
parseGates where-kinds |
scripts.X/target X per-command; recipe/run solo |
sound; unparsed kinds fail open |
operandsDeclared/vouchLabels |
per-span, own declaration | sound — B4 fix |
gateHit first match |
first gate | fail-open — narrower vouch set only removes refusals |
introducesNewNumber(content, gate.label) |
first matched label only | over-keep, measured, deferred — widening would add refusals |
runners() strip |
leading prefix, per-span | sound |
fileAt(region.start) citation |
region single-file | sound — cannot name a file lacking the vouching figure |
runtime.ts lazy index |
tree facts once per pass | sound — tree state, not proof state |
| greedy-anchor decoy | per-candidate | documented fail-open keep |
Green
- Bank + fail-open: 62 pass / 0 fail (54 bank cases incl. the five round-9 pins and
figure-atomic-version-restated, fail-open paths + controls). - Full suite on
141e8a9: 1741 pass / 22 skip / 0 fail (14,678 expects). Typecheck clean. CI on head: lint, smoke, test, test-windows all pass. No e2e rerun here — the push gate covers it.
Prose audit (5845da6..141e8a9 added lines)
152 added lines: no dates, no review IDs, no round narration; the 6 #493 references are bank source: annotations, matching the file's existing style. README unchanged at 4024 words.
Verdict
APPROVE at 141e8a9. Nine rounds of case-by-case escapes end where they should: at the contract itself — tokens() reads . as a word character, and the matcher now agrees with it in both the splitter and the hit admission. The scoping-class table above is the exhaustion evidence; the root fix closes the last live false refusal (B6) by construction rather than by veto.
Deferred, stated plainly so nothing rides the approval unnoticed: the trailing-dot fail-open (3.12 vs 3.12. are different tokens; recovery would widen vouching — declined by polarity); the measured introducesNewNumber(content, gate.label) over-keep; the post-ship refusal-correctness audit (it owns the one-word-fragment granularity and the e.g. lexical note above); AC 4 and the real-model half of AC 3 await the owner's benchmark-tests/ocsi/ harness; false rows stay owned by the #386 sibling; retiring the restatable tag awaits a store with no tagged rows; read-time availability for already-stored rows (P3) is unchanged.
WhollyMindless
left a comment
There was a problem hiding this comment.
Note
🤖 GPT-6.2 Astra responding on behalf of WhollyMindless
Approved at 141e8a9. The changed production-release claim plus the true tooling sentence now stores one row with zero refusals. The verbatim README control stores zero rows and logs one in_tracked_file refusal. All four numeric-fragment cases stay eligible for capture.
The capture suite with our independent regression tests passed 319/319, and all four required GitHub checks passed on this revision. This resolves our change request and concludes our review.
|
🎉 This PR is included in version 0.34.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Addresses #389
AC 1, 2 and 6 ship here. AC 3 ships in its scripted form; the real-model reruns of AC 3 and AC 4 need the owner's benchmark harness (
benchmark-tests/ocsi/), which is not in this repo — named under "What is NOT fixed". AC 5 already exists (the 17-row noise bank, outside this repo).The measured gap, and the measured closure
Step 0 on
main(06b51b5), repo capture harness, canned model reply, real write gate, temp store — a candidate copied verbatim from a trackedREADME.md:Same probe on this branch:
The gap was structural:
availabilityIndexcomputed the restatable verdict andruntime.tsattached therestatabletag to a row it stored anyway. The check could not prevent a write — that was the shipped contract, and the tests asserted it.The design decision: which layer enforces "can the next session get this without me"
Chosen: a runtime predicate in the capture loop — after candidate parsing, before the write gate — exactly where the availability verdict already fired. The verdict's consequence flips from tag to refusal:
continueplus the existingauto_capture_restatableevidence line, which already names the file (in_tracked_file,where=README.md) or the gate (declared_gate,where=package.json scripts.deploy) and carries the whole candidate, so a wrong refusal is replayable from the log alone.Why it beats the two alternatives I weighed:
runWriteGate. The gate is the shared write path formemory_remember, updates, imports and consolidation. The ticket scopes itself to capture's budget ("This ticket can only make capture write fewer things"); a user who says remember this is exercising authority, not spending capture budget. In the gate the check either refuses user-initiated writes — out of the ticket's scope and against the authority model — or needs a capture-only flag threaded through the shared component, and every future write path must then get the flag right in a place where forgetting it fails silently.drop-at-readarm). The row is still written: the store keeps paying the dedup surface and supersession contention, and the refusal becomes invisible — no log names the file, and a wrong verdict silently costs recall forever. The bench measured it: 191 of 197 rows remain, the facts unreachable.What class of future change this choice protects against: scope creep in both directions. The enforcement point is the narrowest one that still sees every capture candidate exactly once. A change here cannot silently extend refusal to user-initiated writes (they never pass through the capture loop) and cannot silently hide rows already stored (it runs before the store, never at read time). The question it answers is a property of (candidate, working tree) computable with no model call, and the tree index is already built once per pass on first candidate — the predicate adds no per-write cost and no new component.
Precision stance: which side the predicate errs on
It errs toward keeping. Every uncertainty — no git, a non-repo workspace, an unreadable file, a byte-capped scan, a dropped negation, one clause the tree does not state, one figure the declaration does not carry — stores the candidate. Refusal fires only on the strictest evidence the hardened matcher holds: every assertion restatable verbatim modulo formatting, word-bounded, same polarity, not the object of a warning.
That is the correct side given R4. R4's harm is a false row: one plausible wrong row shipped a wrong artifact in 4/5 runs while an empty store invented nothing. A restatable row is not false — it is true and redundant; its harm is cost, which base3 measured at roughly neutral (0.98×). The catastrophic direction for this predicate is the opposite one: a wrong refusal deletes a fact the store exists to carry — exactly how the original rule died (29 of its 30 refusals were wrong), and AC 3 pins the transport win, which is the store's only measured benefit. So the predicate abstains from refusing whenever it cannot prove restatability. R4's "abstain beats false-store" is honored where it applies: this refusal never invents a fact — it can only decline a duplicate — and the false-row class stays owned by the claim-verdict check (the #386 sibling), which still runs on everything this predicate keeps.
Guided lane policy (round 2)
Policy: capture refuses guided restatements on the same terms as every other candidate. The recall layer exempts guided rows from the budget demotion; that exemption does not extend upstream. A guided verbatim copy, once stored, rides every later injection block at full rank — exactly the row class this PR removes — so the refusal runs before the gate for guided candidates too, and the refusal line carries
guided=trueso the decision stays visible and replayable. ADR 0009 now states this in its Decision section: "Capture refuses guided candidates on the same terms: the recall layer's exemption of guided rows from the budget demotion does not extend upstream." The user-authority escape hatch stays where it always was:memory_rememberwrites what its caller asks, refusal included.The pin.
test/capture/capture-available.test.ts— "a guided candidate that restates the tree is refused too" — requiresauto_capture_restatablewithguided=trueand no row.Proof it holds.
fa9bade's source with the one-line exemption (if (c.guided) continue;), run againstfa9bade's own tests, fails 2 (the blast radius on tests that existed then: the OPPOSITE-rule polarity case and the guided-contradiction case); run against head's tests, it fails 4 — the pin above, plus the scan-line case, because the exemption skips the index build, so the refusal audit loses guided rows entirely.Figure-subset invariant (round 3). A refusal claims the tree states EVERY figure the candidate states, as whole tokens:
numericTokens(candidate) ⊆ numericTokens(tree), withnumericTokenskeeping1.5,1.4.3and10.20.30.40single, so a corrected number can no longer reassemble from1 second+5 secondsand ride the refusal.Co-location invariant (round 3 addendum). A refusal also claims the tree states the candidate as one contiguous assertion: the claims are walked in the candidate's order and only assertion punctuation and whitespace may separate them — the file joiner breaks contiguity, so two files cannot conspire either. Reported on this PR as a transport loss: with
Staging export pool: cobalt-workers.andProduction export pool: ask operations at rollout.tracked,Production export pool: cobalt-workers.was refusedin_tracked_fileon07bdc61— both halves exist, but the tree pairs that value with Staging, and the pairing was the session's fact. It carries no digits, so the figure check is trivially satisfied; contiguity is the relation that sees it. The same walk also declines the cross-sentence figure reassemblies, so the two invariants overlap by design and each still earns its keep: contiguity catches a non-numeric pairing across sentences, the subset check catches1.5reassembled from two adjacent sentences whose gap is bare punctuation.Residual invariant (round 4). A
declared_gaterefusal claims the candidate states NOTHING beyond the declaration, so the span is read before it is stripped, not after: every word of every command span must be a word the declaration states — the declaration being every label the manifest publishes under the samewhere, the script name and its command together.--target canaryagainst"deploy": "deploy-tool publish"fails that and keeps its row;--prodagainst"deploy": "deploy-tool publish --prod"satisfies it and the plain invocation still refuses. The runner vocabulary (npm run,bun,make, …) is stripped first, so the invocation style is not treated as content. It is a veto: it can only remove a refusal. It subsumes the figure cases that ride a span (--timeout 5000,--bwlimit=100fail on words as well as figures); the figure check stays because it also guards figures in the prose outside any span, which is the direction where an extra veto is free.Where-scoped vouch rule (round 5). The set a declaration vouches with is scoped to what the
whereactually names. A per-scriptwhere(package.json scripts.deploy) names ONE command, so its two labels — the script name and the command string — vouch together. A step-kindwhere(Makefile recipe,.github/workflows/ci.yml run) names a FILE: every recipe and everyrun:line in it shares the site while stating nothing about its siblings, so there the matched label alone vouches. Without that split,run: npm run buildplus a neighbouringrun: docker push app --prodmadenpm run build --prodlook declared, and a Makefile'startravelled from the backup recipe into the ship one — the flag combination is exactly what the session observed. Veto shape unchanged: narrowing the vouch set can only remove refusals.Operand-run rule (round 6) — the unification. The gate path now asks the tree path's one question: contiguity, not presence. Per span, the operand is what the span states around the command — its tokens after the runner vocabulary and the matched label — and the
declared_gaterefusal fires only when that operand is a contiguous token run inside a vouching label. Empty operand (the bare invocation) refuses; a declared prefix refuses; a verbatim command refuses. Swapped values (--target staging --fallback canarydeclared,--target canary --fallback stagingin the row), values stripped from options, and flag reorders all keep their rows. The reorder case is deliberate:--dry --verboseand--verbose --dryare the same command to the tool, but order-irrelevance is not something a token comparison can establish, and the asymmetry decides it — a wrong keep costs one row, a wrong refusal costs a fact the store exists to hold. The round-4/5 membership pre-filter is gone: contiguity inside one label implies every word is in the vouch set, so the older rule was strictly weaker and removing it flipped no control (verified against the full bank). One relation now guards both paths: the tree must state the candidate, in order, as something it actually says. Vouch labels are per span (round 7): each span is checked against its OWN matched declaration, never against the first span's — otherwise a second mention lends its declaration's words to the first, and a barenpm run deployhides whatnpm run build -- --target stagingbrought. Figure scope is the matched region (round 8): the contiguity check returns the region it matched and the figure-subset check compares the candidate againstnumericTokens(region), not against every number the tree states —The budget is 1, 5 seconds of margin.chains across its comma and matches a row saying1.5 seconds, so aNode 1.5in another file, or in another sentence of the same file, was clearing a veto for a passage that never states it. Shrinking the vouching set removes refusals only, so veto-only holds by construction.The spine rule (round 9): figures are atomic. Eight rounds narrowed vouching surfaces while fragments and half-figures stayed representable, so reassembly kept finding a new door. The two rules now sit in the matcher itself. R1:
claims()splits on the assertion boundaries except where a.sits inside a figure — the maximal[a-z0-9_.]run holding it states a digit — so a candidate's1.5,1.4.3,10.20.30.40arrive as one claim token and cannot reassemble from two sentences. R2:findClauseadmits a hit only when no figure run crosses either edge of it (hitCoversFigures), so a claim ending at the3of3.12, or starting at the5of30.5, is no longer a match at all. The contract this follows iscore/tokenize.ts:tokens()splits on[^a-z0-9_.]+, so.is a word character and a figure is any such run containing a digit — which means the sentence-final dot belongs to the figure token (numericTokens("The cost is 11.")is["11."], not["11"]). Both rules narrow what can match: R1 makes a claim longer and therefore harder to find, R2 rejects hits, so neither can create a refusal — verified by running the whole 54-case bank and the full suite with no verdict moving in the refusal direction. The earlier guards (figure subset, matched region, contiguity, solo/per-span vouching) stay as defense-in-depth: they cost nothing on the fail-open side and catch what atomicity cannot reach.Left open, by measurement: comma-grouped figures.
The timeout is 5,000 ms.against a tree stating5000keeps — confirmed[comma] none (kept). The keep is not the figure check's doing:claims()splits on the comma, so the fragmentthe timeout is 5has no word-bounded hit inside5000and contiguity declines first. Closing it means changingnorm()orclaims(), which are the spine every other rule reads, for a formatting case on the fail-open side. Not one line, so left.Matcher-death floor. The scan line now carries
candidates=, emitted on every pass that had candidates even when the index was never built.verdicts=0atcandidates>0, across passes, is matcher death; an empty session — no candidates, no line — never produces it. Fail-open is now contract, not prose:test/capture/available-fail-open.test.tsenumerates the uncertainty paths (no git, a tracked path the read cannot open, an oversized file, a budget-truncated scan, nowhere-in-tree) and asserts keep-on-uncertainty for each, plus a control row that must refuse when the scan can read the fact.Deferred follow-up (explicit): post-ship refusal-correctness audit — count
auto_capture_restatablelines whosewhereno longer matches the tree, monthly. Not in this PR. Neither is the gate-path figure over-keep above, nor the dotless-tail keep that atomic figures accept (a row ending on11.5against a tree stating11.5.keeps; recovering it means widening a vouch set).Fail-before (each tally labeled: source sha × test file)
The gap. Step-0 probe (scratch, not shipped): on
main(06b51b5) a verbatim README restatement stored 1 row; on this branch, 0.The contract flip.
06b51b5's source × head'stest/capture/capture-available.test.ts: 14 pass / 17 fail, measured against33c0dcd's copy of the file. This tally is a function of head, not a constant — it read 15/11 at the first head, then 14/14 and 14/16, because every round adds cases; the sha that produced it is stated so the number can be re-measured; it stands at141e8a9because rounds 6 through 9 added bank cases, not file cases. Decisive lines:The guided pin.
fa9bade's source (with the one-line exemptionif (c.guided) continue;) ×fa9bade's own test file: 24 pass / 2 fail —— the exemption's blast radius on the tests that existed then. × head's test file (which contains the guided pin): 23 pass / 4 fail, adding
The scan denominator.
fa9bade's source × head's test file: 1 fail —expect(Number(scan?.candidates)).toBe(1)receivesNaN.The figure-subset invariant (round 3).
4f93057's source × head's bank + refusal suite: 5 bank fails + 1 runtime fail, one per reviewer repro class:After the fix all five flip to kept and every pre-existing verdict is unchanged — no bank case moved refuse→keep; the true restatements (
negation-kept,figure-stated-whole-still-restatable,prose-restatement-still-tags,declared-command-restated) still refuse.The co-location invariant (round 3 addendum).
07bdc61's source × head's bank + refusal suite: 1 bank fail + 1 runtime fail, the reviewer's exact README lines and candidate:Its control,
same-line-label-value-pairing— the same two halves stated by one line — refuses before and after, so the pair proves the relation moved and not the matcher.The residual invariant (round 4).
31464b7's source × head's bank + refusal suite: 1 bank fail + 1 runtime fail, the reported fixture (scripts.deploy = "deploy-tool publish", candidateRun `npm run deploy -- --target canary`.):Both controls refuse before and after: the bare
Run \npm run deploy`.andgate-forwarded-arg-declared, where the manifest statesdeploy-tool publish --prodand the row mentions--prod`.The where-scoped vouch rule (round 5).
83bf979's source × head's bank + refusal suite: 2 bank fails + 1 runtime fail, both reported classes:Three controls refuse before and after, one per vouching shape: the bare
Run \npm run deploy`.(per-script, name only),gate-forwarded-arg-declared(per-script, name plus command), andgate-workflow-same-step-flag— one workflow step declaringnpm run build --prod`, quoted verbatim — which is the shape that must survive narrowing a step-kind vouch set.The operand-run rule (round 6).
33c0dcd's source × head's bank: 2 bank fails, the reported class and the wider probe:The third pin,
gate-contiguous-prefix-operands, refuses before and after — it is the shape the narrowing must spare, alongside the must-not-break set:declared-command-restated(bare invocation),make-target-restatedand the verbatim declared command,gate-forwarded-arg-declared(declared--prod),gate-workflow-same-step-flag, and the round-4/5 forwarded-arg and sibling cases. Removing the membership pre-filter flipped none of them.Per-span vouch labels (round 7).
d3f7b5d's source × head's bank: 2 fails — the reported row, and its counterpart failing the other way for the same scoping bug:The reviewer's pair is pinned whole —
gate-multi-span-single-operand(the build operand kept alone) andgate-multi-span-borrowed-labels(the same operand kept once a bare deploy mention is added) — plusgate-multi-span-borrowed-labels-reversed, which keeps in both orders so the rule is not an accident of which span matched first. One verdict moves in the refusal direction, and it is the bug seen from the other side:gate-multi-span-both-declaredkept ond3f7b5dbecause the second span's operand was tested against the first script's labels, where it is absent. With each span judged by its own declaration, both operands check out and the row refuses — correctly, since the tree states both invocations verbatim and the residual is filler. No pre-existing case changed verdict.Region-scoped figures (round 8).
bf11254's source × head's bank: 2 fails, both the reported shape:The same-file variant is the proof that per-FILE scoping was not the fix: one README holding both the
1, 5sentence andRequires Node 1.5 or newer.refused too. Controls refuse before and after:figure-region-dotted-restated(the region states the dotted figure itself),figure-stated-whole-still-restatable(whole figure, same line), and the round-2 reassembly trio, which keeps for the same reason it always did.hayFiguresis gone — the region set replaced its only consumer, and no other caller read it. Thewhere:line now resolves from the region's own start rather than a separatefindClauseof the first claim, which is the same file the verdict already named.Over-keep left standing, by ruling:
introducesNewNumber(content, gate.label)compares the candidate's figures against the matched label alone, not against the vouch label list the operand check uses. Measured on head: with"deploy": "deploy-tool publish --timeout 5000", the rowRun `npm run deploy`. The timeout is 5000 ms.keeps, although the script's own command states the figure. Widening it to the vouch list would add refusals wherever the label union does not carry the figure, which breaks the veto-only shape this PR is built on; the asymmetry says a wrong keep costs a row and a wrong refusal costs a fact. It goes to the deferred list with the refusal-correctness audit.Atomic figures (round 9).
5845da6's source × head's bank: 5 fails — the four half-figure faces and the one-occurrence region:The fifth is the outside reviewer's face, reconstructed to the shape that actually refuses: README
The supported releases are 1, 5 for production. The minimum runtime is 1.5 for tooling.against the rowThe supported releases are 1.5 for production. The minimum runtime is 1.5 for tooling.— the second sentence is verbatim, the first states a pairing the tree never makes, and one1.5in the region vouched for both.Flip list, complete. No pre-existing case changed verdict: the 48 earlier bank cases, the fail-open 6/6, and the full suite (1741 pass / 22 skip / 0 fail) are green with the spine rules in, so nothing that refused for a sound reason now keeps. The five pins above move refuse→keep because their old verdict was the bug. One shape outside the bank moves the same way and is accepted rather than fixed: a row whose last token is a figure and which omits the tree's sentence-final dot now keeps —
Requires Python 3.12againstRequires Python 3.12.,The cost is 11.5againstThe cost is 11.5.. Under the tokenizer contract those are different tokens (3.12vs3.12.), and recovering the refusal would mean normalizing the trailing dot inside the region's figure set — widening a vouch set, which adds refusals and breaks veto-only. Measured neighbours, all unchanged: a row ending in a word after the figure (The budget is 1.5 seconds), the same row with its own dot, a mid-row version (Requires Python 3.12 on workers), a two-sentence row whose figure ends a clause, hyphenated ranges (2010-2014), dates (2026-01-05), andv1.2.3-rcall still refuse. Comma-grouped figures keep, as before, for the reason already documented.Tally
What is NOT fixed
benchmark-tests/ocsi/, which is not in this repo. The in-repo proxies: the bench'sdelete-hardenedarm — this exact policy — keeps 10/10 transport facts and refuses 6/6 restatable ones, and the tests pin the transport case kept at runtime.restatabletag: capture no longer writes it; the retrieval demotion stays for legacy rows. Retiring the tag is a separate decision once no tagged row survives in a store.Disagreement with the ticket, argued
AC 4 says "capture's token cost per session" should fall. It cannot fall for the capture call itself: candidates come from the model, so availability can only be evaluated after the call that produced them — a pinned test asserts one model call whatever the verdicts. What falls is what the pass leaves behind: refused candidates never become rows, so the store and every later session's injection block shrink. If the AC 4 rerun measures capture-call tokens alone it will show no change; the cost that moves is the injected bytes of every later session. Everything else in the ticket is implemented as written.
Addresses #389— AC 1, 2, 6 met; AC 3 met in scripted form, real-model rerun pending; AC 4 pending the owner's harness; AC 5 already exists outside this repo.