Repository navigation
fix(dispatcher): a conflict merge keeps an approval; a bot commit buries one - #290
Conversation
…ies one The rulesets' dismiss_stale_reviews_on_push (on since 2026-11-17) dismissed every approval on each conflict resolution: the merge moves the merge base, and GitHub has no setting that spares a merge of the base. It is off again in all five rulesets as of 2026-11-20, so the dispatcher now withdraws only what warrants it. buriedApprovals reads the PR's commits after each standing approval. A commit of the bot's own (fix-ci, address-review, a relay) buries it. A merge of the base (two parents, the second off the PR) does not. The approver's own commit on top vouches again. Unread fails closed. - A person's buried approval is dismissed (dismissStale) on every pass, ahead of the lock guard, so the queue cannot merge it once CI goes green. - proxyPlan keeps the bot's approval on the owner's PR across a merge of the base, instead of dismissing it and asking for `approve`. - gather reads the PR's commits only when an approval sits below the head. Co-Authored-By: Claude Opus 5.5 <[email protected]>
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The shape is right, and the two halves cannot ship apart: turning the ruleset setting off is what opens the second hole, so proxyPlan alone would leave the queue merging code nobody approved. GitHub has no "dismiss on push, except a merge of the base", and disarmAutoMerge does not substitute, because armAutoMerge re-arms on the next pass unless it reads the same helper. So own code is forced, at 90 lines.
should-fix
docs/why.md:2334— the middle paragraphs restate the two doc comments and the new tests.dispatcher/apply.mjs:299— thedismissStalecase isdismissProxy's body again.
consider
dispatcher/decide.mjs:540— ten pieces of approval accounting in one 82KB file.dispatcher/decide.mjs:561—buriedApprovalsis exported with no importer.dispatcher/decide.mjs:536— the dismissal requests no reviewer, wherecontractSyncPlandoes.
What was checked. Read: decide.mjs, apply.mjs and gather.mjs on the branch, plus status.mjs, relay.mjs, documentation.md and the resolve-conflicts skill. Traced both scenarios: an owner's conflict merge plans nothing, a fix over a person's approval plans dismissStale. The relay claim holds — applyRelay fast-forwards, and its repos.merge fallback commits under the bot's PAT, so that second parent is on the PR. resolve-conflicts forbids rebase, so an approval's commit never leaves the PR on a resolution. Gather's fetch condition cannot be false while a standing approval sits below the head, so "unread fails closed" cannot fire a false dismissal. dismissStale is in MOVES, ahead of evaluateOpenPr's lock guard. The other dismiss_stale_reviews_on_push mention is updated; no skill prose went stale.
One assumption nothing pins: the index walk needs pulls.listCommits oldest-first, and the fixtures cannot show it.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
…on-conflict-merge
`dismissStale` was `dismissProxy`'s body with the message changed. Two bodies that dismiss the same way drift apart on the next change to either. One case now carries both, picking its message from `a.type`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVNCfuWhXrreDirTJ4
No module imported it: `status.mjs` does not read it, and the tests reach it through `evaluatePr`. Its sibling `standingApprovals` is private, which is the right shape. An export with no importer invites one from outside the plan. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVNCfuWhXrreDirTJ4
The two middle paragraphs restated `buriedApprovals`'s and `stalePlan`'s doc comments sentence for sentence, and the conditions the new tests hold. documentation.md gives each fact one home and forbids paraphrasing a symbol's logic, so a condition added to the code left the prose stale with no gate to catch it. What stays is what the code cannot show: the ruleset history, that a conflict merge asks nothing, that a person's commit neither buries nor vouches, and why unread fails closed. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVNCfuWhXrreDirTJ4
Found while dropping `buriedApprovals`'s export, one screen away and the same defect: nothing imports `vouched` either. `proxyVerdict` is its only caller, and the tests reach it through `evaluatePr` and the status derivation. (joined per the join rule) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVNCfuWhXrreDirTJ4
|
Every critic thread is answered and resolved. Merged Adopted
Rebutted
Its own ticket
Security review ran: no findings. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
sydevs-bot
left a comment
There was a problem hiding this comment.
Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is
Failure this prevents
On 2026-11-17 the five rulesets turned on
dismiss_stale_reviews_on_push. After that, every conflict resolution dismissed every approval: the merge moves the merge base and changes the diff, and GitHub has no setting that spares a merge of the base. Each approved PR went back to its reviewer for a resolution that, perdocs/why.md#a-resolved-conflict-is-not-a-new-question, asks nothing.The setting is off again in all five rulesets as of 2026-11-20 (done by hand; no other ruleset field changed). That alone left two problems:
proxyPlanstill dismissed the bot's approval and asked for@sydevs-bot approve, because aresolve-conflictsmerge commit is the bot's own.What changes
buriedApprovalsreads the PR's commits after each reviewer's standing approval:dismissStale: a person's buried approval is dismissed on every pass, ahead of the lock guard, like the disarm. Otherwise the queue would merge the moment CI goes green.proxyPlan: on your own PR, a merge of the base keeps the bot's approval. Nobody is asked to approve again.gather: onepulls.listCommitscall, made only when an approval sits below the head.docs/why.md: new section#a-bot-commit-buries-an-approval-a-conflict-merge-does-not, namingburiedApprovalsrather than retelling its conditions. Two passages that assumed the setting was on are updated.vouchedwas exported with no importer, a screen belowburiedApprovalsand the same defect. Both exports are gone.Unchanged: the contract check still withdraws its own approval, and an Actions app's approval is never touched by
dismissStale.Tests
node --test dispatcher/test/*.test.mjs: 398 pass. 8 new tests cover: a merge carried on the owner's PR; a fix under the merge; a relay merge; a person's approval carried; a person's approval dismissed, also under a lock; the unread cases; and approvals that are left alone.node --test workflow/lib/*.test.mjs: 147 pass.workflow/changed, so the plugin version stays the same.⚠ Unverified until the first live dismissal
dismissStaleis the first time sydevs-bot dismisses someone else's review. It haswritein all five repos, and no ruleset restricts who may dismiss, so GitHub should allow it. If GitHub refuses,handOverreports the refusal instead of dropping it. The first bot push after a person's approval is the supervised check.Notes for reviewer
requestReviewer'salreadyguard makes it a no-op).decide.mjsintodispatcher/approvals.mjs. It is a pure refactor and deliberately not in this PR — ten moved functions plus an import-cycle decision would make this diff unreviewable.mainis merged into the branch (clean), so the gate tested the merged result.🤖 Generated with Claude Code