Repository navigation
feat(sdv-ship): ci_wait.py runs the self-review before Copilot (0.25.4) - #73
Conversation
Owner rule, 2026-11-26: the self-review rounds run and their fixes are pushed before a Copilot review is requested. Without --self-reviewed, the Copilot fallback (both bots rate-limited on a package PR) now stops with verdict self-review (exit 8) instead of requesting Copilot or asking; rerun with the flag once the rounds ran. A quota refusal already on the head still reports the refusal, not a pointer to Copilot. Data repos, --copilot never and PRs whose bots are not rate-limited are unchanged. 7 new tests; the post-self-review tests pass --self-reviewed via go_sr().
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Sorry @saiemgilani, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 4 days and 18 hours by commenting |
Reviewer's GuideImplementationGate the Copilot fallback on
DocumentationExplain the self-review-first rule, the opt-in flag, and the updated meaning of the
TestsAdd coverage for the no-flag gate and its exceptions, and pass
Other changesFiles not grouped.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…elf-reviewed Round-2 review of #73. Exit 8 meant both 'no bot can review' and 'Copilot is next', and the doc told an agent to rerun without the flag to wait for CI, which hit the gate at once: a self-review loop with no CI verdict. The gate now returns self-review-first (exit 9), and the no-bot exits say to wait for CI with --copilot never. --self-reviewed takes the reviewed SHA (4-40 hex, prefix match), so a later push, such as Copilot's own fixes, can't spend credits on commits nobody self-reviewed; the push test now expects exit 9, not a second request. New tests: never mode and a Copilot review of this head need no flag; a flag on another head and a malformed flag (usage error, exit 6). Every mutation in the matrix fails a test.
There was a problem hiding this comment.
🟡 Changes recommended
A critical race allows a push during credit lookup to trigger Copilot on an unreviewed head, requiring head revalidation before both request paths and a regression test.
1 open issue
What changed in this PR
This PR updates sdv-ship so its Copilot fallback requires a self-reviewed head, reserving Copilot for the final review gate.
Changes:
- Adds
--self-reviewed SHAand exit 9 (self-review-first) when the current head lacks self-review confirmation. - Clarifies exit 8 and documents using
--copilot neverto continue waiting for CI. - Expands regression coverage and bumps the plugin to version 0.25.4.
| File | Description |
|---|---|
sdv-toolkit/tools/test_ci_wait.py |
Adds self-review gate tests and updates existing fallback cases. |
sdv-toolkit/skills/sdv-ship/SKILL.md |
Documents review ordering, the SHA flag, and verdict handling. |
sdv-toolkit/skills/sdv-ship/scripts/ci_wait.py |
Implements the self-review gate and revised action messages. |
sdv-toolkit/.claude-plugin/plugin.json |
Bumps the plugin version to 0.25.4. |
Review effort: Balanced
Copilot review of #73: the self-review gate checked the poll's snapshot, so a push during the user/credit lookups could get the new, unreviewed head a Copilot request. The head is re-read just before the request; if it moved, the poll restarts (the head-move check resets the rule, and the gate then wants a new --self-reviewed SHA). requested_reviewers takes no SHA, so a ms-wide window remains between the re-read and the POST (ponytail comment). Regression test for a push during the checks; four fixtures gain the extra pulls/7 read.
…breaking change Round-2 review of #74: '--copilot auto --self-reviewed <old head>' (the line #73 documented) fell through to the Copilot request after a push. A stale flag now returns self-review-first under any --copilot mode; regression test added. Restored the guidance not to rerun --copilot auto after fixing Copilot's own threads (wait with --copilot never), on the explicit path and in the bots-unaddressed row. Fixed a stale --self-reviewed comment. A breaking change bumps the minor version in this repo (b679baf, b91c604): 0.26.0, not 0.25.5.
… (0.26.0) (#74) * feat(sdv-ship)!: two self-review rounds replace Copilot in ci_wait.py (0.25.5) Owner rule restated 2026-11-26: after two self-review rounds, Copilot is not requested at all. #73 encoded the earlier draft (self-review, then Copilot as the last gate). Now --self-reviewed <head SHA> satisfies the rate-limited-bots fallback: no Copilot request, no ask, no credit read; the script waits for CI. --copilot defaults to unset, so by default the fallback returns self-review-first (exit 9); the Copilot request path runs only with an explicit --copilot auto|ask, for a PR that gets no self-review. The #73 head re-read is removed: it guarded a path that no longer requests Copilot. sdv-ship documents the two rounds and limits re-requesting Copilot to PRs where it was the chosen reviewer. BREAKING CHANGE: ci_wait.py no longer requests Copilot by default; pass --copilot auto explicitly for the old fallback. * fix(sdv-ship): any --self-reviewed rules Copilot out; 0.26.0 for the breaking change Round-2 review of #74: '--copilot auto --self-reviewed <old head>' (the line #73 documented) fell through to the Copilot request after a push. A stale flag now returns self-review-first under any --copilot mode; regression test added. Restored the guidance not to rerun --copilot auto after fixing Copilot's own threads (wait with --copilot never), on the explicit path and in the bots-unaddressed row. Fixed a stale --self-reviewed comment. A breaking change bumps the minor version in this repo (b679baf, b91c604): 0.26.0, not 0.25.5.

What
Owner rule, 2026-11-26: the self-review comes before Copilot. Run the self-review rounds and push their fixes, then request Copilot on the self-reviewed head as the last gate.
ci_wait.py's Copilot fallback (CodeRabbit and Sourcery both rate-limited for more than 5 minutes on a package PR) now depends on a new flag:--self-reviewed <SHA>: the head that was self-reviewed. It accepts 4–40 hex characters and matches the head by prefix. Copilot may be requested only while that SHA is still the head. After that, the existing credit-floor, allowed-actor and ask-or-request logic runs unchanged.self-review-first, exit 9: returned while the flag is missing or names another head. In that case the script doesn't request Copilot, ask the user, or read Copilot's credits. A push after the self-review, including Copilot's own fix commits, therefore needs a new self-review before Copilot is requested again.self-review) keeps one meaning: no bot can review. Its note now says how to wait for CI: rerun with--copilot never. Without that, the first draft could loop between self-reviewing and rerunning and never reach a CI verdict.-raw/-datarepos,--copilot never, a head Copilot has already reviewed, and PRs whose bots aren't both rate-limited.sdv-ship/SKILL.mdgets the rule, the reworded fallback section, the flag in the Phase 6 usage line, and verdict rows for 8 and 9. Version 0.25.3 → 0.25.4.Why
On #72, Copilot ran after two self-review rounds and CodeRabbit, and it still found 3 issues none of them had. Copilot credits are finite, so spending them on an already-cleaned diff gets the most from each review.
Review
Round 1 was my own review before pushing:
Round 2 was an independent adversarial review:
--copilot neverhint.Reports are in ClaudeCowork
notes/2026-11-26-pr-self-review/github-73_r{1,2}.md.Tests
There are 71 unit tests (60 before). The mutation matrix runs each mutation on a scratch copy, and every one fails at least one test:
--copilot neverhint droppedThe existing tests of post-self-review behaviour run with
--self-reviewed <head>throughgo_sr(). One assertion changed on purpose: a push mid-wait now expects exit 9 rather than a second Copilot request.release.py checkpasses: catalog, render, tools tests and hooks tests.Not in this PR
On main,
--shamode raises aKeyErroronbots["Copilot"]at its first poll (exit 6). That's a separate fix.The dotfiles mirror follows after this merges.