diff --git a/.agents/skills/drive-pr/SKILL.md b/.agents/skills/drive-pr/SKILL.md index 3676dad24..d9d4774db 100644 --- a/.agents/skills/drive-pr/SKILL.md +++ b/.agents/skills/drive-pr/SKILL.md @@ -249,5 +249,5 @@ instance's outcome is context for the new one, never a standing answer to reuse - A genuine design trade-off, a recurring finding pattern, or an architectural redesign proposal each escalate per pr-review-conduct's own list, restated there, not duplicated here. -- An unrecognized review shape blocks the gate on its own, file an issue naming it and ask, never - guess what new wording probably meant. +- A review shape the digest notes under `shapes=NOTED` is read by hand per pr-review-conduct's + Merge Gate item 4, never guessed at from what the new wording probably meant. diff --git a/.agents/skills/merge-and-release/SKILL.md b/.agents/skills/merge-and-release/SKILL.md index 7ad9a4f3e..3d1bffc95 100644 --- a/.agents/skills/merge-and-release/SKILL.md +++ b/.agents/skills/merge-and-release/SKILL.md @@ -61,10 +61,10 @@ skill covers all of it, scoped down by what the maintainer actually asks for. 1. Identify the open develop -> main promotion PR for this repo, stop and report if none is open. 2. Record the promotion's live head, `gh pr view [number] --repo owner/repo --json headRefOid --jq .headRefOid`. Then, from a hub checkout, `scripts/` is not carried into downstream repos, - run `scripts/pr_review.py status [number] --repo owner/repo` on it and confirm the + run `uv run --no-project --script scripts/pr_review.py status [number] --repo owner/repo` on it and confirm the pr-review-conduct Merge Gate. Stop and report exactly what is missing rather than merging on a - partial gate. A `status` exit `45` is not a partial gate where the promotion meets the one case - that skill's Merge Gate item 2 states. Check that case again on every re-run below, and record + partial gate. A digest reading `coverage=none` is not a partial gate where the promotion meets the + one case that skill's Merge Gate item 2 states. Check that case again on every re-run below, and record its evidence for the head step 3 merges, as that item says. Confirm the digest's `head=` is a prefix of the recorded SHA, re-running both where it is not, so the SHA step 3 merges is the one the gate verified. Where drive-pr's ready report named a diff --git a/.agents/skills/pr-review-conduct/SKILL.md b/.agents/skills/pr-review-conduct/SKILL.md index ce34cf297..e03e3d876 100644 --- a/.agents/skills/pr-review-conduct/SKILL.md +++ b/.agents/skills/pr-review-conduct/SKILL.md @@ -39,27 +39,22 @@ visible comments, routinely still carries a finding nobody has answered. Treatin 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, - where the whole review history is in view and no round on record states or appears to state - partial coverage. A promotion re-reviews content its feature pull requests already carried, so + 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 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. Where - the round covering the - head states no coverage at all, the newest round that does state some stands in for it, and - only where the pull request changes the same set of files at both commits, since a statement - about a diff this head no longer has says nothing about this one. A head round's own - statement always wins, and `pr_review.py` refuses the carry where it cannot read that set at - both commits. Where no statement reaches the head either way, a round covering it whose own - file table names exactly the changed files covers it, `coverage=table` in the digest, which is - the reading a Copilot round at Balanced review effort gives, and a statement that reaches the - head, stated on it or carried to it, wins over that table. Where no round covering the head - carries a table of its own, the newest round that does, its table naming exactly the changed - files, stands in under the bound a statement carries under, the pull request changing the same - set of files at both commits, and that reading shows as `coverage=carried:table`. The table - stands in only where no Copilot round on the pull request, on any commit, states or appears to - state partial coverage, so a pull request that ever had a partial round goes to the maintainer. + head SHA and still decline the PR outright, or say it read only part of the changed files. + `pr_review.py` reads coverage into the digest's `coverage=` field, and only a stated partial + is an exit code, `42`. A round covering the head that states full coverage satisfies this + item. Where none states any, a round covering the head whose own file table names exactly the + changed files covers it, `coverage=table`, the reading a Copilot round at Balanced review + effort gives. Where no round covering the head carries a table of its own, the newest round + that does, its table naming exactly the changed files, stands in as `coverage=carried:table`. + 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. + `coverage=none` and `coverage=UNKNOWN` leave this item unsatisfied and decide no exit code, + so read the field rather than the exit. The coverage this item requires is Copilot's, or the attested local pass above, and CodeRabbit and Qodo are advisory, since the hub's `docs/pr-reviewer-evaluation.md` "Status" names Copilot the incumbent and says no candidate is @@ -70,22 +65,25 @@ visible comments, routinely still carries a finding nobody has answered. Treatin ordinary "reviewed, nothing to flag" shape, not a missing review. 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, which is the - only cause on record that the loop can clear. `pr_review.py wait` exit `46` is the one nothing - the loop does clears, the pull request's newest Copilot review being an account-quota refusal - or an error refusal read as a possible quota hit, on this head or an earlier one, which is the - case "Which Reviewers a Repository Actually Has" below states. Exit `47` is that same account - state read from the reviewer's activity elsewhere when this head carries none of its own, and - exit `41` holding across several heads with no cause its body names reaches it the slower way. - Those exits are `wait`'s alone: `status` exits 0 over a refusal, carrying it as `refusal=` in - the digest line instead, so reading that exit code as the absence of one would falsely satisfy - this item on the exact state it exists to catch. That is where the + only cause on record that the loop can clear. `pr_review.py wait` exits `41` on every refusal + and quota state, its `status=` line naming which, and the digest's `refusal=` field carries + a refusal on this pull request. + `refusal=QUOTA` or `refusal=ERROR`, the pull request's newest Copilot review being an + account-quota refusal or an error refusal read as a possible quota hit, on this head or an + earlier one, is the one nothing the loop does clears, which is the case "Which Reviewers a + Repository Actually Has" below states. `status=COPILOT_QUOTA_EXHAUSTED_REPO_WIDE` is that same + account state read from the reviewer's activity elsewhere when this head carries none of its + own, and a refusal holding across several heads with no cause its body names reaches it the + slower way. That exit is `wait`'s alone: `status` exits 0 over a refusal, carrying it as + `refusal=` in the digest line instead, so reading that exit code as the absence of one would + falsely satisfy this item on the exact state it exists to catch. That is where the unsatisfied item goes to the maintainer, with the coverage the other reviewers gave that head read rather than counted and named to them, and their permission under item 5 is what allows the merge. Item 2 is never waived, and a merge over an unsatisfied one is theirs to authorize. One further case satisfies this item where no coverage reaches the head, and it is the only such case. The maintainer adopted it as a standing rule. It applies to a develop -> main - promotion on which `pr_review.py` exits `45`. That promotion satisfies item 2 where each + promotion on which `pr_review.py` reads `coverage=none`. That promotion satisfies item 2 where each of these holds on the live head: - Every change it carries had full coverage on its own feature -> develop pull request, from its @@ -93,8 +91,7 @@ visible comments, routinely still carries a finding nobody has answered. Treatin coverage, not by permission. Failing that, each file it changed has positive evidence of a full read, at the head that last changed the file or a later one. A Copilot table row with no note, on that pull request or on the promotion, is such evidence. It counts only where no - Copilot round on the pull request holding it, on any commit, states or appears to state - partial coverage. A round stating full coverage is evidence for every file. So is the + Copilot round on the pull request holding it, on any commit, states partial coverage. A round stating full coverage is evidence for every file. So is the attestation `pr_review.py attest` published on the feature pull request, for each file the attested head's diff held. That head is held to the same rule, the head that last changed the file or a later one. The attestation counts only from an owner, member, or collaborator, with the marker @@ -102,10 +99,9 @@ visible comments, routinely still carries a finding nobody has answered. Treatin pull request merged into. A local receipt does not count, since removing its worktree deletes it. - Every review thread on the promotion is resolved, and every check passes. - - Exit `45` is the only reason `pr_review.py` does not report the promotion ready. Read this - from the digest's lines rather than from the exit code, since exit `45` returns before the - exit `50` check runs. A `VERDICT WITH NO COUNTED FINDING` headline is a second reason until - it is answered under item 3, and not after. + - `coverage=none` is the only reason `pr_review.py` does not report the promotion ready, read + from the digest's lines. A `VERDICT WITH NO COUNTED FINDING` headline, exit `50`, is a second + reason until it is answered under item 3, and not after. The merge then runs with `--match-head-commit` set to the head those were checked on. The evidence names each constituent pull request and how its coverage was stated. An @@ -128,28 +124,24 @@ visible comments, routinely still carries a finding nobody has answered. Treatin decline one with evidence rather than a reason to leave it unanswered. Qodo's own `Resolved`/`Dismissed` self-tracked badge is a fast pre-triage signal, not a substitute for reading the finding, spot-verify against `gh pr diff` rather than trusting it outright. - Copilot's second review-body format states its own finding total, which the digest reads as - `overview=T/M` beside the number of review threads that round opened. A total larger than that - thread count is usually findings that format withheld, the same blind spot under a different - name, and it is sometimes the digest undercounting instead, where the round's enumeration - carries findings earlier rounds raised. Reading the review body is what tells the two apart, and - nothing else does, so read it and dispose of what it holds as this section's outcomes require. - `T` reads `?` where no total was found, which is a round stating none and equally one the digest + A Copilot round states its own count of open findings, which the digest reads as + `overview=T/M` beside the number of review threads that round opened. The digest's + `FINDINGS WITH NO THREAD` block counts the findings the round names, in that count or in its + findings list, that no open entry links to a thread on the pull request. That is usually + findings the round withheld, the same blind spot under a different name, and sometimes the + digest undercounting instead. Reading the review body is what tells the two apart, and nothing + else does, so read it and dispose of what it holds as this section's outcomes require. `T` + reads `?` where no count was found, which is a round stating none and equally one the digest could not locate, so a `?` leaves this item unsatisfied and sends you to the body exactly as a - shortfall does. The digest's `FINDINGS WITH NO THREAD` block also counts an open-findings entry - whose title links no thread, whatever the totals say. A round with a verdict other than the + shortfall does. A round with a verdict other than the clean one that counts no finding prints its headline under `VERDICT WITH NO COUNTED FINDING`, and `status` and `wait` exit `50`. The headline is the one place that round names what it flags, so answer it as a suppressed finding. The exit code repeats on that head after the answer. A clean verdict on the same terms prints its headline under `CLEAN VERDICT HEADLINE`, which changes no exit code. Read that headline, since it can name a nit no thread carries, and answer any such nit with `comment`. - The body read in that format so far carried no `Suppressed comments` heading, so `suppressed=` - finds nothing in it and there is no collapsed block to quote a count from: the digest's - shortfall and the body's own prose are what an answer cites instead. A later body that does - collapse one may have those findings counted by `suppressed=` and again in the shortfall, or may - have them counted once each, depending on whether its stated total includes them, which no body - read so far says. Answer what the body holds rather than what the two numbers add up to. + A finding `suppressed=` counts may be counted in the shortfall too, so answer what the body + holds rather than what the two numbers add up to. What closing a finding owes turns on whether it is `pre-existing`, under the classes `local-strict-review` "Disposing of Findings" defines, applied here to a PR-hosted finding. A `pre-existing` finding on text inside a canonical Markdown unit takes the first bullet of @@ -178,10 +170,12 @@ visible comments, routinely still carries a finding nobody has answered. Treatin the review round, and the list's length where it states the block's `(N)` count. A line under a heading that outcome 4 of that section names is not on that list. It is already its finding's outcome, and owes only the pointer that outcome names. -4. Nothing in the review was a shape the tooling could not read (an unrecognized heading, a moved - section, an unfamiliar coverage wording). An unrecognized shape blocks the gate on its own. - File an issue naming it and quoting the body, rather than guessing what the new wording - probably meant. +4. Every part of the review the tooling could not read was read by hand (an unrecognized + heading, a moved section, an unfamiliar label). The digest marks one `shapes=NOTED` and names + each under `REVIEWER OUTPUT NOTED`, and decides no exit code on it, so this item is read from + the digest rather than the exit. Read the body for what that part says, give any finding in it + item 3's outcome, and file an issue on the hub naming the spelling to add to its + `scripts/reviewers/` vocabulary, rather than guessing what the new wording probably meant. 5. The maintainer has given **explicit** permission to merge. The agent never merges on its own. A green or CLEAN PR with one open finding is not mergeable, @@ -244,12 +238,12 @@ is never carried into a downstream repository. Run `local-strict-review` against the branch's current diff before every push this loop makes, the one that opens the pull request in step 1 and each one after it, whatever finding it answers and whether or not the branch was reviewed once already. A push that delivers content no pass has read is the case the rule is about, so a re-push of a tree a recorded pass already covers needs no second pass, the receipt being keyed on the branch's net content rather than on its commit series. A rebase that leaves the tree alone keeps it only while the merge base holds: rebasing onto a target that has moved retires the receipt although no file changed, and that push owes a pass like any other. Follow that skill's own ordering and record each pass, which is what a capture point reads, the hub's own `pre-push` hook being one and a repository having none until such a hook is carried to it. A push that hook refuses, where one is present, is the gate working rather than an obstacle to route around, and that skill's refusal table says what each refusal means and what clears it. 1. Push changes to the PR branch and open the pull request when it does not exist. Once the push - lands, run `scripts/pr_review.py attest --repo / --checkout `. + lands, run `uv run --no-project --script scripts/pr_review.py attest --repo / --checkout `. `attest` refuses unless the checkout is the pushed head and a recorded pass covers that head. Attest after every push a recorded pass covers, the opening push included. The comment `attest` posts is the record Merge Gate item 2's promotion case reads, since the receipt goes when its worktree does. -2. Run `scripts/pr_review.py status --repo /` once in the foreground and read its output. +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 @@ -260,7 +254,7 @@ Run `local-strict-review` against the branch's current diff before every push th drift, under a quota or error refusal, and where something is already in the request set, which is the condition the recovery below clears. Requesting in the pull request UI is the maintainer's route rather than this loop's. -4. Run a bounded `scripts/pr_review.py wait --repo /` in a background process and read its terminal output. +4. Run a bounded `uv run --no-project --script scripts/pr_review.py wait --repo /` in a background process and read its terminal output. A completed review raising **no findings** is a valid terminal outcome, so do not re-trigger it or read silence as a missing review. A review whose body says it declined to review is the one exception, and it is terminal the other way. Nothing follows it, and re-requesting the same @@ -272,7 +266,7 @@ Run `local-strict-review` against the branch's current diff before every push th 8. Re-run the loop after every fix push until the checks are green, the current head is covered, and no finding remains open. -The review effort setting is user-controlled. The workflow never selects or changes it. `status` reports `effort=lite`, `effort=balanced`, or `effort=max` when the completed review exposes that metadata, lowercased, and names an inherited setting apart from a chosen one in a separate `effort_source=default|explicit` field, both reading `unknown` when no effort line parses. Missing effort metadata reports `unknown` and does not change coverage or completion. A pending effort-labeled request can complete without a `copilot_work_started` timeline event, so absence of that event never proves the request is abandoned. The bounded timeout reports `PENDING` when no review or terminal answer arrives. `requested=yes` reports that the request was accepted rather than that a round is coming. An accepted request can sit unpicked, printing the same digest as one about to be served, so a driver reading that field as progress is waiting on evidence it does not hold. After a timeout carrying it, rerun `wait` for another bounded interval by default, because the request may still be active. Where a second bounded wait times out as well, read the pending set, and clear it only where no human or team reviewer is requested alongside the bot, because the clear replaces that set rather than adding to it and nothing restores a request it drops. A stall on a pull request that has a human or team reviewer requested goes to the maintainer instead, and so does one still pending after the wait that follows a clear. The clear leaves the next `wait` nothing outstanding to defer to, so that run requests afresh, and its own auto-request line is what says so, since `wait` reads the reviewer's node id out of the repository's recent reviews and polls without requesting where it finds none. The hub's `docs/pr-reviewer-reference.md` carries the mutation, and an agent seat can run it, where removing and re-adding the reviewer in the pull request UI is a step only the maintainer can take. This recovery replaces only the review request and never changes the effort setting. A `wait` ending `REQUEST_NOT_RECORDED`, exit 48, 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, which is how an exhausted Copilot allowance has shown itself, so clearing and requesting again does not clear it and it goes to the maintainer. +The review effort setting is user-controlled. The workflow never selects or changes it. `status` reports `effort=lite`, `effort=balanced`, or `effort=max` when the completed review exposes that metadata, lowercased, and names an inherited setting apart from a chosen one in a separate `effort_source=default|explicit` field, both reading `unknown` when no effort line parses. Missing effort metadata reports `unknown` and does not change coverage or completion. A pending effort-labeled request can complete without a `copilot_work_started` timeline event, so absence of that event never proves the request is abandoned. The bounded timeout reports `PENDING` when no review or terminal answer arrives. `requested=yes` reports that the request was accepted rather than that a round is coming. An accepted request can sit unpicked, printing the same digest as one about to be served, so a driver reading that field as progress is waiting on evidence it does not hold. After a timeout carrying it, rerun `wait` for another bounded interval by default, because the request may still be active. Where a second bounded wait times out as well, read the pending set, and clear it only where no human or team reviewer is requested alongside the bot, because the clear replaces that set rather than adding to it and nothing restores a request it drops. A stall on a pull request that has a human or team reviewer requested goes to the maintainer instead, and so does one still pending after the wait that follows a clear. The clear leaves the next `wait` nothing outstanding to defer to, so that run requests afresh, and its own auto-request line is what says so, since `wait` reads the reviewer's node id out of the repository's recent reviews and polls without requesting where it finds none. The hub's `docs/pr-reviewer-reference.md` carries the mutation, and an agent seat can run it, where removing and re-adding the reviewer in the pull request UI is a step only the maintainer can take. 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, which is how an exhausted Copilot allowance has shown itself, so clearing and requesting again does not clear it and it goes to the maintainer. Drive to green, a review confirmed on the latest head SHA and every actionable finding closed, then apply the Merge Gate above. **Never exit this PR-hosted loop early.** Its pre-push @@ -395,7 +389,7 @@ own words to identify it. Give one bold verdict per finding: `Fixed in `, ` maintainer's decision. State the `(N)` count the block gave so answers can be checked against findings, and link the review round. **Read every round, not only the head.** A suppressed finding does not retire when a later push -supersedes it, it just stops showing up in a head-scoped query while still unanswered. Post the answer with `scripts/pr_review.py comment --repo / --body ` +supersedes it, it just stops showing up in a head-scoped query while still unanswered. Post the answer with `uv run --no-project --script scripts/pr_review.py comment --repo / --body ` from a hub checkout. Do not use a provider connector or reconstruct the GitHub mutation. ## Escalate to the maintainer when diff --git a/.agents/skills/python-codestyle/references/profiles.md b/.agents/skills/python-codestyle/references/profiles.md index c4457c558..2d2f5424b 100644 --- a/.agents/skills/python-codestyle/references/profiles.md +++ b/.agents/skills/python-codestyle/references/profiles.md @@ -71,7 +71,8 @@ configuration alone marks the lint-only one: coverage report to Codecov. The hub validator runs them in each directory the caller declares in its `python-directories` input, which the registry's `pythonDirectories` mirrors. From inside a lint-only directory it runs `uvx ruff@latest check`, `uvx ruff@latest format --check`, - `uvx mypy@latest`, and `uvx coverage@latest run -m unittest discover -s tests`, then writes + `uvx mypy@latest`, and `uvx coverage@latest run -m unittest discover -s tests`, adding + `--with-requirements tests/requirements.txt` to that last where the directory carries one, then writes `coverage.xml` and uploads it best-effort per `WORKFLOW.md` D1.6, with no threshold adopted. A declared directory with no `tests/` fails that job. diff --git a/.agents/skills/repo-worktree/SKILL.md b/.agents/skills/repo-worktree/SKILL.md index 47b12e5eb..549f81d6f 100644 --- a/.agents/skills/repo-worktree/SKILL.md +++ b/.agents/skills/repo-worktree/SKILL.md @@ -285,8 +285,8 @@ since git then runs whatever that directory holds, and nothing where it holds no session changed a tree in between, and its output then names what was already deleted. Any exit other than `0` stops and is reported as it stands rather than finished by hand. The raw `git worktree remove`, `git branch -D`, and remote delete it replaces are not on the host-safety - permission allowlist, and the command is. `scripts/README.md` in the hub holds the full - contract. + permission allowlist, and the command is. It forwards to `scripts/pr_cleanup.py`, and + `scripts/README.md` "`pr_cleanup.py`" in the hub holds the full contract. - **What no merged pull request into `develop` covers is removed by hand.** That is a promotion's worktree, a detached helper worktree, and a temporary standalone clone. Confirm the tree is clean, then remove the exact path with `git worktree remove `, or delete the exact diff --git a/.agents/skills/unattended-handoff/SKILL.md b/.agents/skills/unattended-handoff/SKILL.md index d61d454eb..42aea3bb3 100644 --- a/.agents/skills/unattended-handoff/SKILL.md +++ b/.agents/skills/unattended-handoff/SKILL.md @@ -300,8 +300,8 @@ does not qualify, since skipping one costs nothing and a guess costs a revert an the lane read finds the promotion held, the round narrows to develop. Otherwise, where a `decision` issue blocking that promotion has a `closedAt` at or after the time noted before the first read, park. That answer may not be to merge, so the `decision` issue the park files asks - whether it lets the promotion merge. Exit `45` on a promotion blocks no merge where the promotion - meets the one case `pr-review-conduct` Merge Gate item 2 states. Such a promotion merges with no + whether it lets the promotion merge. A digest reading `coverage=none` on a promotion blocks no + merge where the promotion meets the one case `pr-review-conduct` Merge Gate item 2 states. Such a promotion merges with no `decision` issue, and the worker records that item's evidence on the handoff. Any other shortfall parks. 4. **Wait in the foreground.** Each wait is one bounded command such as `pr_review.py wait`, run in diff --git a/.claude-plugin/fleet-skills/.source-digests/drive-pr b/.claude-plugin/fleet-skills/.source-digests/drive-pr index 1f89dc37e..c716b9e40 100644 --- a/.claude-plugin/fleet-skills/.source-digests/drive-pr +++ b/.claude-plugin/fleet-skills/.source-digests/drive-pr @@ -1 +1 @@ -c505ee536cd9fc4b +20fbf0764feb2653 diff --git a/.claude-plugin/fleet-skills/.source-digests/merge-and-release b/.claude-plugin/fleet-skills/.source-digests/merge-and-release index 2335249c4..02997783e 100644 --- a/.claude-plugin/fleet-skills/.source-digests/merge-and-release +++ b/.claude-plugin/fleet-skills/.source-digests/merge-and-release @@ -1 +1 @@ -21cefc7fd8a4a77b +67c1aa2e5852f602 diff --git a/.claude-plugin/fleet-skills/.source-digests/pr-review-conduct b/.claude-plugin/fleet-skills/.source-digests/pr-review-conduct index 5ab128e71..8c3f1d92c 100644 --- a/.claude-plugin/fleet-skills/.source-digests/pr-review-conduct +++ b/.claude-plugin/fleet-skills/.source-digests/pr-review-conduct @@ -1 +1 @@ -0c0d090b10d0e195 +5d653240a1d00f2a diff --git a/.claude-plugin/fleet-skills/.source-digests/python-codestyle b/.claude-plugin/fleet-skills/.source-digests/python-codestyle index 95bb55db0..e9f853b0c 100644 --- a/.claude-plugin/fleet-skills/.source-digests/python-codestyle +++ b/.claude-plugin/fleet-skills/.source-digests/python-codestyle @@ -1 +1 @@ -2cc0649ed49326a5 +d3467a4f6fb7020f diff --git a/.claude-plugin/fleet-skills/.source-digests/repo-worktree b/.claude-plugin/fleet-skills/.source-digests/repo-worktree index 02a66c6ef..ffa1928c6 100644 --- a/.claude-plugin/fleet-skills/.source-digests/repo-worktree +++ b/.claude-plugin/fleet-skills/.source-digests/repo-worktree @@ -1 +1 @@ -c233d55574283ea1 +62200d177005042e diff --git a/.claude-plugin/fleet-skills/.source-digests/unattended-handoff b/.claude-plugin/fleet-skills/.source-digests/unattended-handoff index 36c9d4a08..752540e52 100644 --- a/.claude-plugin/fleet-skills/.source-digests/unattended-handoff +++ b/.claude-plugin/fleet-skills/.source-digests/unattended-handoff @@ -1 +1 @@ -59be7322b3968af3 +151cf349b4115615 diff --git a/.claude-plugin/fleet-skills/skills/drive-pr/SKILL.md b/.claude-plugin/fleet-skills/skills/drive-pr/SKILL.md index 3676dad24..d9d4774db 100644 --- a/.claude-plugin/fleet-skills/skills/drive-pr/SKILL.md +++ b/.claude-plugin/fleet-skills/skills/drive-pr/SKILL.md @@ -249,5 +249,5 @@ instance's outcome is context for the new one, never a standing answer to reuse - A genuine design trade-off, a recurring finding pattern, or an architectural redesign proposal each escalate per pr-review-conduct's own list, restated there, not duplicated here. -- An unrecognized review shape blocks the gate on its own, file an issue naming it and ask, never - guess what new wording probably meant. +- A review shape the digest notes under `shapes=NOTED` is read by hand per pr-review-conduct's + Merge Gate item 4, never guessed at from what the new wording probably meant. diff --git a/.claude-plugin/fleet-skills/skills/merge-and-release/SKILL.md b/.claude-plugin/fleet-skills/skills/merge-and-release/SKILL.md index 7ad9a4f3e..3d1bffc95 100644 --- a/.claude-plugin/fleet-skills/skills/merge-and-release/SKILL.md +++ b/.claude-plugin/fleet-skills/skills/merge-and-release/SKILL.md @@ -61,10 +61,10 @@ skill covers all of it, scoped down by what the maintainer actually asks for. 1. Identify the open develop -> main promotion PR for this repo, stop and report if none is open. 2. Record the promotion's live head, `gh pr view [number] --repo owner/repo --json headRefOid --jq .headRefOid`. Then, from a hub checkout, `scripts/` is not carried into downstream repos, - run `scripts/pr_review.py status [number] --repo owner/repo` on it and confirm the + run `uv run --no-project --script scripts/pr_review.py status [number] --repo owner/repo` on it and confirm the pr-review-conduct Merge Gate. Stop and report exactly what is missing rather than merging on a - partial gate. A `status` exit `45` is not a partial gate where the promotion meets the one case - that skill's Merge Gate item 2 states. Check that case again on every re-run below, and record + partial gate. A digest reading `coverage=none` is not a partial gate where the promotion meets the + one case that skill's Merge Gate item 2 states. Check that case again on every re-run below, and record its evidence for the head step 3 merges, as that item says. Confirm the digest's `head=` is a prefix of the recorded SHA, re-running both where it is not, so the SHA step 3 merges is the one the gate verified. Where drive-pr's ready report named a 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 ce34cf297..e03e3d876 100644 --- a/.claude-plugin/fleet-skills/skills/pr-review-conduct/SKILL.md +++ b/.claude-plugin/fleet-skills/skills/pr-review-conduct/SKILL.md @@ -39,27 +39,22 @@ visible comments, routinely still carries a finding nobody has answered. Treatin 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, - where the whole review history is in view and no round on record states or appears to state - partial coverage. A promotion re-reviews content its feature pull requests already carried, so + 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 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. Where - the round covering the - head states no coverage at all, the newest round that does state some stands in for it, and - only where the pull request changes the same set of files at both commits, since a statement - about a diff this head no longer has says nothing about this one. A head round's own - statement always wins, and `pr_review.py` refuses the carry where it cannot read that set at - both commits. Where no statement reaches the head either way, a round covering it whose own - file table names exactly the changed files covers it, `coverage=table` in the digest, which is - the reading a Copilot round at Balanced review effort gives, and a statement that reaches the - head, stated on it or carried to it, wins over that table. Where no round covering the head - carries a table of its own, the newest round that does, its table naming exactly the changed - files, stands in under the bound a statement carries under, the pull request changing the same - set of files at both commits, and that reading shows as `coverage=carried:table`. The table - stands in only where no Copilot round on the pull request, on any commit, states or appears to - state partial coverage, so a pull request that ever had a partial round goes to the maintainer. + head SHA and still decline the PR outright, or say it read only part of the changed files. + `pr_review.py` reads coverage into the digest's `coverage=` field, and only a stated partial + is an exit code, `42`. A round covering the head that states full coverage satisfies this + item. Where none states any, a round covering the head whose own file table names exactly the + changed files covers it, `coverage=table`, the reading a Copilot round at Balanced review + effort gives. Where no round covering the head carries a table of its own, the newest round + that does, its table naming exactly the changed files, stands in as `coverage=carried:table`. + 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. + `coverage=none` and `coverage=UNKNOWN` leave this item unsatisfied and decide no exit code, + so read the field rather than the exit. The coverage this item requires is Copilot's, or the attested local pass above, and CodeRabbit and Qodo are advisory, since the hub's `docs/pr-reviewer-evaluation.md` "Status" names Copilot the incumbent and says no candidate is @@ -70,22 +65,25 @@ visible comments, routinely still carries a finding nobody has answered. Treatin ordinary "reviewed, nothing to flag" shape, not a missing review. 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, which is the - only cause on record that the loop can clear. `pr_review.py wait` exit `46` is the one nothing - the loop does clears, the pull request's newest Copilot review being an account-quota refusal - or an error refusal read as a possible quota hit, on this head or an earlier one, which is the - case "Which Reviewers a Repository Actually Has" below states. Exit `47` is that same account - state read from the reviewer's activity elsewhere when this head carries none of its own, and - exit `41` holding across several heads with no cause its body names reaches it the slower way. - Those exits are `wait`'s alone: `status` exits 0 over a refusal, carrying it as `refusal=` in - the digest line instead, so reading that exit code as the absence of one would falsely satisfy - this item on the exact state it exists to catch. That is where the + only cause on record that the loop can clear. `pr_review.py wait` exits `41` on every refusal + and quota state, its `status=` line naming which, and the digest's `refusal=` field carries + a refusal on this pull request. + `refusal=QUOTA` or `refusal=ERROR`, the pull request's newest Copilot review being an + account-quota refusal or an error refusal read as a possible quota hit, on this head or an + earlier one, is the one nothing the loop does clears, which is the case "Which Reviewers a + Repository Actually Has" below states. `status=COPILOT_QUOTA_EXHAUSTED_REPO_WIDE` is that same + account state read from the reviewer's activity elsewhere when this head carries none of its + own, and a refusal holding across several heads with no cause its body names reaches it the + slower way. That exit is `wait`'s alone: `status` exits 0 over a refusal, carrying it as + `refusal=` in the digest line instead, so reading that exit code as the absence of one would + falsely satisfy this item on the exact state it exists to catch. That is where the unsatisfied item goes to the maintainer, with the coverage the other reviewers gave that head read rather than counted and named to them, and their permission under item 5 is what allows the merge. Item 2 is never waived, and a merge over an unsatisfied one is theirs to authorize. One further case satisfies this item where no coverage reaches the head, and it is the only such case. The maintainer adopted it as a standing rule. It applies to a develop -> main - promotion on which `pr_review.py` exits `45`. That promotion satisfies item 2 where each + promotion on which `pr_review.py` reads `coverage=none`. That promotion satisfies item 2 where each of these holds on the live head: - Every change it carries had full coverage on its own feature -> develop pull request, from its @@ -93,8 +91,7 @@ visible comments, routinely still carries a finding nobody has answered. Treatin coverage, not by permission. Failing that, each file it changed has positive evidence of a full read, at the head that last changed the file or a later one. A Copilot table row with no note, on that pull request or on the promotion, is such evidence. It counts only where no - Copilot round on the pull request holding it, on any commit, states or appears to state - partial coverage. A round stating full coverage is evidence for every file. So is the + Copilot round on the pull request holding it, on any commit, states partial coverage. A round stating full coverage is evidence for every file. So is the attestation `pr_review.py attest` published on the feature pull request, for each file the attested head's diff held. That head is held to the same rule, the head that last changed the file or a later one. The attestation counts only from an owner, member, or collaborator, with the marker @@ -102,10 +99,9 @@ visible comments, routinely still carries a finding nobody has answered. Treatin pull request merged into. A local receipt does not count, since removing its worktree deletes it. - Every review thread on the promotion is resolved, and every check passes. - - Exit `45` is the only reason `pr_review.py` does not report the promotion ready. Read this - from the digest's lines rather than from the exit code, since exit `45` returns before the - exit `50` check runs. A `VERDICT WITH NO COUNTED FINDING` headline is a second reason until - it is answered under item 3, and not after. + - `coverage=none` is the only reason `pr_review.py` does not report the promotion ready, read + from the digest's lines. A `VERDICT WITH NO COUNTED FINDING` headline, exit `50`, is a second + reason until it is answered under item 3, and not after. The merge then runs with `--match-head-commit` set to the head those were checked on. The evidence names each constituent pull request and how its coverage was stated. An @@ -128,28 +124,24 @@ visible comments, routinely still carries a finding nobody has answered. Treatin decline one with evidence rather than a reason to leave it unanswered. Qodo's own `Resolved`/`Dismissed` self-tracked badge is a fast pre-triage signal, not a substitute for reading the finding, spot-verify against `gh pr diff` rather than trusting it outright. - Copilot's second review-body format states its own finding total, which the digest reads as - `overview=T/M` beside the number of review threads that round opened. A total larger than that - thread count is usually findings that format withheld, the same blind spot under a different - name, and it is sometimes the digest undercounting instead, where the round's enumeration - carries findings earlier rounds raised. Reading the review body is what tells the two apart, and - nothing else does, so read it and dispose of what it holds as this section's outcomes require. - `T` reads `?` where no total was found, which is a round stating none and equally one the digest + A Copilot round states its own count of open findings, which the digest reads as + `overview=T/M` beside the number of review threads that round opened. The digest's + `FINDINGS WITH NO THREAD` block counts the findings the round names, in that count or in its + findings list, that no open entry links to a thread on the pull request. That is usually + findings the round withheld, the same blind spot under a different name, and sometimes the + digest undercounting instead. Reading the review body is what tells the two apart, and nothing + else does, so read it and dispose of what it holds as this section's outcomes require. `T` + reads `?` where no count was found, which is a round stating none and equally one the digest could not locate, so a `?` leaves this item unsatisfied and sends you to the body exactly as a - shortfall does. The digest's `FINDINGS WITH NO THREAD` block also counts an open-findings entry - whose title links no thread, whatever the totals say. A round with a verdict other than the + shortfall does. A round with a verdict other than the clean one that counts no finding prints its headline under `VERDICT WITH NO COUNTED FINDING`, and `status` and `wait` exit `50`. The headline is the one place that round names what it flags, so answer it as a suppressed finding. The exit code repeats on that head after the answer. A clean verdict on the same terms prints its headline under `CLEAN VERDICT HEADLINE`, which changes no exit code. Read that headline, since it can name a nit no thread carries, and answer any such nit with `comment`. - The body read in that format so far carried no `Suppressed comments` heading, so `suppressed=` - finds nothing in it and there is no collapsed block to quote a count from: the digest's - shortfall and the body's own prose are what an answer cites instead. A later body that does - collapse one may have those findings counted by `suppressed=` and again in the shortfall, or may - have them counted once each, depending on whether its stated total includes them, which no body - read so far says. Answer what the body holds rather than what the two numbers add up to. + A finding `suppressed=` counts may be counted in the shortfall too, so answer what the body + holds rather than what the two numbers add up to. What closing a finding owes turns on whether it is `pre-existing`, under the classes `local-strict-review` "Disposing of Findings" defines, applied here to a PR-hosted finding. A `pre-existing` finding on text inside a canonical Markdown unit takes the first bullet of @@ -178,10 +170,12 @@ visible comments, routinely still carries a finding nobody has answered. Treatin the review round, and the list's length where it states the block's `(N)` count. A line under a heading that outcome 4 of that section names is not on that list. It is already its finding's outcome, and owes only the pointer that outcome names. -4. Nothing in the review was a shape the tooling could not read (an unrecognized heading, a moved - section, an unfamiliar coverage wording). An unrecognized shape blocks the gate on its own. - File an issue naming it and quoting the body, rather than guessing what the new wording - probably meant. +4. Every part of the review the tooling could not read was read by hand (an unrecognized + heading, a moved section, an unfamiliar label). The digest marks one `shapes=NOTED` and names + each under `REVIEWER OUTPUT NOTED`, and decides no exit code on it, so this item is read from + the digest rather than the exit. Read the body for what that part says, give any finding in it + item 3's outcome, and file an issue on the hub naming the spelling to add to its + `scripts/reviewers/` vocabulary, rather than guessing what the new wording probably meant. 5. The maintainer has given **explicit** permission to merge. The agent never merges on its own. A green or CLEAN PR with one open finding is not mergeable, @@ -244,12 +238,12 @@ is never carried into a downstream repository. Run `local-strict-review` against the branch's current diff before every push this loop makes, the one that opens the pull request in step 1 and each one after it, whatever finding it answers and whether or not the branch was reviewed once already. A push that delivers content no pass has read is the case the rule is about, so a re-push of a tree a recorded pass already covers needs no second pass, the receipt being keyed on the branch's net content rather than on its commit series. A rebase that leaves the tree alone keeps it only while the merge base holds: rebasing onto a target that has moved retires the receipt although no file changed, and that push owes a pass like any other. Follow that skill's own ordering and record each pass, which is what a capture point reads, the hub's own `pre-push` hook being one and a repository having none until such a hook is carried to it. A push that hook refuses, where one is present, is the gate working rather than an obstacle to route around, and that skill's refusal table says what each refusal means and what clears it. 1. Push changes to the PR branch and open the pull request when it does not exist. Once the push - lands, run `scripts/pr_review.py attest --repo / --checkout `. + lands, run `uv run --no-project --script scripts/pr_review.py attest --repo / --checkout `. `attest` refuses unless the checkout is the pushed head and a recorded pass covers that head. Attest after every push a recorded pass covers, the opening push included. The comment `attest` posts is the record Merge Gate item 2's promotion case reads, since the receipt goes when its worktree does. -2. Run `scripts/pr_review.py status --repo /` once in the foreground and read its output. +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 @@ -260,7 +254,7 @@ Run `local-strict-review` against the branch's current diff before every push th drift, under a quota or error refusal, and where something is already in the request set, which is the condition the recovery below clears. Requesting in the pull request UI is the maintainer's route rather than this loop's. -4. Run a bounded `scripts/pr_review.py wait --repo /` in a background process and read its terminal output. +4. Run a bounded `uv run --no-project --script scripts/pr_review.py wait --repo /` in a background process and read its terminal output. A completed review raising **no findings** is a valid terminal outcome, so do not re-trigger it or read silence as a missing review. A review whose body says it declined to review is the one exception, and it is terminal the other way. Nothing follows it, and re-requesting the same @@ -272,7 +266,7 @@ Run `local-strict-review` against the branch's current diff before every push th 8. Re-run the loop after every fix push until the checks are green, the current head is covered, and no finding remains open. -The review effort setting is user-controlled. The workflow never selects or changes it. `status` reports `effort=lite`, `effort=balanced`, or `effort=max` when the completed review exposes that metadata, lowercased, and names an inherited setting apart from a chosen one in a separate `effort_source=default|explicit` field, both reading `unknown` when no effort line parses. Missing effort metadata reports `unknown` and does not change coverage or completion. A pending effort-labeled request can complete without a `copilot_work_started` timeline event, so absence of that event never proves the request is abandoned. The bounded timeout reports `PENDING` when no review or terminal answer arrives. `requested=yes` reports that the request was accepted rather than that a round is coming. An accepted request can sit unpicked, printing the same digest as one about to be served, so a driver reading that field as progress is waiting on evidence it does not hold. After a timeout carrying it, rerun `wait` for another bounded interval by default, because the request may still be active. Where a second bounded wait times out as well, read the pending set, and clear it only where no human or team reviewer is requested alongside the bot, because the clear replaces that set rather than adding to it and nothing restores a request it drops. A stall on a pull request that has a human or team reviewer requested goes to the maintainer instead, and so does one still pending after the wait that follows a clear. The clear leaves the next `wait` nothing outstanding to defer to, so that run requests afresh, and its own auto-request line is what says so, since `wait` reads the reviewer's node id out of the repository's recent reviews and polls without requesting where it finds none. The hub's `docs/pr-reviewer-reference.md` carries the mutation, and an agent seat can run it, where removing and re-adding the reviewer in the pull request UI is a step only the maintainer can take. This recovery replaces only the review request and never changes the effort setting. A `wait` ending `REQUEST_NOT_RECORDED`, exit 48, 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, which is how an exhausted Copilot allowance has shown itself, so clearing and requesting again does not clear it and it goes to the maintainer. +The review effort setting is user-controlled. The workflow never selects or changes it. `status` reports `effort=lite`, `effort=balanced`, or `effort=max` when the completed review exposes that metadata, lowercased, and names an inherited setting apart from a chosen one in a separate `effort_source=default|explicit` field, both reading `unknown` when no effort line parses. Missing effort metadata reports `unknown` and does not change coverage or completion. A pending effort-labeled request can complete without a `copilot_work_started` timeline event, so absence of that event never proves the request is abandoned. The bounded timeout reports `PENDING` when no review or terminal answer arrives. `requested=yes` reports that the request was accepted rather than that a round is coming. An accepted request can sit unpicked, printing the same digest as one about to be served, so a driver reading that field as progress is waiting on evidence it does not hold. After a timeout carrying it, rerun `wait` for another bounded interval by default, because the request may still be active. Where a second bounded wait times out as well, read the pending set, and clear it only where no human or team reviewer is requested alongside the bot, because the clear replaces that set rather than adding to it and nothing restores a request it drops. A stall on a pull request that has a human or team reviewer requested goes to the maintainer instead, and so does one still pending after the wait that follows a clear. The clear leaves the next `wait` nothing outstanding to defer to, so that run requests afresh, and its own auto-request line is what says so, since `wait` reads the reviewer's node id out of the repository's recent reviews and polls without requesting where it finds none. The hub's `docs/pr-reviewer-reference.md` carries the mutation, and an agent seat can run it, where removing and re-adding the reviewer in the pull request UI is a step only the maintainer can take. 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, which is how an exhausted Copilot allowance has shown itself, so clearing and requesting again does not clear it and it goes to the maintainer. Drive to green, a review confirmed on the latest head SHA and every actionable finding closed, then apply the Merge Gate above. **Never exit this PR-hosted loop early.** Its pre-push @@ -395,7 +389,7 @@ own words to identify it. Give one bold verdict per finding: `Fixed in `, ` maintainer's decision. State the `(N)` count the block gave so answers can be checked against findings, and link the review round. **Read every round, not only the head.** A suppressed finding does not retire when a later push -supersedes it, it just stops showing up in a head-scoped query while still unanswered. Post the answer with `scripts/pr_review.py comment --repo / --body ` +supersedes it, it just stops showing up in a head-scoped query while still unanswered. Post the answer with `uv run --no-project --script scripts/pr_review.py comment --repo / --body ` from a hub checkout. Do not use a provider connector or reconstruct the GitHub mutation. ## Escalate to the maintainer when diff --git a/.claude-plugin/fleet-skills/skills/python-codestyle/references/profiles.md b/.claude-plugin/fleet-skills/skills/python-codestyle/references/profiles.md index c4457c558..2d2f5424b 100644 --- a/.claude-plugin/fleet-skills/skills/python-codestyle/references/profiles.md +++ b/.claude-plugin/fleet-skills/skills/python-codestyle/references/profiles.md @@ -71,7 +71,8 @@ configuration alone marks the lint-only one: coverage report to Codecov. The hub validator runs them in each directory the caller declares in its `python-directories` input, which the registry's `pythonDirectories` mirrors. From inside a lint-only directory it runs `uvx ruff@latest check`, `uvx ruff@latest format --check`, - `uvx mypy@latest`, and `uvx coverage@latest run -m unittest discover -s tests`, then writes + `uvx mypy@latest`, and `uvx coverage@latest run -m unittest discover -s tests`, adding + `--with-requirements tests/requirements.txt` to that last where the directory carries one, then writes `coverage.xml` and uploads it best-effort per `WORKFLOW.md` D1.6, with no threshold adopted. A declared directory with no `tests/` fails that job. diff --git a/.claude-plugin/fleet-skills/skills/repo-worktree/SKILL.md b/.claude-plugin/fleet-skills/skills/repo-worktree/SKILL.md index 47b12e5eb..549f81d6f 100644 --- a/.claude-plugin/fleet-skills/skills/repo-worktree/SKILL.md +++ b/.claude-plugin/fleet-skills/skills/repo-worktree/SKILL.md @@ -285,8 +285,8 @@ since git then runs whatever that directory holds, and nothing where it holds no session changed a tree in between, and its output then names what was already deleted. Any exit other than `0` stops and is reported as it stands rather than finished by hand. The raw `git worktree remove`, `git branch -D`, and remote delete it replaces are not on the host-safety - permission allowlist, and the command is. `scripts/README.md` in the hub holds the full - contract. + permission allowlist, and the command is. It forwards to `scripts/pr_cleanup.py`, and + `scripts/README.md` "`pr_cleanup.py`" in the hub holds the full contract. - **What no merged pull request into `develop` covers is removed by hand.** That is a promotion's worktree, a detached helper worktree, and a temporary standalone clone. Confirm the tree is clean, then remove the exact path with `git worktree remove `, or delete the exact diff --git a/.claude-plugin/fleet-skills/skills/unattended-handoff/SKILL.md b/.claude-plugin/fleet-skills/skills/unattended-handoff/SKILL.md index d61d454eb..42aea3bb3 100644 --- a/.claude-plugin/fleet-skills/skills/unattended-handoff/SKILL.md +++ b/.claude-plugin/fleet-skills/skills/unattended-handoff/SKILL.md @@ -300,8 +300,8 @@ does not qualify, since skipping one costs nothing and a guess costs a revert an the lane read finds the promotion held, the round narrows to develop. Otherwise, where a `decision` issue blocking that promotion has a `closedAt` at or after the time noted before the first read, park. That answer may not be to merge, so the `decision` issue the park files asks - whether it lets the promotion merge. Exit `45` on a promotion blocks no merge where the promotion - meets the one case `pr-review-conduct` Merge Gate item 2 states. Such a promotion merges with no + whether it lets the promotion merge. A digest reading `coverage=none` on a promotion blocks no + merge where the promotion meets the one case `pr-review-conduct` Merge Gate item 2 states. Such a promotion merges with no `decision` issue, and the worker records that item's evidence on the handoff. Any other shortfall parks. 4. **Wait in the foreground.** Each wait is one bounded command such as `pr_review.py wait`, run in diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 56980d28b..a9ccc1cde 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -28,9 +28,9 @@ 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 and full diff coverage of the change set that head has is stated, or read from a file table as below. The round covering the head states it, or the newest round that states it at all does and the pull request changes the same set of files at both commits, which is the only condition under which a statement carries forward. Only that newest round is consulted, so an older round whose change set does match carries nothing. Where no statement reaches the head either way, a round covering it whose own file table names exactly the changed files covers it, which is the reading a round at Balanced review effort gives, and a statement that reaches the head, stated on it or carried to it, wins over that table. Where no round covering the head carries a table of its own, the newest round that does, its table naming exactly the changed files, stands in under the bound a statement carries under, the pull request changing the same set of files at both commits. The table stands in only where no Copilot round on the pull request, on any commit, states or appears to state 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, a coverage statement that does not reach this head, meaning absent from every round or carried by none because the change set moved or could not be compared, with no file table or attested local pass standing in for it, an unrecognized output shape, 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 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 and full diff coverage of the change set that head has is 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, which is the reading a round at Balanced review effort gives. Where no round covering the head carries a table of its own, the newest round that does stands in where its table names exactly the changed files. 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, a head that no coverage statement, file table, or attested local pass covers, 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 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`. -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, reading 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, 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, or polls and says so on its own auto-request line where it finds no reviewer node id to request with. 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, and 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 48, 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, which is how an exhausted Copilot allowance has shown itself, so clearing and requesting again does not clear it and it goes to the maintainer. +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, reading 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, 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, or polls and says so on its own auto-request line where it finds no reviewer node id to request with. 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, and 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, which is how an exhausted Copilot allowance has shown itself, so clearing and requesting again does not clear it and it goes to the maintainer. ### Disproved Claims diff --git a/.github/skills/drive-pr/SKILL.md b/.github/skills/drive-pr/SKILL.md index 3676dad24..d9d4774db 100644 --- a/.github/skills/drive-pr/SKILL.md +++ b/.github/skills/drive-pr/SKILL.md @@ -249,5 +249,5 @@ instance's outcome is context for the new one, never a standing answer to reuse - A genuine design trade-off, a recurring finding pattern, or an architectural redesign proposal each escalate per pr-review-conduct's own list, restated there, not duplicated here. -- An unrecognized review shape blocks the gate on its own, file an issue naming it and ask, never - guess what new wording probably meant. +- A review shape the digest notes under `shapes=NOTED` is read by hand per pr-review-conduct's + Merge Gate item 4, never guessed at from what the new wording probably meant. diff --git a/.github/skills/merge-and-release/SKILL.md b/.github/skills/merge-and-release/SKILL.md index 7ad9a4f3e..3d1bffc95 100644 --- a/.github/skills/merge-and-release/SKILL.md +++ b/.github/skills/merge-and-release/SKILL.md @@ -61,10 +61,10 @@ skill covers all of it, scoped down by what the maintainer actually asks for. 1. Identify the open develop -> main promotion PR for this repo, stop and report if none is open. 2. Record the promotion's live head, `gh pr view [number] --repo owner/repo --json headRefOid --jq .headRefOid`. Then, from a hub checkout, `scripts/` is not carried into downstream repos, - run `scripts/pr_review.py status [number] --repo owner/repo` on it and confirm the + run `uv run --no-project --script scripts/pr_review.py status [number] --repo owner/repo` on it and confirm the pr-review-conduct Merge Gate. Stop and report exactly what is missing rather than merging on a - partial gate. A `status` exit `45` is not a partial gate where the promotion meets the one case - that skill's Merge Gate item 2 states. Check that case again on every re-run below, and record + partial gate. A digest reading `coverage=none` is not a partial gate where the promotion meets the + one case that skill's Merge Gate item 2 states. Check that case again on every re-run below, and record its evidence for the head step 3 merges, as that item says. Confirm the digest's `head=` is a prefix of the recorded SHA, re-running both where it is not, so the SHA step 3 merges is the one the gate verified. Where drive-pr's ready report named a diff --git a/.github/skills/pr-review-conduct/SKILL.md b/.github/skills/pr-review-conduct/SKILL.md index ce34cf297..e03e3d876 100644 --- a/.github/skills/pr-review-conduct/SKILL.md +++ b/.github/skills/pr-review-conduct/SKILL.md @@ -39,27 +39,22 @@ visible comments, routinely still carries a finding nobody has answered. Treatin 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, - where the whole review history is in view and no round on record states or appears to state - partial coverage. A promotion re-reviews content its feature pull requests already carried, so + 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 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. Where - the round covering the - head states no coverage at all, the newest round that does state some stands in for it, and - only where the pull request changes the same set of files at both commits, since a statement - about a diff this head no longer has says nothing about this one. A head round's own - statement always wins, and `pr_review.py` refuses the carry where it cannot read that set at - both commits. Where no statement reaches the head either way, a round covering it whose own - file table names exactly the changed files covers it, `coverage=table` in the digest, which is - the reading a Copilot round at Balanced review effort gives, and a statement that reaches the - head, stated on it or carried to it, wins over that table. Where no round covering the head - carries a table of its own, the newest round that does, its table naming exactly the changed - files, stands in under the bound a statement carries under, the pull request changing the same - set of files at both commits, and that reading shows as `coverage=carried:table`. The table - stands in only where no Copilot round on the pull request, on any commit, states or appears to - state partial coverage, so a pull request that ever had a partial round goes to the maintainer. + head SHA and still decline the PR outright, or say it read only part of the changed files. + `pr_review.py` reads coverage into the digest's `coverage=` field, and only a stated partial + is an exit code, `42`. A round covering the head that states full coverage satisfies this + item. Where none states any, a round covering the head whose own file table names exactly the + changed files covers it, `coverage=table`, the reading a Copilot round at Balanced review + effort gives. Where no round covering the head carries a table of its own, the newest round + that does, its table naming exactly the changed files, stands in as `coverage=carried:table`. + 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. + `coverage=none` and `coverage=UNKNOWN` leave this item unsatisfied and decide no exit code, + so read the field rather than the exit. The coverage this item requires is Copilot's, or the attested local pass above, and CodeRabbit and Qodo are advisory, since the hub's `docs/pr-reviewer-evaluation.md` "Status" names Copilot the incumbent and says no candidate is @@ -70,22 +65,25 @@ visible comments, routinely still carries a finding nobody has answered. Treatin ordinary "reviewed, nothing to flag" shape, not a missing review. 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, which is the - only cause on record that the loop can clear. `pr_review.py wait` exit `46` is the one nothing - the loop does clears, the pull request's newest Copilot review being an account-quota refusal - or an error refusal read as a possible quota hit, on this head or an earlier one, which is the - case "Which Reviewers a Repository Actually Has" below states. Exit `47` is that same account - state read from the reviewer's activity elsewhere when this head carries none of its own, and - exit `41` holding across several heads with no cause its body names reaches it the slower way. - Those exits are `wait`'s alone: `status` exits 0 over a refusal, carrying it as `refusal=` in - the digest line instead, so reading that exit code as the absence of one would falsely satisfy - this item on the exact state it exists to catch. That is where the + only cause on record that the loop can clear. `pr_review.py wait` exits `41` on every refusal + and quota state, its `status=` line naming which, and the digest's `refusal=` field carries + a refusal on this pull request. + `refusal=QUOTA` or `refusal=ERROR`, the pull request's newest Copilot review being an + account-quota refusal or an error refusal read as a possible quota hit, on this head or an + earlier one, is the one nothing the loop does clears, which is the case "Which Reviewers a + Repository Actually Has" below states. `status=COPILOT_QUOTA_EXHAUSTED_REPO_WIDE` is that same + account state read from the reviewer's activity elsewhere when this head carries none of its + own, and a refusal holding across several heads with no cause its body names reaches it the + slower way. That exit is `wait`'s alone: `status` exits 0 over a refusal, carrying it as + `refusal=` in the digest line instead, so reading that exit code as the absence of one would + falsely satisfy this item on the exact state it exists to catch. That is where the unsatisfied item goes to the maintainer, with the coverage the other reviewers gave that head read rather than counted and named to them, and their permission under item 5 is what allows the merge. Item 2 is never waived, and a merge over an unsatisfied one is theirs to authorize. One further case satisfies this item where no coverage reaches the head, and it is the only such case. The maintainer adopted it as a standing rule. It applies to a develop -> main - promotion on which `pr_review.py` exits `45`. That promotion satisfies item 2 where each + promotion on which `pr_review.py` reads `coverage=none`. That promotion satisfies item 2 where each of these holds on the live head: - Every change it carries had full coverage on its own feature -> develop pull request, from its @@ -93,8 +91,7 @@ visible comments, routinely still carries a finding nobody has answered. Treatin coverage, not by permission. Failing that, each file it changed has positive evidence of a full read, at the head that last changed the file or a later one. A Copilot table row with no note, on that pull request or on the promotion, is such evidence. It counts only where no - Copilot round on the pull request holding it, on any commit, states or appears to state - partial coverage. A round stating full coverage is evidence for every file. So is the + Copilot round on the pull request holding it, on any commit, states partial coverage. A round stating full coverage is evidence for every file. So is the attestation `pr_review.py attest` published on the feature pull request, for each file the attested head's diff held. That head is held to the same rule, the head that last changed the file or a later one. The attestation counts only from an owner, member, or collaborator, with the marker @@ -102,10 +99,9 @@ visible comments, routinely still carries a finding nobody has answered. Treatin pull request merged into. A local receipt does not count, since removing its worktree deletes it. - Every review thread on the promotion is resolved, and every check passes. - - Exit `45` is the only reason `pr_review.py` does not report the promotion ready. Read this - from the digest's lines rather than from the exit code, since exit `45` returns before the - exit `50` check runs. A `VERDICT WITH NO COUNTED FINDING` headline is a second reason until - it is answered under item 3, and not after. + - `coverage=none` is the only reason `pr_review.py` does not report the promotion ready, read + from the digest's lines. A `VERDICT WITH NO COUNTED FINDING` headline, exit `50`, is a second + reason until it is answered under item 3, and not after. The merge then runs with `--match-head-commit` set to the head those were checked on. The evidence names each constituent pull request and how its coverage was stated. An @@ -128,28 +124,24 @@ visible comments, routinely still carries a finding nobody has answered. Treatin decline one with evidence rather than a reason to leave it unanswered. Qodo's own `Resolved`/`Dismissed` self-tracked badge is a fast pre-triage signal, not a substitute for reading the finding, spot-verify against `gh pr diff` rather than trusting it outright. - Copilot's second review-body format states its own finding total, which the digest reads as - `overview=T/M` beside the number of review threads that round opened. A total larger than that - thread count is usually findings that format withheld, the same blind spot under a different - name, and it is sometimes the digest undercounting instead, where the round's enumeration - carries findings earlier rounds raised. Reading the review body is what tells the two apart, and - nothing else does, so read it and dispose of what it holds as this section's outcomes require. - `T` reads `?` where no total was found, which is a round stating none and equally one the digest + A Copilot round states its own count of open findings, which the digest reads as + `overview=T/M` beside the number of review threads that round opened. The digest's + `FINDINGS WITH NO THREAD` block counts the findings the round names, in that count or in its + findings list, that no open entry links to a thread on the pull request. That is usually + findings the round withheld, the same blind spot under a different name, and sometimes the + digest undercounting instead. Reading the review body is what tells the two apart, and nothing + else does, so read it and dispose of what it holds as this section's outcomes require. `T` + reads `?` where no count was found, which is a round stating none and equally one the digest could not locate, so a `?` leaves this item unsatisfied and sends you to the body exactly as a - shortfall does. The digest's `FINDINGS WITH NO THREAD` block also counts an open-findings entry - whose title links no thread, whatever the totals say. A round with a verdict other than the + shortfall does. A round with a verdict other than the clean one that counts no finding prints its headline under `VERDICT WITH NO COUNTED FINDING`, and `status` and `wait` exit `50`. The headline is the one place that round names what it flags, so answer it as a suppressed finding. The exit code repeats on that head after the answer. A clean verdict on the same terms prints its headline under `CLEAN VERDICT HEADLINE`, which changes no exit code. Read that headline, since it can name a nit no thread carries, and answer any such nit with `comment`. - The body read in that format so far carried no `Suppressed comments` heading, so `suppressed=` - finds nothing in it and there is no collapsed block to quote a count from: the digest's - shortfall and the body's own prose are what an answer cites instead. A later body that does - collapse one may have those findings counted by `suppressed=` and again in the shortfall, or may - have them counted once each, depending on whether its stated total includes them, which no body - read so far says. Answer what the body holds rather than what the two numbers add up to. + A finding `suppressed=` counts may be counted in the shortfall too, so answer what the body + holds rather than what the two numbers add up to. What closing a finding owes turns on whether it is `pre-existing`, under the classes `local-strict-review` "Disposing of Findings" defines, applied here to a PR-hosted finding. A `pre-existing` finding on text inside a canonical Markdown unit takes the first bullet of @@ -178,10 +170,12 @@ visible comments, routinely still carries a finding nobody has answered. Treatin the review round, and the list's length where it states the block's `(N)` count. A line under a heading that outcome 4 of that section names is not on that list. It is already its finding's outcome, and owes only the pointer that outcome names. -4. Nothing in the review was a shape the tooling could not read (an unrecognized heading, a moved - section, an unfamiliar coverage wording). An unrecognized shape blocks the gate on its own. - File an issue naming it and quoting the body, rather than guessing what the new wording - probably meant. +4. Every part of the review the tooling could not read was read by hand (an unrecognized + heading, a moved section, an unfamiliar label). The digest marks one `shapes=NOTED` and names + each under `REVIEWER OUTPUT NOTED`, and decides no exit code on it, so this item is read from + the digest rather than the exit. Read the body for what that part says, give any finding in it + item 3's outcome, and file an issue on the hub naming the spelling to add to its + `scripts/reviewers/` vocabulary, rather than guessing what the new wording probably meant. 5. The maintainer has given **explicit** permission to merge. The agent never merges on its own. A green or CLEAN PR with one open finding is not mergeable, @@ -244,12 +238,12 @@ is never carried into a downstream repository. Run `local-strict-review` against the branch's current diff before every push this loop makes, the one that opens the pull request in step 1 and each one after it, whatever finding it answers and whether or not the branch was reviewed once already. A push that delivers content no pass has read is the case the rule is about, so a re-push of a tree a recorded pass already covers needs no second pass, the receipt being keyed on the branch's net content rather than on its commit series. A rebase that leaves the tree alone keeps it only while the merge base holds: rebasing onto a target that has moved retires the receipt although no file changed, and that push owes a pass like any other. Follow that skill's own ordering and record each pass, which is what a capture point reads, the hub's own `pre-push` hook being one and a repository having none until such a hook is carried to it. A push that hook refuses, where one is present, is the gate working rather than an obstacle to route around, and that skill's refusal table says what each refusal means and what clears it. 1. Push changes to the PR branch and open the pull request when it does not exist. Once the push - lands, run `scripts/pr_review.py attest --repo / --checkout `. + lands, run `uv run --no-project --script scripts/pr_review.py attest --repo / --checkout `. `attest` refuses unless the checkout is the pushed head and a recorded pass covers that head. Attest after every push a recorded pass covers, the opening push included. The comment `attest` posts is the record Merge Gate item 2's promotion case reads, since the receipt goes when its worktree does. -2. Run `scripts/pr_review.py status --repo /` once in the foreground and read its output. +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 @@ -260,7 +254,7 @@ Run `local-strict-review` against the branch's current diff before every push th drift, under a quota or error refusal, and where something is already in the request set, which is the condition the recovery below clears. Requesting in the pull request UI is the maintainer's route rather than this loop's. -4. Run a bounded `scripts/pr_review.py wait --repo /` in a background process and read its terminal output. +4. Run a bounded `uv run --no-project --script scripts/pr_review.py wait --repo /` in a background process and read its terminal output. A completed review raising **no findings** is a valid terminal outcome, so do not re-trigger it or read silence as a missing review. A review whose body says it declined to review is the one exception, and it is terminal the other way. Nothing follows it, and re-requesting the same @@ -272,7 +266,7 @@ Run `local-strict-review` against the branch's current diff before every push th 8. Re-run the loop after every fix push until the checks are green, the current head is covered, and no finding remains open. -The review effort setting is user-controlled. The workflow never selects or changes it. `status` reports `effort=lite`, `effort=balanced`, or `effort=max` when the completed review exposes that metadata, lowercased, and names an inherited setting apart from a chosen one in a separate `effort_source=default|explicit` field, both reading `unknown` when no effort line parses. Missing effort metadata reports `unknown` and does not change coverage or completion. A pending effort-labeled request can complete without a `copilot_work_started` timeline event, so absence of that event never proves the request is abandoned. The bounded timeout reports `PENDING` when no review or terminal answer arrives. `requested=yes` reports that the request was accepted rather than that a round is coming. An accepted request can sit unpicked, printing the same digest as one about to be served, so a driver reading that field as progress is waiting on evidence it does not hold. After a timeout carrying it, rerun `wait` for another bounded interval by default, because the request may still be active. Where a second bounded wait times out as well, read the pending set, and clear it only where no human or team reviewer is requested alongside the bot, because the clear replaces that set rather than adding to it and nothing restores a request it drops. A stall on a pull request that has a human or team reviewer requested goes to the maintainer instead, and so does one still pending after the wait that follows a clear. The clear leaves the next `wait` nothing outstanding to defer to, so that run requests afresh, and its own auto-request line is what says so, since `wait` reads the reviewer's node id out of the repository's recent reviews and polls without requesting where it finds none. The hub's `docs/pr-reviewer-reference.md` carries the mutation, and an agent seat can run it, where removing and re-adding the reviewer in the pull request UI is a step only the maintainer can take. This recovery replaces only the review request and never changes the effort setting. A `wait` ending `REQUEST_NOT_RECORDED`, exit 48, 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, which is how an exhausted Copilot allowance has shown itself, so clearing and requesting again does not clear it and it goes to the maintainer. +The review effort setting is user-controlled. The workflow never selects or changes it. `status` reports `effort=lite`, `effort=balanced`, or `effort=max` when the completed review exposes that metadata, lowercased, and names an inherited setting apart from a chosen one in a separate `effort_source=default|explicit` field, both reading `unknown` when no effort line parses. Missing effort metadata reports `unknown` and does not change coverage or completion. A pending effort-labeled request can complete without a `copilot_work_started` timeline event, so absence of that event never proves the request is abandoned. The bounded timeout reports `PENDING` when no review or terminal answer arrives. `requested=yes` reports that the request was accepted rather than that a round is coming. An accepted request can sit unpicked, printing the same digest as one about to be served, so a driver reading that field as progress is waiting on evidence it does not hold. After a timeout carrying it, rerun `wait` for another bounded interval by default, because the request may still be active. Where a second bounded wait times out as well, read the pending set, and clear it only where no human or team reviewer is requested alongside the bot, because the clear replaces that set rather than adding to it and nothing restores a request it drops. A stall on a pull request that has a human or team reviewer requested goes to the maintainer instead, and so does one still pending after the wait that follows a clear. The clear leaves the next `wait` nothing outstanding to defer to, so that run requests afresh, and its own auto-request line is what says so, since `wait` reads the reviewer's node id out of the repository's recent reviews and polls without requesting where it finds none. The hub's `docs/pr-reviewer-reference.md` carries the mutation, and an agent seat can run it, where removing and re-adding the reviewer in the pull request UI is a step only the maintainer can take. 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, which is how an exhausted Copilot allowance has shown itself, so clearing and requesting again does not clear it and it goes to the maintainer. Drive to green, a review confirmed on the latest head SHA and every actionable finding closed, then apply the Merge Gate above. **Never exit this PR-hosted loop early.** Its pre-push @@ -395,7 +389,7 @@ own words to identify it. Give one bold verdict per finding: `Fixed in `, ` maintainer's decision. State the `(N)` count the block gave so answers can be checked against findings, and link the review round. **Read every round, not only the head.** A suppressed finding does not retire when a later push -supersedes it, it just stops showing up in a head-scoped query while still unanswered. Post the answer with `scripts/pr_review.py comment --repo / --body ` +supersedes it, it just stops showing up in a head-scoped query while still unanswered. Post the answer with `uv run --no-project --script scripts/pr_review.py comment --repo / --body ` from a hub checkout. Do not use a provider connector or reconstruct the GitHub mutation. ## Escalate to the maintainer when diff --git a/.github/skills/python-codestyle/references/profiles.md b/.github/skills/python-codestyle/references/profiles.md index c4457c558..2d2f5424b 100644 --- a/.github/skills/python-codestyle/references/profiles.md +++ b/.github/skills/python-codestyle/references/profiles.md @@ -71,7 +71,8 @@ configuration alone marks the lint-only one: coverage report to Codecov. The hub validator runs them in each directory the caller declares in its `python-directories` input, which the registry's `pythonDirectories` mirrors. From inside a lint-only directory it runs `uvx ruff@latest check`, `uvx ruff@latest format --check`, - `uvx mypy@latest`, and `uvx coverage@latest run -m unittest discover -s tests`, then writes + `uvx mypy@latest`, and `uvx coverage@latest run -m unittest discover -s tests`, adding + `--with-requirements tests/requirements.txt` to that last where the directory carries one, then writes `coverage.xml` and uploads it best-effort per `WORKFLOW.md` D1.6, with no threshold adopted. A declared directory with no `tests/` fails that job. diff --git a/.github/skills/repo-worktree/SKILL.md b/.github/skills/repo-worktree/SKILL.md index 47b12e5eb..549f81d6f 100644 --- a/.github/skills/repo-worktree/SKILL.md +++ b/.github/skills/repo-worktree/SKILL.md @@ -285,8 +285,8 @@ since git then runs whatever that directory holds, and nothing where it holds no session changed a tree in between, and its output then names what was already deleted. Any exit other than `0` stops and is reported as it stands rather than finished by hand. The raw `git worktree remove`, `git branch -D`, and remote delete it replaces are not on the host-safety - permission allowlist, and the command is. `scripts/README.md` in the hub holds the full - contract. + permission allowlist, and the command is. It forwards to `scripts/pr_cleanup.py`, and + `scripts/README.md` "`pr_cleanup.py`" in the hub holds the full contract. - **What no merged pull request into `develop` covers is removed by hand.** That is a promotion's worktree, a detached helper worktree, and a temporary standalone clone. Confirm the tree is clean, then remove the exact path with `git worktree remove `, or delete the exact diff --git a/.github/skills/unattended-handoff/SKILL.md b/.github/skills/unattended-handoff/SKILL.md index d61d454eb..42aea3bb3 100644 --- a/.github/skills/unattended-handoff/SKILL.md +++ b/.github/skills/unattended-handoff/SKILL.md @@ -300,8 +300,8 @@ does not qualify, since skipping one costs nothing and a guess costs a revert an the lane read finds the promotion held, the round narrows to develop. Otherwise, where a `decision` issue blocking that promotion has a `closedAt` at or after the time noted before the first read, park. That answer may not be to merge, so the `decision` issue the park files asks - whether it lets the promotion merge. Exit `45` on a promotion blocks no merge where the promotion - meets the one case `pr-review-conduct` Merge Gate item 2 states. Such a promotion merges with no + whether it lets the promotion merge. A digest reading `coverage=none` on a promotion blocks no + merge where the promotion meets the one case `pr-review-conduct` Merge Gate item 2 states. Such a promotion merges with no `decision` issue, and the worker records that item's evidence on the handoff. Any other shortfall parks. 4. **Wait in the foreground.** Each wait is one bounded command such as `pr_review.py wait`, run in diff --git a/.github/workflows/test-pull-request.yml b/.github/workflows/test-pull-request.yml index 450fea9b2..587d8ed74 100644 --- a/.github/workflows/test-pull-request.yml +++ b/.github/workflows/test-pull-request.yml @@ -52,6 +52,7 @@ jobs: shell: bash run: | set -Eeuo pipefail + python -m pip install --requirement tests/requirements.txt python -m unittest discover -s tests # GitHub Actions does not support required status checks on conditional jobs, so a single always-run aggregator gates the merge. diff --git a/.github/workflows/validate-task.yml b/.github/workflows/validate-task.yml index f8f446d1d..30e183f91 100644 --- a/.github/workflows/validate-task.yml +++ b/.github/workflows/validate-task.yml @@ -680,7 +680,7 @@ jobs: leg: ${{ toJSON(matrix) }} directories: ${{ steps.python.outputs.projects }} - # A directory's dependency manifest decides how its suite runs, a committed uv.lock or a requirements*.txt through pytest, and neither through unittest, the lint-only profile being stdlib-only. + # A directory's dependency manifest decides how its suite runs, a committed uv.lock or a requirements*.txt through pytest, and neither through unittest, with tests/requirements.txt's libraries. # No --cov selector here, and the report is checked, per D1.6. # The pre-run delete makes the report check one on what this run wrote, since a committed coverage.xml would otherwise satisfy it without any measurement. # Each directory's run reads /dev/null, since the loop's own list is its stdin and a suite reading stdin would swallow the directories after it. @@ -749,7 +749,11 @@ jobs: ;; lint-only) status=0 - uvx coverage@latest run -m unittest discover -s tests || status=$? + extra=() + if [ -f tests/requirements.txt ]; then + extra=(--with-requirements tests/requirements.txt) + fi + uvx "${extra[@]}" coverage@latest run -m unittest discover -s tests || status=$? if [ "$status" -eq 5 ]; then echo "::error::unittest found no tests in $dir/tests. Discovery collects only unittest.TestCase subclasses, so a pytest-style plain test function does not count, it reads only files named test*.py, and it skips a nested test directory that has no __init__.py." fi diff --git a/GOVERNANCE.md b/GOVERNANCE.md index ecb01dceb..3974725a5 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -242,7 +242,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: 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, 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, and that a review covers the full diff rather than only part of it. Where the round covering the head states no coverage at all, read the newest round that does state some as covering this head only where the pull request changes the same set of files at both commits, a head round's own statement always winning over a carried one. Where no statement reaches the head either way, a round covering it whose own file table names exactly the changed files covers it, which is the reading a Copilot round at Balanced review effort gives, and a statement that reaches the head, stated on it or carried to it, wins over that table. Where no round covering the head carries a table of its own, the newest round that does, its table naming exactly the changed files, stands in under the bound a statement carries under, the pull request changing the same set of files at both commits. The table stands in only where no Copilot round on the pull request, on any commit, states or appears to state 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. Request a Copilot review at one defined moment rather than on every push: 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, 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, and 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, which is the reading a Copilot round at Balanced review effort gives. Where no round covering the head carries a table of its own, the newest round that does stands in where its table names exactly the changed files. 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, not a repo-relative link since that path 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/OPERATIONS.md b/OPERATIONS.md index d3f3d766d..1e8b90187 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -21,7 +21,7 @@ export RUFF_CACHE_DIR="$PROJECTTEMPLATE_TOOL_CACHE/ruff" uvx ruff@latest check . uvx ruff@latest format --check . uvx mypy@latest -uvx coverage@latest run --source=scripts,spec,host-setup -m unittest discover -s tests +uvx --with-requirements tests/requirements.txt coverage@latest run --source=scripts,spec,host-setup -m unittest discover -s tests uvx coverage@latest run --source=scripts,spec,host-setup --append spec/audit.py --selftest uvx coverage@latest run --source=scripts,spec,host-setup --append spec/workflow_reuse.py --selftest uvx coverage@latest run --source=scripts,spec,host-setup --append host-setup/agent-safety/claude/gh-write-guard.py --selftest diff --git a/TODO.md b/TODO.md index d917b5c7c..72da7b1e3 100644 --- a/TODO.md +++ b/TODO.md @@ -243,7 +243,7 @@ One pull request, after a survey, deciding whether anything stands between this - **Issue** - None filed here, and the ask is filed upstream as [GitHub community discussion 204320][copilot-review-schema], which asks for a versioned machine-readable schema carrying severity, category, suggestion and resolution state, rather than the human-facing prose an integration has to infer those from. It is unanswered, so it is a place to watch rather than a dependency to wait on. The prose reader and its vetted inventory shipped under [#607][issue-607], which is the change this would supersede. - **Checked** - `develop` at `20916ad` on 2026-08-07, reading the live GraphQL schema by introspection and one review over REST, against the reader in `scripts/pr_review.py`. - **Open** - Whether `bodyHTML` is a better surface than the Markdown body, since it arrives as a rendered tree whose structure survives a change in Markdown syntax, while leaving the wording drift the inventory exists for exactly where it is. - - **Open** - Whether any third-party library tracks this output, and whether depending on one is acceptable at all, given that [`scripts/README.md`][scripts] holds these scripts to the standard library with no third-party packages. + - **Settled** - A third-party library is acceptable: the review scripts declare markdown-it-py inline, run through `uv`, and parse the Markdown body with it, while every spelling of the reviewer's output stays in `scripts/reviewers/` as data. - **Open** - Whether the review's own inline threads and their metadata carry enough to derive coverage and suppression without reading the body, which would narrow the prose surface rather than replace it. - **Settled** - The public API carries no structured Copilot review as of the date above. GraphQL `PullRequestReview` exposes `body`, `bodyText` and `bodyHTML` and no field naming a finding, a file count, or a withheld section, and REST returns the same prose body beside its ids and its state. - **Settled** - The only Copilot-named types in the GraphQL schema are `CopilotCodeReviewParameters` and its input form, which configure review-on-push inside a branch ruleset and describe nothing about a review that has run, so the schema search that looks promising by name answers a different question. diff --git a/docs/host-setup.md b/docs/host-setup.md index 2e2fe6c0f..8a596b7e0 100644 --- a/docs/host-setup.md +++ b/docs/host-setup.md @@ -18,7 +18,7 @@ This section is the **contract**: which tools a host needs and which repo proced | --- | --- | --- | --- | | `git` | everything, and the identity and signing contract in [`STANDUP.md`][standup] step 0 | `git --version` | none | | `gh` | the PR and review loop, `gh api` queries, `repo-config/configure.sh` | `gh --version` | **2.47.0**, measured | -| Python 3 | `scripts/` and `spec/` (standard library only, no packages to install) | `python3 --version` | **3.13**, target | +| Python 3 | `scripts/` and `spec/` (standard library, and the few libraries a hub script declares inline, which `uv` supplies) | `python3 --version` | **3.13**, target | | `jq` | the ruleset normalizer in `repo-config/configure.sh`, the ruleset diff in [`AUDIT.md`][audit] section 6, and payload regeneration | `jq --version` | **1.7**, target | | Ripgrep | repository searches and file discovery by coding agents | `rg --version` | **13.0.0**, target | | `docker` | the four linters, which run as pinned images rather than local installs | `docker --version` | **29.6.2**, target | @@ -26,7 +26,7 @@ This section is the **contract**: which tools a host needs and which repo proced The **Floor** column exists because presence and sufficiency are different questions and the answer to the first was being read as the answer to the second. A tool below its floor still answers `--version`, so every other column reports it as fine while `scripts/host_gate.py` fails it. The kind is named beside the number, since a **measured** floor sits above a version known to break a documented procedure and gives a failing host a defect to point at, where a **target** floor names the version the repo's toolchain is configured for and does not. The next section carries the reasoning behind each one. -Two consequences worth reading off the table rather than discovering later. **Python 3 needs no packages**, because every script here is standard library only, so a bare interpreter is enough. And **the linters need only `docker`**, not `node`, `dotnet` or a local `markdownlint`, since each runs as a pinned image, which is what keeps a local run and CI the same check. +Two consequences worth reading off the table rather than discovering later. **Python 3 needs no packages installed**, because a script needing a library declares it inline and runs through `uv`, so a bare interpreter beside `uv` is enough. And **the linters need only `docker`**, not `node`, `dotnet` or a local `markdownlint`, since each runs as a pinned image, which is what keeps a local run and CI the same check. **The interpreter is called `python3` everywhere, and on native Windows that is something the tooling provides rather than something the platform ships.** Windows registers `python` and `py` through the interpreter's own installer, and gives `python3` by default to an *app execution alias stub*, a zero-byte reparse point in the WindowsApps directory belonging to App Installer, which only ever offers to open the Microsoft Store. A Microsoft Store Python registers aliases under those same two names carrying the same reparse tag, and those reach a real interpreter somebody chose, so the target package rather than the tag is what tells a placeholder from a working setup. The installer removes only the placeholder and reports anything else. Measured on a fleet Windows host, that stub writes its `Python was not found` message to **stderr** and exits **9009**, so it fails loudly and a `&&` chain does stop on it. What it does instead is occupy the name: WindowsApps is on `PATH` by default, so wherever it sits ahead of the install directory the stub answers and the installed interpreter cannot be reached under that name at all. [`host-setup/windows/install-tools.ps1`][install-tools-windows] fixes both halves when it manages the `python` tool: it removes those stubs, and it puts a real `python3` beside the interpreter it installed. Stock Debian is the mirror image, carrying `python3` and no bare `python`, so `python3` is the one name that is correct on all three platforms and is what every script and brief should use. @@ -384,7 +384,7 @@ Verified on Windows 11 Pro 10.0.26200 with PowerShell 7.6.4, where `python3 scri | --- | --- | | Stand up a new repo through [`STANDUP.md`][standup] | step 0 verifies identity and signing, and its window closes at the first commit | | Run the four linters locally, matching CI | `docker` runs each as the same pinned image CI uses | -| Run the repo's own gates and tests | Python 3 covers `scripts/` and `spec/` with no packages to install | +| Run the repo's own gates and tests | Python 3 and `uv` cover `scripts/` and `spec/` with no packages to install | | Drive the PR and Copilot review loop | `gh` and an authenticated session | | Let an agent work with the `gh` credentials live | the host-safety kit is installed | | Have the fleet skills surface in every agent session | the skills snapshot is current per `skills_install.py --report` | diff --git a/docs/pr-reviewer-evaluation.md b/docs/pr-reviewer-evaluation.md index 9c6c3ceed..8f6257c65 100644 --- a/docs/pr-reviewer-evaluation.md +++ b/docs/pr-reviewer-evaluation.md @@ -148,7 +148,7 @@ The expansion should preserve one compact command while adding provider adapters `status` should report every enabled reviewer on one line and then list unresolved findings grouped by provider. `wait` should finish only when each selected reviewer reaches a recognized terminal state. -The existing Copilot adapter remains behaviorally unchanged during extraction. Provider support must not weaken its refusal, partial-coverage, suppressed-finding, or unrecognized-shape checks. +The Copilot adapter is `scripts/pr_review_copilot.py`, with its spellings in `scripts/reviewers/copilot.json`, and a provider joins it as a vocabulary file read by the same code path. Provider support must not weaken its refusal, partial-coverage, or suppressed-finding readings, and a shape it cannot place stays a note in the digest rather than an exit. ## Next Evaluation Steps diff --git a/docs/pr-reviewer-reference.md b/docs/pr-reviewer-reference.md index 4609b3253..23fc61561 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 48, 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, which is how an exhausted Copilot allowance has shown itself, so clearing and requesting again does not clear it 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. 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, which is how an exhausted Copilot allowance has shown itself, so clearing and requesting again does not clear it 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') diff --git a/pyproject.toml b/pyproject.toml index cb14a2137..771b2b5fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,11 @@ files = ["spec", "host-setup", "scripts", "tests"] mypy_path = [".github/actions/prose-gate", ".github/actions/python-directories", ".github/actions/repo-gate"] exclude = 'scripts/(prose_lint|repo_gate)\.py' +# The review scripts declare markdown-it-py inline, and a type check run with no environment of its own does not install it. +[[tool.mypy.overrides]] +module = ["markdown_it", "markdown_it.*"] +ignore_missing_imports = true + [tool.pyright] pythonVersion = "3.13" # Matches [tool.mypy]'s platform pin above, for the same reason: Pylance in an editor otherwise flags the same POSIX-only attributes live on a Windows or macOS host. diff --git a/scripts/README.md b/scripts/README.md index 5945354c7..c2307c021 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -4,14 +4,16 @@ The fleet's checks and review tooling, run by hand, with the deterministic ones **Hosted here and reached, never carried.** These are not declared in [`spec/files.json`][files], so the audit does not expect a downstream repo to ship them, the same footing as `spec/audit.py`. That is the fleet model rather than an omission: a gate holding no per-repo content has one canonical implementation for the fleet. The prose and repository gate implementations live beside their composite actions under `.github/actions/`, which lets reusable workflows reach the implementation at their pinned hub commit through `$/.github/actions/` without checking out the hub. The same-named files in `scripts/` are thin local entry points that call those action-owned implementations, so maintainers and hooks retain the established commands from a hub checkout without creating a second copy of either gate. A repository that cannot reach the hub reports a local check as not run rather than reconstructing it, since a rebuilt gate encodes its author's reading of the rule and agrees with no other repository. -Python only, standard library only, no third-party packages. 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, and 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. +Python only, and standard library only, except `pr_review.py`, `pr_review_copilot.py`, and `pr_cleanup.py`, which declare markdown-it-py in their inline script metadata. 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, and 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_review.py`, `skills_install.py`. `gh_graphql.py` is a library with no command line, the GraphQL transport and cursor walker that `handoff.py` and `pr_review.py` import from beside them. The unit tests live apart at the repository root under [`tests/`][tests], one `test_