Repository navigation
fix(dispatcher): only FORBIDDEN is a refusal by type - #219
sydevs-bot wants to merge 6 commits into
Conversation
…owed #218 made `mayArm` false for a PR based on another branch, but left the Status derivation with arms for only the other two reasons. An approved stacked PR fell through to `approved — auto-merge is owed` with a due, so the reconciler checked it three times and then handed it back as overdue. The crash was fixed; the item still landed on a desk under a wrong reason. The predicate is now `stacked`, exported from decide.mjs and read by both `evaluateGreenPr` and `prStatus`, which derives Awaiting — merging it into its parent is the reviewer's. A conflict or red CI still comes first, since both are the machinery's to repair on a stacked PR too. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXjPgRiz8KDn92pQ7B
…by words #218 put UNPROCESSABLE in the GraphQL type test. That type is GitHub saying the input was invalid, which also covers a wrong node id or a bad enum — a bug in our own mutation. Under the wide test any such bug would be handed over quietly, and a loud job is how we find one. So the type test keeps FORBIDDEN alone, a permission we do not hold, and the refusal actually seen on SahajAtlasWeb#340 is matched by its words: `in clean status` joins the message regex. The GraphQL error carries no HTTP status either way, so both halves are tested through `apply`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXjPgRiz8KDn92pQ7B
#218 told the GraphQL hand-over story in the last three lines of `#a-stacked-pr-is-never-armed`. A reader meets that surprise under `#a-write-we-cannot-make-is-handed-over-not-thrown`, directly below, which is where the rest of it already lives. Moved, and rewritten to the narrowed test: FORBIDDEN by type, the clean-status refusal by its words. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXjPgRiz8KDn92pQ7B
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
This is #218's three asks and nothing else: one commit each, a test each, and the prose moved rather than rewritten. Exporting stacked so evaluateGreenPr and prStatus read one definition is the right shape — the bug was two readers of one rule.
Two things to settle. The new prStatus arm sits above the producer-wait arm, so an approved stacked PR in a cross-repo set reads as yours to merge now. And narrowing handOver's type test is correct about bugs, but leaves one message regex carrying every other GraphQL refusal — and a repo with auto-merge off is not in it.
No contract surface is touched, and no skill, hook or loop-config.json change, so the body is right that no version bump is owed.
Findings
should-fix— the stacked arm preempts the producer wait:dispatcher/status.mjs:105should-fix— a repo with auto-merge off throws instead of handing over:dispatcher/apply.mjs:99
What was checked
- Read whole:
status.mjs,decide.mjs(stacked,evaluateGreenPr,MOVES),apply.mjshandOverand its five call sites, both new tests, and bothdocs/why.mdsections. gather.mjs:309buildsbasefrom one fullpulls.get, so thedefaultBranchfail-open is unreachable for both readers — checked, not taken on the body's word.- #218's three threads, each against the commit claiming it.
claude plugin validate ./workflow --strictandnode --test workflow/lib/*.test.mjs— 97 pass.node --test dispatcher/test/*.test.mjs— 335 pass, as claimed.- No
## Previewlink, and none owed here.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
prStatus derived the stacked arm above the linkedBlockedOpen arm, so an approved stacked PR in a cross-repo set read `merging it into <base> is yours` while its producer was still open. The producer wait left the board, and the reviewer was told to merge first. Both arms are non-due, so the order is the whole fix: the wait holds until the producer closes, and the next pass derives the stacked Awaiting. Answers #219 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjY7RW2WNvcYA2dV7DF
Narrowing the type test to FORBIDDEN left one message regex as the only net for every other GraphQL refusal, and a repository with auto-merge switched off is not in it: `UNPROCESSABLE`, "Pull request Auto merge is not allowed for this repository". That threw, and the pass died before syncStatus — on a repo setting, not a bug. Adds `not allowed for this repository` to the words, with a test through `apply`, and says in why.md that every refusal the narrowed type test drops is owed its wording there. Answers #219 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjY7RW2WNvcYA2dV7DF
|
Both review findings adopted, one commit each, pushed as b7bdd82.
Nothing rebutted, nothing asked. The branch was already level with 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
#221 answered this PR's stacked finding more completely than this PR did, so the stacked half is dropped and main's kept. Only the handOver narrowing remains. - decide.mjs, status.mjs: main's `stackedPr`. It is byte-identical to this PR's `stacked`, and #221 stops a stacked PR in `evaluatePr` and reads it Awaiting at the top of `prStatus`, above the producer wait. This PR's arm sat at the bottom, for an approved PR only, so it is now unreachable. - status.test.mjs: the arm's test goes with it. Its other two assertions — that a conflict or red CI on a stacked PR is still the machinery's, and that a producer wait outranks it — are false under #221, which runs nothing on a stacked PR at all. relay.test.mjs covers the new arm. - why.md: main's "A stacked PR is never armed" section, with its closing sentence pointed at the hand-over anchor. `handOver` no longer reads `UNPROCESSABLE` as a refusal, so that sentence was stale as merged. - apply.mjs and its lifecycle.test.mjs merged clean and are untouched. Gate: claude plugin validate --strict ✓, workflow/lib 97 ✓, dispatcher/test 349 ✓. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVvHDgjginfrKPtg2X
|
Merged #221 answered this PR's stacked finding while it sat here, and answered it wider: a stacked PR now That test also asserted a conflict or red CI on a stacked PR is still the machinery's, and that a The hunk not taken whole: What is left of this PR is the 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
…d auto-merge-off by their words (#222) * fix(dispatcher): only FORBIDDEN is a refusal by type; a clean status by words #218 put UNPROCESSABLE in the GraphQL type test. That type is GitHub saying the input was invalid, which also covers a wrong node id or a bad enum — a bug in our own mutation. Under the wide test any such bug would be handed over quietly, and a loud job is how we find one. So the type test keeps FORBIDDEN alone, a permission we do not hold, and the refusal actually seen on SahajAtlasWeb#340 is matched by its words: `in clean status` joins the message regex. The GraphQL error carries no HTTP status either way, so both halves are tested through `apply`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXjPgRiz8KDn92pQ7B * fix(dispatcher): auto-merge off is a refusal, not a bug Narrowing the type test to FORBIDDEN left one message regex as the only net for every other GraphQL refusal, and a repository with auto-merge switched off is not in it: `UNPROCESSABLE`, "Pull request Auto merge is not allowed for this repository". That threw, and the pass died before syncStatus — on a repo setting, not a bug. Adds `not allowed for this repository` to the words, with a test through `apply`, and says in why.md that every refusal the narrowed type test drops is owed its wording there. Answers #219 (comment) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjY7RW2WNvcYA2dV7DF * docs(loop): the hand-over rule, told once The new paragraph retold SahajAtlasWeb#340 — the clean-status refusal and the missing HTTP status — four lines below the stacked-PR section that already tells it, and that now links here. One incident told twice leaves the next reader reconciling two accounts of it. What is left is the rule: only FORBIDDEN by type, every other refusal by GitHub's words, and invalid input still throws. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjX5JEB4FeoyxC34V5k * fix(dispatcher): a REST 422 is invalid input, not a refusal 422 is the REST spelling of the GraphQL UNPROCESSABLE this PR just stopped trusting, and it sat in the same expression. Invalid input was loud on one transport and silent on the other, so the rule the why.md paragraph states was broken by its own neighbour. Both REST writes under handOver answer 422 only to a bug: `set Hold Until` with a field id that does not exist, and `request a reviewer` with a login nobody can request a review from — an `assignment.reviewer` typo. Each was posted as "cannot …" and handed to a person who cannot fix it. A permission on either path answers 403, which still hands over, and a branch rule's 422 is still caught by its words. The bare 422 was never a measured refusal: it arrived with 403 and 405 when handOver was introduced (d041272), wrapping no merge call. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjX5JEB4FeoyxC34V5k --------- Co-authored-by: sydevs-bot <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: sydevs-bot <[email protected]>
Summary
handOverfinding of fix(dispatcher): never arm a stacked PR, and hand over a GraphQL refusal #218's adversarial review — fix(dispatcher): never arm a stacked PR, and hand over a GraphQL refusal #218 merged before that run could reply.mainon9014ec8drops this PR's version of it. See What the merge dropped below.Change outline
Behaviour — what
handOverreads as a refusalUNPROCESSABLEis GitHub calling the input invalid, which a wrong node id or a bad enum alsoanswers. Under #218's test any such bug was handed over quietly. Narrowing the type test leaves the
message regex as the whole net for every other GraphQL refusal, so each one is listed by its words.
docs/why.mdcarries the story under the hand-over anchor, where it belongs, and the stackedsection's closing sentence now points there instead of restating a rule that changed.
What the merge dropped
#221 made the loop refuse stacked PRs outright:
evaluatePrstops one with a single comment andruns nothing on it, and
prStatusreads it Awaiting at the top, above the producer wait. ThisPR's arm sat at the bottom, for an approved PR only, so it became unreachable. Its predicate
stackedis byte-identical to #221'sstackedPr.So the merge takes
mainwhole for that half: the arm, the export, and its test instatus.test.mjsare removed. That test's other two assertions — that a conflict or red CI on astacked PR is still the machinery's to repair, and that a producer wait outranks the stacked
Awaiting — are false under #221, which repairs nothing on a stacked PR at all.
relay.test.mjscovers the behaviour that replaced it.Test results
claude plugin validate ./workflow --strict, thennode --test workflow/lib/*.test.mjs— 97 passednode --test dispatcher/test/*.test.mjs— 349 passedManual verification
Notes for reviewer
FORBIDDEN. why.mdsays every refusal the narrowed type test drops is owed its wording there, so the list is
maintained rather than guessed.
loop-config.jsonchange in this PR's own diff, so no pluginversionbump isowed by it. feat(loop): a relay instead of patch comments, and no stacked PRs #221's bump comes in with the merge.
dispatcher/): no findings. It traced all fivehandOvercall sites and every payload they carry.
Detail
The run that built this PR's commits held the lock on #218 and was answering its review when #218
was merged to
mainasf5d1365. Those commits were written againstbf9bf05, then re-appliedonto
origin/main.Both halves of the
handOverchange are tested throughapplyinlifecycle.test.mjs, since theGraphQL error carries no HTTP status and the closure is not exported: a clean-status refusal is
handed over, auto-merge-off is handed over, a
FORBIDDENtype with an unmatched message is handedover, and a wrong node id throws.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjVvHDgjginfrKPtg2X