Skip to content

Commit 120ca3c

Browse files
committed
feat(pm/fleet-write): run_rerun_failed's seventh fence — the run's head is its pull's current head
A run_rerun_failed is now refused unless the run's head_sha equals the current head of the pull it names. The pull is the run's pull_requests[0].number, and its head is read with the pull's own GET /repos/{repo}/pulls/{n}, never from the copy the run embeds. A run naming no pull (a fork pull request's run, or the field empty) is refused by name. ci.yml's concurrency group is keyed by the pull number with cancel-in-progress true, so a stale head's re-run would cancel the current head's run. The executor judges it authoritatively: the run and then the pull are the last two reads before the POST, and a stale head, a run naming no pull or an unreadable pull is zero writes with the POST row not sent. The wrapper judges it earlier as an advisory refusal naming the fence. RERUN_FAILED_FENCES gains the head fence, every predicate now takes (run, pull), and the self-test batteries that judge it gain cases on both sides, with their pins raised: validate 30 to 33, execute 17 to 21, rerun-failed's seat fences 8 to 11. Claude-Session: https://claude.ai/code/session_01FM29ZqLTrnPNXxijioZwMp Co-authored-by: Claude <noreply@anthropic.com>
1 parent f2ee5ad commit 120ca3c

5 files changed

Lines changed: 225 additions & 104 deletions

File tree

‎scripts/pm/fleet-write/dispatch.mjs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,9 @@
242242
* IS that confirmation; the seat reads the new head with one
243243
* `GET /repos/{repo}/pulls/{n}` after, and this file reads nothing back;
244244
* - `run_rerun_failed` carries no body, names no workflow and is
245-
* confirmed INSIDE the run too: the executor judges the four fences on
246-
* the run before its POST and lands the action only when the run reads
245+
* confirmed INSIDE the run too: the executor judges the five fences on
246+
* the run and its pull's current head before its POST, and lands the
247+
* action only when the run reads
247248
* back as attempt 2 with its failed jobs queued or in progress
248249
* (`execute.mjs`, `confirmRerunFailed`). So a `success` run IS that
249250
* confirmation and this file reads nothing back; the seat's wrapper

0 commit comments

Comments
 (0)