Skip to content

fix(dispatcher): ask a member's PR reviewer after the critic - #261

Merged
Ardnived merged 2 commits into
mainfrom
claude/dispatcher-reviewer-after-critic
Nov 16, 2026
Merged

Ardnived merged 2 commits into
mainfrom
claude/dispatcher-reviewer-after-critic

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Failure this prevents

A member's ready PR was planned as [requestReviewer, fire review-pr], and the pull_request.ready_for_review event also requested the reviewer unconditionally. The human reviewer was pinged at the same moment the critic started, and reviewed a PR that address-review was 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 over review.skipWhen plans [fire review-pr] only. Once the critic has run, or the PR is under skipWhen, the plan is requestReviewer then armAutoMerge, as before.
  • pull_request.ready_for_review: requests the reviewer only for a bot PR. A member's goes through evaluatePr.
  • Gates, mirroring a bot draft's markReady: evaluatePr reaches evaluateGreenPr only with CI green, and routes any unanswered critic thread to address-review first. So the request waits for CI, the critic and its threads. requestReviewer in apply.mjs already skips a reviewer who was requested or has reviewed, so later passes and a moved head do not re-ask.
  • README and docs/why.md#a-members-pr-gets-the-loop say the reviewer is asked after the critic, and that a PR under review.skipWhen has no critic to wait for.

Tests

node --test dispatcher/test/*.test.mjs workflow/lib/*.test.mjs: 480 pass, 0 fail. claude plugin validate ./workflow --strict passes. 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_review for member vs bot.

For the owner to check

  • A critic session that never posts leaves a member PR without a reviewer request, exactly as a bot draft stays unready. Each later green pass re-fires it, because ownReview is still empty. If it never finishes, the timeout hand-back (apply.mjs:361) comments attempts-exhausted to 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.
  • Merging this changes dispatcher behaviour in all five repos on the next event.

🤖 Generated with Claude Code

…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 sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 16, 2026
@sydevs-bot

sydevs-bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 22:52Z address-review · attempt 1 · session · done
  • 22:52Z address-review · attempt 1 · session
  • 22:45Z review-pr · attempt 1 · session · done
  • 22:45Z review-pr · attempt 1 · session

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

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧐 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 the review.skipWhen exception that the code and docs/why.md both 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

Comment thread dispatcher/decide.mjs Resolved
Comment thread README.md Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 16, 2026
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
@sydevs-bot

Copy link
Copy Markdown
Contributor

Both critic threads addressed. No dispatcher/ code changed.

  • README.md:134 — adopted in 1db9c7c. The README now names the review.skipWhen exception: a small member PR skips the critic and is asked at once.
  • decide.mjs:571 — adopted in the body. The For the owner to check bullet now states what an unfinished critic leaves: later green passes re-fire it while ownReview is empty, and an exhausted one comments attempts-exhausted to the author and leaves the PR Awaiting, nobody else asked. No guard added. The bullet asks whether you want one.

Gate: claude plugin validate ./workflow --strict passes, node --test dispatcher/test/*.test.mjs workflow/lib/*.test.mjs 480 pass, 0 fail. The branch was level with main, so no base merge. Security review skipped: this push touches README.md only. Docs checked, nothing stale.

🤖 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 16, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 16, 2026
@Ardnived
Ardnived merged commit dc0d2b6 into main Nov 16, 2026
34 of 36 checks passed
@Ardnived
Ardnived deleted the claude/dispatcher-reviewer-after-critic branch November 16, 2026 23:00
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 16, 2026
Ardnived added a commit that referenced this pull request Nov 17, 2026
* 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]>
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.

3 participants