diff --git a/.agents/skills/drive-pr/SKILL.md b/.agents/skills/drive-pr/SKILL.md index 61e8ca5f5..0635a82dc 100644 --- a/.agents/skills/drive-pr/SKILL.md +++ b/.agents/skills/drive-pr/SKILL.md @@ -96,17 +96,19 @@ this skill exists to prevent. So is forgetting to loop back to the promotion PR route around. The hub carries such a hook, and a repository has one only if it adds one. That skill's refusal table says what each refusal means and what clears it. 3. Drive pr-review-conduct's review loop on it to the Merge Gate, disposing of every finding per - "Disposing of Every Finding" below. Request no Copilot round on this feature PR. Its `wait` reads - step 2's attestation as `coverage=local` and requests none, unless a partial round or a truncated - review history is on record. Exit `49` means the head carries no attestation, so run and record a + "Disposing of Every Finding" below. Request no review by hand. `wait` sends each request the review + policy asks for. Under the hub's default it reads step 2's attestation as `coverage=local` here. It + then requests no Copilot round, unless a partial round or a truncated review history is on record. Exit `49` means the head carries no attestation, so run and record a pass over it, push, and attest. Exit `46` means a thread is open on the head, so dispose of each one per "Disposing of Every Finding" and wait again. Read `state=` in every digest `wait` or `status` prints. A peer can merge or close the pull request mid-drive. A digest carrying `state=MERGED` on a feature PR into develop means the merge has landed. Skip the merge in step 4 and go on to its post-merge path. On a promotion PR it means the drive's end state is passed, so stop and report it merged. A digest carrying `state=CLOSED` is a stop to report, with its `closed_at=`. - On such a PR `state=` decides the next step over any exit code `wait` or `status` returns. A promotion re-reviews content its feature PRs already carried, - so the hosted review runs once per change, at the promotion in step 6. + On such a PR `state=` decides the next step over any exit code `wait` or `status` returns. A promotion re-reviews content its feature PRs already carried. + So under the hub's default review policy, the hosted review runs once per change, at the + promotion in step 6. `wait` sends each request the repository's review policy asks for, so + the drive never asks whether a reviewer starts on its own. 4. Merge the feature PR into develop with `uv run --no-project --script scripts/pr_review.py merge --repo / --cleanup --checkout `, run from a hub checkout outside the task's worktree, `` being the repository's diff --git a/.agents/skills/pr-review-conduct/SKILL.md b/.agents/skills/pr-review-conduct/SKILL.md index dc9f8fe2d..86282f8d0 100644 --- a/.agents/skills/pr-review-conduct/SKILL.md +++ b/.agents/skills/pr-review-conduct/SKILL.md @@ -34,11 +34,15 @@ visible comments, routinely still carries a finding nobody has answered. Treatin 1. Required status checks are green, and where they are not, the reason is **read**, never inferred. `BLOCKED` covers a failed check, a required check nothing is running, an unresolved thread, and a missing approval alike, and the response differs by cause. -2. A review is confirmed on the **current head SHA**. On a pull request into a branch other than the - default, every head can carry an attested local pass instead, `coverage=local` in the digest. - That holds where the whole review history is in view and no round on record states partial coverage. A promotion re-reviews content its feature pull requests already carried, so - the hosted review runs once per change, at the promotion. A pull request into the default - branch, a promotion among them, always carries a Copilot round on its head. A review is matched +2. A review is confirmed on the **current head SHA**. The review policy can hand a head to a local + pass, by default on a pull request into a branch other than the default. Such a head can carry an + attested local pass instead, `coverage=local` in the digest. + That holds where the whole review history is in view and no round on record states partial coverage. A policy that waits on no Copilot round drops that condition. That is a Copilot that is off, ungated, or past its cap. No refusal or pending request on the head then stands against the attestation either, since no round is coming to settle it. A promotion re-reviews content its feature pull requests already carried. + So under the hub's default review policy, the hosted review runs once per change, at the + promotion. There a pull request into the default branch, a promotion among them, always + carries a Copilot round on its head. A repository's own `.github/pr-review.json` can move, + cap, or hold that round until the head's checks pass. `pr_review.py` applies it, so follow + the digest and the exit code rather than this paragraph's default. A review is matched by commit SHA rather than assumed from a green merge-state. A push makes checks go green *before* the re-review lands, and the matched review is **read**, not just counted. A review can carry the head SHA and still decline the PR outright, or say it read only part of the changed files. @@ -72,15 +76,16 @@ visible comments, routinely still carries a finding nobody has answered. Treatin A refusal is not that coverage, so this item stays unsatisfied under one, and the loop clears it where it can. A file-count refusal is cleared by splitting the pull request. A refusal saying every changed file is in Copilot's default review exclusions says nothing about the content, and - no round follows it. On a pull request into a branch other than the default, the attested local - pass covers that head. Where none can, it goes to the maintainer, `wait` exiting `41` as + no round follows it. The attested local pass covers that head where the review policy hands it + to a local pass. By default that is a pull request into a branch other than the default. Where none can, it goes to the maintainer, `wait` exiting `41` as `REVIEW_EXCLUDED_FILES_ONLY`. `pr_review.py wait` exits `41` on every other refusal and quota state no local pass covers, its `status=` line naming which. The digest's `refusal=` field carries a refusal on this pull request. `refusal=QUOTA` or `refusal=ERROR` means the pull request's newest Copilot review is an account-quota refusal or an error refusal read as a possible quota hit. That review can sit on - this head or an earlier one. On a pull request into a branch other than the default, an attested - local pass on a later head clears it, `coverage=local`. Otherwise nothing the loop does clears it, which is the case "Which + this head or an earlier one. Where the review policy hands heads to a local pass, by default off + the default branch, an attested later head clears it, `coverage=local`. One on + this head clears it too where the policy waits on no Copilot round. Otherwise nothing the loop does clears it, which is the case "Which Reviewers a Repository Actually Has" below states. An error refusal whose `RUN LOG READING` line says transient is the exception. `wait` re-requests it once and exits `30` while that request is pending. A second error refusal in a row, or a re-request made with no round answering it, @@ -254,8 +259,9 @@ must have done. describes it as its own ordinary shape. Read the reviews themselves rather than the comments alone, since the third case appears only there. - **Copilot's absence blocks where no local pass stands in, and is answered elsewhere.** - Merge Gate item 2 requires Copilot's own coverage of the current head. On a pull request into a - branch other than the default, an attested local pass stands in for it. The loop's own request + Merge Gate item 2 requires Copilot's own coverage of the current head. Where the review policy + hands the head to a local pass, by default off the default branch, an attested local pass stands + in for it. The loop's own request step below is where a missing one is answered, on the terms stated there. A refusal naming the account quota is its own case rather than a review. So is one saying only that Copilot encountered an error, which is what the @@ -293,11 +299,13 @@ Run `local-strict-review` against the branch's current diff before every push th posts is the record Merge Gate item 2's promotion case reads, since the receipt goes when its worktree does. 2. Run `uv run --no-project --script scripts/pr_review.py status --repo /` once in the foreground and read its output. -3. Request a Copilot round at one defined moment: the head of a pull request into the default - branch, a promotion among them. Auto-trigger is unreliable, so request it explicitly, which - step 4's `wait` is what does. On a pull request into any other branch, `wait` reads step 1's +3. Send each request the repository's review policy asks for, which step 4's `wait` is what does. + Under the hub's default that is one Copilot round, on the head of a pull request into the default + branch. A promotion is one such pull request. Auto-trigger is unreliable, so `wait` fills a + missed one. On a pull request into any other branch, `wait` reads step 1's attestation as `coverage=local` where Merge Gate item 2 allows that reading. There `wait` - requests a round only where a partial round or a truncated review history is on record. Pass `wait --request` where a change + requests a round only where a partial round or a truncated review history is on record. It + requests none where the policy waits on no Copilot round, Copilot being off, ungated, or past its cap. Pass `wait --request` where a change deserves a Copilot round anyway. `wait` also skips the request where a review already covers the head, where the answer came outside a formal review, or where it detects drift. It skips it under a quota or error refusal too, and where something is already in diff --git a/.claude-plugin/fleet-skills/.source-digests/drive-pr b/.claude-plugin/fleet-skills/.source-digests/drive-pr index 6e5b3acaa..a3792ead8 100644 --- a/.claude-plugin/fleet-skills/.source-digests/drive-pr +++ b/.claude-plugin/fleet-skills/.source-digests/drive-pr @@ -1 +1 @@ -7a040cbe2174c5e5 +89baa7367f4cc925 diff --git a/.claude-plugin/fleet-skills/.source-digests/pr-review-conduct b/.claude-plugin/fleet-skills/.source-digests/pr-review-conduct index f2352b42d..6a70f93c0 100644 --- a/.claude-plugin/fleet-skills/.source-digests/pr-review-conduct +++ b/.claude-plugin/fleet-skills/.source-digests/pr-review-conduct @@ -1 +1 @@ -ad58c8a117d06acb +1beaec523daad9b5 diff --git a/.claude-plugin/fleet-skills/skills/drive-pr/SKILL.md b/.claude-plugin/fleet-skills/skills/drive-pr/SKILL.md index 61e8ca5f5..0635a82dc 100644 --- a/.claude-plugin/fleet-skills/skills/drive-pr/SKILL.md +++ b/.claude-plugin/fleet-skills/skills/drive-pr/SKILL.md @@ -96,17 +96,19 @@ this skill exists to prevent. So is forgetting to loop back to the promotion PR route around. The hub carries such a hook, and a repository has one only if it adds one. That skill's refusal table says what each refusal means and what clears it. 3. Drive pr-review-conduct's review loop on it to the Merge Gate, disposing of every finding per - "Disposing of Every Finding" below. Request no Copilot round on this feature PR. Its `wait` reads - step 2's attestation as `coverage=local` and requests none, unless a partial round or a truncated - review history is on record. Exit `49` means the head carries no attestation, so run and record a + "Disposing of Every Finding" below. Request no review by hand. `wait` sends each request the review + policy asks for. Under the hub's default it reads step 2's attestation as `coverage=local` here. It + then requests no Copilot round, unless a partial round or a truncated review history is on record. Exit `49` means the head carries no attestation, so run and record a pass over it, push, and attest. Exit `46` means a thread is open on the head, so dispose of each one per "Disposing of Every Finding" and wait again. Read `state=` in every digest `wait` or `status` prints. A peer can merge or close the pull request mid-drive. A digest carrying `state=MERGED` on a feature PR into develop means the merge has landed. Skip the merge in step 4 and go on to its post-merge path. On a promotion PR it means the drive's end state is passed, so stop and report it merged. A digest carrying `state=CLOSED` is a stop to report, with its `closed_at=`. - On such a PR `state=` decides the next step over any exit code `wait` or `status` returns. A promotion re-reviews content its feature PRs already carried, - so the hosted review runs once per change, at the promotion in step 6. + On such a PR `state=` decides the next step over any exit code `wait` or `status` returns. A promotion re-reviews content its feature PRs already carried. + So under the hub's default review policy, the hosted review runs once per change, at the + promotion in step 6. `wait` sends each request the repository's review policy asks for, so + the drive never asks whether a reviewer starts on its own. 4. Merge the feature PR into develop with `uv run --no-project --script scripts/pr_review.py merge --repo / --cleanup --checkout `, run from a hub checkout outside the task's worktree, `` being the repository's diff --git a/.claude-plugin/fleet-skills/skills/pr-review-conduct/SKILL.md b/.claude-plugin/fleet-skills/skills/pr-review-conduct/SKILL.md index dc9f8fe2d..86282f8d0 100644 --- a/.claude-plugin/fleet-skills/skills/pr-review-conduct/SKILL.md +++ b/.claude-plugin/fleet-skills/skills/pr-review-conduct/SKILL.md @@ -34,11 +34,15 @@ visible comments, routinely still carries a finding nobody has answered. Treatin 1. Required status checks are green, and where they are not, the reason is **read**, never inferred. `BLOCKED` covers a failed check, a required check nothing is running, an unresolved thread, and a missing approval alike, and the response differs by cause. -2. A review is confirmed on the **current head SHA**. On a pull request into a branch other than the - default, every head can carry an attested local pass instead, `coverage=local` in the digest. - That holds where the whole review history is in view and no round on record states partial coverage. A promotion re-reviews content its feature pull requests already carried, so - the hosted review runs once per change, at the promotion. A pull request into the default - branch, a promotion among them, always carries a Copilot round on its head. A review is matched +2. A review is confirmed on the **current head SHA**. The review policy can hand a head to a local + pass, by default on a pull request into a branch other than the default. Such a head can carry an + attested local pass instead, `coverage=local` in the digest. + That holds where the whole review history is in view and no round on record states partial coverage. A policy that waits on no Copilot round drops that condition. That is a Copilot that is off, ungated, or past its cap. No refusal or pending request on the head then stands against the attestation either, since no round is coming to settle it. A promotion re-reviews content its feature pull requests already carried. + So under the hub's default review policy, the hosted review runs once per change, at the + promotion. There a pull request into the default branch, a promotion among them, always + carries a Copilot round on its head. A repository's own `.github/pr-review.json` can move, + cap, or hold that round until the head's checks pass. `pr_review.py` applies it, so follow + the digest and the exit code rather than this paragraph's default. A review is matched by commit SHA rather than assumed from a green merge-state. A push makes checks go green *before* the re-review lands, and the matched review is **read**, not just counted. A review can carry the head SHA and still decline the PR outright, or say it read only part of the changed files. @@ -72,15 +76,16 @@ visible comments, routinely still carries a finding nobody has answered. Treatin A refusal is not that coverage, so this item stays unsatisfied under one, and the loop clears it where it can. A file-count refusal is cleared by splitting the pull request. A refusal saying every changed file is in Copilot's default review exclusions says nothing about the content, and - no round follows it. On a pull request into a branch other than the default, the attested local - pass covers that head. Where none can, it goes to the maintainer, `wait` exiting `41` as + no round follows it. The attested local pass covers that head where the review policy hands it + to a local pass. By default that is a pull request into a branch other than the default. Where none can, it goes to the maintainer, `wait` exiting `41` as `REVIEW_EXCLUDED_FILES_ONLY`. `pr_review.py wait` exits `41` on every other refusal and quota state no local pass covers, its `status=` line naming which. The digest's `refusal=` field carries a refusal on this pull request. `refusal=QUOTA` or `refusal=ERROR` means the pull request's newest Copilot review is an account-quota refusal or an error refusal read as a possible quota hit. That review can sit on - this head or an earlier one. On a pull request into a branch other than the default, an attested - local pass on a later head clears it, `coverage=local`. Otherwise nothing the loop does clears it, which is the case "Which + this head or an earlier one. Where the review policy hands heads to a local pass, by default off + the default branch, an attested later head clears it, `coverage=local`. One on + this head clears it too where the policy waits on no Copilot round. Otherwise nothing the loop does clears it, which is the case "Which Reviewers a Repository Actually Has" below states. An error refusal whose `RUN LOG READING` line says transient is the exception. `wait` re-requests it once and exits `30` while that request is pending. A second error refusal in a row, or a re-request made with no round answering it, @@ -254,8 +259,9 @@ must have done. describes it as its own ordinary shape. Read the reviews themselves rather than the comments alone, since the third case appears only there. - **Copilot's absence blocks where no local pass stands in, and is answered elsewhere.** - Merge Gate item 2 requires Copilot's own coverage of the current head. On a pull request into a - branch other than the default, an attested local pass stands in for it. The loop's own request + Merge Gate item 2 requires Copilot's own coverage of the current head. Where the review policy + hands the head to a local pass, by default off the default branch, an attested local pass stands + in for it. The loop's own request step below is where a missing one is answered, on the terms stated there. A refusal naming the account quota is its own case rather than a review. So is one saying only that Copilot encountered an error, which is what the @@ -293,11 +299,13 @@ Run `local-strict-review` against the branch's current diff before every push th posts is the record Merge Gate item 2's promotion case reads, since the receipt goes when its worktree does. 2. Run `uv run --no-project --script scripts/pr_review.py status --repo /` once in the foreground and read its output. -3. Request a Copilot round at one defined moment: the head of a pull request into the default - branch, a promotion among them. Auto-trigger is unreliable, so request it explicitly, which - step 4's `wait` is what does. On a pull request into any other branch, `wait` reads step 1's +3. Send each request the repository's review policy asks for, which step 4's `wait` is what does. + Under the hub's default that is one Copilot round, on the head of a pull request into the default + branch. A promotion is one such pull request. Auto-trigger is unreliable, so `wait` fills a + missed one. On a pull request into any other branch, `wait` reads step 1's attestation as `coverage=local` where Merge Gate item 2 allows that reading. There `wait` - requests a round only where a partial round or a truncated review history is on record. Pass `wait --request` where a change + requests a round only where a partial round or a truncated review history is on record. It + requests none where the policy waits on no Copilot round, Copilot being off, ungated, or past its cap. Pass `wait --request` where a change deserves a Copilot round anyway. `wait` also skips the request where a review already covers the head, where the answer came outside a formal review, or where it detects drift. It skips it under a quota or error refusal too, and where something is already in diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 2fb885523..f9012fb00 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -28,7 +28,7 @@ For every review: The review automation is `scripts/pr_review.py`, run from a hub checkout. Use its `status`, `wait`, `attest`, `comment`, and `reply --resolve` commands instead of reconstructing GraphQL queries or copying review identifiers by hand. Use `comment` for a suppressed-finding answer in the pull request conversation. Its status gate verifies the current head, diff coverage, output shape, inline threads, body-only findings, and required checks. -A formal review with no findings is complete only when it covers the current head. It also needs full diff coverage of the change set that head has, stated or read from a file table as below. A round covering the head states it. Where none does, a round covering the head whose own file table names exactly the changed files covers it. That is the reading a round at Balanced review effort gives. Where no round covering the head carries its own table, the newest round that does stands in where its table names exactly the changed files. Either table may leave out an added, modified, or deleted file with no changed line, such as a binary. That holds while some changed file has one. A table stands in only where no Copilot round on the pull request, on any commit, states partial coverage. So a pull request that ever had a partial round goes to the maintainer. A round reporting partial coverage of the diff blocks the merge, and so does a refusal. So does a head that no coverage statement, file table, or attested local pass covers. So does an output shape the digest notes and nobody has read by hand, an unresolved thread, or a body-only finding. On a pull request into a branch other than the default, an attested local pass covers the head, `coverage=local` in the digest. A partial round, a truncated review history, or a refusal on the head still blocks that reading. A refusal saying every changed file is in Copilot's default review exclusions is the exception. A pull request into the default branch, a promotion among them, always carries a Copilot round on its head. Re-run the loop after every fix push. Never infer review completion from `mergeStateStatus: CLEAN`. +A formal review with no findings is complete only when it covers the current head. It also needs full diff coverage of the change set that head has, stated or read from a file table as below. A round covering the head states it. Where none does, a round covering the head whose own file table names exactly the changed files covers it. That is the reading a round at Balanced review effort gives. Where no round covering the head carries its own table, the newest round that does stands in where its table names exactly the changed files. Either table may leave out an added, modified, or deleted file with no changed line, such as a binary. That holds while some changed file has one. A table stands in only where no Copilot round on the pull request, on any commit, states partial coverage. So a pull request that ever had a partial round goes to the maintainer. A round reporting partial coverage of the diff blocks the merge, and so does a refusal. So does a head that no coverage statement, file table, or attested local pass covers. So does an output shape the digest notes and nobody has read by hand, an unresolved thread, or a body-only finding. Where the review policy hands the head to a local pass, an attested local pass covers it, `coverage=local` in the digest. By default that is a pull request into a branch other than the default. A partial round, a truncated review history, or a refusal on the head still blocks that reading. A refusal saying every changed file is in Copilot's default review exclusions is the exception. So is a policy that waits on no Copilot round, Copilot being off, ungated, or past its cap. There none of them blocks the reading, since no round is coming to settle them. Under the hub's default review policy, a pull request into the default branch, a promotion among them, always carries a Copilot round on its head. A repository's own `.github/pr-review.json` can move or cap that round, and the digest reports what it decided. Re-run the loop after every fix push. Never infer review completion from `mergeStateStatus: CLEAN`. Review effort is user-controlled. The automation observes `Lite`, `Balanced`, or `Max`, including an inherited `Default ()`, and never selects or changes the setting. Effort does not determine coverage or completion. A request can complete without a `copilot_work_started` event, so absence of that event is not a stalled-review verdict. When `wait` returns `PENDING` with `requested=yes`, report the state and rerun `wait` for another bounded interval by default. Read that field as acceptance of the request rather than as delivery of a round. Do not clear the request on that first timeout, because it may still be active. Where a second bounded wait times out as well, read the pending set. In that case, clear it only where no human or team reviewer is requested alongside the bot, and rerun `wait`. That rerun then has nothing outstanding to defer to and requests afresh. Where it finds no reviewer node id to request with, it polls instead and says so on its own auto-request line. The clear replaces that set rather than adding to it, and nothing restores a request it drops. So a stall on a pull request that has a human or team reviewer requested goes to the maintainer. So does one still pending after the wait that follows a clear. That clear is a recovery step the script does not implement, and `docs/pr-reviewer-reference.md`, in the hub checkout the script is run from, carries it. This recovery replaces only the review request and never changes the effort setting. A `wait` ending `REQUEST_NOT_RECORDED`, exit 40, is a different state and takes none of this recovery. The request returned success and left neither a pending reviewer nor a review-request event. That is how an exhausted Copilot allowance has shown itself. So clearing and requesting again does not clear this state, and it goes to the maintainer. diff --git a/.github/skills/drive-pr/SKILL.md b/.github/skills/drive-pr/SKILL.md index 61e8ca5f5..0635a82dc 100644 --- a/.github/skills/drive-pr/SKILL.md +++ b/.github/skills/drive-pr/SKILL.md @@ -96,17 +96,19 @@ this skill exists to prevent. So is forgetting to loop back to the promotion PR route around. The hub carries such a hook, and a repository has one only if it adds one. That skill's refusal table says what each refusal means and what clears it. 3. Drive pr-review-conduct's review loop on it to the Merge Gate, disposing of every finding per - "Disposing of Every Finding" below. Request no Copilot round on this feature PR. Its `wait` reads - step 2's attestation as `coverage=local` and requests none, unless a partial round or a truncated - review history is on record. Exit `49` means the head carries no attestation, so run and record a + "Disposing of Every Finding" below. Request no review by hand. `wait` sends each request the review + policy asks for. Under the hub's default it reads step 2's attestation as `coverage=local` here. It + then requests no Copilot round, unless a partial round or a truncated review history is on record. Exit `49` means the head carries no attestation, so run and record a pass over it, push, and attest. Exit `46` means a thread is open on the head, so dispose of each one per "Disposing of Every Finding" and wait again. Read `state=` in every digest `wait` or `status` prints. A peer can merge or close the pull request mid-drive. A digest carrying `state=MERGED` on a feature PR into develop means the merge has landed. Skip the merge in step 4 and go on to its post-merge path. On a promotion PR it means the drive's end state is passed, so stop and report it merged. A digest carrying `state=CLOSED` is a stop to report, with its `closed_at=`. - On such a PR `state=` decides the next step over any exit code `wait` or `status` returns. A promotion re-reviews content its feature PRs already carried, - so the hosted review runs once per change, at the promotion in step 6. + On such a PR `state=` decides the next step over any exit code `wait` or `status` returns. A promotion re-reviews content its feature PRs already carried. + So under the hub's default review policy, the hosted review runs once per change, at the + promotion in step 6. `wait` sends each request the repository's review policy asks for, so + the drive never asks whether a reviewer starts on its own. 4. Merge the feature PR into develop with `uv run --no-project --script scripts/pr_review.py merge --repo / --cleanup --checkout `, run from a hub checkout outside the task's worktree, `` being the repository's diff --git a/.github/skills/pr-review-conduct/SKILL.md b/.github/skills/pr-review-conduct/SKILL.md index dc9f8fe2d..86282f8d0 100644 --- a/.github/skills/pr-review-conduct/SKILL.md +++ b/.github/skills/pr-review-conduct/SKILL.md @@ -34,11 +34,15 @@ visible comments, routinely still carries a finding nobody has answered. Treatin 1. Required status checks are green, and where they are not, the reason is **read**, never inferred. `BLOCKED` covers a failed check, a required check nothing is running, an unresolved thread, and a missing approval alike, and the response differs by cause. -2. A review is confirmed on the **current head SHA**. On a pull request into a branch other than the - default, every head can carry an attested local pass instead, `coverage=local` in the digest. - That holds where the whole review history is in view and no round on record states partial coverage. A promotion re-reviews content its feature pull requests already carried, so - the hosted review runs once per change, at the promotion. A pull request into the default - branch, a promotion among them, always carries a Copilot round on its head. A review is matched +2. A review is confirmed on the **current head SHA**. The review policy can hand a head to a local + pass, by default on a pull request into a branch other than the default. Such a head can carry an + attested local pass instead, `coverage=local` in the digest. + That holds where the whole review history is in view and no round on record states partial coverage. A policy that waits on no Copilot round drops that condition. That is a Copilot that is off, ungated, or past its cap. No refusal or pending request on the head then stands against the attestation either, since no round is coming to settle it. A promotion re-reviews content its feature pull requests already carried. + So under the hub's default review policy, the hosted review runs once per change, at the + promotion. There a pull request into the default branch, a promotion among them, always + carries a Copilot round on its head. A repository's own `.github/pr-review.json` can move, + cap, or hold that round until the head's checks pass. `pr_review.py` applies it, so follow + the digest and the exit code rather than this paragraph's default. A review is matched by commit SHA rather than assumed from a green merge-state. A push makes checks go green *before* the re-review lands, and the matched review is **read**, not just counted. A review can carry the head SHA and still decline the PR outright, or say it read only part of the changed files. @@ -72,15 +76,16 @@ visible comments, routinely still carries a finding nobody has answered. Treatin A refusal is not that coverage, so this item stays unsatisfied under one, and the loop clears it where it can. A file-count refusal is cleared by splitting the pull request. A refusal saying every changed file is in Copilot's default review exclusions says nothing about the content, and - no round follows it. On a pull request into a branch other than the default, the attested local - pass covers that head. Where none can, it goes to the maintainer, `wait` exiting `41` as + no round follows it. The attested local pass covers that head where the review policy hands it + to a local pass. By default that is a pull request into a branch other than the default. Where none can, it goes to the maintainer, `wait` exiting `41` as `REVIEW_EXCLUDED_FILES_ONLY`. `pr_review.py wait` exits `41` on every other refusal and quota state no local pass covers, its `status=` line naming which. The digest's `refusal=` field carries a refusal on this pull request. `refusal=QUOTA` or `refusal=ERROR` means the pull request's newest Copilot review is an account-quota refusal or an error refusal read as a possible quota hit. That review can sit on - this head or an earlier one. On a pull request into a branch other than the default, an attested - local pass on a later head clears it, `coverage=local`. Otherwise nothing the loop does clears it, which is the case "Which + this head or an earlier one. Where the review policy hands heads to a local pass, by default off + the default branch, an attested later head clears it, `coverage=local`. One on + this head clears it too where the policy waits on no Copilot round. Otherwise nothing the loop does clears it, which is the case "Which Reviewers a Repository Actually Has" below states. An error refusal whose `RUN LOG READING` line says transient is the exception. `wait` re-requests it once and exits `30` while that request is pending. A second error refusal in a row, or a re-request made with no round answering it, @@ -254,8 +259,9 @@ must have done. describes it as its own ordinary shape. Read the reviews themselves rather than the comments alone, since the third case appears only there. - **Copilot's absence blocks where no local pass stands in, and is answered elsewhere.** - Merge Gate item 2 requires Copilot's own coverage of the current head. On a pull request into a - branch other than the default, an attested local pass stands in for it. The loop's own request + Merge Gate item 2 requires Copilot's own coverage of the current head. Where the review policy + hands the head to a local pass, by default off the default branch, an attested local pass stands + in for it. The loop's own request step below is where a missing one is answered, on the terms stated there. A refusal naming the account quota is its own case rather than a review. So is one saying only that Copilot encountered an error, which is what the @@ -293,11 +299,13 @@ Run `local-strict-review` against the branch's current diff before every push th posts is the record Merge Gate item 2's promotion case reads, since the receipt goes when its worktree does. 2. Run `uv run --no-project --script scripts/pr_review.py status --repo /` once in the foreground and read its output. -3. Request a Copilot round at one defined moment: the head of a pull request into the default - branch, a promotion among them. Auto-trigger is unreliable, so request it explicitly, which - step 4's `wait` is what does. On a pull request into any other branch, `wait` reads step 1's +3. Send each request the repository's review policy asks for, which step 4's `wait` is what does. + Under the hub's default that is one Copilot round, on the head of a pull request into the default + branch. A promotion is one such pull request. Auto-trigger is unreliable, so `wait` fills a + missed one. On a pull request into any other branch, `wait` reads step 1's attestation as `coverage=local` where Merge Gate item 2 allows that reading. There `wait` - requests a round only where a partial round or a truncated review history is on record. Pass `wait --request` where a change + requests a round only where a partial round or a truncated review history is on record. It + requests none where the policy waits on no Copilot round, Copilot being off, ungated, or past its cap. Pass `wait --request` where a change deserves a Copilot round anyway. `wait` also skips the request where a review already covers the head, where the answer came outside a formal review, or where it detects drift. It skips it under a quota or error refusal too, and where something is already in diff --git a/GOVERNANCE.md b/GOVERNANCE.md index f2a7c4447..39052c6f0 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -249,7 +249,7 @@ Hardening is spent where a failure can actually occur. A defense against a case ## PR Review Etiquette -The provider-agnostic review-loop contract every fleet repo follows starts when a pull request opens. Open every fleet-owned pull request ready for review. Draft state is reserved for the separately documented upstream contribution workflow while a third-party contribution is still being prepared. Creating the pull request is not a terminal handoff. Run the review status once in the foreground. Then start the bounded review wait in a background process. Request a Copilot review at one defined moment rather than on every push. That moment is the head of a pull request into the default branch, a promotion among them. The review wait also requests one on any other pull request where a partial round or a truncated review history is on record. On a pull request into any other branch, every head is covered instead by the recorded local pass the push already owes. That pass is published to the pull request so the review status can read it. The `pr-review-conduct` Skill's Merge Gate states when that published pass counts as coverage. Confirm that the current head SHA is covered by a review or, on such a pull request, by that published pass. Also confirm that a review covers the full diff rather than only part of it. Where no round covering the head states coverage, a round covering it whose own file table names exactly the changed files covers it. That is the reading a Copilot round at Balanced review effort gives. Where no round covering the head carries its own table, the newest round that does stands in where its table names exactly the changed files. Either table may leave out an added, modified, or deleted file with no changed line, such as a binary. That holds while some changed file has one. A table stands in only where no Copilot round on the pull request, on any commit, states partial coverage. So a pull request that ever had a partial round goes to the maintainer. A develop -> main promotion whose head round states no coverage has one further way to be covered, which the `pr-review-conduct` Skill's Merge Gate states. Triage every finding, including low-confidence findings collapsed into the review body rather than threads. Reply to and resolve every addressed finding. Repeat after every fix until the checks are green, the current head is covered, and no finding is left open. Only an explicit maintainer instruction may stop, defer, or alter this default. Silence or a request that says only "open a PR" is not such an instruction. Never merge on a green or CLEAN merge state alone. That state does not prove the review covered the current head SHA and full diff. It also does not expose unanswered low-confidence findings that opened no thread. +The provider-agnostic review-loop contract every fleet repo follows starts when a pull request opens. Open every fleet-owned pull request ready for review. Draft state is reserved for the separately documented upstream contribution workflow while a third-party contribution is still being prepared. Creating the pull request is not a terminal handoff. Run the review status once in the foreground. Then start the bounded review wait in a background process. Which bots review which pull requests, when, and how often is the repository's review policy, `.github/pr-review.json`, or the hub's `spec/pr-review.default.json` where the repository carries none. The review wait reads that policy from the pull request's base branch. It sends each request the policy asks it to send. A bot the policy marks automatic is left to start on its own, except a gated Copilot, whose missed start it fills. So the loop below runs the same whether a repository's reviews arrive automatically or on request, and nothing here names which. Under the hub default, a Copilot review is requested at one defined moment rather than on every push. That moment is the head of a pull request into the default branch, a promotion among them. The review wait also requests one on any other pull request where a partial round or a truncated review history is on record. On a pull request into any other branch, every head is covered instead by the recorded local pass the push already owes. That pass is published to the pull request so the review status can read it. The `pr-review-conduct` Skill's Merge Gate states when that published pass counts as coverage. Confirm that the current head SHA is covered by a review or, on such a pull request, by that published pass. Also confirm that a review covers the full diff rather than only part of it. Where no round covering the head states coverage, a round covering it whose own file table names exactly the changed files covers it. That is the reading a Copilot round at Balanced review effort gives. Where no round covering the head carries its own table, the newest round that does stands in where its table names exactly the changed files. Either table may leave out an added, modified, or deleted file with no changed line, such as a binary. That holds while some changed file has one. A table stands in only where no Copilot round on the pull request, on any commit, states partial coverage. So a pull request that ever had a partial round goes to the maintainer. A develop -> main promotion whose head round states no coverage has one further way to be covered, which the `pr-review-conduct` Skill's Merge Gate states. Triage every finding, including low-confidence findings collapsed into the review body rather than threads. Reply to and resolve every addressed finding. Repeat after every fix until the checks are green, the current head is covered, and no finding is left open. Only an explicit maintainer instruction may stop, defer, or alter this default. Silence or a request that says only "open a PR" is not such an instruction. Never merge on a green or CLEAN merge state alone. That state does not prove the review covered the current head SHA and full diff. It also does not expose unanswered low-confidence findings that opened no thread. This is packaged as the `pr-review-conduct` Skill at `.agents/skills/pr-review-conduct/SKILL.md` in the hub. That path is not a repo-relative link, since it is hub-local and not carried into every fleet repo. The summary above sketches the contract. Read the skill for the merge gate, the expected loop, and how a finding is closed. diff --git a/docs/pr-reviewer-reference.md b/docs/pr-reviewer-reference.md index 18ef8c777..4c90bebaf 100644 --- a/docs/pr-reviewer-reference.md +++ b/docs/pr-reviewer-reference.md @@ -24,7 +24,7 @@ The consequence a review loop actually needs: **a private repository has Copilot The repository already has first-class status, wait, comment, reply, resolution, coverage, and output-shape handling in `scripts/pr_review.py`. -A review is requested by that script rather than by hand. `wait` requests one on the current head where nothing it reads already settles the round and nothing is outstanding. An accepted request that is never picked up is therefore a state it cannot clear for itself. Into a branch other than the default, `wait` requests none unless a partial round or a truncated review history is on record. An attested local pass covers that head instead. Clearing the request set is what leaves the next `wait` nothing to defer to. A `wait` ending `REQUEST_NOT_RECORDED`, exit 40, is a different state and takes none of this recovery. The request returned success and left neither a pending reviewer nor a review-request event. That is how an exhausted Copilot allowance has shown itself. So clearing and requesting again does not clear this state, and it goes to the maintainer. Nothing in the commands below is the script. So none of its scope refusals reaches them, and the owner in the target is checked by whoever runs them: +A review is requested by that script rather than by hand. `wait` requests one on the current head where nothing it reads already settles the round and nothing is outstanding. An accepted request that is never picked up is therefore a state it cannot clear for itself. Where the review policy hands the head to a local pass, `wait` requests none unless a partial round or a truncated history is on record. By default that is a head into a branch other than the default. It requests none at all where the policy waits on no Copilot round. An attested local pass covers that head instead. Clearing the request set is what leaves the next `wait` nothing to defer to. A `wait` ending `REQUEST_NOT_RECORDED`, exit 40, is a different state and takes none of this recovery. The request returned success and left neither a pending reviewer nor a review-request event. That is how an exhausted Copilot allowance has shown itself. So clearing and requesting again does not clear this state, and it goes to the maintainer. Nothing in the commands below is the script. So none of its scope refusals reaches them, and the owner in the target is checked by whoever runs them: ```sh PR_NODE=$(gh pr view "" --repo "/" --json id --jq '.id') @@ -76,6 +76,7 @@ Each reviewer's behavior is shaped by a committed file rather than accepted as g - **CodeRabbit** is configured in `.coderabbit.yaml`, whose [settings reference][coderabbit-config] names each option. Auto review is on for pull requests into `develop`, which the open-source tier honors only at ten stars or more. No pause follows five reviewed commits, since a fleet pull request routinely passes five pushes and the pause reads as a reviewer that stopped. A path instruction for Markdown asks for false, stale, unverifiable, or unfollowable claims only. That is because CI lints style and the local review pass reads canonical prose whole. Sequence diagrams, suggested labels and reviewers, and the in-progress fortune are off. The markdownlint, actionlint, shellcheck, and ruff tools are off, since CI runs the same four and fails the pull request on them. - **Qodo** is configured in `.pr_agent.toml`, whose [configuration reference][qodo-config] names each option. An issues guideline asks for a reproduction with any claimed crash. That guideline came after a claimed `IsADirectoryError` on this repository's build was disproven by running it. A compliance guideline asks for the rule's own sentence and routes a rule against unchanged text to the summary. Informational findings go to the [summary][qodo-verbosity] rather than a thread, since a thread blocks the merge until resolved. Images are off so a finding's title is plain text a matcher can see. Qodo's [review standards][qodo-rules] import from `AGENTS.md`, `CLAUDE.md`, `copilot-instructions.md`, and `SKILL.md` files when changes merge. Each is scoped to its folder at any depth. Only new rules are added, so an edited or deleted rule is changed in its portal instead. This repository sits below Qodo's star gate and gets no automatic Qodo review. +- **Which reviewer runs, and when**, is the repository's review policy, `.github/pr-review.json`, or the hub default `spec/pr-review.default.json` where it carries none. `scripts/README.md` "`pr_review.py`" describes how `wait` applies it. A bot's own automatic trigger is a setting outside the policy. `auto` says only that the bot may start on its own. `explicit` assumes it does not, so turn the bot's own trigger off before moving it to `explicit`. Otherwise it reviews twice. For Copilot, `wait` also notes any request already pending when it starts. That includes one an earlier `wait` sent, so the note points at a trigger left on only where no session sent the request. - **GitHub Copilot**: the carried `.github/copilot-instructions.md`, which bootstraps the `fleet-code-review` Skill, is the lever this repository uses. GitHub also documents path-scoped `.github/instructions/*.instructions.md` files, unused here. ## Plan and Repository Scope diff --git a/scripts/README.md b/scripts/README.md index a419917fd..c11a27ffd 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -6,7 +6,7 @@ The fleet's checks and review tooling, run by hand, with the deterministic ones Python only, and standard library only, with markdown-it-py and PyYAML the exceptions. `build_dist.py`, `canonical_review.py`, `carry.py`, `pr_review.py`, `pr_review_copilot.py`, and `pr_cleanup.py` declare markdown-it-py in their inline script metadata, and `build_dist.py` declares PyYAML as well. `build_dist.py` and `carry.py` import markdown-it-py only on the path that reads a region. `build_dist.py` imports PyYAML only on the path that measures a skill description. That is because `skills_install.py` and `handoff.py` import them under a plain `python3`. Every check script is read-only and exits non-zero on a finding. `build_dist.py`, `local_review.py`, `canonical_review.py`, `handoff.py`, and `skills_install.py` below are the exceptions, since a generator, two recorders, an installer, and the handoff chain all exist to write. `build_dist.py --check` and `skills_install.py --report` are read-only modes for CI and for asking without changing anything. `local_review.py status` and `check` answer without recording anything, but they are not read-only in that same sense. Reading the working tree stages it, which writes inside `.git` and runs any `filter.*.clean` the repository configures. Only the receipt is left untouched. `canonical_review.py` reads files rather than staging them, so its `list`, `status`, `sweep`, and `report` are read-only outright, and `record` alone writes. -The directory separates its kinds by name and by tree. A gate checks and exits non-zero on a finding, and its name carries a `_lint` or `_gate` suffix saying what it gates. The `prose_lint.py` and `repo_gate.py` entry points delegate to the action-owned implementations that gate this tree in CI, and `host_gate.py` gates the machine it runs on. A utility does work rather than gating and carries no suffix: `backlog_metrics.py`, `build_dist.py`, `canonical_review.py`, `handoff.py`, `local_review.py`, `pr_cleanup.py`, `pr_review.py`, `pr_review_copilot.py`, `skills_install.py`. `gh_graphql.py` is a library with no command line, the GraphQL transport and cursor walker that `backlog_metrics.py`, `handoff.py`, `pr_cleanup.py`, and `pr_review.py` import from beside them. `pr_review_checks.py`, `pr_review_check_lines.py`, `pr_review_rounds.py`, and `pr_review_digest.py` are libraries with no command line as well. They are the pure readers `pr_review.py` imports for the head's checks, its review rounds, and the digest rendered from both. The digest takes its lines about the checks from `pr_review_check_lines.py`. The unit tests live apart at the repository root under [`tests/`][tests], one `test_