Skip to content

Commit 4a7250b

Browse files
committed
feat(pm): red the board-snapshot run when the archive has gone stale
`count_check: pending` is the tool's own "could not check", but the exit code was built from the count check's `ok` alone, which `pending` leaves null — so a run that archived days-old state exited 0 and the workflow's exit-code step never fired. Measured on this repository's archive: nineteen consecutive runs reported `pending` between 2026-09-10T20:23Z and 2026-09-14T20:24Z and every scheduled run in that window is green, including the one whose delta cursor was two days behind the live board on the morning a suspension destroyed cards the archive did not hold. A run now also answers whether the archive is still level with the live board: `freshness` in the manifest, one row in the summary, and EXIT_STALE (5) when no run has reached a count-check verdict for longer than a day. The anchor is the streak's start stamp, not the delta cursor — that cursor is the newest archived row's `updated_at`, so on a quiet board it sits days in the past while the archive is exactly level, and ageing it would red a board for being quiet. A stamp rather than a run counter keeps the manifest diff-stable: two writes per incident instead of one per run. The archive still lands: the commit and the R2 mirror run before the step that reads the exit code. The row prescribes no remedy — cadence, budget and slice stay the maintainer's. Claude-Session: https://claude.ai/code/session_01HZfg2AwVX191qCizp88gQr Co-authored-by: Claude <noreply@anthropic.com>
1 parent cb648cb commit 4a7250b

2 files changed

Lines changed: 373 additions & 7 deletions

File tree

‎.github/workflows/board-snapshot.yml‎

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,25 @@ name: Board Snapshot
7373
# cursor and exits non-zero with the reset time. A loop against a spent budget
7474
# starves every other automated caller in the repository for the rest of the hour.
7575
#
76+
# ## A stale archive is not a green run
77+
#
78+
# A run that stops on its own budget is a planned pause and exits 0. A run whose
79+
# archive has not been CONFIRMED against the live board for longer than a day is
80+
# a different thing, and until #18137 it exited 0 as well: NINETEEN consecutive
81+
# runs of this workflow reported `count_check: pending` between 2026-09-10T20:23Z
82+
# and 2026-09-14T20:24Z and every one of them is `success` in this workflow's own
83+
# run history — including 2026-09-14T02:34Z, whose delta cursor was two days
84+
# behind the live board on the morning an account suspension destroyed cards the
85+
# archive did not hold. The script now carries a `freshness` row and exits 5 when
86+
# that streak passes a day; its header is the authority on the anchor and the
87+
# window, and ⛔ the row prescribes no remedy: the cadence above and the
88+
# 800-request cap are the maintainer's decisions, not this row's.
89+
#
90+
# The ORDER of the steps below is what makes that safe, and it is deliberate: the
91+
# commit and the R2 mirror run BEFORE the step that reads the exit code, so a red
92+
# freshness row never costs the records the same run archived. ⛔ Do not move the
93+
# failing step above them — a stale archive is better than none.
94+
#
7695
# ## The `pull_request` trigger, and what it is allowed to do
7796
#
7897
# Every patrol in this tree exercises itself on the pull requests that change
@@ -421,8 +440,10 @@ jobs:
421440
echo '</details>'
422441
} >> "$GITHUB_STEP_SUMMARY"
423442
424-
- name: Fail the run if the snapshot did not read the board
443+
# LAST on purpose: every step that lands the records is above it, so this
444+
# one only ever decides the colour of the run. See the header.
445+
- name: Fail the run if the snapshot did not read the board, or the archive is behind it
425446
if: steps.snapshot.outputs.exit_code != '0'
426447
run: |
427-
echo "::error::board-snapshot exited ${{ steps.snapshot.outputs.exit_code }} — 2 is a failed count check (the archive and the board disagree about how many open issues exist), 3 is a prerequisite the runner did not meet, 4 is a rate-limit stop with a resume cursor written. Whatever was read HAS been committed; see this run's summary."
448+
echo "::error::board-snapshot exited ${{ steps.snapshot.outputs.exit_code }} — 2 is a failed count check (the archive and the board disagree about how many open issues exist), 3 is a prerequisite the runner did not meet, 4 is a rate-limit stop with a resume cursor written, 5 is a STALE archive (no run has confirmed it against the live board for longer than a day; the run summary names the streak and what clears it). Whatever was read HAS been committed; see this run's summary."
428449
exit 1

0 commit comments

Comments
 (0)