Skip to content
2 changes: 1 addition & 1 deletion AUDIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This audit is not occasional. Run it whenever you **create, adopt, or materially

- **A full sweep opens with a fleet membership check, not a per-repo one.** `spec/audit.py`, run with no repo names, first lists every non-fork repository the registry `owner` actually owns on GitHub and diffs it against `registry/repos.json`. A repo that exists but carries no entry is invisible to every other check in this file. That is because all of them iterate the registry and never look past it. So this is the only place that gap is caught. The check also reconciles one field: a registry `status: "archived"` must agree with GitHub's own archived flag, in either direction. A name-filtered run or `--issue` skips it, since those are scoped to repos already known to the registry. Authenticate `gh` with a token that reaches every repository the owner has, never a fine-grained PAT scoped to "selected repositories". Such a token returns an incomplete list with no error, so the sweep would read clean while some repos were never inspected. The runner refuses a login other than the registry owner, but it cannot see a token's scope.
- **Onboarding a repo is complete only when it either passes this audit or has a hub-committed `reports/<repo>/audit.md` plus a tracking issue** enumerating every residual delta. Section 8 defines `<repo>` in that path. Passing means operational on every applicable check. A repo that is partially set up but never audited is itself a **defect**, the exact state this process prevents. The create-to-conformance counterpart is [`STANDUP.md`][standup]. Because both read the same manifests, a repo stood up by that file passes this audit by construction.
- **Touching a repo** (any conformance-affecting change) ends by re-running the applicable checks and **reconciling the registry entry to reality**: `status`, `types`, `releaseTrigger`, `workflowModel`, `driftNotes`. The registry records reality, not intent. [`spec/validate.py`][validate] proves the catalog is self-consistent, not that it matches the live repo. Closing that gap is this audit's job. The deterministic subset is mechanized in [`spec/audit.py`][audit-runner]. It covers settings, rulesets, secret names, file presence, and file names. It also covers per-scope Markdown section presence, workflow interface conformance, verbatim content, hub-hosted files a repo carries, and branch facts. The runner is owner-initiated, run on demand when onboarding a repo, on suspected drift, or before fleet-wide changes. A required section missing from a carried Markdown file is a **drift finding**, not a letter. That is because a heading rename reads as missing and equivalence is judged by hand. A carried `interface` workflow (`spec/fidelity-model.md`) is checked by name and wiring. That covers its required jobs, the ruleset-bound check name, and the tokens and event types its [`spec/files.json`][files] contract names. Where they apply, the checks also cover the workflow's `concurrency:` block and the `workflow-model` and `python-directories` inputs it passes its hub task. All of those checks are at **drift**, since the body is owned and a rename is a hint to verify. A carried `verbatim` unit is content-hashed against the hub's canonical after line-ending, action-pin, and job-`needs:` normalization. Such a unit is either a whole file (`.markdownlint-cli2.jsonc`) or a `## heading` section of a carried Markdown file (the verbatim sections of `AGENTS.md` and `GOVERNANCE.md`). A mismatch is classified **stale** (matches a past hub revision, re-vendor) or **modified** (matches none, the repo changed fixed content). Both are at **drift**, since equivalence is intent-governed and a byte diff is a hint to review. A carried `intent` unit gets one advisory beyond presence, a last-modified comparison. That advisory marks a copy as possibly trailing, at **drift**, and `spec/fidelity-model.md` states which changes raise it. That is a hint rather than proof, since a copy touched without reconciling reads current. Content only ever clears a copy, since one hashing equal to the hub's file for it is current however old its last commit. A plain-JSON copy of a unit declaring `repoOwnedKeys` is the exception, judged by the leaves it does not own and reported whatever the dates read. The advisory does not run against the hub itself. A content scan also looks for a version literal. Such a literal is a three-part version, a full 40-character commit SHA, or an abbreviated one of 7 to 12 characters mixing digits and letters. One found in `AGENTS.md`, `GOVERNANCE.md`, `CODESTYLE.md`, or `WORKFLOW.md`, outside the verbatim sections downstream and across the whole file in the hub, is a **drift** finding. That is because a pin's value in prose goes stale at the next bump and every other literal reads like one.
- **Touching a repo** (any conformance-affecting change) ends by re-running the applicable checks and **reconciling the registry entry to reality**: `status`, `types`, `releaseTrigger`, `workflowModel`, `driftNotes`. The registry records reality, not intent. [`spec/validate.py`][validate] proves the catalog is self-consistent, not that it matches the live repo. Closing that gap is this audit's job. The deterministic subset is mechanized in [`spec/audit.py`][audit-runner]. It covers settings, rulesets, secret names, file presence, and file names. It also covers per-scope Markdown section presence, workflow interface conformance, verbatim content, hub-hosted files a repo carries, and branch facts. The runner is owner-initiated, run on demand when onboarding a repo, on suspected drift, or before fleet-wide changes. A required section missing from a carried Markdown file is a **drift finding**, not a letter. That is because a heading rename reads as missing and equivalence is judged by hand. A carried `interface` workflow (`spec/fidelity-model.md`) is checked by name and wiring. That covers its required jobs, the ruleset-bound check name, and the tokens and event types its [`spec/files.json`][files] contract names. Where they apply, the checks also cover the workflow's `concurrency:` block and the `workflow-model` and `python-directories` inputs it passes its hub task. All of those checks are at **drift**, since the body is owned and a rename is a hint to verify. A carried `verbatim` unit is content-hashed against the hub's canonical after line-ending, action-pin, and job-`needs:` normalization. Such a unit is either a whole file (`.markdownlint-cli2.jsonc`) or a `## heading` section of a carried Markdown file (the verbatim sections of `AGENTS.md` and `GOVERNANCE.md`). A mismatch is classified **stale** (matches a past hub revision, re-vendor) or **modified** (matches none, the repo changed fixed content). Both are at **drift**, since equivalence is intent-governed and a byte diff is a hint to review. A carried `intent` unit gets one advisory beyond presence, a last-modified comparison. That advisory marks a copy as possibly trailing, at **drift**, and `spec/fidelity-model.md` states which changes raise it. That is a hint rather than proof, since a copy touched without reconciling reads current. Content only ever clears a copy, since one hashing equal to the hub's file for it is current however old its last commit. A plain-JSON copy of a `repoOwnedKeys` unit is the exception, judged by the leaves it does not own and by an owned array's entries. A differing copy is reported whatever the dates read. The advisory does not run against the hub itself. A content scan also looks for a version literal. Such a literal is a three-part version, a full 40-character commit SHA, or an abbreviated one of 7 to 12 characters mixing digits and letters. One found in `AGENTS.md`, `GOVERNANCE.md`, `CODESTYLE.md`, or `WORKFLOW.md`, outside the verbatim sections downstream and across the whole file in the hub, is a **drift** finding. That is because a pin's value in prose goes stale at the next bump and every other literal reads like one.

