Skip to content

feat(sdv-ship)!: two self-review rounds replace Copilot in ci_wait.py (0.26.0) - #74

Merged
saiemgilani merged 2 commits into
mainfrom
feat/ci-wait-self-review-replaces-copilot
Nov 26, 2026
Merged

saiemgilani merged 2 commits into
mainfrom
feat/ci-wait-self-review-replaces-copilot

Conversation

@saiemgilani

@saiemgilani saiemgilani commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

What

Owner rule, restated 2026-11-26: after two self-review rounds, Copilot is not requested at all. #73 encoded an earlier draft of the rule, "self-review, then Copilot as the last gate", which this replaces.

When CodeRabbit and Sourcery are both rate-limited on a package PR, ci_wait.py now does one of three things:

Invocation Behaviour
default (no --self-reviewed) verdict self-review-first, exit 9: run the two rounds, push, rerun with --self-reviewed <head SHA>
--self-reviewed <SHA> naming the head no Copilot request, no ask, no credit read; it waits for CI. A later push needs a new SHA; until then, a stale flag returns exit 9 under any --copilot mode, so a PR with the rounds never gets Copilot.
--copilot auto|ask, passed explicitly the pre-#73 Copilot fallback (allowed actor, credits floor, ask). Only for a PR that gets no self-review.

The other changes:

  • --copilot defaults to unset instead of auto.
  • feat(sdv-ship): ci_wait.py runs the self-review before Copilot (0.25.4) #73's head re-read is removed. It kept Copilot off unreviewed commits on the self-review path, and that path no longer requests Copilot.
  • sdv-ship/SKILL.md:
    • the fallback section now describes the two rounds;
    • Copilot is explicit-only;
    • gh pr edit --remove-reviewer @copilot withdraws a mistaken request (REST DELETE returns 422 for the bot);
    • Phase 5 step 8 re-requests Copilot only on a PR where it was the chosen reviewer;
    • after fixing Copilot's own threads, wait for CI with --copilot never, not --copilot auto (in the fallback section and the bots-unaddressed row);
    • the verdict rows for 8, 9 and 4 are updated.

Version 0.25.4 → 0.26.0 (a minor bump, as this repo does for a breaking change). BREAKING: ci_wait.py no longer requests Copilot by default.

Tests

73 unit tests:

  • SelfReviewFirst:
    • the flag on the head never requests Copilot;
    • the flag wins over an explicit auto or ask, and a stale flag still rules Copilot out under --copilot auto;
    • a push after the self-review needs a new one, and the "no Copilot" line prints once per head;
    • a flag naming another head, a malformed flag, never mode, a head Copilot already reviewed, and a data repo;
    • the 5-minute limit.
  • The Copilot-path tests (CopilotRule, CopilotCredits, re-arm after a push) run with an explicit --copilot auto through go_cp(). Their pre-feat(sdv-ship): ci_wait.py runs the self-review before Copilot (0.25.4) #73 assertions are restored.

Mutation matrix, each on a scratch copy; every mutation fails at least one test:

Mutation Tests failed
no-Copilot branch removed 3
flag not tied to the head 2
default requests Copilot 5
--copilot defaults to auto 5
once-per-head flag dropped 1

release.py check passes.

Review

Two self-review rounds, and no Copilot request under the rule this PR encodes. Reports are in ClaudeCowork notes/2026-11-26-pr-self-review/github-74_r{1,2}.md.

  • Round 1: the stale Phase 5 re-request step; two mutations that wrongly showed as surviving.
  • Round 2 (independent): major: --copilot auto --self-reviewed <old head> requested Copilot after a push. Minors: the dropped "don't re-request after Copilot's fixes" guidance, a stale comment, and a patch bump for a breaking change.

The dotfiles mirror follows after this merges, and supersedes saiemgilani/dotfiles#42, the mirror of #73.

… (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.
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

The package review workflow now defaults to two self-review rounds when both review bots are rate-limited beyond the threshold. Copilot review requires explicit selection. The CI wait script and tests reflect the updated behavior.

Changes: Package review workflow

Layer / File(s) Summary
Fallback policy and instructions
sdv-toolkit/.claude-plugin/plugin.json, sdv-toolkit/skills/sdv-ship/SKILL.md, sdv-toolkit/skills/sdv-ship/scripts/ci_wait.py
The plugin manifest version changes to 0.25.5. The shipping instructions describe two self-review rounds as the default for specified rate-limited package PRs, with Copilot available only when explicitly selected.
CI wait decision and validation
sdv-toolkit/skills/sdv-ship/scripts/ci_wait.py, sdv-toolkit/tools/test_ci_wait.py
The CI wait script defaults to no Copilot request, checks whether the supplied self-reviewed SHA matches the current head, and continues to the Copilot path only when explicitly selected. Tests cover the updated decisions and request path.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Reviewer
  participant ci_wait.py
  participant Copilot
  participant CI
  Reviewer->>ci_wait.py: Run after both review bots exceed the rate-limit threshold
  ci_wait.py-->>Reviewer: Return self-review-first when no matching self-reviewed head is supplied
  Reviewer->>Reviewer: Complete two self-review rounds and push fixes
  Reviewer->>ci_wait.py: Rerun with the pushed head SHA
  ci_wait.py->>ci_wait.py: Check the supplied SHA against the current head
  ci_wait.py->>CI: Wait for CI when the SHA matches
  Reviewer->>ci_wait.py: Select Copilot explicitly when no self-review applies
  ci_wait.py->>Copilot: Request review when the selected mode and actor allow it
Loading
Merge Risk: Low · up to 89e2d

Defaults now require two self-review rounds and no longer request Copilot. One edge case remains: a stale self-reviewed SHA used together with an explicit --copilot auto can still request Copilot after a push. This affects only opt-in users, and it is unclear whether it is intended. It is safe to merge, but the author should decide the intended behavior and add a test for it.

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the feature and the component (ci_wait.py, sdv-ship), and the main change is two self-review rounds replacing Copilot as the fallback. The title is specific and accurate to the changes…
Full details: Title check

Explanation

The title names the feature and the component (ci_wait.py, sdv-ship), and the main change is two self-review rounds replacing Copilot as the fallback. The title is specific and accurate to the changeset. It carries the breaking-change marker (!) and a version tag (0.26.0). The PR objectives state version 0.25.5 for the plugin bump, so the version in the title does not match the plugin file change. That mismatch does not change whether the title describes the main change, so the check passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@sourcery-ai

sourcery-ai Bot commented Nov 26, 2026

Copy link
Copy Markdown

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 5 days and 6 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Additional comments: 1

sdv-toolkit/skills/sdv-ship/scripts/ci_wait.py-588-588: 1

588-588: Minor · Functional Correctness · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Require another self-review when an explicitly selected mode has a stale SHA.

If a run uses --self-reviewed abc123 --copilot auto, a push resets copilot_tried. After the new head's rate-limit window expires, the stale SHA fails Line 584. This branch then skips self-review-first because a.copilot is not None. The script can request Copilot for the new head.

This violates the rule that a PR with self-review never gets Copilot. Return self-review-first for a supplied but stale SHA before entering the explicit Copilot path. Keep explicit Copilot available when no self-reviewed SHA was supplied.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 218c2d8d-704c-4761-8c4c-02589e6b5424
Commits

Reviewing files that changed from the base of the PR and between 48b265e and 89e2df9.

Files selected for processing: 4

  • sdv-toolkit/.claude-plugin/plugin.json
  • sdv-toolkit/skills/sdv-ship/SKILL.md
  • sdv-toolkit/skills/sdv-ship/scripts/ci_wait.py
  • sdv-toolkit/tools/test_ci_wait.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

…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.
@saiemgilani saiemgilani changed the title feat(sdv-ship)!: two self-review rounds replace Copilot in ci_wait.py (0.25.5) feat(sdv-ship)!: two self-review rounds replace Copilot in ci_wait.py (0.26.0) Nov 26, 2026
@saiemgilani
saiemgilani merged commit 14c6334 into main Nov 26, 2026
6 checks passed
@saiemgilani
saiemgilani deleted the feat/ci-wait-self-review-replaces-copilot branch November 26, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant