Skip to content

fix(dispatcher): only the queue's own merge_group run fails it - #323

Merged
sydevs-dispatcher[bot] merged 8 commits into
mainfrom
claude/fix-321-queue-suite-app
Nov 26, 2026
Merged

sydevs-dispatcher[bot] merged 8 commits into
mainfrom
claude/fix-321-queue-suite-app

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • A failure on a gh-readonly-queue/* branch resolves to queue-failed only when it is a workflow_run the merge_group trigger ran. A queue check_suite resolves to nothing.
  • The resolve log line names the run that failed, so the next reader can tell which one spent the repair passes.

Change outline

The queue path's decisions. Only the trigger test is new; the branch match and the cancelled exclusion are unchanged.

 eventTargets(workflow_run | check_suite | status)      dispatcher/resolve.mjs
   queuedPr(head_branch) → the PR, else the PR-head lookup takes over
   conclusion not in QUEUE_FAILED → no target           # cancelled stays excluded
+  workflow_run.event is not 'merge_group' → core.info says so, no target
+    a check_suite names no trigger, so every queue suite stops here
   → pr#<n>:queue-failed
     facts { run: workflow_run.html_url }                # never null past the test above

What an operator sees afterwards. A queue failure used to leave a line naming nothing, and an ignored one left no line at all.

 the resolve log line                    dispatcher/resolve.mjs, index.mjs
-  workflow_run.completed → 1 target(s): pr#489:queue-failed
+  workflow_run.completed → 1 target(s): pr#489:queue-failed(https://…/runs/457…)
-  check_suite.completed  → 1 target(s): pr#489:queue-failed     # the #489 defect
+  check_suite.completed  → 0 target(s): none
+    a failed check suite on gh-readonly-queue/… is not the queue's CI — ignored

targetLabel is new and exported from resolve.mjs, the file that owns the queue reason, so index.mjs stays generic.

Test results

  • Lean gate: ✓ claude plugin validate ./workflow --strict passed, node --test workflow/lib/*.test.mjs 194 passed
  • Targeted specs: node --test dispatcher/test/*.test.mjs 470 passed
  • Both suites also pass from a .claude/worktrees/<slug> worktree
  • Build: N/A

Both new cases produce a target against resolve.mjs as it stands on main: the queue check_suite yields queue-failed with run: null, which is the SahajAtlasWeb#489 record exactly, and a pull_request-triggered run on the ephemeral branch yields one too.

Manual verification

  1. Nothing in the automated gate proves this against a real delivery. The next genuine queue failure in a product repo should log pr#<n>:queue-failed(<run url>) — worth reading once in the resolve job log.

Notes for reviewer

The approach changed in review. You answered B on the question thread: test what triggered the run, not who posted the suite. That is what this branch now does, and it unmeets #321's criterion 2 as written — criteria 2 to 4 there carry the amendment as review lines.

The net diff against main is four files and 86 added lines. Two fields the earlier revisions added, queueFail.app and queueFail.suite, are gone again: app could hold only github-actions while the test was an equality and now has no event to read it from, and suite held an API url a routine cannot reach on a leg nothing reaches. dispatcher/decide.mjs and dispatcher/record.mjs are therefore byte-identical to main. The record keeps run, which a merge_group run always carries as a page a person can open.

Six commits, each separately revertable. origin/main is merged in, cleanly, with no conflict.

Judgement calls, yours to overturn:

  • 'merge_group' is a literal in resolve.mjs, not a loop-config.json value, beside the gh-readonly-queue/ regex it belongs with. It is GitHub's own event name, not tunable per repo.
  • The core.info line on an ignored failure stays, and a test pins it. It is the only trace of the failure mode docs/why.md calls unasserted, and B removes no path that produced a record.

One assumption survives, named in docs/why.md#a-queue-failure-is-a-ci-failure: that every check a ruleset requires in the queue is an Actions workflow triggered by merge_group, as ci.yml is here. A repo whose queue gate is a third-party context would record no queue failure when it failed. The critic flagged that it read only this repo; I have not read the other four's rulesets either, because a routine cannot. The cost if it is wrong is the #959 eject-and-re-arm loop returning for that repo, visible as a PR that never merges.

Dismissed findings, both pre-existing and both carried from earlier revisions:

  • Nothing ever clears record.queueFail. queueFailure is already scoped to the head and to an unarmed PR, so a new head or a re-arm ends it, and the ceiling plus handback is the designed exit. It only bites when the trigger was wrong, which is what this PR narrows.
  • renderRecord could escape - so no record value can contain the END marker. Real property of the serializer, no measured harm, and this PR adds no record field at all now.
Detail

Fixture pre-mortem. The test payloads assume a workflow_run carries event and html_url, and that a check_suite carries neither. event is documented on Get a workflow run as the event that triggered the run, and the merge queue's event name is merge_group — the trigger ci.yml:20 subscribes to. The check suite schema has no trigger field of any kind. Neither value is readable from a routine: the MCP projections of a real check run drop both, and non-search gh api reads are closed to it. This is better grounded than the app.slug === 'github-actions' value it replaces, which no schema documented at all.

Behaviour against main, measured. Run against origin/main's resolve.mjs, a queue check_suite with conclusion failure returns [[959, 'queue-failed', { run: null }]], and a queue workflow_run with event: 'pull_request' returns [[959, 'queue-failed', { run: 'https://run' }]]. Both are zero targets on this branch, each with a core.info line.

Reviews that ran. The security review ran because dispatcher/ matches securityReview.triggerPattern, and reported nothing at or above its bar. It read resolve.mjs whole against main's copy, decide.mjs's queueFailure/repairPlan/case 'queue-failed'/evaluateGreenPr regions, record.mjs, fire.mjs, apply.mjs's arming handlers and dispatcher.yml's triggers, and found the change monotonically restrictive: every payload that now returns [] previously produced a target, the rejected event does not fall through to the PR-head ci path, and a missed classification costs the #959 loop rather than a merge-gate bypass, since arming is gated by mayArm and the merge by GitHub's ruleset. comment-lint.mjs added nothing banned. No /simplify or /code-review pass: address-review runs the security review, the gate and the docs sync, not the full ship pipeline.

Docs. docs/why.md#a-queue-failure-is-a-ci-failure is the only surface that describes this; a grep for merge_group, queue-failed, gh-readonly and queueFail across every .md and .json finds one other mention, in docs/rollback/README.md, which the change does not make stale.

Closes #321

A failing check suite on a gh-readonly-queue/* branch was read as the queue's
CI failing, whatever app posted it. On SahajAtlasWeb#489 another app's suite
failed at 21:24Z while the queue's own Actions run was still going; that run
concluded success at 21:27:02Z and GitHub merged the PR 32 seconds later. The
dispatcher had already recorded queueFail against head 6ccbee46, bumped fixCi
to 2, and spent a fix-ci session that found nothing to repair. Because the
record is kept against the head while nothing re-arms it, every later pass
repairs rather than re-arms, to ciFixIterations and a handback, on a PR whose
required checks are green.

The PR-head path never read a failure that way: gather drops
ci.ignoreCheckNames and reduces to the base ruleset's required checks first,
so another app's suite is advisory there. It is advisory on the ephemeral
branch too. A workflow_run is always Actions; a check_suite must now say
app.slug === 'github-actions', and anything else is logged and ignored.

Reading the queue branch's own run back before firing was rejected: it costs a
call per event and still races, since that run was in progress when this event
arrived.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXNxbxE4rDVFNUWE1U
resolve passed only `run`, which is null for a check_suite event, and decide
stored that — so after SahajAtlasWeb#489 nothing could say which app's suite
had spent the repair passes. The ticket for it could not name the app either.

queueFail now carries the app slug beside the sha and the suite or run url,
the rendered status line names the app, and the resolve log line names both
beside pr#<n>:queue-failed. targetLabel is the one formatter for that line,
in the file that owns the queue reason, so index.mjs stays generic.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXNxbxE4rDVFNUWE1U
The review pass on the two commits above.

A check_suite carries no html_url, so recording its API url as `run` put an
api.github.com endpoint behind a [run] link in the public status comment and
handed it to a fix-ci session as flags.queueRun — which a routine cannot
reach at all. `run` now stays a page a person can open, null for a suite as
it was before, and the suite's own url is recorded as `suite`.

Also from the pass, all quality: the one-call-site queueFailure helper folds
into the branch that needs it, which reads the app slug once instead of twice
and no longer shares a name with decide.mjs's queueFailure; targetLabel takes
the coalesced shape its only caller passes; the test fixture splits into a
flat queueRun and queueSuite; and the app-less patch case goes, since it
asserted a defensive default rather than anything resolve can produce.

why.md no longer claims the queue path and the PR-head path share a
definition of CI. They do not: gather keeps a required check whoever posts it,
resolve keeps an Actions check whether required or not. It now says the queue
path approximates the required-check reduction by the posting app, because a
check_suite event carries no check names, and names the two assumptions that
make the approximation safe.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXNxbxE4rDVFNUWE1U

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 question for the reviewer, one per thread.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread dispatcher/resolve.mjs Resolved
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
@sydevs-dispatcher

sydevs-dispatcher Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

🤖 no session running

recent dispatches
  • 16:13Z address-review · attempt 1 · session · done
  • 16:13Z address-review · attempt 1 · session
  • 02:15Z address-review · attempt 1 · session · done
  • 02:15Z address-review · attempt 1 · session
  • 02:08Z review-pr · attempt 1 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 26, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

The diff is the size of #321 and no bigger — the narrowing, the record, the log line, a test per direction — and nothing unrelated rides along. The shape question it leaves open is the right one: app.slug names who posted a suite, never what triggered it. My second opinion on that thread is B, not the built option: the workflow_run leg already carries this repo's required check, and the check_suite leg is the only path that can admit a non-CI Actions check run.

Two consequences of the equality test. queueFail.app can hold one value, so criterion 3's "names what failed" buys a constant. And the app that needed naming on #489 is the one the fix now ignores — a core.info line, no record. That is the right call, but it leaves the third-party-required-check assumption why.md names traceable only in a job log. No cross-repo contract is touched.

Findings

  • should-fix — queueFail.app is always github-actions; the field records nothing. dispatcher/decide.mjs:1180
  • should-fix — the run/suite rationale has two homes, against docs/documentation.md. docs/why.md:1735

What was checked

Read whole on the branch: resolve.mjs, record.mjs, decide.mjs's queueFailure/repairPlan/route paths, gather.mjs:342-356 for the PR-head test this approximates, workflow-state.yml's on: block, ci.yml's triggers, docs/documentation.md. Grepped every queueFail/queueRun reader. ## Change outline matches the diff; no path or link the body names is absent from the branch, and this repo publishes no preview. Ladder walked for ACTIONS_APP and the core param. The streamliner covered 3 pieces and kept 2; its one finding — drop the ignored-suite core.info — I dropped, because the new test pins that log and it is the only trace of the failure mode why.md calls unasserted.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread dispatcher/decide.mjs Resolved
Comment thread docs/why.md Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
sydevs-bot and others added 2 commits November 26, 2026 02:18
The reason `run` stays a page and a suite's API url goes under `suite` was
in two homes: this clause and the code comment at `dispatcher/resolve.mjs`.
`docs/documentation.md` gives a fact one home and every other mention a
link, with code above prose, so the comment is the home and the clause goes.

The clause also rested on `flags.queueRun` handing the url to a session,
which no skill reads — `git grep queueRun workflow/` finds nothing. The
comment states the same intent without leaning on that claim.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXPtAcurMDPYg2dnop
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Pushed dd4a039. The critic's two findings are answered.

The question thread stays open and waits on you. The critic's second opinion there is B.

origin/main merged in cleanly, with no conflict. Both suites pass on the merged tree: lib 184, dispatcher 470. No security review — this push touches docs/why.md alone.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
@sydevs-dispatcher
sydevs-dispatcher Bot marked this pull request as ready for review November 26, 2026 02:23
@sydevs-dispatcher
sydevs-dispatcher Bot requested a review from Ardnived November 26, 2026 02:23
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 26, 2026
The reviewer answered B on the question thread: a queue failure resolves
only from a `workflow_run` whose `event` is `merge_group`, and a queue
`check_suite` resolves to nothing at all.

`app.slug === 'github-actions'` named who posted a suite, never what
triggered the run. An Actions suite aggregates every Actions check run on
the sha — the `dispatch / *` ones `ci.ignoreCheckNames` drops on the PR
head included — so a non-required Actions workflow failing on the
ephemeral branch still spent a repair pass. `workflow_run.event` is in the
payload, costs no call, and names the queue's own gate by definition.

Two fields go with the suite leg. `queueFail.app` could hold only
`github-actions` while the test was an equality, and now has no event to
read it from; `suite` held the API url a routine cannot reach, and no suite
reaches this reason any more. The record keeps `run`, which a `merge_group`
run always carries as a page.

This unmeets #321's acceptance criterion 2 as written, which the reviewer
amended by choosing B. Criteria 2 and 3 are updated there with review
lines.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVTTAxuwtwZczheDpn
Relative to `main` the `queueFail` patch assertion never changed — the
`app`/`suite` fields were added and removed inside this branch — so the
comment explaining them describes nothing the diff does.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVTTAxuwtwZczheDpn
@sydevs-bot sydevs-bot changed the title fix(dispatcher): only Actions' own suite fails a queue run fix(dispatcher): only the queue's own merge_group run fails it Nov 26, 2026
@sydevs-dispatcher
sydevs-dispatcher Bot added this pull request to the merge queue Nov 26, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Pushed 666722e. Option B from the question thread is built, and the thread is resolved.

  • The queue path now requires workflow_run.event === 'merge_group'. A queue check_suite resolves to zero targets, with a core.info line naming what it ignored.
  • queueFail.app and queueFail.suite went with the suite leg, so decide.mjs and record.mjs are byte-identical to main again. The net diff is 4 files and 86 added lines.
  • fix(dispatcher): any failed suite on a queue branch reads as queue CI #321's criteria 2 to 4 carry the amendment as review lines: B unmeets criterion 2 as written, and amending it was yours.
  • Title and body refreshed — both described the app-slug test.

Your approval was submitted 7 seconds after the answer, so it predates this build.

origin/main merged in cleanly, no conflict. Gate: validate ✓, lib 194, dispatcher 470, both also from a worktree. The security review ran and reported nothing.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Merged via the queue into main with commit 7e180d3 Nov 26, 2026
22 checks passed
@sydevs-dispatcher
sydevs-dispatcher Bot deleted the claude/fix-321-queue-suite-app branch November 26, 2026 16:25
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Done in SYDevelopers Technical Roadmap Nov 26, 2026
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

fix(dispatcher): any failed suite on a queue branch reads as queue CI

3 participants