Repository navigation
fix(dispatcher): ask a member's PR reviewer after the critic - #261
Conversation
…ide it A ready member PR planned [requestReviewer, fire review-pr], and the pull_request.ready_for_review event requested the reviewer on its own, so the human was pinged the moment the critic started and read a PR that address-review was about to change. A member's ready PR now gets only the critic first. The reviewer request moves to the same point a bot draft reaches markReady: evaluatePr only gets there with CI green and any critic thread routed to address-review first, and then the critic has run or the PR is under review.skipWhen. The ready_for_review event requests a reviewer only on a bot PR. The request is already idempotent in apply (it skips a reviewer already requested or who reviewed), so later passes and a moved head do not re-ask. Co-Authored-By: Claude Opus 5.5 <[email protected]>
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Two lines of behaviour, four files, one change: the diff is no bigger than the problem and smuggles nothing in. Every gate the body leans on is pre-existing and holds — evaluatePr reaches evaluateGreenPr only on green CI, needsAddressReview routes an unanswered critic thread first, and apply.mjs skips a reviewer already requested or reviewed, so the repeated green passes do not re-ask. No new file, function, constant or dependency, so the ladder has nothing to walk. The one question is the far end: the reviewer request is now downstream of the critic, and nothing downstream of a hand-back puts it back.
Findings
consider—dispatcher/decide.mjs:571: a critic that never posts leaves nobody asked to review, and the body's stated mitigation does not cover that.consider—README.md:134: drops thereview.skipWhenexception that the code anddocs/why.mdboth keep.
What was checked
Read whole: decide.mjs (evaluatePr, evaluateGreenPr, route, quietSweep, needsAddressReview, ownReview, criticReviewTimes, fullTreatment), status.mjs, and apply.mjs's requestReviewer and timeout cases. Traced the member path: ready → CI green → fire review-pr → critic unlocks → address-review → requestReviewer on the next unlock pass, which is not quiet-swept. ownReview also matches the critic's fallback issue comment, so a fallback review does not re-fire the critic forever. Status is unaffected: doFire mutates snapshot.item.labels, so deriveStatus reads working, not awaiting — review. node --test dispatcher/test/*.test.mjs workflow/lib/*.test.mjs from a detached worktree at f188383: 480 pass, 0 fail, as claimed. The diff adds two lines to a 1239-line file, so there is no materially grown file to re-read whole.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The README said a member's reviewer is asked once the critic has run and its threads are answered. A member PR under `review.skipWhen` fires no critic: `evaluateGreenPr` falls straight through to `requestReviewer` on the first green pass. `docs/why.md` kept that exception in parentheses; the README, which is where a member reads when they will be pinged, dropped it. Addresses the critic's README.md:134 thread on #261. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjY39GkLbGT6tWfWUYK
|
Both critic threads addressed. No
Gate: 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
* feat(dispatcher): note a skipped critic on a small member PR A bot draft under review.skipWhen gets a comment saying the critic was skipped and how to force one. Since #261 a member's ready PR follows the same gates, but a small one went straight to the reviewer request with no note, so the reviewer could not tell "the critic found nothing" from "the critic never ran". The member path runs on every pass of a ready PR, and a member keeps pushing to it, so the note is keyed once per PR rather than per head, and planned only while no reviewer is requested: commentOnce lists the PR's comments each time it is planned, and a quiet pass should not pay that. The message is shared with the bot-draft path through one helper. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(dispatcher): drop the requestedReviewers guard on the critic note The guard hid the note in the one case it exists for. A member who requests a reviewer when they open a small PR arrives with `requestedReviewers` already filled, so the note was never planned — and apply's `requestReviewer` breaks early on the same field, so nothing at all told the reviewer the critic had been skipped or how to force one. The saving it bought also expires: GitHub clears `requested_reviewers` when that reviewer submits, so from the first review the note is planned on every pass regardless. `commentOnce` already carries the once-per-PR promise the `critic-skipped` key encodes, so the guard was paying for nothing. Raised by the adversarial review on #264. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWmZP6U3jkGnrX7qaQ --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Failure this prevents
A member's ready PR was planned as
[requestReviewer, fire review-pr], and thepull_request.ready_for_reviewevent also requested the reviewer unconditionally. The human reviewer was pinged at the same moment the critic started, and reviewed a PR thataddress-reviewwas about to change. The owner wants the automated pass (CI, critic,address-review) complete before a human is asked.Change (dispatcher only, no skill edits)
evaluateGreenPr: a member's ready PR with no critic review and overreview.skipWhenplans[fire review-pr]only. Once the critic has run, or the PR is underskipWhen, the plan isrequestReviewerthenarmAutoMerge, as before.pull_request.ready_for_review: requests the reviewer only for a bot PR. A member's goes throughevaluatePr.markReady:evaluatePrreachesevaluateGreenPronly with CI green, and routes any unanswered critic thread toaddress-reviewfirst. So the request waits for CI, the critic and its threads.requestReviewerinapply.mjsalready skips a reviewer who was requested or has reviewed, so later passes and a moved head do not re-ask.docs/why.md#a-members-pr-gets-the-loopsay the reviewer is asked after the critic, and that a PR underreview.skipWhenhas no critic to wait for.Tests
node --test dispatcher/test/*.test.mjs workflow/lib/*.test.mjs: 480 pass, 0 fail.claude plugin validate ./workflow --strictpasses. New cases cover: critic first with no reviewer; no reviewer while a critic thread is open or CI runs; small PR still asks at once;ready_for_reviewfor member vs bot.For the owner to check
ownReviewis still empty. If it never finishes, the timeout hand-back (apply.mjs:361) commentsattempts-exhaustedto the author and the PR sits Awaiting with that reason — nobody else is asked. This PR adds no guard for that, and no existing one covers it. Say if an exhausted critic should hand the PR to a human instead.🤖 Generated with Claude Code