Originally created by: lodar
The defect. "A gate whose task looks shipped retires with it" reads the row's own commit
stream and calls that evidence about the gate. It is not. DIVE-2382 was auto-flagged
"likely shipped, verify+close" because one commit naming that row landed, while its live human
gate asked about a completely different item — a row carrying a six-item program gets one commit
for item [#5] and reads as complete. On a ticket that lands in pieces the nudge points the right
way for the wrong reason and arrives with the authority of an automatic check.
The rule. The reader resolves what the gate is about — the pull request it names — and
never inherits the row's commit stream as evidence. A gate that names no subject does not
auto-retire; it stays open and says so.
src/cmd_task.sh)| function | what it answers |
|---|---|
_gate_subject_refs_from_text |
which refs does this text ask about (structured Subject:/Blocked-on: line, or approve/merge/land/sign off adjacent to the ref) |
_gate_ref_states |
measured state per ref via gh, through the DIVE-1955 qualified resolver. MERGED / MERGED-RED / OPEN / CLOSED / AMBIGUOUS / UNRESOLVED |
_gate_subject_verdict |
NO-SUBJECT | UNKNOWN | OPEN | MERGED, strictest first |
The subject must come from a structured, intentional signal, never "a number appeared in the
text" — the same rule DIVE-1965 set for delivery. Report verbs are excluded on purpose:
DIVE-2382's own ask says "fix [#5] is already in review as PR [#335]" about a PR it is not
about, and a mention-predicate retires a live approval on the strength of it. The asymmetry is
the safety argument: reading a citation as the subject retires a live human question, reading a
subject as a citation costs one nudge.
There is no git call anywhere in the reader. The moment it can reach the row's commit stream,
the defect is back — so the test asserts it with a tripwire, not a comment.
(a) the heartbeat gate sweep. When the ask names a PR, that PR's state is authoritative and
the row's commits are not consulted at all. OPEN or UNKNOWN withholds the flag (no stamp,
so a later tick retries — a non-verdict is not a negative, DIVE-2318); MERGED flags with the
subject as the named evidence. A no-subject gate keeps its DIVE-1140 row-level flag, and the
nudge now says the evidence is row-level and may be about a different item on the same row.
(b) the DIVE-1830 cited-not-delivered gap. Cited refs were set aside and never read. The
set-aside is right — DIVE-1965 deleted that fleet-wide close blocker on purpose — but reading
is a different act from judging. Their state is now measured and disclosed: never refused,
never stamped UNVERIFIED, never changes a verdict. DIVE-2382 closed while citing its own PR [#337]
as OPEN and nothing said so; that PR then outlived the only row pointing at it.
Built as one reader because building it as two rows repeats the defect DIVE-2382 was filed about
(olivia's scope, and it is a correctness argument, not anti-duplication).
Nothing here auto-answers or auto-closes a human gate (lodar 2026-07-12, DIVE-555). Whether a
merged subject may retire a gate without a human is a policy call and is filed as a decision
gate on DIVE-2414 rather than decided in this diff.
tests/gate_subject_state_unit.shThe load-bearing arms are the withholds, not the flags: an arm proving "a merged subject
flags" signs off on a wider nudge, not a narrower one.
| mutation | signature | reds |
|---|---|---|
| baseline | 34/0 | — |
| delete the open-subject veto | 31/3 | H1 H1b H1c |
| subject := any PR mention | 30/4 | E3 E4 E5 E8 |
| collapse MERGED-RED into MERGED | 32/2 | R3 V6 |
| cited refs not read | 31/3 | C1 C2 C3 |
| UNKNOWN treated as retirable | 32/2 | H4 H4b |
| revert the row-level evidence wording | 33/1 | H3b |
Each mutation shown applied (non-empty diff) before its run, so none of these is a VOID
measurement. Existing suites unchanged and green against this tree:
heartbeat_gate_shipped_unit 19/0 · task_merge_gate_result_pr_unit 29/0 ·
task_merge_gate_delivered_vs_cited_unit 31/0 · task_deliver_merge_gate_unit 11/0 ·
task_merge_gate_autodetect_unit 14/0 · task_merge_gate_ancestry_unit 35/0.
Verifier must be someone other than me. Not CI-cleared: graded locally by mutation.
🤖 Generated with Claude Code
Ticket changed by: lodar