fix(list-recent-runs): recover dropped cron ticks via previous-run anchor#753
Merged
Conversation
…chor The hourly completion window floors at intended-1h, which tiles exactly only when consecutive cron ticks fire. GHA drops ticks, not just delays them; a dropped tick leaves its hour uncovered by any cycle — the skipped-tick case #526 deferred as "rare under sustained outage." It is not rare, and it silently drops outcome audits. Floor the window at the previous *actual* completed run's intended tick instead of assuming the previous tick fired. When every tick fires this is byte-identical (no overlap, as #526 required); when one is dropped it reaches back to cover the orphaned hour. Capped at 6h. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
list-recent-runs.shanchors its completion window to the most recent intended cron tick and floors it atintended - 3600. This tiles exactly —[intended-1h, intended]then[intended, intended+1h]— only when consecutive cron ticks actually fire. GHA doesn't just delay scheduled ticks (which the tick-anchoring in #526 handles well); it drops them. A dropped tick leaves that hour's completions in the gap between the previous and next cycle's windows, and no run ever analyzes them.#526 named this exact "skipped-tick edge case" and deferred it as "rare under sustained outage," because the only fix on the table then was the 2h-overlap approach the maintainer had rejected for re-analyzing runs. This run is direct evidence it is not rare and the miss is invisible — a dropped tick produces no error, so the skipped outcomes just never get audited.
Evidence (this run)
Analyzing
max-sixty/worktrunk,review-reviewersfired at07:50Z(07:47 tick) then09:46Z(09:47 tick) — GHA dropped the 08:47 tick. The window for the 09:47 cycle floored at08:47, leaving[07:47, 08:47]covered by no cycle.list-recent-runs.shreturned 3 of the 10 tend-* runs actually in[07:47, 09:47]. The orphaned hour contained real, substantive bot output:4874219842,08:16Z).COMMENTEDflaggingcodecov/patch, author pushed coverage, botAPPROVEDon the fixed commit (08:15Z–08:23Z).Both were healthy outcomes this time — but had either gone wrong, no
review-reviewerscycle would have caught it. (I covered the gap manually for this run's audit; the gist records the full window.)Fix
Floor the window at the previous actual completed run's intended tick instead of assuming the previous tick fired. #526's discussion weighed only two options — the intended fire time (not exposed by GHA) vs 2h overlap (rejected) — and missed a third: the previous run's own start time is queryable, and rounding it down to its cron tick recovers exactly where the last cycle's window ended.
== intended - 3600→ byte-identical to today's behavior, no overlap (the constraint fix(list-recent-runs): anchor completion window to intended cron tick #526 set).ghfailure, noGITHUB_WORKFLOW) to the current floor.Verified in this CI session: the patched script returns all 10 in-window runs (was 3); with consecutive ticks it resolves the floor to
intended - 3600unchanged.Gate assessment
Evidence log: https://gist.github.com/b923bbc52f3c6606931d59abdae616a3