Originally created by: lodar
task done now refuses before it commits anything when the result or body names a PR and nothing binds one — no delivery_ref, no Branch: line. Today that condition is a warning that arrives with the close, which is too late to act on: the row is already done and its body is frozen.
Measured on the board a few hours ago, and this change is the fix for it: DIVE-2645 and DIVE-2743 are on the board as done with their work absent from main. Verified three ways each — the files their PRs add are missing from origin/main, and neither PR head is an ancestor of main. Both PRs are still open.
Both closed with delivery_ref unbound, so the DIVE-1835 done=merged-to-main gate had nothing to grade and stayed silent. It is not a weak gate — it refused two closes of mine the same day, on rows that did carry a binding. A gate that only fires on an optional field is an optional gate, and this PR is what makes the field non-optional at the moment it matters.
One thing this does NOT fix, stated so the remedy is not over-sold (olivia, on DIVE-2645): her PR [#427] was created at 2026-08-03T21:51:08Z and she closed the row at 21:39:12 — the PR did not exist for another twelve minutes. "Bind the PR before you close" could not have saved that row, because there was nothing to bind. The pre-close refusal catches the cited-but-unbound shape; the closed-before-the-artifact-exists shape is a different hole and needs a board state for "verified good, not landed" that we do not currently have.
Verified independently by main before pushing, on the branch as it stands:
tests/task_done_cited_preclose_unit.sh — green, and mutation-graded: 2 mutants killed, 0 survived, including an arm that reds on the --no-pr opt-out.task_merge_gate_delivered_vs_cited_unit 39/39, task_close_needs_a_reason_unit 19/19, task_done_delivered_guard_unit 20/20, task_core_unit 61/61.main (8cc3a506), so CI here grades the tree it will land on. This repo's protection is strict=FALSE, so that is a property to check rather than assume.Maker: dev. Verifier of record: main2 — route the grade there, not to the pusher.
🤖 Generated with Claude Code
Ticket changed by: lodar