feat: implement issue #2032 โ€” dev-lead claim retraction: replies from cancelled runs are never swept, and a clean rebase retracts claims for fixes that landed

Merged
DO
10d ago
+1066-16

Problem

The claim-retraction sweep from #2013 has two gaps (issue #2032):

  1. Replies posted by a pass that was cancelled or killed are never retracted, because each pass only sweeps replies created since its own start.
  2. When the push guard cleanly rebases dev-lead's commits onto someone else's, the replies cite the pre-rebase SHAs, so true claims are retracted and the thread cannot recover without a new commit.

This PR adds a start-of-pass sweep of earlier passes' claims (retract what did not land, or what predates the finding it answers; restore a wrongly retracted reply whose fix is on the remote head), and re-points a claim at its rebased commit after a clean rebase.

Provenance: this branch is dev-lead's checkpoint from run 37980413691, which hit the 45-minute action budget before it could open a PR. The commit is marked INCOMPLETE and has not been reviewed. Opened by the maintainer so CI and review can finish it. It covers criteria 1 to 4 of the issue with tests; criterion 5 (the full test list) needs checking against the issue.

Risk

Medium. It changes when dev-lead edits its own review replies (start of every pass, and after a rebase) and adds bookkeeping to the push guard. A wrong verdict would retract a true claim or restore a false one. It is exercised only after merge and channel promotion.

Test plan

New and extended bats suites: tests/dev-lead/unit/test_claim_sweep.bats, test_claim_landing.bats, test_incorporate_remote_head.bats, test_fix_reviews.bats. CI runs them; they have not been run since the checkpoint.

Rollback

Revert this PR. No tags, migrations or external state.

Monitoring

After promotion, watch dev-lead run logs for the start-of-pass sweep's retract/restore notices and for claims re-pointed after a rebase.

Closes #2032

๐Ÿค– Generated with Claude Code