From 5d39783b7797107a266a7fd1f73bf15149f8092a Mon Sep 17 00:00:00 2001 From: dan-claude-bot Date: Mon, 20 Jul 2026 16:23:09 +0000 Subject: [PATCH] test(labels): pin the reverse direction of the supersede rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A finished re-run that completed after an earlier in-flight entry is the newer word on its context, and the context is settled. Nothing asserted that, so "an undateable/in-flight run sorts last" could be widened into "in flight always wins" — sort_by([(.outcome == ""), .at]) — and the suite stayed green. It now fails exactly this fixture and nothing else. Also records why the undateable fixture is non-vacuous: it is guarded by the sort tiebreak, not the dating expression. Reverting only `at:` leaves it passing, so the two code changes are separately pinned rather than jointly credited to the dating fix. Fixtures 48 -> 49. Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 5 +++-- test/labels-reconcile.sh | 10 +++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2eadd0b..da6488c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,8 +83,9 @@ actually cutting it, and this file starts there. **clears** it once the PR stops being mergeable-by-a-human. Ported from heavy-duty/box#137 so the three repos' reconcilers stay byte-identical; both live shapes, the mixed round, the in-flight run superseding a finished one — - in both spellings of an absent completion — and the whole check-outcome enum - are pinned in `test/labels-reconcile.sh` (fixtures 19 → 48). + in both spellings of an absent completion, and in both directions — and the + whole check-outcome enum are pinned in `test/labels-reconcile.sh` + (fixtures 19 → 49). ## 0.1.1 — 2026-07-19 diff --git a/test/labels-reconcile.sh b/test/labels-reconcile.sh index 86be743..7a532ed 100644 --- a/test/labels-reconcile.sh +++ b/test/labels-reconcile.sh @@ -277,11 +277,19 @@ expect "a replacement in flight for a CANCELLED run is pending, not failed" PEND "$(rollup "[$(run_ build CANCELLED 2026-07-20T15:00:00Z),\ $(inflight_ build 2026-07-20T15:10:00Z)]" | checks_state)" # an entry carrying no usable timestamp is treated as newest, not oldest — -# ambiguity resolves toward "not settled" rather than toward a stale success +# ambiguity resolves toward "not settled" rather than toward a stale success. +# Guarded by the sort tiebreak rather than the dating expression: reverting +# only `at:` leaves this passing, so the two changes are separately pinned. expect "an undateable in-flight run is not discarded for a stale success" PENDING \ "$(rollup "[$(run_ build SUCCESS 2026-07-20T15:00:00Z),\ $(jq -n '{__typename:"CheckRun",workflowName:"ci",name:"build",conclusion:"",startedAt:null,completedAt:null}')]" \ | checks_state)" +# ...and the reverse direction, which stops "in flight sorts last" being +# widened into "in flight always wins": a run that FINISHED after an earlier +# in-flight entry is the newer word, and the context is settled. +expect "a finished re-run supersedes an earlier in-flight run" SUCCESS \ + "$(rollup "[$(inflight_ build 2026-07-20T15:19:00Z),\ + $(run_ build SUCCESS 2026-07-20T15:19:45Z)]" | checks_state)" # -- the classifier feeds the state machine: a cancelled required check must # take the PR off the human's plate, which is the whole point of #136.