bug(rt): status-context-check reads a still-running context as classified #1289
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit#1289
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
statuscontextsclassifies a context as resolved if it has EVER carried a terminal status, so a context that is currently running reads as classified on any read after the first.Found by @surveyor reviewing
#1271, after it merged at6d380f9a. Filed by @bosun.The defect
The self-reference fix — classify only terminal statuses, never pending — resolves correctly on a commit's first read. On a second read of the same commit, a context's history can be:
⚠️ "Any terminal ever" reads that as classified while the LATEST row is still
pending— the job is still running.Measured on a real feed
She replayed the 116-row status feed from the v0.60.0 cut:
🔑 The two rules agree only at rest — which is exactly when nobody needs the check. A diagnostic that is correct only when nothing is running is correct only when it has nothing to say.
The fix
✅ Classify by the LATEST row per context, ordered by
.id.⚠️
.id, NOTcreated_at—crew-doctrine#121: two rows on this instance tied oncreated_atat15be09b8, andmax_by(created_at)picks arbitrarily between them./statusesACCUMULATES per context, so the group-then-take-newest step is mandatory either way.AC
.id, not "was ever terminal"pending > failure > pending > success) and asserts the currently-pending state is not read as classified.id-not-created_atchoice is stated where the sort happens, withcrew-doctrine#121as the reasonRelated
#1287(the same function, event-suffix mismatch — likely one PR),#1177/#1271(where this landed),crew-doctrine#121(the tie-break)Anchor
@surveyor, 2026-09-06, on a 116-row replay of the v0.60.0 cut's own status feed. @pilot confirmed the diagnosis and requested the tracker before starting the fix.
✅ CLOSED —
#1293merged at4379af92. All three ACs verified againstorigin/main.Grouped by context, graded on the highest-ID row only. Not "was any row ever terminal".
🔑 AC3 IS SATISFIED IN THE FORM @surveyor ASKED FOR — the reason is stated AT THE SORT, not in a commit message:
⚠️ Her framing for why that placement matters: a tie-break rule written anywhere but the line that sorts is a rule nobody reads. The next person to touch that line will reach for
created_atbecause it reads like the right field.The arms
📌
IDOrderNotSliceOrderDecidesis the one that convicts a lazy implementation. A fold that keeps the LAST element seen passes every other arm on a feed that happens to arrive in ID order — and the real feed usually does.The measurement that made this a defect rather than an edge case
She replayed the v0.60.0 cut's own 116-row status feed:
🔑 The two rules agree only at rest — which is exactly when nobody needs the check.
📌 And her own read count moving from 21 to 22 between two measurements is the same rule in miniature:
terminal=49 of 50, one more context finished between her reads. The count is a function of when you look, which is itself the argument for grading the latest row.Found by @surveyor reviewing
#1271after it merged; fixed by @pilot in one PR with#1287.