Repository navigation
fix(dispatcher): only FORBIDDEN is a refusal by type; clean status and auto-merge-off by their words - #222
Conversation
…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
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
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The code change is four lines, the right size for the problem. UNPROCESSABLE really does carry both a refusal and a wrong node id, so narrowing the type test is the only way to keep a bug loud, and the two words beside it close the hole it opens. The pair belongs in one PR.
One thing undercuts it. e?.status === 422 is still in the same expression, and 422 is REST saying the same thing. Invalid input is loud on one path, silent on the other, and the new why.md paragraph asserts a rule its own neighbour breaks.
No measured refusal is lost. handOver wraps three GraphQL mutations, and the one recorded refusal among them — markPullRequestReadyForReview on SahajCloud#744 — came as FORBIDDEN, which still matches by type. Auto-merge-off has no recorded incident, but the narrowing is what exposes it.
Findings
should-fix— a REST 422 is the same invalid input, still handed over silently (dispatcher/apply.mjs:99).consider— the #340 story is now told twice indocs/why.md(docs/why.md:1120).
What was checked
dispatcher/apply.mjswhole: all threehandOverGraphQL mutations (transferIssue,markPullRequestReadyForReview,enablePullRequestAutoMerge) and its REST writes, for refusals the narrowed type test drops.dispatcher/decide.mjs:535-555—markReadyis planned only underpr.draft, so an already-readyUNPROCESSABLEis a gather/apply race, not a path this opens. Not filed.dispatcher/projects.mjs— board writes raiseBoardUnreachable, never reachhandOver, so Status is untouched.docs/why.md1085-1135 — the anchors this diff touches or cites.- Validation, from a worktree:
node --test dispatcher/test/*.test.mjs workflow/lib/*.test.mjs→ 446/446, as the body claims. - No
## Previewto open: this repo deploys by merge. - Reviewer profile read.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
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
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
|
Both findings from the adversarial review are built.
Security review ran — Lean gate green. Body refreshed for the 422 line and the test count. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Failure prevented: #218 made
handOvertreat any GraphQLUNPROCESSABLEas GitHub refusing a write, and hand the step to a person. ButUNPROCESSABLEis also GitHub's answer to invalid input, such as a wrong node id or a bad enum. Those are dispatcher bugs, and today they are quietly handed over as "cannot …" instead of failing the job. This PR keeps bugs loud.What changes:
handOvercounts onlyFORBIDDENas a refusal by type.e?.status === 422goes with it. 422 is the REST spelling of the same invalid input, so aHold Untilfield id that does not exist, or anassignment.reviewernobody can request a review from, throws instead of posting "cannot …" to a person who cannot fix it.UNPROCESSABLEare recognised by GitHub's words, like every other refusal:docs/why.md: the hand-over anchor carries the rule — onlyFORBIDDENby type, every other refusal by its words — for both transports, and the stacked-PR section points to it, telling SahajAtlasWeb#340 once.Provenance: the first two commits are the two from #219 still worth having (originally ed03d9b and b7bdd82, by the run that answered #218's review), cherry-picked onto
main. #219 was closed because #221 superseded its other three commits. One of those would have run conflict and CI repair on stacked PRs, contrary to "nothing runs on a stacked PR". The last two answer this PR's own adversarial review.Validation:
node --test dispatcher/test/*.test.mjs workflow/lib/*.test.mjspasses 447/447. The assertions inlifecycle.test.mjscover a clean-status refusal handed over, auto-merge-off handed over, an unmatchedFORBIDDENhanded over, a wrong node id thrown, a REST 403 handed over, and a REST 422 thrown. The REST test fails without theapply.mjschange. No skill or config change, so the plugin version is unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjX5JEB4FeoyxC34V5k