Skip to content

Commit 6ec0a89

Browse files
authored
Promote the Write Guard Rewrite, uv Scripts, and Parser Gates to Main (#3417)
## Summary Promotes the pull requests merged into develop since release 2.0.1148. Each carries a maintainer decision of 2026-10-23 recorded on #3391. - [#3407](#3407): rewrites the write guard as a small lexer of 1,653 lines. It fails open under its stated threat model and fails closed only on requirement 4. A test holds it at 2,500 lines or fewer (item 1). - [#3409](#3409): adds CODESTYLE rules. Tests live in `tests/`, and a maintained parser replaces a hand-written one. A script declares its dependencies in PEP 723 metadata and runs as `uv run --no-project --script`. It switches the callers to that spelling and adds a managed allow rule to the agent-safety installer (item 1 follow-ups). - [#3410](#3410): splits `pr_review.py` into the gate, a Copilot adapter reading its vocabulary from JSON, and `pr_cleanup.py`. It collapses the exit codes and adds `tests/requirements.txt` and the CI runners. - [#3411](#3411): rebuilds the prose gate on Pygments and markdown-it-py, with its vocabulary and exemptions in `prose-gate.json` and a repo-local override. - [#3415](#3415): holds the Merge Gate on a part of a Copilot review body the tooling cannot place. The hold lasts until an owner acknowledges it with outcomes (item 4 follow-up). - [#3416](#3416): moves the audit self-test to `tests/` and reads YAML and Markdown with PyYAML and markdown-it-py. It adds the check registry `spec/checks.json` and splits out `spec/audit_markdown.py`. It shares `spec/carried_text.py` with carry, `build_dist`, and `canonical_review`. - [#3418](#3418): fixes the findings this promotion's first review round raised on the content above. It aligns the drive-pr escalation line with pr-review-conduct and names `tests/requirements.txt` where the prose said the tests need nothing installed. It also restores the `uvx` launcher in a release-guard assertion. - [#3419](#3419): fixes the finding the second review round raised. The Copilot adapter's prose path reads a coverage count longer than `COUNT_DIGITS` as `unknown`, sharing `count_state` with the marker path. - [#3420](#3420): fixes the finding the third review round raised, under the maintainer's ruling. `hub_fetch_run.py` falls back to `git ls-remote` where the API lookup of `main` fails, so the prose gate and its data are fetched at one commit. Where neither lookup resolves, the documented fail-open against `main` stays. - [#3421](#3421): fixes the findings the fourth review round raised. The Copilot adapter reads a finding count longer than `COUNT_DIGITS` as unknown rather than zero, through one length check and one None-aware sum. The host-setup gates-and-tests row says `uv` installs the test requirements. Closes #3408 ## Constituent coverage The Copilot rounds on this promotion ran at Lite effort and state no full coverage, so Merge Gate item 2 rests on the promotion case. Each change this promotion carries had full coverage on its own pull request into develop, at its merged head: | Pull request | Merged head | Coverage | | --- | --- | --- | | [#3407](#3407) | `9efc1002` | attested local pass, `coverage=local` | | [#3409](#3409) | `bcc7a9e1` | attested local pass, `coverage=local` | | [#3410](#3410) | `00cec726` | attested local pass, `coverage=local` | | [#3411](#3411) | `bd128136` | attested local pass, `coverage=local` | | [#3415](#3415) | `5be9db87` | attested local pass, `coverage=local` | | [#3416](#3416) | `b914f083` | attested local pass, `coverage=local` | | [#3418](#3418) | `3a86cb51` | attested local pass, and a Copilot table naming exactly the changed files, `coverage=table` | | [#3419](#3419) | `6e7b868d` | attested local pass, and a Copilot table naming exactly the changed files, `coverage=table` | | [#3420](#3420) | `9b492290` | attested local pass, and a Copilot table naming exactly the changed files, `coverage=table` | | [#3421](#3421) | `743010e6` | attested local pass, and a Copilot table naming exactly the changed files, `coverage=table` | 🤖 Generated with [Claude Code](https://claude.com/claude-code)
2 parents f610e42 + 9f19b2a commit 6ec0a89

117 files changed

Lines changed: 20734 additions & 50708 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/audit-a-repo/SKILL.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ The audit is the fleet's measurement procedure, and the failure shapes it guards
1414

1515
- **Route first.** A repo with no carried instruction set, or a partial one, has a baseline that never arrived rather than drift to report, so it goes to `STANDUP.md` sections 1A and 2 first (`AUDIT.md` section 0). Auditing it anyway produces a report that is all absences and reads as catastrophe.
1616
- **Verify the host.** Run `python3 scripts/host_gate.py --repo <target-checkout>` from the hub checkout before any hub tool, and pass `--repo`, since a bare run skips the target's own `host-tools.json` overlay. A stale tool answers `--version`, looks healthy, and produces a wrong answer.
17-
- **Read `main` as ground truth**, for every workflow model, and read `develop` only to detect divergence (`AUDIT.md` section 1). An `operational` repo's `develop` is mid-flight by design, so conformance work sitting there is un-promoted work, not a defect, and it counts when it reaches `main`. Use `spec/audit.py --branch <ref>` to preview in-flight work, which stamps the override so the finding cannot be mistaken for one against ground truth.
17+
- **Read `main` as ground truth**, for every workflow model, and read `develop` only to detect divergence (`AUDIT.md` section 1). An `operational` repo's `develop` is mid-flight by design, so conformance work sitting there is un-promoted work, not a defect, and it counts when it reaches `main`. Use `uv run --no-project --script spec/audit.py --branch <ref>` to preview in-flight work, which stamps the override so the finding cannot be mistaken for one against ground truth.
1818

1919
## Measuring
2020

2121
- **Resolve the repo's types from `registry/repos.json`** and classify a `classificationPending` entry from the tree (`AUDIT.md` section 2). The applicability gate is `WORKFLOW.md` section 1, extended to `AUDIT.md`'s own checks: an item or check governing an absent construct is N/A, excluded from the verdict, and never a defect (`AUDIT.md` section 3).
2222
- **Know what the runner does and does not prove.** `spec/audit.py` mechanizes the deterministic subset only: settings, rulesets, secret names, file and section presence, verbatim hashing, interface wiring, Dependabot coverage, branch facts. It evaluates no check under a type in `spec/project-types.json`, so every per-type check is judged by hand, and a clean run is no evidence for them (`AUDIT.md` section 4). Silence from a tool that was never looking reads exactly like a pass.
2323
- **Judge letter and intent per check** and keep the vocabulary: letter miss with intent satisfied is a drift finding, both missing is a defect, and operational is binary over the applicable set (`AUDIT.md` sections 4 and 7). Do not invent a parallel scheme.
2424
- **Assert the Actions implement `WORKFLOW.md`** by outcome, not by matching catalog snippets byte for byte: the 5A static audit, each applicable guarantee cited in the form 5A sets out, then the 5B trace scenarios (`AUDIT.md` section 5). Read a workflow the repo only calls at the SHA it pins, throughout. The `workflow-ci-contract` skill summarizes that contract.
25-
- **Check live settings, rulesets, and secrets from a hub checkout at `main`** with `AUDIT.md` section 6. Run `repo-config/configure.sh check` with the target repository and model for settings and rulesets, and `spec/audit.py [RepoName]` for secrets, rather than constructing a local comparison. The hub payloads are the only repository-configuration source.
25+
- **Check live settings, rulesets, and secrets from a hub checkout at `main`** with `AUDIT.md` section 6. Run `repo-config/configure.sh check` with the target repository and model for settings and rulesets, and `uv run --no-project --script spec/audit.py [RepoName]` for secrets, rather than constructing a local comparison. The hub payloads are the only repository-configuration source.
2626

2727
## Reporting
2828

2929
- **Write `reports/<repo>/audit.md` from `reports/_template.md`**, findings ranked most severe first, each with the `file:line` it was judged against, and quote the run stamp, since findings are a point-in-time snapshot (`AUDIT.md` section 8).
3030
- **The hub authors the report.** A downstream repo never opens a hub pull request to write its own, which would be self-certification. Downstream context goes into issues filed against the hub instead.
31-
- **Generate a convergence issue, never compose one**: `spec/audit.py --issue <repo>` emits it from live findings. An agent picking such an issue up re-runs the audit first and acts on the live result, not the pasted findings.
31+
- **Generate a convergence issue, never compose one**: `uv run --no-project --script spec/audit.py --issue <repo>` emits it from live findings. An agent picking such an issue up re-runs the audit first and acts on the live result, not the pasted findings.
3232
- **Reconcile registry `driftNotes` in the same pass**: a resolved deviation's note is deleted, not left describing finished work, and a note naming a check id is retired by a person, not by a run (`AUDIT.md` section 8).
3333
- **Stale-versus-modified classification and the intent staleness advisory need a full hub clone with git history.** In a shallow clone the audit reports one ERROR per repo and exits non-zero, so run `git fetch --unshallow origin` in the hub checkout first. To verify one finding without history, compare against the current hub canonical on `main`, which decides current-match only.
3434

3535
## After the Report
3636

3737
Measuring and fixing are separate phases. Converging is `AUDIT.md` section 10: fixes ship as pull requests on the target repo, one focused pull request per drift class, the Copilot loop driven to green per the `pr-review-conduct` skill, and the maintainer merges. For a repo already stood up, `RESYNC.md` sequences the findings, since order matters (a deletion lands before the re-vendor that would refresh it). Systemic drift shared by many repos is fixed in the hub spec, not hand-patched per repo, and spec questions are escalated rather than resolved silently (`AUDIT.md` section 9).
3838

39-
An audit leaves no checkout behind it, since one left standing is what a later sweep has to tell apart from live work. Each is removed when the run ends, per `repo-worktree` "Listing and Cleanup". The report's pull request is cleaned up once it merges, with `python3 scripts/pr_review.py cleanup <number> --repo ptr727/ProjectTemplate --checkout <hub-base-clone>`. A detached checkout at `main` that only read the hub is removed by hand once it is clean.
39+
An audit leaves no checkout behind it, since one left standing is what a later sweep has to tell apart from live work. Each is removed when the run ends, per `repo-worktree` "Listing and Cleanup". The report's pull request is cleaned up once it merges, with `uv run --no-project --script scripts/pr_review.py cleanup <number> --repo ptr727/ProjectTemplate --checkout <hub-base-clone>`. A detached checkout at `main` that only read the hub is removed by hand once it is clean.

‎.agents/skills/backlog-burndown/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ Write Safety" forbids.
284284
So the whole procedure moves to the orchestrator, which runs it against the base clone at the round's
285285
cleanup step, while no worker is live in a tree it touches.
286286
It carries the remote half of `drive-pr`'s post-merge cleanup too.
287-
For a merged group both halves are one command, `python3 scripts/pr_review.py cleanup <number> --repo <owner>/<repo> --checkout <base-clone>`, run from a hub checkout once for each merged group, `<base-clone>` being the repository's primary clone.
287+
For a merged group both halves are one command, `uv run --no-project --script scripts/pr_review.py cleanup <number> --repo <owner>/<repo> --checkout <base-clone>`, run from a hub checkout once for each merged group, `<base-clone>` being the repository's primary clone.
288288
It deletes the remote branch, then removes the group's worktree and local branch, per `repo-worktree` "Listing and Cleanup", which also says what its exit leaves to do.
289289
Taking that step from the worker without naming a new owner would leave a live remote branch behind every group.
290290
`cleanup` holds the delete's checks, among them the tip against the pull request's `headRefOid`.

‎.agents/skills/drive-pr/SKILL.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ promotion PR once the fix lands, is the early exit this skill exists to prevent.
108108
checked out, and `gh pr merge --delete-branch` needs to switch that worktree to the base branch
109109
to delete it, which fails when `develop` is already checked out somewhere else, the ordinary
110110
case in this layout. Instead run repo-worktree's post-merge cleanup with
111-
`python3 scripts/pr_review.py cleanup <number> --repo <owner>/<repo> --checkout <base-clone>`,
111+
`uv run --no-project --script scripts/pr_review.py cleanup <number> --repo <owner>/<repo> --checkout <base-clone>`,
112112
run from a hub checkout outside the task's worktree, `<base-clone>` being the repository's
113113
primary clone. It deletes the remote branch, then removes the task's worktree and local branch.
114114
It decides its local refusals before the remote delete, and `repo-worktree` "Listing and
@@ -122,7 +122,7 @@ promotion PR once the fix lands, is the early exit this skill exists to prevent.
122122
than deleting by hand: `1` is a refusal, a moved tip among them, `2` a read that did not answer
123123
or a delete it could not confirm, and `64` a target under an owner other than the hub
124124
checkout's own `origin`, or that `origin` unreadable. A registry refusal is a `1`. It runs
125-
under the host-safety installer's `Bash(python3 scripts/pr_review.py:*)` allow rule,
125+
under the host-safety installer's `Bash(uv run --no-project --script scripts/pr_review.py:*)` allow rule,
126126
which is what lets auto mode complete it.
127127
It also refuses while another open pull request in the repository has the branch as its head or base.
128128
It names each, since the delete would close or retarget it.
@@ -249,5 +249,6 @@ instance's outcome is context for the new one, never a standing answer to reuse
249249

250250
- A genuine design trade-off, a recurring finding pattern, or an architectural redesign proposal
251251
each escalate per pr-review-conduct's own list, restated there, not duplicated here.
252-
- An unrecognized review shape blocks the gate on its own, file an issue naming it and ask, never
253-
guess what new wording probably meant.
252+
- A part of the review the digest prints under `UNPLACED ON THE HEAD` holds the gate until its
253+
outcomes are acknowledged per pr-review-conduct's Merge Gate item 4. Never guess what the new
254+
wording probably meant. Only an item that cannot be told to be a finding or not goes to the maintainer.

‎.agents/skills/merge-and-release/SKILL.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ skill covers all of it, scoped down by what the maintainer actually asks for.
6161
1. Identify the open develop -> main promotion PR for this repo, stop and report if none is open.
6262
2. Record the promotion's live head, `gh pr view [number] --repo owner/repo --json headRefOid
6363
--jq .headRefOid`. Then, from a hub checkout, `scripts/` is not carried into downstream repos,
64-
run `scripts/pr_review.py status [number] --repo owner/repo` on it and confirm the
64+
run `uv run --no-project --script scripts/pr_review.py status [number] --repo owner/repo` on it and confirm the
6565
pr-review-conduct Merge Gate. Stop and report exactly what is missing rather than merging on a
66-
partial gate. A `status` exit `45` is not a partial gate where the promotion meets the one case
67-
that skill's Merge Gate item 2 states. Check that case again on every re-run below, and record
66+
partial gate. A digest reading `coverage=none` is not a partial gate where the promotion meets the
67+
one case that skill's Merge Gate item 2 states. Check that case again on every re-run below, and record
6868
its evidence for the head step 3 merges, as that item says.
6969
Confirm the digest's `head=` is a prefix of the recorded SHA, re-running both where it is not,
7070
so the SHA step 3 merges is the one the gate verified. Where drive-pr's ready report named a
@@ -174,7 +174,7 @@ skill covers all of it, scoped down by what the maintainer actually asks for.
174174
than reading an empty answer as safe: `gh pr list --head "<branch>" --base develop --state
175175
merged --repo owner/repo --json number --jq 'if length == 1 then .[0].number else
176176
error("expected exactly one merged PR for this head, got \(length)") end'`. Then run
177-
`python3 scripts/pr_review.py cleanup <number> --repo owner/repo --checkout <base-clone>`
177+
`uv run --no-project --script scripts/pr_review.py cleanup <number> --repo owner/repo --checkout <base-clone>`
178178
from a hub checkout outside the worktree it removes, `<base-clone>` being the repository's
179179
primary clone, per `repo-worktree` "Listing and Cleanup". It re-reads that pull request and
180180
repeats the merged, base, head-repository, and tip checks in code, refuses a permanent or
@@ -186,15 +186,15 @@ skill covers all of it, scoped down by what the maintainer actually asks for.
186186
any other exit stops and reports: `1` is a refusal, `2` an unanswered read or an unconfirmed
187187
delete, and `64` a target under an owner other than the hub checkout's own `origin` or that
188188
`origin` unreadable, a registry refusal being a `1`. It runs under the host-safety
189-
installer's `Bash(python3 scripts/pr_review.py:*)` allow rule, which is what lets auto mode
189+
installer's `Bash(uv run --no-project --script scripts/pr_review.py:*)` allow rule, which is what lets auto mode
190190
complete it.
191191
It also refuses while another open pull request in the repository has the branch as its head or base, naming each.
192192
Where this seat cannot run `cleanup`, report the cleanup to the maintainer instead of running its steps by hand, naming the pull request number and `--repo`.
193193
No direct `git push origin --delete`, ref API delete, `git worktree remove`, or `git branch -D` runs on a feature branch from this skill, because `cleanup` is the one place holding the checks.
194194
Never apply this sweep to `develop` or `main`
195195
themselves, only to feature branches a drive-pr loop created.
196196
- What no single pull request names: run
197-
`python3 scripts/pr_review.py cleanup --sweep --repo owner/repo --checkout <base-clone>`
197+
`uv run --no-project --script scripts/pr_review.py cleanup --sweep --repo owner/repo --checkout <base-clone>`
198198
and report what it lists. It writes nothing but a fetch, and `--apply` runs only on the
199199
maintainer's go-ahead, since the report reaches other sessions' finished work too.
200200

0 commit comments

Comments
 (0)