Skip to content

fix(dor): scope the dor-stuck mark by ownership, not by the gate label - #1003

Merged
TaekeK merged 1 commit into
mainfrom
bugfixes/reconcile-dorstuck-scope
Aug 11, 2026
Merged

fix(dor): scope the dor-stuck mark by ownership, not by the gate label#1003
TaekeK merged 1 commit into
mainfrom
bugfixes/reconcile-dorstuck-scope

Conversation

@TaekeK

@TaekeK TaekeK commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

A latent regression from #1002. Nothing is in Building on either board today, which is the only reason it has not fired yet.

The bug

The 💀 notice is the only signal a died build produces — the flow dies with the sidekick, so it never reaches its own error handling. It comments directly on the affected issue, and is meant to do so once; the dor-stuck label is how it remembers:

marked="$(gh issue list … --label dor-stuck --label "$LABEL")"
for num in $stalled; do
  case " $marked " in *" $num "*) continue ;; esac    # already told them
  gh issue edit "$num" --add-label dor-stuck
  gh issue comment "$num" --body "💀 …"
done

Before #1002 the walk only ever saw gate-labelled issues, so stalled and marked were drawn from the same population. Since #1002 the walk follows board membership, so stalled can hold an issue carrying no gate label — and --label dor-stuck --label "$LABEL" can never return that issue. Its mark is invisible, the dedupe never fires, and the comment repeats every hour, on an issue that is already broken.

38 open Feature-board items have no gate label, so this was one dead build away from firing.

The fix

Scope the lookup by the same ownership rule the walk uses (belongs_here: bug → Bug Pipeline, otherwise → Feature Pipeline) rather than by the gate label. Equivalent for gate-labelled issues, and the "clear the mark once it recovers" loop now only touches issues this pipeline owns, instead of potentially clearing marks belonging to the other board.

Why the harness missed it

The stub served the marked list regardless of the --label arguments, so the gate-labelled query and the ownership-scoped one looked identical to it. It now models GitHub's AND-ing of repeated --label filters, which is precisely what makes the two distinguishable.

Two assertions added, 33 total. Against main, exactly one fails:

FAIL  an already-marked stalled issue is not commented on again

Also anchored three 💀 assertions on the comment's target (COMMENT: issue comment 370) instead of the phrase "died mid-flight" — that phrase appears in the health digest as well, so they could not distinguish a direct comment from a line in the report. One of them was passing for the wrong reason.

Not fixed here

Two other paths remain gated on the gate label, both deliberately:

  • The heal path (§2) — the label is the opt-in that says "this issue belongs in the pipeline". Sweeping every open issue in the repo would drag in meta and docs issues that must never reach the board. The 38 unlabelled issues are therefore un-healable if they ever fall off the board, which is an argument for labelling them, not for changing the query.
  • §3b, closed issues still holding a sidekick — pre-existing, unchanged by feat(dor): sweep the whole board, and notify only when findings change #1002. Narrowing it by ownership would mean dropping the label filter from a --limit 50 window sorted by creation date, which risks missing older entries. Left alone rather than traded for a subtler gap.

🤖 Generated with Claude Code

The 💀 notice comments directly on the affected issue and must do so ONCE; the
`dor-stuck` label is how it remembers. That mark was looked up with
`--label dor-stuck --label "$LABEL"`.

Since #1002 the walk follows board membership, so `stalled` can hold an issue
carrying no gate label — and that query can never return such an issue. Its mark
would be invisible, the dedupe would never fire, and the comment would repeat
every hour on something already broken. 38 open Feature-board items have no gate
label, so this was one dead build away from firing. Nothing is in Building on
either board today, which is the only reason it has not.

Scope the lookup by the same ownership rule the walk uses (`belongs_here`)
instead. Equivalent for gate-labelled issues, and the "clear the mark once it
recovers" loop now only touches issues this pipeline owns.

The harness could not see this: its stub served the marked list regardless of
the --label arguments, so both queries looked identical. It now models GitHub's
AND-ing of repeated --label filters, which is what makes the two distinguishable.
Two assertions added; the first fails against main.

Also anchored three 💀 assertions on the comment's target rather than on
"died mid-flight" — that phrase appears in the health digest too, so they could
not tell a direct comment from a line in the report.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@TaekeK
TaekeK merged commit 4ec51d5 into main Aug 11, 2026
29 checks passed
@TaekeK
TaekeK deleted the bugfixes/reconcile-dorstuck-scope branch August 11, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant