Repository navigation
Refactor Copilot Review Instructions and Skills - #799
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the GitHub Copilot review bootstrap to route through a provider-independent code-review skill, and updates scripts/pr_review.py + tests to accept a stable machine-readable coverage marker and to block “unstated coverage” with a dedicated exit code.
Changes:
- Introduce a new
code-reviewskill (in both.agents/skillsand the Claude plugin distribution) that standardizes review procedure and the structured coverage marker. - Slim
.github/copilot-instructions.mddown to a bootstrap + output contract while preserving the repository’s disproved-claims ledger. - Extend
scripts/pr_review.pyand its tests to parse<!-- fleet-review: ... -->and to return exit 45 when coverage is unstated.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scripts/tests/test_pr_review.py | Updates corpus/status tests to cover the new structured marker and new exit-45 behavior. |
| scripts/pr_review.py | Adds marker parsing and blocks unstated coverage with exit 45. |
| AGENTS.md | Routes “reviewing a change set” to the new code-review skill. |
| .github/copilot-instructions.md | Reduces to review bootstrap/runbook + preserves disproved-claims ledger. |
| .agents/skills/code-review/SKILL.md | Adds provider-independent review skill and defines the structured coverage marker contract. |
| .agents/skills/pr-review-conduct/SKILL.md | Updates “mechanics live elsewhere” guidance to point to scripts/pr_review.py + bootstrap. |
| .agents/skills/copilot-instructions-keeper/SKILL.md | Adjusts description to reflect bootstrap role of Copilot instructions. |
| .claude-plugin/fleet-skills/skills/code-review/SKILL.md | Distributes the new code-review skill into the Claude plugin skill set. |
| .claude-plugin/fleet-skills/skills/pr-review-conduct/SKILL.md | Mirrors the same “mechanics live elsewhere” update for the Claude plugin skill set. |
| .claude-plugin/fleet-skills/skills/copilot-instructions-keeper/SKILL.md | Mirrors the bootstrap-description update for the Claude plugin skill set. |
| .claude-plugin/fleet-skills/.source-digest | Updates the generated skill-set digest. |
| .claude-plugin/fleet-skills/.claude-plugin/plugin.json | Registers the new code-review skill in the plugin manifest. |
Suppressed comments (1)
scripts/tests/test_pr_review.py:911
- The docstring for this test still says that treating a no-coverage body as a failure would “cry wolf”, but
scripts/pr_review.py statusnow blocks oncoverage=unstatedwith exit 45. Update the docstring to reflect that this body shape is recognized ascoverage=unstated(not UNVETTED), but it is still a blocking outcome forstatusbecause it provides no proof of full diff coverage.
def test_a_round_stating_no_coverage_at_all_is_unstated(self) -> None:
"""28 of the 332 bodies are an overview and a change list, and that shape is current.
It interleaves with the counted one throughout rather than preceding it, and one pull
request carries both across its two rounds, so failing on it would cry wolf on about one
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Copilot review round 4955381803 reported Suppressed comments (1).
Fixed in f1c24d7. The test now states that this is a recognized |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 53 out of 53 changed files in this pull request and generated no new comments.
Suppressed comments (2)
scripts/tests/test_pr_review.py:2844
- This contract test reads the marker from the
.agents/skills/copy, but the runbook explicitly points Copilot at.github/skills/code-review/SKILL.md. Reading the generated.github/skills/file here would better validate the actual Copilot-facing contract (and would fail if the generated tree wasn’t regenerated/committed).
.github/skills/code-review/SKILL.md:17 - The GitHub Copilot skill lives under
.github/skills/, but this step tells the reviewer to load skills from.agents/skills/. In downstream repos (where.agents/skills/is not carried), this instruction is impossible to follow and will prevent the intended routing to the per-language/workflow skills.
3. Load every applicable skill from `.agents/skills/`:
|
Suppressed finding responses Review round on
Review round on
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 53 out of 53 changed files in this pull request and generated no new comments.
Suppressed comments (1)
scripts/build_dist.py:180
is_stale()only considers directory entries when validating.github/skills/(and the plugin'sskills/), so a stray file at the distribution root (for example an accidental hand-addedREADME.mdor.DS_Store) would not be detected as drift andbuild_dist.py --checkcould still pass. Since the docs and help text describe--checkas failing whenever a generated distribution differs from.agents/skills/, it should also treat any non-directory entry under the distribution root as stale (and ideally require the root directory to exist even when there are zero skills).
|
Review round on
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 53 out of 53 changed files in this pull request and generated no new comments.
Suppressed comments (1)
scripts/pr_review.py:19
- The
statussubcommand docstring says exit 0 implies “the round covering the head read the whole diff”, butreport_verdict()returns 0 early when there are no head-covering reviews (if not head_reviews(pr): return 0). This makes exit 0 ambiguous (no review yet vs full coverage), so the docstring should describe the no-review case explicitly.
|
Review round on
|
…1743) Settles #1741 and #1740, both raised by a concurrent session in another fleet repository and ranked first and third on handoff #1738. ## The rule an agent could not follow `pr-review-conduct` "Expected review loop" ended its timeout advice with "remove Copilot in the pull request UI, add it again", which no agent seat can perform, and its only other advice was to wait again, which is what was already failing. Every stall therefore escalated to the maintainer for a manual click. The recovery now reads: on a second bounded `wait` timeout, read the pending set, clear it only where no human or team reviewer is requested alongside the bot, and rerun `wait`, which then has nothing outstanding to defer to and requests afresh. A stall still pending after that wait is the maintainer's, which is the bound the previous text got from the maintainer gate it no longer needs. `requested=yes` reads as acceptance of the request rather than delivery of a round, on all three surfaces that state it. An unpicked request prints the digest of one about to be served, so a driver reading that field as progress waits on evidence it does not hold. ## Where the mutation went, and why not the runbook `docs/pr-reviewer-reference.md`, whose stated subject is how each reviewer is triggered. Not `.github/copilot-instructions.md`: #799 reduced that file to a review bootstrap, and `test_the_runbook_routes_mutations_to_the_script` asserts it carries no mutation document at all. That is also the home `test_the_only_writes_are_the_four_named_here` has described all along as keeping the `union:false` clear-and-recover form manually, while naming the wrong file for it, so this change makes that docstring true rather than merely current. The snippet gates its own write rather than describing a gate beside an ungated command: the pull request id and the pending-set count are each captured live and each guarded, and the clear runs only where the count is zero. `gh pr view --json reviewRequests` omits a Bot, which is what makes that count a human-and-team count. ## The watcher trap next to the one 2.0.656 shipped A watcher testing for a bare negative matches a line a covered review wrote, so it reports no review over a review that landed. The rule added is to anchor the pattern on what is unique to the field being read, and for a pair nested in a parenthesized group the group's name ahead of it, since the digest renders the same inner names in more than one group. ## Carried forward rather than fixed here The clear's guard covers humans and teams. A second reviewer **app** in the pending set is invisible to both it and the digest's `requested` field, which matches the Copilot login alone, so such a request would be dropped by the replace. Narrow today, since no other reviewer here is configured as a requested reviewer, and worth either a stated limit or a GraphQL read that excludes one login rather than every Bot. ## Verification 427 `pr_review` tests and 1641 across the suite pass. `build_dist.py --check` reports the generated trees current. `ruff check`, `ruff format --check`, `prose_lint.py` whole-tree and against the diff, `repo_gate.py`, `spec/validate.py`, and the Docker linters are clean. The new test was proved by removing the code block it pins and watching it fail. Five local strict review rounds ran before this push, raising 33 findings between them, of which 21 were fixed, 8 declined as preference or as inherent to two API calls with no lock, and the rest are the two pre-existing ones noted above and below. Separately pre-existing, filed rather than fixed: `.github/copilot-instructions.md`'s third Disproved Claims entry is proved against a `BOT_ID` query in a "Triggering and Polling" section that file no longer carries, and `in_scope`'s refusal message in `scripts/pr_review.py` routes a cross-owner caller to a runbook `gh` path that does not exist. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved handling of stalled automated code-review requests with repeated, bounded waits and clearer progress reporting. - Pending automated requests can now be cleared and retried when no human or team reviewer is involved. - Requests involving human or team reviewers are preserved and escalated for maintainer action. - **Documentation** - Added recovery guidance for stalled review requests. - Expanded review-operation guidance, including monitoring requirements and recovery procedures. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
code-reviewskill that routes changed files to the applicable language, documentation, and workflow skillspr_review.pyparse the marker and block unstated coverage with exit 45Root Cause
The Copilot instruction file duplicated provider-independent rules and embedded API mechanics already implemented by
scripts/pr_review.py. Copilot review output also had no stable machine-readable coverage contract, while an unstated coverage result did not produce a blocking exit code.Validation
uvx ruff@latest check .uvx ruff@latest format --check .uvx mypy@latestOPERATIONS.md(79% total coverage, 97% forscripts/pr_review.py)python3 scripts/build_dist.py --checkpython3 scripts/repo_gate.pyFollow-Up
Closes #793