**Verify the host before running any hub tool.** The tools carry version floors. A host below one answers `--version`, looks healthy, and produces a wrong answer. So a clean audit run from a broken host is a clean-looking result rather than a result.

Expand Down
4 changes: 2 additions & 2 deletions RESYNC.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The order is load-bearing. Each step below either changes the rules the later st
**A skill path lands with the instruction file that names it.** Where this re-vendor adds, removes, or renames a `.github/skills` directory that `.github/copilot-instructions.md` names, edit that path in the instruction file in the same change. Do this ahead of step 6. Copilot reads both from the pull request head, so a path naming a pruned directory leaves it reviewing without its skill.
4. **Interface workflows.** Honor the named contract rather than copying bytes. Section 0 of [`AUDIT.md`][audit] lists the checks that contract covers. The body is the repository's own.
5. **Settings, rulesets, and secrets.** Set the first public-interaction limit by hand on one `collaborators` pilot repository, since `apply` sets none until a committed record says a pilot verified one. Verify there that Copilot, CodeRabbit, Qodo, and Dependabot still work under it. Then commit that record, `repo-config/interaction-verification.json`, through a hub pull request carrying the evidence. Check also that no `collaborators` README links a Discussions page. This is `repo-config/README.md` "Public Interaction". From the hub checkout section 1 fetched, run `repo-config/configure.sh check "<owner>/<repo>" release` (substitute `operational` for an operational repo), then `apply` for what it reports. That checkout is at `main`, or at `develop` for an entry not yet promoted. Pass the model explicitly. `apply` ends by writing every secret the repository owes from the running host's `~/.secrets/`, overwriting each stored value. A file the repository owes that is missing or refused makes it exit non-zero after every other group is applied. An empty placeholder from `scaffold` is one such refusal. That exit reports the secrets listed as missing or refused, rather than a failed resync. Delete each target-repository path under `repo-config/` that the audit classified `retire`. Inspect every untriaged path collision before deciding its disposition.
6. **Intent files last, and by hand.** See section 5, which states why these carry little mechanical signal. A unit declaring `repoOwnedKeys`, such as `global.json`, keeps the repository's values at those keys, such as its `sdk.version`. It also keeps every key the baseline does not hold, such as `test.runner`, and takes only the baseline's other keys. A repository's `.vscode/tasks.json` is a presence unit, so the audit only asserts that it exists. Bring its task groups, the Lint group included, in line with the catalog snippet for each of its types by hand. Copy the hook helper's content from `catalog/snippets/hub_fetch_run.py` in the same commit, since the Lint tasks fetch their hub script through it. Add the snippets' `--extend-exclude ./hub_fetch_run.py --force-exclude` to each ruff task and hook call lacking it, per `catalog/snippets/pre-commit/README.md`. A hook helper still named `hub-fetch-run.py` is renamed to `hub_fetch_run.py`, and one under `.husky/` moves to the repo root. Every repo keeps it there, whichever hook it wires. Every call to it in the hook config and `.vscode/tasks.json` changes in the same commit. Nothing mechanical carries the helper, so copying the new snippet beside it would leave both.
6. **Intent files last, and by hand.** See section 5, which states why these carry little mechanical signal. A unit declaring `repoOwnedKeys`, such as `global.json`, keeps the repository's values at those keys, such as its `sdk.version`. It also keeps every top-level key the baseline does not hold, such as the `test` object holding `test.runner`, and takes only the baseline's other keys. It drops a leaf added inside an object the baseline holds, such as `Disable.EndOfLine`, since that can switch a fleet check off. An owned array keeps the repository's own entries and takes each baseline entry it lacks, such as an `Exclude` pattern in `.editorconfig-checker.json`. A repository's `.vscode/tasks.json` is a presence unit, so the audit only asserts that it exists. Bring its task groups, the Lint group included, in line with the catalog snippet for each of its types by hand. Copy the hook helper's content from `catalog/snippets/hub_fetch_run.py` in the same commit, since the Lint tasks fetch their hub script through it. Add the snippets' `--extend-exclude ./hub_fetch_run.py --force-exclude` to each ruff task and hook call lacking it, per `catalog/snippets/pre-commit/README.md`. A hook helper still named `hub-fetch-run.py` is renamed to `hub_fetch_run.py`, and one under `.husky/` moves to the repo root. Every repo keeps it there, whichever hook it wires. Every call to it in the hook config and `.vscode/tasks.json` changes in the same commit. Nothing mechanical carries the helper, so copying the new snippet beside it would leave both.

**Reconcile the registry entry in the same pass.** `status`, `types`, `releaseTrigger`, `workflowModel` and `driftNotes` record reality rather than intent. A `driftNote` describing work that is now finished is deleted rather than left standing. A note asserting outstanding work in prose ("pending", "not yet", "behind") contradicts a clean audit outright.

Expand Down Expand Up @@ -110,7 +110,7 @@ flowchart LR

## 5. What a Resync Cannot Detect

State this rather than letting a clean run imply more than it earned. A carried file at `intent` fidelity is checked for **presence plus a staleness advisory**, per [`spec/fidelity-model.md`][fidelity-model]. Content only ever clears such a copy, since one hashing equal to the hub's file for it is current however old its last commit. That covers every unit `spec/files.json` declares at `intent` fidelity, such as `CODESTYLE.md`, `.editorconfig`, and `global.json`. A plain-JSON copy of a unit declaring `repoOwnedKeys` is the exception, judged by the leaves it does not own whatever the dates read. The prose checks that [`spec/fidelity-model.md`][fidelity-model] "What a Local Edit Looks Like" lists also read some of that content.
State this rather than letting a clean run imply more than it earned. A carried file at `intent` fidelity is checked for **presence plus a staleness advisory**, per [`spec/fidelity-model.md`][fidelity-model]. Content only ever clears such a copy, since one hashing equal to the hub's file for it is current however old its last commit. That covers every unit `spec/files.json` declares at `intent` fidelity, such as `CODESTYLE.md`, `.editorconfig`, and `global.json`. A plain-JSON copy of a `repoOwnedKeys` unit is the exception, judged by the leaves it does not own and by an owned array's entries. A differing copy is reported whatever the dates read. The prose checks that [`spec/fidelity-model.md`][fidelity-model] "What a Local Edit Looks Like" lists also read some of that content.

The advisory is a hint rather than proof, since a copy touched after its canonical changed, without actually reconciling, still reads current. Two things follow. Read the hub's own history for those files when a resync is meant to be thorough, rather than trusting the advisory to raise them. And treat `spec/fidelity_honesty.py`'s promotion candidates as the structural fix. An `intent` unit that is content-identical fleet-wide can become `verbatim` and gain drift detection for free. That is the class that hid the `configure.sh` drift for as long as it did.

Expand Down
Loading
Loading