Repository navigation
fix(capture): tell a truncated response from a genuine empty result - #626
Conversation
The e2e outcome cases fail on source before the guard: a call cut off mid-array records the same outcome as the literal empty answer.
WhollyMindless
left a comment
There was a problem hiding this comment.
Note
🤖 gpt-6.2-sol responding on behalf of WhollyMindless
Capture with a bracketed preamble can still be recorded as empty. At c4307fe, I reran the two capture test files on Windows with Bun 1.4.4 (46 passed). In the existing end-to-end truncation test, I changed only the response prefix to Draft [analysis]. Here are possible memories: and kept the unterminated candidate array. The test then observed capture_lag outcome=empty where it expected unparsed.
firstJsonArray returns the balanced [analysis] span. parseCandidates rejects it as invalid JSON, but hasJsonArraySpan accepts it as enough evidence to choose empty in src/runtime/capture.ts. Could the outcome check require a syntactically valid JSON array? That would keep literal [] and valid arrays whose candidates all fail validation in the existing empty bucket while preserving the distinction for this truncation case.
There was a problem hiding this comment.
PR Reviewer
Review — PR #626 @ c4307fe6a2f85465fe77aa2d04635dec42c619bd (base 6e33179 = origin/main)
Full review under WORKFLOW.md: blind pass first, then the claims. Blind pass written to
.dev/626-blind.md before the PR body, overview, triage, or thread were opened.
Blind pass vs. author intent
Theory committed blind: truncated capture replies blur into capture_lag outcome=empty
because parseCandidates is total; the fix must distinguish "never finished answering"
from "answered: nothing". The two breakers I committed blind, and where they went:
- A consumer branches on the two-valued assumption. Falsified by measurement —
the full reader inventory below finds no reader of the lagoutcomevalue anywhere.
The author states the same (src/telemetry/record.ts:267isoutcome: string,
no enum); I verified independently, not on the body's word. - The span check calls a truncated reply an answer. My stronger sub-shape (a reply
that closes an array early, then is cut mid-second-array, readsempty) resolved in
the diff's favor:parseCandidatesitself keeps only the first balanced array, so
"first closed span wins" is exactly the parse's semantics —hasJsonArraySpanand the
parse cannot disagree about what the answer is, and the unit case
[[2]] unclosed later [{→true(test/capture/capture-parse.test.ts:225) documents
it. The error direction for any exotic shape stays at the old (pre-PR) value, never a
new false signal. My second sub-shape (closed-but-all-rejected) was real as a silence;
the architect ratifiedemptyfor it and the body discloses it — see Residuals.
Difference from the author's stated intent: none material. The body's claim list is one
I independently reproduced.
What I ran (head c4307fe, tree verified at dispatch and again at publish)
| Check | Result line |
|---|---|
bun run typecheck |
exit 0, no diagnostics |
bun run lint |
exit 0; biome Checked 555 files … Found 966 warnings. Found 206 infos. + biome format: Checked 487 files; CI lint job SUCCESS on this head |
named files — capture-auto, capture-parse, status, evidence-write-policy, host/claims, plus host/readme-budget, host/doc-links |
158 pass / 0 fail / 492 expect() calls — Ran 158 tests across 7 files [2.46s] |
bun run test (full) |
2163 pass / 23 skip / 0 fail / 16676 expect() calls — Ran 2186 tests across 200 files [40.88s] — byte-matches the fixer's reported counts |
| fail-before (below) | reproduced, right reason |
| two mutants (below) | both killed by the named test |
Fail-before, reproduced independently — /tmp/626-failbefore is a full copy of the
tree; only src/capture/candidates.ts + src/runtime/capture.ts were rolled back to
6e33179; tests stayed at head; the working tree was never touched:
error: expect(received).toBe(expected)
Expected: "unparsed"
Received: "empty"
at <anonymous> (/private/tmp/626-failbefore/test/capture/capture-auto.test.ts:329:7)
(fail) … a truncated response records an outcome distinct from a genuine empty [51.32ms]
27 pass / 2 fail (second fail: capture-parse.test.ts file-level
`SyntaxError: Export named 'hasJsonArraySpan' not found`)
The three control cases (literal []→empty, blank→empty, candidate→candidates) pass on
base src: the pins hold behavior fixed where the diff claims no change, and only the
new discriminator bites. Fail-before commit 7f1ae41 is test-only (148 insertions,
git show 7f1ae41 --stat).
Mutation/pin strength. On the /tmp copy at head src:
- Remove
!text.trim() ||from the ternary (src/runtime/capture.ts:1068) →
(fail) a blank response keeps the empty outcome. Whitespace default is pinned by a
test, not narration. - Make
hasJsonArraySpanreturntrueunconditionally (src/capture/candidates.ts:70)
→(fail) a truncated response records an outcome distinct from a genuine empty. The
span discriminator is pinned. - The closed-array branch is pinned via the literal-
[]case; sincehasJsonArraySpan
never inspects array contents (it returnsfirstJsonArray(...) !== null,
candidates.ts:70), the[]-pin and any closed-with-rejected-items case are the same
code path — the mapping cannot drift for one without the other (see Residuals).
Breaker 1, resolved: reader inventory of the lag outcome
Commands: rg 'capture_lag' src test integration (all sites listed), rg '\boutcome\b' src,
rg 'capture_lag|outcome' src/inject src/recall src/viewer src/adapters/opencode/tui/panel.tsx src/capture/triggers.ts src/status/report.ts. Complete list of everything that sees a
capture_lag line:
src/status/metrics.ts:62-78—captureLag()readsf.lagonly.src/status/metrics.ts:298-303— completion receipt: readsev+tsonly.src/status/report.ts:232— renderslastTerminal.reason, which comes from
auto_capture_finish/auto_capture_refused(src/runtime/capture.ts:302, reasons
whitelisted atsrc/status/metrics.ts:314-326) — different event, different field.
unparsedexists nowhere else in the repo (rg -n 'unparsed' src test integration
→ onlycapture.ts:1070+capture-auto.test.ts:329), so no finish-reason collision.src/telemetry/record.ts:264-287— opaqueoutcome: stringpassthrough, no enum.integration/pi/provider-runner.ts:221— counts lines;integration/support/await-capture.ts:22— presence only.src/telemetry/ledger.ts:80— the onlyoutcomethat branches (PASS|FAIL) is a different event.
Direct observation on the status surface: feeding synthetic outcome=unparsed lines to
the real readers → captureLag: {"p50":500,"p95":700,"n":2}, lastExecuted set,
lastTerminal: undefined, blocked: 0. The third value is inert on every existing
surface; it changes the evidence line and nothing else — which is the whole ticket
(interim item 2, owner 2026-11-07) as scoped by the architect.
README (Slice B) — measured, not read
- Lines:
wc -l README.md→ 104 at head and at6e33179. Claim holds. - Words: 1341 at head vs 1323 at base; ratchet
test/host/readme-budget.test.ts:20-22
caps 227 lines / 4028 words / 8 refs, and the ratchet constants are not touched by
this PR. Net +18 words (the two owner-ratified sentences) against 2687 words of
headroom; the privacy paragraph and Quick-start line were deduplicated in place. - Enforcers green:
claims.test.ts(word-scans README +docs/for the retraction and
saving rules),readme-budget,doc-links— inside the 158-pass run above. - Retracted figures:
bench/claims.json:46-52retracts20,506/10,009; grep of all
added diff lines for those plus the title's78%/2,430→ no matches (rc=1).
cheaperabsent from added lines (the onesavedhit is a source comment,
capture.ts:1063, saying truncation "says nothing about what it would have saved" —
not a shipped string, not a savings claim). - Claim-surface on the figure sentence: README says prompt ~1,200 / completion 1,232 /
~343 JSON, n=1, cache excluded, seat named, "one call's shape, not a cost claim".
This matches the owner's own 2026-11-11 thread text verbatim in all four figures and
carries the owner's exact prohibition ("Read them as 'one capture call', never as
'what the plugin costs a session'"). Yield parity is not promised — consistent with
the owner's 2026-11-07T04:49 correction. The n=1 observation itself is not
reproducible in this seat (live local seat, out of scope by ratification); the
sentence claims nothing beyond the single attributed observation, which is what the
#392 disposition permits. - Quick-start dedup: scrub language now lives once, in the linked section ("reasoning
excluded, credentials best-effort scrubbed"). The send-warning survives; no promise
was dropped, one duplicate was removed.
State/surface matrix — fact: the outcome token on a capture_lag line
Commands cited once: C1 rg 'capture_lag' src/inject src/recall → no match (rc=1).
C2 synthetic-lines run through captureLag/captureHealth (result above).
C3 the 7-file named run. C4 the reader inventory above. C5 full suite.
| Event | delivered bytes | recall output | status & report | viewer & export | evidence log | counters |
|---|---|---|---|---|---|---|
| the write itself | no path (C1) | no path (C1) | C2: lag p50/p95/n unchanged, lastExecuted set, lastTerminal unset |
no path (C4; viewer outcome = quarantine only) |
C3: 4 e2e cases assert the token per session id | none branch on outcome (C4; ledger.ts:80 is the PASS/FAIL event) |
| repeat turn, no store change | no path (C1) | no path (C1) | C5 green (cooldown/cursor suites) | no path (C4) | recomputed per pass at one site, capture.ts:1059-1077 inside runPass (:228) — no state (C4) |
none (C4) |
| compaction-triggered write | no path (C1) | no path (C1) | same single recording site; ternary names no trigger (capture.ts:1066-1070) |
no path (C4) | outcome-specific compaction assertion uncovered — line presence after compact is pinned at integration/pi/provider-runner.ts:220-230; a dedicated e2e for the token on the compaction leg exists in no test |
none (C4) |
| restart | no path (C1) | no path (C1) | lines re-parse per-line, any outcome value parses (C2) | no path (C4) | append-only log; written before process end (C5 green incl. dispose/drain suites) | none (C4) |
| second session, same store | no path (C1) | no path (C1) | per-session lines; report aggregates ts only (C2) | no path (C4) | C3: four distinct session ids written into one evidence bank, each outcome read back correctly | none (C4) |
| a reader without visibility of the row (= status report) | no path (C1) | no path (C1) | C2 + C4: report renders lastTerminal.reason only; outcome invisible by design (triage/architect: "that is the whole acceptance bar") |
no path (C4) | visible to whoever greps the log — that is the deliverable | none (C4) |
| later write to an unrelated row | no path (C1) | no path (C1) | per-line append; nothing keys across rows (C4) | no path (C4) | uncovered beyond line-append semantics pinned by C5 telemetry suites | none (C4) |
| eviction/revocation of the same line | n/a (C1) | n/a (C1) | no deletion path for evidence lines exists in src (C4) |
uncovered — nothing in src deletes or keys on evidence lines today; no test pins deletion semantics because no deletion exists |
append-only | none |
Promises row: this diff adds no model-facing string. The outcome token reaches no
model (C1, C4); the README is human-facing and covered above. hasJsonArraySpan's
"they can never disagree" comment (candidates.ts:63-66) is structurally true — one
scanner (firstJsonArray at candidates.ts:39 via stripFences) shared by parse and
predicate — and its removal/inversion is caught (mutation 2).
Tier note
The diff introduces a predicate, but it labels evidence and decides nothing that is
stored, dropped, or delivered — parseCandidates is untouched and total; the ternary
only picks a string for the receipt. The escape-shape bank rule (predicates whose
verdict destroys or discards) is not triggered; the four e2e cases + span unit cases
already exceed what a labeling change owes.
Findings
Blockers (code): none.
Operational finding — CI is not green on this head. gh pr view 626 --json statusCheckRollup: 8/9 checks SUCCESS; oh-my-pi (windows-latest) FAILURE.
Log (job 142365502476, SDK contracts and packed installation step): exactly one failed
test, integration/oh-my-pi/capture-shutdown.test.ts > default capture respects real SDK shutdown: false-grant, 31.1 s — the child was killed by the test's own watchdog
(setTimeout(() => child.kill(), 30_000), exit Received: 143); the other 38 tests in
the job pass, including the four sibling shutdown cases. The same job SUCCEEDED on base
fd4f435 (gh api commits/fd4f435/check-runs), and this diff contains no timing,
grant, delivery, or shutdown change (only a bounded string scan at record time,
capture.ts:1066-1070). Classification: unrelated Windows timing flake on a
real-process watchdog test; unblock condition is an owner-identity rerun per merge
discipline, not a code change. The publish gate will therefore downgrade this approval
to a comment — recorded here so the downgrade reads as a CI fact, not a review reversal.
Nits (do not hold):
hasJsonArraySpan'stypeof raw !== "string"guard (candidates.ts:69) is dead for
the only production caller (TS-typedstring); it exists for the JS/test boundary and
totality. Harmless.outcomevalues remain an untyped convention (plainstringat
record.ts:267); that is what made the third value free, and it is also what means
a future fourth value will pass unnoticed by the compiler. Accepted cost of the
architect's "plumbing is free" design; test pins are the guard.
Residuals — per item 12, each a ticket or a withdrawal:
- Closed-but-all-rejected →
emptyhas no dedicated e2e case. Withdrawn.
The architect ratified the choice in-thread ("the reviewer may overrule; do not
silently invent a fourth value") and the body discloses it under "Deliberate limits".
Structurally it cannot rot silently: the classifier never inspects array contents,
so the[]-pin and the all-rejected shape are one code path — a maintainer who wants
to split them must add an inspecting predicate, which cannot land without new tests
(mutation evidence above). A tests-only ticket for a direct case would be fair but
buys nothing the structure does not already hold. unparsedis invisible to the human status report. Withdrawn as out-of-slice by
owner/architect ratification ("surfacing … a deliberate follow-on, not this slice";
channel documented atreport.ts:232). The follow-on is the architect's/owner's to
file, and #603's plumbing already is that channel.
Uncovered cells (named, per rule 1): outcome-specific assertion on the compaction
leg; evidence-line deletion semantics (no deletion path exists). Both labeled above
rather than inferred from the green suite.
What remains unfixed (approval reads with these attached)
A truncated pass is distinguished in the evidence log only — no human-facing report
line, no alert, no counter. A closed array of all-invalid items still reads empty
(refusals at the gate write their own lines; parse-level drops remain silent, as before
this PR). The Windows false-grant watchdog flake is a CI hazard independent of this
diff.
Not an approval: CI is failing (1 failing: oh-my-pi (windows-latest) (failure)). Posted as a comment.
There was a problem hiding this comment.
PR Reviewer
Review — PR #626 @ c4307fe6a2f85465fe77aa2d04635dec42c619bd (base 6e33179 = origin/main)
Full review under WORKFLOW.md: blind pass first, then the claims. Blind pass written to
.dev/626-blind.md before the PR body, overview, triage, or thread were opened.
Blind pass vs. author intent
Theory committed blind: truncated capture replies blur into capture_lag outcome=empty
because parseCandidates is total; the fix must distinguish "never finished answering"
from "answered: nothing". The two breakers I committed blind, and where they went:
- A consumer branches on the two-valued assumption. Falsified by measurement —
the full reader inventory below finds no reader of the lagoutcomevalue anywhere.
The author states the same (src/telemetry/record.ts:267isoutcome: string,
no enum); I verified independently, not on the body's word. - The span check calls a truncated reply an answer. My stronger sub-shape (a reply
that closes an array early, then is cut mid-second-array, readsempty) resolved in
the diff's favor:parseCandidatesitself keeps only the first balanced array, so
"first closed span wins" is exactly the parse's semantics —hasJsonArraySpanand the
parse cannot disagree about what the answer is, and the unit case
[[2]] unclosed later [{→true(test/capture/capture-parse.test.ts:225) documents
it. The error direction for any exotic shape stays at the old (pre-PR) value, never a
new false signal. My second sub-shape (closed-but-all-rejected) was real as a silence;
the architect ratifiedemptyfor it and the body discloses it — see Residuals.
Difference from the author's stated intent: none material. The body's claim list is one
I independently reproduced.
What I ran (head c4307fe, tree verified at dispatch and again at publish)
| Check | Result line |
|---|---|
bun run typecheck |
exit 0, no diagnostics |
bun run lint |
exit 0; biome Checked 555 files … Found 966 warnings. Found 206 infos. + biome format: Checked 487 files; CI lint job SUCCESS on this head |
named files — capture-auto, capture-parse, status, evidence-write-policy, host/claims, plus host/readme-budget, host/doc-links |
158 pass / 0 fail / 492 expect() calls — Ran 158 tests across 7 files [2.46s] |
bun run test (full) |
2163 pass / 23 skip / 0 fail / 16676 expect() calls — Ran 2186 tests across 200 files [40.88s] — byte-matches the fixer's reported counts |
| fail-before (below) | reproduced, right reason |
| two mutants (below) | both killed by the named test |
Fail-before, reproduced independently — /tmp/626-failbefore is a full copy of the
tree; only src/capture/candidates.ts + src/runtime/capture.ts were rolled back to
6e33179; tests stayed at head; the working tree was never touched:
error: expect(received).toBe(expected)
Expected: "unparsed"
Received: "empty"
at <anonymous> (/private/tmp/626-failbefore/test/capture/capture-auto.test.ts:329:7)
(fail) … a truncated response records an outcome distinct from a genuine empty [51.32ms]
27 pass / 2 fail (second fail: capture-parse.test.ts file-level
`SyntaxError: Export named 'hasJsonArraySpan' not found`)
The three control cases (literal []→empty, blank→empty, candidate→candidates) pass on
base src: the pins hold behavior fixed where the diff claims no change, and only the
new discriminator bites. Fail-before commit 7f1ae41 is test-only (148 insertions,
git show 7f1ae41 --stat).
Mutation/pin strength. On the /tmp copy at head src:
- Remove
!text.trim() ||from the ternary (src/runtime/capture.ts:1068) →
(fail) a blank response keeps the empty outcome. Whitespace default is pinned by a
test, not narration. - Make
hasJsonArraySpanreturntrueunconditionally (src/capture/candidates.ts:70)
→(fail) a truncated response records an outcome distinct from a genuine empty. The
span discriminator is pinned. - The closed-array branch is pinned via the literal-
[]case; sincehasJsonArraySpan
never inspects array contents (it returnsfirstJsonArray(...) !== null,
candidates.ts:70), the[]-pin and any closed-with-rejected-items case are the same
code path — the mapping cannot drift for one without the other (see Residuals).
Breaker 1, resolved: reader inventory of the lag outcome
Commands: rg 'capture_lag' src test integration (all sites listed), rg '\boutcome\b' src,
rg 'capture_lag|outcome' src/inject src/recall src/viewer src/adapters/opencode/tui/panel.tsx src/capture/triggers.ts src/status/report.ts. Complete list of everything that sees a
capture_lag line:
src/status/metrics.ts:62-78—captureLag()readsf.lagonly.src/status/metrics.ts:298-303— completion receipt: readsev+tsonly.src/status/report.ts:232— renderslastTerminal.reason, which comes from
auto_capture_finish/auto_capture_refused(src/runtime/capture.ts:302, reasons
whitelisted atsrc/status/metrics.ts:314-326) — different event, different field.
unparsedexists nowhere else in the repo (rg -n 'unparsed' src test integration
→ onlycapture.ts:1070+capture-auto.test.ts:329), so no finish-reason collision.src/telemetry/record.ts:264-287— opaqueoutcome: stringpassthrough, no enum.integration/pi/provider-runner.ts:221— counts lines;integration/support/await-capture.ts:22— presence only.src/telemetry/ledger.ts:80— the onlyoutcomethat branches (PASS|FAIL) is a different event.
Direct observation on the status surface: feeding synthetic outcome=unparsed lines to
the real readers → captureLag: {"p50":500,"p95":700,"n":2}, lastExecuted set,
lastTerminal: undefined, blocked: 0. The third value is inert on every existing
surface; it changes the evidence line and nothing else — which is the whole ticket
(interim item 2, owner 2026-11-07) as scoped by the architect.
README (Slice B) — measured, not read
- Lines:
wc -l README.md→ 104 at head and at6e33179. Claim holds. - Words: 1341 at head vs 1323 at base; ratchet
test/host/readme-budget.test.ts:20-22
caps 227 lines / 4028 words / 8 refs, and the ratchet constants are not touched by
this PR. Net +18 words (the two owner-ratified sentences) against 2687 words of
headroom; the privacy paragraph and Quick-start line were deduplicated in place. - Enforcers green:
claims.test.ts(word-scans README +docs/for the retraction and
saving rules),readme-budget,doc-links— inside the 158-pass run above. - Retracted figures:
bench/claims.json:46-52retracts20,506/10,009; grep of all
added diff lines for those plus the title's78%/2,430→ no matches (rc=1).
cheaperabsent from added lines (the onesavedhit is a source comment,
capture.ts:1063, saying truncation "says nothing about what it would have saved" —
not a shipped string, not a savings claim). - Claim-surface on the figure sentence: README says prompt ~1,200 / completion 1,232 /
~343 JSON, n=1, cache excluded, seat named, "one call's shape, not a cost claim".
This matches the owner's own 2026-11-11 thread text verbatim in all four figures and
carries the owner's exact prohibition ("Read them as 'one capture call', never as
'what the plugin costs a session'"). Yield parity is not promised — consistent with
the owner's 2026-11-07T04:49 correction. The n=1 observation itself is not
reproducible in this seat (live local seat, out of scope by ratification); the
sentence claims nothing beyond the single attributed observation, which is what the
#392 disposition permits. - Quick-start dedup: scrub language now lives once, in the linked section ("reasoning
excluded, credentials best-effort scrubbed"). The send-warning survives; no promise
was dropped, one duplicate was removed.
State/surface matrix — fact: the outcome token on a capture_lag line
Commands cited once: C1 rg 'capture_lag' src/inject src/recall → no match (rc=1).
C2 synthetic-lines run through captureLag/captureHealth (result above).
C3 the 7-file named run. C4 the reader inventory above. C5 full suite.
| Event | delivered bytes | recall output | status & report | viewer & export | evidence log | counters |
|---|---|---|---|---|---|---|
| the write itself | no path (C1) | no path (C1) | C2: lag p50/p95/n unchanged, lastExecuted set, lastTerminal unset |
no path (C4; viewer outcome = quarantine only) |
C3: 4 e2e cases assert the token per session id | none branch on outcome (C4; ledger.ts:80 is the PASS/FAIL event) |
| repeat turn, no store change | no path (C1) | no path (C1) | C5 green (cooldown/cursor suites) | no path (C4) | recomputed per pass at one site, capture.ts:1059-1077 inside runPass (:228) — no state (C4) |
none (C4) |
| compaction-triggered write | no path (C1) | no path (C1) | same single recording site; ternary names no trigger (capture.ts:1066-1070) |
no path (C4) | outcome-specific compaction assertion uncovered — line presence after compact is pinned at integration/pi/provider-runner.ts:220-230; a dedicated e2e for the token on the compaction leg exists in no test |
none (C4) |
| restart | no path (C1) | no path (C1) | lines re-parse per-line, any outcome value parses (C2) | no path (C4) | append-only log; written before process end (C5 green incl. dispose/drain suites) | none (C4) |
| second session, same store | no path (C1) | no path (C1) | per-session lines; report aggregates ts only (C2) | no path (C4) | C3: four distinct session ids written into one evidence bank, each outcome read back correctly | none (C4) |
| a reader without visibility of the row (= status report) | no path (C1) | no path (C1) | C2 + C4: report renders lastTerminal.reason only; outcome invisible by design (triage/architect: "that is the whole acceptance bar") |
no path (C4) | visible to whoever greps the log — that is the deliverable | none (C4) |
| later write to an unrelated row | no path (C1) | no path (C1) | per-line append; nothing keys across rows (C4) | no path (C4) | uncovered beyond line-append semantics pinned by C5 telemetry suites | none (C4) |
| eviction/revocation of the same line | n/a (C1) | n/a (C1) | no deletion path for evidence lines exists in src (C4) |
uncovered — nothing in src deletes or keys on evidence lines today; no test pins deletion semantics because no deletion exists |
append-only | none |
Promises row: this diff adds no model-facing string. The outcome token reaches no
model (C1, C4); the README is human-facing and covered above. hasJsonArraySpan's
"they can never disagree" comment (candidates.ts:63-66) is structurally true — one
scanner (firstJsonArray at candidates.ts:39 via stripFences) shared by parse and
predicate — and its removal/inversion is caught (mutation 2).
Tier note
The diff introduces a predicate, but it labels evidence and decides nothing that is
stored, dropped, or delivered — parseCandidates is untouched and total; the ternary
only picks a string for the receipt. The escape-shape bank rule (predicates whose
verdict destroys or discards) is not triggered; the four e2e cases + span unit cases
already exceed what a labeling change owes.
Findings
Blockers (code): none.
Operational finding — CI is not green on this head. gh pr view 626 --json statusCheckRollup: 8/9 checks SUCCESS; oh-my-pi (windows-latest) FAILURE.
Log (job 142365502476, SDK contracts and packed installation step): exactly one failed
test, integration/oh-my-pi/capture-shutdown.test.ts > default capture respects real SDK shutdown: false-grant, 31.1 s — the child was killed by the test's own watchdog
(setTimeout(() => child.kill(), 30_000), exit Received: 143); the other 38 tests in
the job pass, including the four sibling shutdown cases. The same job SUCCEEDED on base
fd4f435 (gh api commits/fd4f435/check-runs), and this diff contains no timing,
grant, delivery, or shutdown change (only a bounded string scan at record time,
capture.ts:1066-1070). Classification: unrelated Windows timing flake on a
real-process watchdog test; unblock condition is an owner-identity rerun per merge
discipline, not a code change. The publish gate will therefore downgrade this approval
to a comment — recorded here so the downgrade reads as a CI fact, not a review reversal.
Nits (do not hold):
hasJsonArraySpan'stypeof raw !== "string"guard (candidates.ts:69) is dead for
the only production caller (TS-typedstring); it exists for the JS/test boundary and
totality. Harmless.outcomevalues remain an untyped convention (plainstringat
record.ts:267); that is what made the third value free, and it is also what means
a future fourth value will pass unnoticed by the compiler. Accepted cost of the
architect's "plumbing is free" design; test pins are the guard.
Residuals — per item 12, each a ticket or a withdrawal:
- Closed-but-all-rejected →
emptyhas no dedicated e2e case. Withdrawn.
The architect ratified the choice in-thread ("the reviewer may overrule; do not
silently invent a fourth value") and the body discloses it under "Deliberate limits".
Structurally it cannot rot silently: the classifier never inspects array contents,
so the[]-pin and the all-rejected shape are one code path — a maintainer who wants
to split them must add an inspecting predicate, which cannot land without new tests
(mutation evidence above). A tests-only ticket for a direct case would be fair but
buys nothing the structure does not already hold. unparsedis invisible to the human status report. Withdrawn as out-of-slice by
owner/architect ratification ("surfacing … a deliberate follow-on, not this slice";
channel documented atreport.ts:232). The follow-on is the architect's/owner's to
file, and #603's plumbing already is that channel.
Uncovered cells (named, per rule 1): outcome-specific assertion on the compaction
leg; evidence-line deletion semantics (no deletion path exists). Both labeled above
rather than inferred from the green suite.
What remains unfixed (approval reads with these attached)
A truncated pass is distinguished in the evidence log only — no human-facing report
line, no alert, no counter. A closed array of all-invalid items still reads empty
(refusals at the gate write their own lines; parse-level drops remain silent, as before
this PR). The Windows false-grant watchdog flake is a CI hazard independent of this
diff.
Addendum at re-post (same head, c4307fe): this review's findings are unchanged. At the
time of the first posting the checks were not green — the only failure was
oh-my-pi (windows-latest), capture-shutdown.test.ts > false-grant, killed at 31.1 s by
the test's own 30-second watchdog. The green now standing on this head was obtained by an
operator-identity rerun of that same job, not by a new commit; the rerun passing once is
one observation, so the shutdown timing of the false-grant case on Windows remains
unproven rather than proven stable — a reader weighing a future merge should treat that job
as flaky-by-history, not as cleared.
WhollyMindless
left a comment
There was a problem hiding this comment.
Note
🤖 gpt-6.2-sol responding on behalf of WhollyMindless
I have a tested patch against c4307fe for the bracketed-prose case that the council confirmed. It uses the candidate parser’s JSON decoder to choose the evidence label, with the existing first-array selection and candidate filtering preserved. It covers a Markdown-link prefix before both a truncated and a complete array. Both cases failed on this head and pass with the patch. Typecheck and all 517 capture, status, and evidence tests passed locally.
Happy to send the patch for the fixer to apply in #626 if you’d like it.
There was a problem hiding this comment.
PR Reviewer
PR Reviewer
Adjudication — #626 @ c4307fe6a2f85465fe77aa2d04635dec42c619bd (base 6e33179)
The claim is real. A bracketed preamble flips unparsed into empty, confirmed at
head from stored receipt bytes, not from any log line. CHANGES_REQUESTED at this head.
This review answers @WhollyMindless on both comments and supersedes the earlier
APPROVED state recorded against this same head — see Correction below.
To WhollyMindless
Your first comment (finding). Confirmed independently, end to end. Driven through the
real capture path with a harness fake host, outcome read from the evidence file written
under a throwaway OPENCODE_MEMORY_DIR:
| response shape | stored receipt says | must say |
|---|---|---|
| bare truncated array (control) | unparsed |
unparsed ✓ |
literal [] (control) |
empty |
empty ✓ |
| prose, no brackets (control) | unparsed |
unparsed ✓ |
Draft [analysis]. … + truncated array |
empty |
unparsed ✗ |
Draft [analysis]. … + complete valid array |
empty |
unparsed ✗ |
[notes](https://example.com) + complete array |
empty |
unparsed ✗ |
[notes](https://example.com) + truncated array |
empty |
unparsed ✗ |
Your mechanism description is accurate, with one sharpening: hasJsonArraySpan and the
parse do share the scanner (candidates.ts:71 calls firstJsonArray) — they cannot
disagree about which span is selected. The disagreement is one level up: the parse
accepts a span only when JSON.parse accepts it; the predicate accepts on closure alone.
Balanced-but-not-JSON spans ([analysis], [notes](url)) are exactly where the two
criteria part, and that is where the label lies. Your question — could the outcome check
require a syntactically valid JSON array? — is the right rule; implemented as described
below, it keeps literal [] and valid-arrays-with-all-rejected-items in the empty
bucket (verified: [{"junk":true}] still reports empty), and moves every never-decoded
reply to unparsed.
Your second comment (the patch offer). Your mechanism — the candidate parser's JSON
decoder deciding the evidence label, first-array selection and candidate filtering
preserved — is the right shape, and we say so on the record because we proved it
ourselves rather than on your word: a reviewer-side prototype of exactly that rule
turns all seven rows in the table green while the PR's own pins stay green. The offer of
the code itself is declined, by standing rule and not by judgment: accepted outside
patches are re-derived and pinned by our fixer from the invariant the review states,
never pasted — attribution is the smaller reason; the larger is that a patch arriving
with green tests but no stated invariant leaves nothing the next round can reuse. So:
nothing to send. Your finding, your mechanism, and your test coverage (Markdown-link
prefix before both truncated and complete arrays — we reproduced all four) are credited
in this review and in the fixer brief below. Thank you for the repro; it was one string
change and it found the hole.
Correction — why the earlier approval at this head was wrong
The review and approval recorded at 03:25/03:46 UTC on c4307fe resolved this concern
"diff-favorably" on the inference: "parseCandidates itself keeps only the first
balanced array, so 'first closed span wins' is exactly the parse's semantics —
hasJsonArraySpan and the parse can never disagree about what the answer is." That
conflation is the bug: the pair can never disagree about span selection, and the
acceptance criteria are different — see above. Its supporting evidence hides the hole by
construction: every new-test input whose first span closes also happens to decode
([[2]] unclosed later [{ → span [[2]], valid JSON), and the mutation battery probed
"span check always true", never "span closed without being JSON" — which is the shipped
logic itself, i.e. the mutant was already in the source. The argument that "the error
direction stays at the old pre-PR value" is true and immaterial: this PR's only
deliverable is the discriminator, and a discriminator that mislabels the normal prose
shape of reasoning models (bracketed labels, Markdown links — not exotic) is the #631
lesson again — a metric that can only say "fine" against a systematic failure is not a
metric. The APPROVED state against c4307fe is superseded by this review.
Shape pass (disclosure, per WORKFLOW item 16)
#626 has no architect artifact, so the reviewer ran the arch-phase shape pass before
opening the diff, body, or thread; full write-up at .dev/626-shape.md. Committed
pre-diff: the problem statement; alternatives A (the parse returns its own decode
verdict — {candidates, decoded} — and the runtime consumes that single decision),
B (extraction becomes "first span that decodes", which also recovers candidates
lost behind decoy spans; larger, changes what is stored), C (sentinel-wrapped prompt
contract); and the predicted redundancy. The shipped shape — add hasJsonArraySpan,
consult it on zero candidates — was written down pre-diff as the option to reject, with
its failure mode located precisely at balanced-but-not-JSON spans. One honest refinement:
I predicted duplication of the scan; the predicate in fact calls the scanner — the
duplication is a second accept criterion over one scan. No other assumption failed.
Shape B is the right long-term fix for a sibling defect and is explicitly out of scope
here (see Declared remainder).
Where the misclassification lives: introduced by #626
Diff evidence (git diff 6e33179...c4307fe): hasJsonArraySpan does not exist on main
(git grep hasJsonArraySpan main → no match); the function is added by this PR
(+ hunk in src/capture/candidates.ts @@ -60,6 +60,16 @@), and the ternary
!text.trim() || hasJsonArraySpan(text) ? "empty" : "unparsed" is added in
src/runtime/capture.ts. The unparsed label itself is this PR's invention — on main
every zero-candidate path said empty. So the hole is not a pre-existing mechanism newly
observed; it is the mechanism this PR adds failing to hold the invariant its own title
states ("tell a truncated response from a genuine empty result"). The remedy therefore
belongs to #626 — completing its declared invariant is not widening it, and no separate
ticket is needed for the label.
The invariant this review requires
outcome=empty may be recorded only when the span the parser selected was accepted by
the parser's own JSON.parse as an array (empty or with all items filtered out). Any
reply that never decoded — unclosed array, no array, or a first span that closes without
being JSON — reports unparsed. The label and the candidate list must come from one
decode decision; no parallel span-evidence predicate may exist. Blank-text behavior is
unchanged (!text.trim() → empty).
The smallest correct rule, and the pins
For the fixer (re-derived from the invariant; equivalent in semantics to the claimant's
stated mechanism, credited):
- In
src/capture/candidates.ts: removehasJsonArraySpan. Make the parse return its
verdict —parseCandidatesDecoded(raw, max): { candidates, decoded }— where
decodedis true exactly whenfirstJsonArray(stripFences(raw))returned a span and
JSON.parse(span)returned an array; item filtering unchanged, function stays total
(catch ⇒{candidates: [], decoded: false}).parseCandidatesdelegates, so every
existing caller and every filtering test is untouched. - In
src/runtime/capture.ts:637: callparseCandidatesDecodedonce; thread the same
verdict tolagOutcome:candidates.length > 0 ? "candidates" : !text.trim() || decoded ? "empty" : "unparsed".
Required pins (the shipped battery misses this defect because no input has a
closed-but-undecodable first span):
- e2e receipt pins, labels read from stored evidence bytes: preamble+truncated →
unparsed; Markdown-link+truncated →unparsed; preamble+complete →unparsed;
Markdown-link+complete →unparsed;[{"junk":true}](decodes, all items rejected) →
empty; existing four pins (bare truncated→unparsed,[]→empty, blank→empty,
candidate→candidates) stay green. - unit pins:
parseCandidatesDecoded('Draft [analysis]. … [{…', 5)→
{candidates: [], decoded: false}; same for a Markdown-link prefix before a complete
valid array;[]→decoded: true. - mutation check: replacing the verdict with span-closure-equals-answered (the logic
currently shipped) must turn the preamble e2e pin red.
Verbatim repro at current head, no files needed: in test/capture/capture-auto.test.ts,
test "a truncated response records an outcome distinct from a genuine empty", change
only the response prefix I analyzed the session. → Draft [analysis] (full response:
Draft [analysis]. Here are possible memories: [{"type":"context","scope":"x","content":"a convention that ran out of room mid-sentence),
run bun test test/capture/capture-auto.test.ts — the stored capture_lag receipt reads
outcome=empty where unparsed is expected.
Declared remainder (does not block)
With the rule above, a complete candidate array behind a decoy span still yields zero
stored rows — firstJsonArray selects only the first [-span (src/capture/candidates.ts:39,
identical on main). That data loss predates #626 and is unchanged by both this PR
and the required fix; the fix makes it honestly visible (unparsed) rather than
silently-empty. Recovering those candidates ("first span that decodes", shape B)
changes what gets stored and belongs in its own ticket, not here. Declaring it is not a
blocker; leaving it unlabeled would be.
Ownership
The fixer owns this; no architect round is needed. #626 has no architect artifact to
amend, the invariant follows from the PR's own title and purpose, and the design space
was drawn pre-diff in the shape pass. If the declared remainder (extraction recovery) is
picked up later as a new ticket, that ticket is big enough to want an architect; this one
is not.
Measurements (all in a throwaway /tmp clone; every store-touching run with a fresh OPENCODE_MEMORY_DIR)
| what | result |
|---|---|
git ls-remote … refs/pull/626/head, re-checked immediately before publishing |
c4307fe6a2f85465fe77aa2d04635dec42c619bd — this review adjudicates the live head |
head baseline bun test capture-auto capture-parse |
46 pass / 0 fail |
head bun run typecheck |
exit 0 |
| reviewer harness at head (receipt bytes) | 3 pass (controls) / 4 fail (claim cases), table above |
| prototype of the rule above, in-clone | repro 7/7; capture-auto+repined capture-parse 47 pass / 0 fail; test/status 89/89; evidence 11/11; typecheck exit 0 |
(integration/pi/node-launcher.test.ts environmental failure on this shell's Node
20.20.2 noted as baseline; integration suites were not run and are not counted against
anything here.)
No content authored by a non-participant was relied upon; everything above is either
measured by this seat or quoted from the two threads under adjudication.
VERDICT: CHANGES_REQUESTED at c4307fe — the bracketed-preamble misclassification is real on stored receipt bytes; the label must come from the parser's own decode verdict (invariant, rule, pins and repro above); WhollyMindless's finding and mechanism are accepted and credited, the patch handoff is declined per policy because the fixer re-derives from the invariant; the fix belongs to #626 and to the fixer, and the decoy-span data loss is pre-existing and needs its own ticket.
…closure
The lag receipt picked `empty` from hasJsonArraySpan, a span predicate that
accepts any closed bracket. A reply opening with a bracketed preamble
(`Draft [analysis].`) or a Markdown link makes firstJsonArray lock onto the
prose span; JSON.parse then rejects it as invalid JSON, yet the label still
claimed the model had answered with nothing.
The evidence label now comes from the candidate JSON decoder itself:
parseCandidatesDecoded returns { candidates, decoded }, `decoded` is true
exactly when the selected span passes JSON.parse as an array, and the
runtime threads that single verdict into the lag outcome — one decision
feeding both the rows and the label. hasJsonArraySpan is removed; no
parallel acceptance rule survives next to the parse. Literal [], fenced
arrays, and valid arrays whose items all fail validation stay `empty`;
truncated arrays, replies without an array, and closed-but-not-JSON first
spans report `unparsed`.
Pins: four e2e receipt cases (bracketed preamble and Markdown link, each
before a truncated and a complete array) read `unparsed` from stored
evidence bytes and fail on the pre-fix source; unit pins on
parseCandidatesDecoded cover both prefix shapes, literal [], an
all-rejected valid array, and the total-function junk inputs. parseCandidates
delegates, so every existing caller and filtering test is untouched.
There was a problem hiding this comment.
PR Reviewer
Delta review — #626 @ dd967b030aa4559fea8c9aca36988c1ac95b7723 (delta c4307fe..dd967b0, base 6e33179)
APPROVE at this head. The CHANGES_REQUESTED recorded against c4307fe is resolved by this delta.
What the delta is
One commit, four files. hasJsonArraySpan is deleted — zero references anywhere in the tree at this head (git grep). parseCandidatesDecoded(raw, max) → { candidates, decoded } returns the decoder's own verdict: decoded is true exactly when the selected first-array span passes JSON.parse as an array. parseCandidates delegates to it, selection and filtering untouched. The lag label is candidates.length > 0 ? "candidates" : !text.trim() || decoded ? "empty" : "unparsed" — one decode decision feeding both the rows and the label. Five new end-to-end receipt pins, six new unit pins. Nothing in the four files is outside this fix: the comment edits are fix-adjacent, no README, no drive-by hunks.
What I measured (all on throwaway clones under fresh OPENCODE_MEMORY_DIRs; the live checkout was not touched)
| Check | Result |
|---|---|
bun test test/capture/capture-auto.test.ts test/capture/capture-parse.test.ts @ dd967b0 |
55 pass / 0 fail |
Fail-before: c4307fe src + dd967b0 tests |
exactly the 4 new preamble/Markdown-link e2e pins fail, each Expected: "unparsed" / Received: "empty"; capture-parse.test.ts fails at load (Export named 'parseCandidatesDecoded' not found) — the unit pins pin the new interface |
WM's original defect @ c4307fe |
reproduced through the real capture pipeline, outcome read from the stored evidence logfmt file: Draft [analysis]. + truncated array → outcome=empty |
Preservation pins both ways ([], all-rejected, plain truncated, blank, candidates) |
pass pre- and post-fix — deliberately: their direction is the fix not over-correcting, and the four failing pins prove the fix bites |
| Gate audit | one producer of capture_lag (src/runtime/capture.ts:1082, outcome computed at :1076); no reader branches on the field (src/status/metrics.ts reads only ts/lag) |
bun run typecheck |
exit 0 |
bun run lint / biome format |
warning profile identical to the recorded base numbers (966 warnings / 206 infos); format clean |
COMMENT_LINT_BASE=6e33179 bun scripts/comment-lint.ts |
clean, 75 added comment lines |
The adjudication — Draft [analysis]. … [valid array] reports unparsed
The task brief wanted that shape in empty; the 03:15 finding and the 19:25 adjudication table wanted unparsed; the delta ships unparsed and pins it. I rule for unparsed. The brief's line is the wrong one. In my own words, why:
emptyis a stamp, not a shrug. The prompt protocol makes the model's honest "nothing worth keeping" answer the literal[]. Recordingemptytherefore asserts a model verdict, and the only evidence that a verdict was issued is that the reply decoded as a JSON array.[analysis]decoded as nothing; the model issued no verdict we can see.- Any rule that keeps that shape in
emptyre-creates the machinery that just failed twice. To call the preamble shapeempty, the label would have to ask a second question — "is there a decodable array somewhere else?" — i.e. install a second acceptance criterion next to the parse, and take the label from it. A span predicate and a decoder agreed on selection and disagreed on acceptance, and that seam is exactly wherec4307felied. This delta's invariant is that one decode decision feeds both the rows and the label; there is now exactly one place acceptance is decided. - Does
unparsedblame the model for a finder defect? No.unparsedsays: the capture pass could not read a candidate array out of this reply. That statement is true for all three non-decoding shapes — cut off mid-array, no array at all, and a closed bracket that is not JSON. It attributes nothing to anyone; what it does is withhold the model's stamp. Compare the alternatives at the disputed shape:emptywould assert a model verdict that did not happen — a clean, self-consistent lie, precisely the failure mode #626 exists to remove;unparsedis honest but coarse — it reports the observation and does not pretend to know who failed. On an evidence line, coarse-and-true beats clean-and-false. - The finder is the real remaining bug, and I say so explicitly.
firstJsonArraycommits to the first balanced span, so a complete valid array behind a bracketed preamble is dropped — this predates the PR (identical selection at6e33179), is unchanged by the delta, and the delta's own tests disclose it ("the rows the decoy costs are the pre-existing extraction remainder"). The fix is to select the first span that decodes, not the first that closes: tryJSON.parseper balanced span until one yields an array. Cost is bounded — a few extra parses on capture-sized replies — but it changes what gets stored, not just what is reported, and it opens a decoy surface (a stray[in prose steering which span wins) that needs its own fail-before, pins, and probably an architect pass. It belongs in a follow-up ticket, not this pull: #626's acceptance criteria are about the outcome label, and landing an extraction change under a label review would push a storage-behavior change through the wrong gate. - Asked plainly — can the shipped behaviour still tell a human "nothing to store" when there was something to store? No. No path reaches
emptywithout either genuinely blank text or a selected span that decoded as a JSON array; I audited every route to the ternary and there is exactly one producer, with no early return emitting the receipt. On the preamble shape the candidate itself is still lost — but that loss predates this pull, and this pull is what makes it visible: atc4307fethe receipt liedemptyforever; atdd967b0it saysunparsed, which is where the follow-up's eyes will land. The ticket's failure mode is closed at the receipt.
To WhollyMindless
- Your question (03:15): "could the outcome check require a syntactically valid JSON array?" — it does, exactly as of this head. The label is now the candidate parser's JSON decoder judging the span the parser itself selected. Literal
[]and valid arrays whose items all fail validation keepempty(verified end to end:[{"junk":true}]stores zero rows and reportsempty); every reply that never decoded reportsunparsed, including your bracketed-preamble and Markdown-link shapes, truncated and complete — all four are now pinned against the real receipt line. - Your patch offer (04:03): declined because this round already landed the invariant you specified, not because of any judgment about the patch.
dd967b0implements the mechanism your comment describes: decoder decides the label, existing first-array selection and candidate filtering preserved, Markdown-link coverage on both truncated and complete arrays. There is nothing to send. The finding, the mechanism, and the test coverage are yours and are credited here — this is the second time your reproduction caught what our review had passed, and the recorded repro recipe in your comment is what my fail-before ran on.
Residuals (not blockers)
- File the finder as its own ticket — "capture: recover a decodable array that follows a non-JSON bracketed span". The label fix is what makes that ticket visible; the decoy-span shape and the pins to carry (preamble+complete and link+complete must store the rows; the label pins here stay green) are exactly the acceptance criteria it needs.
- The
unparsedoutcome still reaches only the evidence line; surfacing it in the human status report remains the disclosed follow-on from the prior round.
…ovement into autofix/abogartz_opencode-self-improvement-1796094424832
|
🎉 This PR is included in version 0.41.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixer
What changed
A capture model call that gets cut off mid-array parsed to zero candidates and was recorded with the same
capture_lag outcome=emptyas a model that honestly answered the empty instruction. This separates the two on the evidence line and puts the model-choice guidance the issue's interim plan asked for into the README.Truncation guard.
src/capture/candidates.tsgains one exported helper,hasJsonArraySpan(raw): does the reply carry a closed JSON array span at all, after fence-stripping? It reuses the module's existingstripFences+firstJsonArray— the scanner is not duplicated,parseCandidatesis untouched and stays total — and is total like the parse: blank or malformed input answers "no span".src/runtime/capture.tsis now three-way: candidates present →candidates; text empty or whitespace-only →empty(unchanged, the guard's scope is non-empty responses); a closed array that parsed to nothing →empty(a genuine answer); non-empty text with no closed array →unparsed.outcomewas already a plainstringinrecordCaptureLag/recordCaptureLagBestEffort, so no type widened, and no reader branches on acapture_lagoutcome (src/status/metrics.tsreads only timestamps from those lines).unparsedis distinct from everyauto_capture_finishreason code.Tests.
test/capture/capture-auto.test.ts: four end-to-end outcome cases, each on its own session id — truncated reply →unparsed, literal[]→empty, blank response →empty, a real candidate →candidates.test/capture/capture-parse.test.ts: ahasJsonArraySpandescribe (bare[], fenced[], array inside prose → span; truncated, array-less, blank → none) alongside the unchangedparseCandidatestotality cases.README. The auto-capture section now prefers a
captureModelthat does not think, and frames the one recorded pass by its composition (seat named, n=1, cache excluded, "one call's shape, not a cost claim") rather than as a cost. The section keeps its line count (104 lines, unchanged; 1341 words against the 4028 budget), the privacy paragraph was reworded in place, and the Quick-start pre-install warning was deduplicated because it re-links to this section. No cost claim, no saving claim, and neither retracted figure appears anywhere in the diff.Fail-before
The truncated-response case was committed first (
fix(capture): pin the outcome of a truncated capture response) and run against an export of the pre-fix commit (/tmpexport of6e33179plus the new test file — the working tree was never checked back):Running all four outcome cases pre-fix:
3 pass, 1 fail— only the truncated case fails; the empty-answer pins hold before and after, so the guard cannot be silently reclassifying them.Verification
bun test test/capture/capture-auto.test.ts -t "outcome"(after the fix) →4 pass 0 failbun test test/capture/capture-parse.test.ts→18 pass 0 failbun test test/status/status.test.ts test/telemetry/evidence-write-policy.test.ts test/capture/capture-parse.test.ts test/capture/capture-auto.test.ts test/host/claims.test.ts test/host/readme-budget.test.ts→152 pass 0 fail(the claims suite word-scans README anddocs/for the retraction and saving rules)bun run typecheck→ clean, exit 0bun run lint→ exit 0 (biome's pre-existing bench/ warnings are unchanged from the base; the one format finding in the new test file was fixed)COMMENT_LINT_BASE=6e33179 bun scripts/comment-lint.ts, run from a throwaway copy so the uncommitted half of the diff was included) →comment-lint: clean (24 added comment line(s) checked)bun run test(full unit suite) →2163 pass / 23 skip / 0 fail — Ran 2186 tests across 200 files. [40.14s]Deliberate limits
empty: the discriminator is span presence, per-candidate refusals already write their own evidence lines, and no fourth value was invented for it.Closes #330