From 5c797e07492bd5bf46db7603ba7909c2d61f016c Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Thu, 3 Dec 2026 15:36:18 -0800 Subject: [PATCH] Date the Line-Ending Configs by the Hub's Own Copies (#4628) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary The intent advisory for `.editorconfig`, `.editorconfig-checker.json`, and `.gitattributes` was dated against `.agents/skills/comment-and-doc-style/references/line-endings.md`. So every rewording of that prose raised it again for a copy whose local difference had already been verified. - **Dating.** Each of the three units now names the hub's own copy as its `reference`, so it is dated by an edit to the hub's file rather than to the prose. The hub follows its own line-ending policy, so a real policy change edits those files too. - **`.editorconfig-checker.json`.** It declares `repoOwnedKeys: ["Exclude"]`, so a plain-JSON copy is judged by content whatever the dates read. Its `Disable` block is compared leaf by leaf. - **Owned arrays.** An owned array is now the repository's to extend rather than to shrink. A copy lacking an entry the canonical holds is reported at that key, and a resync takes each baseline entry the copy lacks. Without this, declaring `Exclude` owned would have hidden a copy dropping the hub's cache excludes. - **Ledger.** The `accepted` disposition for `.editorconfig-checker.json` is removed as redundant. `reports/divergences.md` still shows it until its next regeneration. - **Docs.** `spec/fidelity-model.md`, `AUDIT.md`, `RESYNC.md`, and `spec/checks.json` state the new rules. Closes #4627 ## Verification - `test_audit_helpers.py` (207 tests), `test_audit.py`, `test_spec_validate.py`, `test_fidelity_honesty.py`, and the full unit suite (5541 tests, before the last two commits) all pass. So do ruff, mypy, `spec/validate.py`, `audit.py --selftest`, `build_dist.py --check`, `repo_gate.py`, and the prose gate. - A read-only `spec/audit.py` run over Utilities, HomeAutomation-Config, and HolidayLights shows no `.editorconfig-checker.json` advisory. Utilities' copy, whose only difference is an added `Exclude` entry, now reads current. - Live copies on `main` of those three repos hold every baseline `Exclude` entry and the hub's exact `Disable` block. So the superset rule raises nothing new for them. ## Known Residuals - **Comment-only edits still date carriers.** A comment-only edit to the hub's `.editorconfig` or `.gitattributes` still raises the advisory for `.editorconfig` and `.gitattributes` copies, since the dating normalization does not strip comments. This follows from the dating option chosen on the issue, and such edits are rarer than the prose edits that drove the issue. ## Local Review Findings Fixed Three recorded `local-strict-review` passes ran. The edit budget was spent with one finding open, now fixed in this PR: - **introduced, fixed:** `fleet_owned_differences` now reports a leaf a copy adds inside an object the canonical holds, such as `Disable.EndOfLine`. A top-level key a copy adds, and a leaf under an owned key, stay the repository's own. This is deliberate, since global.json carriers legitimately add a top-level `test` object. No fleet C# repository's live `global.json` adds a leaf under `sdk`. Four further recorded passes ran after the fix. Their code findings were fixed. Two prose nits are listed rather than fixed: - **introduced, minor:** `spec/fidelity-model.md` line 14 says a copy with no added nested leaf is current whatever the owned keys hold. An owned array emptied of baseline entries still reports, and a leaf added beneath an owned scalar is exempt. The next sentences and the tests state both. - **introduced, minor:** `spec/checks.json` `files.intent` does not state the exemption for a leaf beneath an owned key. **Owed:** `reports/divergences.md` still lists the removed `.editorconfig-checker.json` accepted row. Regenerating it needs live fleet reads, and the GitHub core API rate limit blocked that run. It is regenerated with `spec/fidelity_honesty.py --report` once the limit resets. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Summary by CodeRabbit * **Bug Fixes** * JSON consistency checks now flag changes to reference-owned values and extra entries within reference-held objects, while allowing top-level additions and growth of owned arrays when required reference entries remain. * Differences are reported regardless of file dates. * **Documentation** * Updated guidance to clarify how reference keys, repository-owned settings, and local edits are handled. * Revised the divergence report’s dispositions and repository-specific guidance. --------- Co-authored-by: Claude Opus 5.5 --- AUDIT.md | 2 +- RESYNC.md | 4 +- reports/divergences.md | 84 +++++++++++++++++----------------- spec/audit.py | 25 ++-------- spec/checks.json | 2 +- spec/divergences.json | 1 - spec/fidelity-model.md | 4 +- spec/files.json | 6 +-- spec/validate.py | 42 +++++++++++++++++ tests/test_audit_helpers.py | 91 +++++++++++++++++++++++++++++++++++-- 10 files changed, 182 insertions(+), 79 deletions(-) diff --git a/AUDIT.md b/AUDIT.md index a0314858d..f1df9b023 100644 --- a/AUDIT.md +++ b/AUDIT.md @@ -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//audit.md` plus a tracking issue** enumerating every residual delta. Section 8 defines `` 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. diff --git a/RESYNC.md b/RESYNC.md index 850d32386..9aa9fc906 100644 --- a/RESYNC.md +++ b/RESYNC.md @@ -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 "/" 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. @@ -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. diff --git a/reports/divergences.md b/reports/divergences.md index 11f45bbd6..be6dce2e8 100644 --- a/reports/divergences.md +++ b/reports/divergences.md @@ -1,70 +1,70 @@ # Fleet divergence report -Generated by `python3 spec/fidelity_honesty.py --report` - do not hand-edit. Curate dispositions in [`spec/divergences.json`][ledger] and regenerate. Each row reflects a repo's ground-truth branch at generation time. Git dates this file. +Generated by `uv run --no-project --script spec/fidelity_honesty.py --report` - do not hand-edit. Curate dispositions in [`spec/divergences.json`][ledger] and regenerate. Each row reflects a repo's ground-truth branch at generation time. Git dates this file. ## Burn-down ### re-vendor -- **.markdownlint-cli2.jsonc** - AudioCleaner, PhotoCleaner _(recorded aiopurpleair now resolved)_ - Verbatim config held as a hand-modified copy rather than a past hub revision. Restore the current canonical. +- **.markdownlint-cli2.jsonc** - AudioCleaner _(recorded PhotoCleaner, aiopurpleair now resolved)_ - Verbatim config held as a hand-modified copy rather than a past hub revision. Restore the current canonical. ### retire -- **repo-config/configure.sh** (manifest gap, carried by ESPHome-NonRoot) - The hub hosts the repository-configuration script. A downstream repository runs the hub's main copy against its repository name and workflow model. -- **repo-config/operational/develop.json** (manifest gap, carried by HomeAssistant-Config) - The hub hosts the operational-model develop ruleset payload. A downstream repository is checked against the hub's main payload. -- **repo-config/main.json** (manifest gap, carried by HomeAssistant-Config) - The hub hosts the shared main ruleset payload. A downstream repository is checked against the hub's main payload. -- **repo-config/settings.json** (manifest gap, carried by ESPHome-NonRoot, HomeAssistant-Config) - The hub hosts the shared repository settings payload. A downstream repository is checked against the hub's main payload. -- **repo-config/README.md** (manifest gap, carried by ESPHome-NonRoot, HomeAssistant-Config) - The hub hosts the repository-configuration reference beside the payloads and script it documents. -- **spec/secrets.json** (manifest gap, carried by HomeAssistant-Config) - The adapted baseline/mechanisms carry never varied per repo: baseline applies to every fleet repo by definition, and mechanisms/targetMechanisms/typeMechanisms are computed centrally by spec/audit.py from the hub's own spec/secrets.json plus registry/repos.json, which a downstream copy could only restate or let drift. A downstream repository is checked against the hub's copy by running spec/audit.py from a hub checkout instead (ptr727/ProjectTemplate#993). -- **.github/workflows/build-release-task.yml** (manifest gap, carried by ESPHome-NonRoot) - The release chain is hub-hosted as a workflow_call task, per docs/reusable-workflows.md "Stage 4: The Release Chain and the Docker Core", so a downstream copy of this filename is retired rather than re-vendored: the caller stub a repo carries after adoption is publish-release.yml and test-pull-request.yml calling the hub task by pin, and no adopting repo carries a same-named local file. The ten carriers measured on develop at hub 7c67328 are PhotoCleaner, PlexCleaner, LanguageTags, MediaTools, Utilities, aiopurpleair, ESPHome-NonRoot, VSCode-Server-DotNetCore, KiCadLibrary, and homeassistant-purpleair. Delete the copy as each repo adopts the hub task; adoption is a separate, later change per repo (docs/reusable-workflows.md "Rollout" Stage 4). -- **.github/workflows/build-docker-task.yml** (manifest gap, carried by ESPHome-NonRoot) - The Docker core is hub-hosted as its own workflow_call task alongside build-release-task.yml, per docs/reusable-workflows.md "Stage 4: The Release Chain and the Docker Core", so a downstream copy of this filename is retired rather than re-vendored the same way. The five carriers measured on develop at hub 7c67328 are ESPHome-NonRoot, NxWitness, PhotoCleaner, PlexCleaner, and VSCode-Server-DotNetCore. Delete the copy as each repo adopts the hub task; adoption is a separate, later change per repo (docs/reusable-workflows.md "Rollout" Stage 4). -- **.github/workflows/get-version-task.yml** (manifest gap, carried by ESPHome-NonRoot) - The task is hub-hosted rather than carried, per GOVERNANCE.md "Hub-Hosted Tooling", so it is no manifest entry and a downstream copy is retired rather than re-vendored. Every copy is the hub's own NBGV logic with nothing per-repo in it beyond the action pins Dependabot already owns. The carriers, read from the fleet on 2026-08-15, are ESPHome-NonRoot, NxWitness, PhotoCleaner, PlexCleaner, VSCode-Server-DotNetCore, KiCadLibrary, aiopurpleair, and homeassistant-purpleair. Delete the copy and reach the hub task by pin as each repo is next visited, per docs/reusable-workflows.md "Adopting the Pure Functions". -- **.github/workflows/publish-plan-task.yml** (manifest gap, carried by ESPHome-NonRoot) - The task is hub-hosted rather than carried, per GOVERNANCE.md "Hub-Hosted Tooling", so it is no manifest entry and a downstream copy is retired rather than re-vendored. The carriers, read from the fleet on 2026-08-15, are ESPHome-NonRoot, NxWitness, and Utilities, and all three carry a strict subset of the canonical, missing the -E in set -Eeuo pipefail and the ::warning:: branch for an unrecognized actor pushing to main (WORKFLOW.md D8.4). Delete the copy and reach the hub task by pin as each repo is next visited, per docs/reusable-workflows.md "Adopting the Pure Functions". -- **.github/workflows/validate-task.yml** (manifest gap, carried by AudioCleaner, ESPHome-NonRoot, PlexCleaner) - The file is hub-hosted as a workflow_call task rather than carried, per GOVERNANCE.md "Hub-Hosted Tooling" and docs/reusable-workflows.md "Stage 2: The Gates". The fleet doc-lint block, the language lint, the prose gate, and the repo gate move into the hub task, and a repo's own domain checks move into its own .github/actions/validate/action.yml hook instead, so a downstream copy is retired rather than re-vendored. The thirteen repos carrying a copy as of 2026-08-16 were PhotoCleaner, PlexCleaner, LanguageTags, Utilities, MediaTools, AudioCleaner, aiopurpleair, Financial-Modeling, Blog, ESPHome-NonRoot, NxWitness, VSCode-Server-DotNetCore, and HomeAutomation-Config, and the live current carrier list above may have moved on since. Delete the copy and adopt the caller stub in docs/reusable-workflows.md "Adopting the Gates" as each repo is next visited. -- **.github/workflows/check-upstream-version-task.yml** (manifest gap, carried by ESPHome-NonRoot) - The task is hub-hosted per docs/reusable-workflows.md "The Docker Family", so a downstream copy of the job graph is retired rather than converged. The carrier is ESPHome-NonRoot, whose check-upstream-version.yml caller and check-upstream-version-task.yml body both replace with the caller stub once a release carries the task. Its second tracker, check-upstream-dependency.yml, is a candidate to fold into the same hub task with auto-merge false, tracked as an adoption note rather than a gap here since it was never a copy of this snippet. +- **CLAUDE.md** (manifest gap, carried by Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics) - Claude Code reads AGENTS.md natively, and the agent-safety kit sets the AGENTS.md plugin to load CLAUDE.md and AGENTS.md both, so a repository needs no pointer file importing AGENTS.md. A downstream copy is deleted rather than re-vendored where it matches one of the hub's past versions, which the audit's finding states, per RESYNC.md section 3 step 2. Any other copy is reported to the maintainer rather than deleted. A host reaches the fleet rules through a Claude Code at or above the 2.1.281 floor docs/host-setup.md names, with the kit installed. +- **.github/workflows/validate-task.yml** (manifest gap, carried by AudioCleaner) - The file is hub-hosted as a workflow_call task rather than carried, per GOVERNANCE.md "Hub-Hosted Tooling" and docs/reusable-workflows.md "Stage 2: The Gates". The fleet doc-lint block, the language lint, the prose gate, and the repo gate move into the hub task, and a repo's own domain checks move into its own .github/actions/validate/action.yml hook instead, so a downstream copy is retired rather than re-vendored. The thirteen repos carrying a copy as of 2026-08-16 were PhotoCleaner, PlexCleaner, LanguageTags, Utilities, MediaTools, AudioCleaner, aiopurpleair, Financial-Modeling, Blog, ESPHome-NonRoot, NxWitness, VSCode-Server-DotNetCore, and HomeAutomation-Config, and the live current carrier list above may have moved on since. Delete the copy and adopt the caller stub in docs/reusable-workflows.md "Adopting the Gates" as each repo is next visited. ### accepted -- **.editorconfig-checker.json** - HolidayLights _(recorded HomeAutomation-Config now resolved)_ - Both carry a legitimate repo-specific Exclude list (HomeAutomation-Config excludes a Vantage/ subtree, HolidayLights excludes .fseq sequence files). The uniform Disable block is carried intent-equivalent. Exclude is inherently repo-local, which is why the unit is intent, not verbatim. -- **LICENSE** (manifest gap, carried by AudioCleaner, Blog, DevKitCIoT, ESPHome-Config, ESPHome-NonRoot, EspDinIoT, Financial-Modeling, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, Utilities, VSCode-Server-DotNetCore, Vantage-Config, aiopurpleair, homeassistant-purpleair) - Each repo owns its license file. The hub does not standardize license text, so it is intentionally outside the manifest. -- **TODO.md** (manifest gap, carried by Financial-Modeling, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, MediaTools) - A repo's own running backlog, which STANDUP.md section 2 names as one of the four declared destinations for repo-specific content. It is advisory and required by no selector, so the manifest deliberately does not declare it and a repo's copy is its own content rather than a carry. +- **LICENSE** (manifest gap, carried by AudioCleaner, Blog, ESPHome-Config, ESPHome-NonRoot, Employment, EspDinIoT, Financial-Modeling, HolidayLights, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, Utilities, VSCode-Server-DotNetCore, Vantage-Config, aiopurpleair, homeassistant-purpleair, homeassistant-vantage-diagnostics) - Each repo owns its license file. The hub does not standardize license text, so it is intentionally outside the manifest. +- **TODO.md** (manifest gap, carried by Financial-Modeling, HolidayLights, HomeAssistant-Config, HomeAutomation-Config, MediaTools) - A repo's own running backlog, which STANDUP.md section 2 names as one of the four declared destinations for repo-specific content. It is advisory and required by no selector, so the manifest deliberately does not declare it and a repo's copy is its own content rather than a carry. - **.husky/pre-commit** (manifest gap, carried by AudioCleaner, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, Utilities) - A path collision rather than a carry. Each repo's hook runs that repo's own language formatters, and the hub's runs the doc gates, so the seven downstream copies share the path and none of the content: LanguageTags and Utilities run language formatting and style with no Docker, PlexCleaner runs CSharpier and dotnet format, and the hub runs prose_lint.py and repo_gate.py. Verified by reading the downstream copies on 2026-08-10. -- **scripts/README.md** (manifest gap, carried by KiCadLibrary) - A path collision rather than a carry. KiCadLibrary's copy documents its own KiCad tooling (common.py, verify_library.py, build_library.py) beside the scripts it describes, and shares nothing with the hub's fleet-gate documentation. Verified by reading it on 2026-08-10. scripts/ is a generic path, so a repo with its own tooling directory matches this check without carrying anything of the hub's. +- **scripts/README.md** (manifest gap, carried by Employment, HomeAutomation-Config, KiCadLibrary) - A path collision rather than a carry. KiCadLibrary's copy documents its own KiCad tooling (common.py, verify_library.py, build_library.py) beside the scripts it describes, and shares nothing with the hub's fleet-gate documentation. Verified by reading it on 2026-08-10. scripts/ is a generic path, so a repo with its own tooling directory matches this check without carrying anything of the hub's. - **.github/actionlint.yaml** (manifest gap, carried by HomeAutomation-Config) - A path collision rather than a carry. HomeAutomation-Config's own copy declares self-hosted-runner labels (homelab, ubuntu-24.04) for its self-hosted CI runner, entirely different content from the hub's own file at this path, which configures $/ self-reference ignore rules for the hub's own workflows. Verified by reading both copies on 2026-08-25. -- **.github/actions/validate/action.yml** (manifest gap, carried by Blog, ESPHome-Config, Financial-Modeling, HomeAutomation-Config, KiCadLibrary, LanguageTags, aiopurpleair) - A path collision rather than a carry. HomeAutomation-Config's own copy overrides the interface-workflow validate hook, per RESYNC.md 'Apply, in This Order' item 4, 'Interface workflows': 'Honor the named contract... rather than copying bytes. The body is the repository's own.' It runs its CloudInit/ nested Python project through uv/ruff/pyright/pytest. The hub's own file at this same path is a different override, its own registry/spec self-test suite. A repo declaring its own .github/actions/validate/action.yml is the documented, intended override mechanism, not drift to reconcile. Verified by reading both copies on 2026-08-25. -- **PSScriptAnalyzerSettings.psd1** (manifest gap, carried by HomeAutomation-Config) - A path collision rather than a carry. Both copies exclude the same two rules, PSAvoidUsingWriteHost and PSUseShouldProcessForStateChangingFunctions, and share a common comment style, but each documents the scripts that repository's own tree actually holds, and those differ. The hub's copy documents the scripts under host-setup/windows and their -DryRun flag with a confirm prompt. HomeAutomation-Config's copy documents host-install/windows/*.ps1, naming upgrade-host.ps1 and install.ps1, under a host-install/ tree the hub does not have, and that repository's own -Check and -Force flags instead. Overwriting either copy with the other would attach the wrong repository's scripts and flags to the same two rule exclusions, which is why the shared style does not make this a stale carry to reconcile. Verified by reading both copies on 2026-09-27. -- **pyproject.toml** (manifest gap, carried by ESPHome-Config, Financial-Modeling, KiCadLibrary, aiopurpleair, homeassistant-purpleair) - A path collision rather than a carry. The hub's own copy is a config-only Scripts-profile file holding its lint configuration, while each Python repo's copy is that repo's own project manifest or tool configuration, and where ruff, mypy, and pyright are configured, and with what values, differs by repo on purpose. aiopurpleair and Financial-Modeling carry Build-profile manifests, ESPHome-Config's is a uv workspace root, and homeassistant-purpleair keeps its ruff and pyright configuration in files of their own. A placement-specific check would raise a finding on a repo that should not converge, and a location-agnostic one would assert almost nothing, so the file is not declared. Verified by reading each carrier's copy on main on 2026-09-24. +- **.github/actions/validate/action.yml** (manifest gap, carried by Blog, ESPHome-Config, ESPHome-NonRoot, Financial-Modeling, HomeAutomation-Config, KiCadLibrary, LanguageTags, aiopurpleair, homeassistant-purpleair, homeassistant-vantage-diagnostics) - A path collision rather than a carry. HomeAutomation-Config's own copy overrides the interface-workflow validate hook, per RESYNC.md 'Apply, in This Order' item 4, 'Interface workflows': 'Honor the named contract... rather than copying bytes. The body is the repository's own.' It runs its CloudInit/ nested Python project through uv/ruff/pyright/pytest. The hub's own file at this same path is a different override, its own registry/spec self-test suite. A repo declaring its own .github/actions/validate/action.yml is the documented, intended override mechanism, not drift to reconcile. Verified by reading both copies on 2026-08-25. +- **.github/actions/resolve-upstream/action.yml** (manifest gap, carried by ESPHome-NonRoot) - A path collision rather than a carry. The hub's check-upstream-version-task.yml requires each caller to supply its own resolve-upstream hook at this path, and each copy resolves that repository's own upstream versions. The hub's own file resolves the newest released line of each host tool the hub pins, while ESPHome-NonRoot's resolves its ESPHome and Device Builder releases from PyPI. A repo carrying its own .github/actions/resolve-upstream/action.yml is the task's documented hook, not drift to reconcile. Verified by reading both copies on 2026-11-24. +- **PSScriptAnalyzerSettings.psd1** (manifest gap, carried by HomeAssistant-Config, HomeAutomation-Config) - A path collision rather than a carry. Both copies exclude the same two rules, PSAvoidUsingWriteHost and PSUseShouldProcessForStateChangingFunctions, and share a common comment style, but each documents the scripts that repository's own tree actually holds, and those differ. The hub's copy documents the scripts under host-setup/windows and their -DryRun flag with a confirm prompt. HomeAutomation-Config's copy documents host-install/windows/*.ps1, naming upgrade-host.ps1 and install.ps1, under a host-install/ tree the hub does not have, and that repository's own -Check and -Force flags instead. Overwriting either copy with the other would attach the wrong repository's scripts and flags to the same two rule exclusions, which is why the shared style does not make this a stale carry to reconcile. Verified by reading both copies on 2026-09-27. +- **pyproject.toml** (manifest gap, carried by ESPHome-Config, Financial-Modeling, KiCadLibrary, aiopurpleair, homeassistant-purpleair, homeassistant-vantage-diagnostics) - A path collision rather than a carry. The hub's own copy is a config-only Scripts-profile file holding its lint configuration, while each Python repo's copy is that repo's own project manifest or tool configuration, and where ruff, mypy, and pyright are configured, and with what values, differs by repo on purpose. aiopurpleair and Financial-Modeling carry Build-profile manifests, ESPHome-Config's is a uv workspace root, and homeassistant-purpleair keeps its ruff and pyright configuration in files of their own. A placement-specific check would raise a finding on a repo that should not converge, and a location-agnostic one would assert almost nothing, so the file is not declared. Verified by reading each carrier's copy on main on 2026-09-24. +- **.coderabbit.yaml** (manifest gap, carried by AudioCleaner, Blog, ESPHome-Config, ESPHome-NonRoot, Employment, EspDinIoT, Financial-Modeling, HolidayLights, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, Utilities, VSCode-Server-DotNetCore, Vantage-Config, aiopurpleair, homeassistant-purpleair, homeassistant-vantage-diagnostics) - Rendered per repository rather than carried. repo-config/configure.sh renders .github/agent-policy.json from the repository's registry entry through scripts/agent_policy.py, sets the reviewer values derived from it in .coderabbit.yaml and .pr_agent.toml while keeping every other setting there, and its check mode compares each of the three on the default branch with that render. The policy differs by repository and the two reviewer files mix derived values with the repository's own, so no spec/files.json fidelity describes any of them, and a manifest entry would have the audit compare text the render already judges. configure.sh check is the conformance check, so the audit accepts the copy rather than reporting it as hub-hosted content to delete. +- **.github/agent-policy.json** (manifest gap, carried by AudioCleaner, Blog, ESPHome-Config, ESPHome-NonRoot, Employment, EspDinIoT, Financial-Modeling, HolidayLights, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, Utilities, VSCode-Server-DotNetCore, Vantage-Config, aiopurpleair, homeassistant-purpleair, homeassistant-vantage-diagnostics) - Rendered per repository rather than carried. repo-config/configure.sh renders .github/agent-policy.json from the repository's registry entry through scripts/agent_policy.py, sets the reviewer values derived from it in .coderabbit.yaml and .pr_agent.toml while keeping every other setting there, and its check mode compares each of the three on the default branch with that render. The policy differs by repository and the two reviewer files mix derived values with the repository's own, so no spec/files.json fidelity describes any of them, and a manifest entry would have the audit compare text the render already judges. configure.sh check is the conformance check, so the audit accepts the copy rather than reporting it as hub-hosted content to delete. +- **.pr_agent.toml** (manifest gap, carried by AudioCleaner, Blog, ESPHome-Config, ESPHome-NonRoot, Employment, EspDinIoT, Financial-Modeling, HolidayLights, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, Utilities, VSCode-Server-DotNetCore, Vantage-Config, aiopurpleair, homeassistant-purpleair, homeassistant-vantage-diagnostics) - Rendered per repository rather than carried. repo-config/configure.sh renders .github/agent-policy.json from the repository's registry entry through scripts/agent_policy.py, sets the reviewer values derived from it in .coderabbit.yaml and .pr_agent.toml while keeping every other setting there, and its check mode compares each of the three on the default branch with that render. The policy differs by repository and the two reviewer files mix derived values with the repository's own, so no spec/files.json fidelity describes any of them, and a manifest entry would have the audit compare text the render already judges. configure.sh check is the conformance check, so the audit accepts the copy rather than reporting it as hub-hosted content to delete. ## Untriaged - add a disposition to `spec/divergences.json` -- **AGENTS.md > Fleet Bootstrap** - **not carried** by AudioCleaner, DevKitCIoT, HolidayLights, so the section never arrived rather than being edited (verbatim canonical) -- **AGENTS.md > Context and Delegation Discipline** - **not carried** by AudioCleaner, DevKitCIoT, HolidayLights, so the section never arrived rather than being edited (verbatim canonical) -- **AGENTS.md > Where the Rules Live** - **not carried** by AudioCleaner, DevKitCIoT, HolidayLights, so the section never arrived rather than being edited (verbatim canonical) +- **AGENTS.md > Fleet Bootstrap** - **not carried** by AudioCleaner, EspDinIoT, so the section never arrived rather than being edited (verbatim canonical) +- **AGENTS.md > Context and Delegation Discipline** - **not carried** by AudioCleaner, EspDinIoT, so the section never arrived rather than being edited (verbatim canonical) +- **AGENTS.md > Where the Rules Live** - **not carried** by AudioCleaner, EspDinIoT, so the section never arrived rather than being edited (verbatim canonical) ## Mechanical re-vendor (verbatim stale copies) A past hub revision, not the current canonical - the audit already flags these as DRIFT. Copy the current file down. No judgment needed. -- **AGENTS.md > Fleet Bootstrap** (3): ESPHome-Config, HomeAssistant-Config, PhotoCleaner -- **AGENTS.md > Context and Delegation Discipline** (13): Blog, ESPHome-Config, ESPHome-NonRoot, HomeAssistant-Config, HomeAutomation-Config, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, Utilities, VSCode-Server-DotNetCore, Vantage-Config -- **AGENTS.md > Where the Rules Live** (3): ESPHome-Config, HomeAssistant-Config, PhotoCleaner -- **GOVERNANCE.md > Durable Knowledge and Self-Improvement** (3): ESPHome-Config, HomeAssistant-Config, PhotoCleaner -- **GOVERNANCE.md > Repository Boundaries and Write Safety** (1): HomeAssistant-Config -- **GOVERNANCE.md > Branching Model** (3): ESPHome-Config, HomeAssistant-Config, PhotoCleaner -- **GOVERNANCE.md > Release Model** (11): ESPHome-Config, ESPHome-NonRoot, HomeAssistant-Config, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, Utilities, VSCode-Server-DotNetCore, Vantage-Config -- **GOVERNANCE.md > Operational Repositories** (3): ESPHome-Config, HomeAssistant-Config, PhotoCleaner -- **GOVERNANCE.md > Hub-Hosted Tooling** (2): HomeAssistant-Config, PhotoCleaner -- **GOVERNANCE.md > Documentation Style Conventions** (11): ESPHome-Config, ESPHome-NonRoot, HomeAssistant-Config, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, Utilities, VSCode-Server-DotNetCore, Vantage-Config -- **GOVERNANCE.md > Verification Discipline** (10): ESPHome-Config, ESPHome-NonRoot, HomeAssistant-Config, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, Utilities, VSCode-Server-DotNetCore -- **GOVERNANCE.md > PR Review Etiquette** (13): Blog, ESPHome-Config, ESPHome-NonRoot, HomeAssistant-Config, HomeAutomation-Config, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, Utilities, VSCode-Server-DotNetCore, Vantage-Config -- **GOVERNANCE.md > Communicating with the User** (3): ESPHome-Config, HomeAssistant-Config, PhotoCleaner -- **GOVERNANCE.md > Workflow YAML Conventions** (17): Blog, ESPHome-Config, ESPHome-NonRoot, Financial-Modeling, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, Utilities, VSCode-Server-DotNetCore, Vantage-Config, aiopurpleair, homeassistant-purpleair -- **GOVERNANCE.md > Editor and Tasks** (12): ESPHome-Config, ESPHome-NonRoot, HomeAssistant-Config, HomeAutomation-Config, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, Utilities, VSCode-Server-DotNetCore, Vantage-Config -- **GOVERNANCE.md > Repository Details** (1): HomeAssistant-Config -- **.markdownlint-cli2.jsonc** (5): AudioCleaner, DevKitCIoT, HolidayLights, HomeAssistant-Config, PhotoCleaner +- **AGENTS.md > Fleet Bootstrap** (1): Financial-Modeling +- **AGENTS.md > Context and Delegation Discipline** (18): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **AGENTS.md > Where the Rules Live** (17): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **GOVERNANCE.md > Foundational Principles** (1): Financial-Modeling +- **GOVERNANCE.md > Durable Knowledge and Self-Improvement** (18): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **GOVERNANCE.md > Repository Boundaries and Write Safety** (16): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **GOVERNANCE.md > Representative Data in Agent-Authored Text** (18): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **GOVERNANCE.md > Git and Commit Rules** (1): Financial-Modeling +- **GOVERNANCE.md > Branching Model** (13): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, VSCode-Server-DotNetCore, Vantage-Config +- **GOVERNANCE.md > Release Model** (1): Financial-Modeling +- **GOVERNANCE.md > Operational Repositories** (16): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **GOVERNANCE.md > Hub-Hosted Tooling** (13): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, VSCode-Server-DotNetCore, Vantage-Config +- **GOVERNANCE.md > Pull Request Title and Commit Message Conventions** (16): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **GOVERNANCE.md > Documentation Style Conventions** (16): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **GOVERNANCE.md > Verification Discipline** (16): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **GOVERNANCE.md > Design Before Code** (16): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **GOVERNANCE.md > Trust Boundaries and Hardening Effort** (1): Financial-Modeling +- **GOVERNANCE.md > PR Review Etiquette** (16): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **GOVERNANCE.md > Communicating with the User** (13): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, VSCode-Server-DotNetCore, Vantage-Config +- **GOVERNANCE.md > Workflow YAML Conventions** (13): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, VSCode-Server-DotNetCore, Vantage-Config +- **GOVERNANCE.md > Supported Development Platforms** (18): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **GOVERNANCE.md > Editor and Tasks** (18): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, HomeAutomation-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, PlexCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **GOVERNANCE.md > Repository Details** (16): Blog, ESPHome-Config, ESPHome-NonRoot, Employment, Financial-Modeling, HolidayLights, HomeAssistant-Config, KiCadLibrary, LanguageTags, MediaTools, NxWitness, PhotoCleaner, VSCode-Server-DotNetCore, Vantage-Config, homeassistant-purpleair, homeassistant-vantage-diagnostics +- **.markdownlint-cli2.jsonc** (2): AudioCleaner, EspDinIoT ## Promote candidates (intent uniform -> verbatim) -_None - no intent unit is currently fleet-uniform with the canonical._ +_None - no intent unit without `repoOwnedKeys` is currently fleet-uniform with the canonical._ [ledger]: ../spec/divergences.json diff --git a/spec/audit.py b/spec/audit.py index cb5743ae2..e78230539 100755 --- a/spec/audit.py +++ b/spec/audit.py @@ -1852,27 +1852,7 @@ def baseline_file_findings(slug, ground, path, item, ref=None): return content, contents_text(content), [] -def fleet_owned_differences(item, canon_text, down_text): - """The leaves outside a unit's `repoOwnedKeys` that its copy holds differently from its JSON canonical, or lacks. - - An empty list means the copy is current, and None means the two cannot be compared. - A value at one of those keys is the repository's own choice, and so is a leaf the copy adds. - So a key the canonical drops goes unreported, and a text either side that is not plain JSON is dated as before. - """ - owned = item.get("repoOwnedKeys") - if not owned or canon_text is None: - return None - try: - canon = json.loads(canon_text) - down = json.loads(down_text.lstrip("\ufeff")) - except ValueError: - return None - held = {k: json.dumps(v, sort_keys=True) for k, v in validate.json_leaves(down)} - return [ - k - for k, v in validate.json_leaves(canon) - if k not in owned and held.get(k) != json.dumps(v, sort_keys=True) - ] +fleet_owned_differences = validate.fleet_owned_differences def intent_trail(slug, ref, path, item, down_text): @@ -1881,7 +1861,8 @@ def intent_trail(slug, ref, path, item, down_text): A last-modified comparison, since intent has no content check. A copy content-identical to the canonical, or to the hub's own file at `path` where the unit names no `reference`, is current. A `repoOwnedKeys` unit's copy is judged by its fleet-owned values instead, whatever the dates read. - `differences` names each fleet-owned leaf that copy trails, and is None for a copy judged by date. + `differences` names each leaf that copy differs at, an added leaf inside a canonical object included. + It is None for a copy judged by date. `ref` is the branch or commit its last change is looked up from. """ canonical_rel, anchor = intent_ref(item, path) diff --git a/spec/checks.json b/spec/checks.json index 0fcefbd28..2f921aa46 100644 --- a/spec/checks.json +++ b/spec/checks.json @@ -25,7 +25,7 @@ { "id": "sections.undeclared", "family": "sections", "description": "A carried instruction file holds no level-two heading the manifest does not declare.", "spec": "spec/section-model.md", "hub": false, "scope": "file" }, { "id": "carried.template-ref", "family": "carried", "description": "A carried instruction file names the hub only inside its verbatim sections.", "spec": "GOVERNANCE.md", "hub": false, "scope": "file" }, { "id": "carried.version-literal", "family": "carried", "description": "An instruction document carries no version literal or commit SHA.", "spec": "GOVERNANCE.md", "hub": true, "scope": "file" }, - { "id": "files.intent", "family": "files", "description": "Each intent copy read is no older than its intent canonical's last change, or a driftNote acknowledges that change. A plain-JSON copy of a unit declaring repoOwnedKeys is judged instead by whether it holds every other leaf of its canonical.", "spec": "spec/fidelity-model.md", "hub": false, "scope": "repo", "suppression": { "endsWithType": null } }, + { "id": "files.intent", "family": "files", "description": "Each intent copy read is no older than its intent canonical's last change, or a driftNote acknowledges that change. A plain-JSON copy of a unit declaring repoOwnedKeys is judged instead by whether it holds every other leaf of its canonical, and every entry of an owned array, and adds no leaf inside an object its canonical holds.", "spec": "spec/fidelity-model.md", "hub": false, "scope": "repo", "suppression": { "endsWithType": null } }, { "id": "pins.age", "family": "pins", "description": "Each caller's hub reusable-workflow pin is the newest hub release, an advisory while behind and drift once a newer release has superseded it for longer than the bound.", "spec": "GOVERNANCE.md", "hub": true, "scope": "repo", "suppression": { "endsWithType": null } }, { "id": "tree.readable", "family": "tree", "description": "The repository's file tree was read in full.", "spec": "spec/files.json", "hub": true, "scope": "repo" }, { "id": "tree.verbatim", "family": "tree", "description": "Each manifest-owned tree matches its hub source.", "spec": "spec/files.json", "hub": false, "scope": "repo" }, diff --git a/spec/divergences.json b/spec/divergences.json index 84e86362b..aa8d5a7bd 100644 --- a/spec/divergences.json +++ b/spec/divergences.json @@ -2,7 +2,6 @@ "$schema": "./divergences.schema.json", "note": "Curated dispositions for known fleet divergences from the manifest canonicals - the burn-down ledger. spec/fidelity_honesty.py --report joins this against live fleet reality to write reports/divergences.md. A recorded divergence still present renders as a burn-down task with its disposition. A live divergence absent here renders as UNTRIAGED. A recorded divergence no longer live renders as resolved. Edit this file (not the generated report) and regenerate. dispositions cover per-repo divergences from a verbatim or intent canonical - a whole file, or a verbatim section whose unit key is the file path, then a space-greater-space delimiter, then the section name (for example GOVERNANCE.md > Git and Commit Rules). gaps cover files carried by the fleet but absent from spec/files.json. disposition vocabulary: re-vendor (drift-to-fix, copy the current canonical down), track (a gap to add to the manifest), accepted (a legitimate permanent divergence, no action), upstream-candidate (the downstream carries an improvement the hub should adopt, then re-vendor), investigate (recorded, decision pending, and the only disposition whose tracking value is required rather than optional, since it names no outcome and the tracking value is what names where the decision is being made), retire (a downstream copy is deleted rather than converged, because the hub hosts the file per GOVERNANCE.md 'Hub-Hosted Tooling' or the fleet retired it outright, and spec/audit.py reports a retire path whether or not the hub still tracks it). A gaps row with a repos list is accepted only, and records that those repositories keep their own copy of the path.", "dispositions": [ - { "path": ".editorconfig-checker.json", "repos": ["HomeAutomation-Config", "HolidayLights"], "disposition": "accepted", "reason": "Both carry a legitimate repo-specific Exclude list (HomeAutomation-Config excludes a Vantage/ subtree, HolidayLights excludes .fseq sequence files). The uniform Disable block is carried intent-equivalent. Exclude is inherently repo-local, which is why the unit is intent, not verbatim.", "tracking": null }, { "path": ".markdownlint-cli2.jsonc", "repos": ["aiopurpleair", "PhotoCleaner", "AudioCleaner"], "disposition": "re-vendor", "reason": "Verbatim config held as a hand-modified copy rather than a past hub revision. Restore the current canonical.", "tracking": null } ], "gaps": [ diff --git a/spec/fidelity-model.md b/spec/fidelity-model.md index cee9207fa..d2e18fda9 100644 --- a/spec/fidelity-model.md +++ b/spec/fidelity-model.md @@ -11,7 +11,7 @@ Carried content is a class with virtual functions. The **fixed** part is the int Each [`spec/files.json`][files] entry declares one `fidelity`, defaulting to `presence`. - **presence** - the unit exists (a file, or a Markdown section heading). The audit's baseline check. -- **intent** - carried faithfully but judged by meaning, not bytes. A downstream copy legitimately differs (a governed divergence or a paraphrase), and equivalence is a human call via `intentRef`. The audit asserts presence, plus a last-modified staleness advisory at drift. A hub canonical changing after the copy's own last commit marks the copy as possibly trailing, a hint rather than proof. Content is never judged, except that a copy hashing equal to the hub's file is current. That file is its canonical, or the hub's own copy at its path where the unit names no `reference`. A `repoOwnedKeys` unit's JSON is also read for its fleet-owned values. That "changing" walks past a revision whose diff is normalized-only (the same line-ending, action-pin, and job-needs normalization as verbatim below). So a Dependabot pin bump on a workflow file does not by itself mark every carrier as trailing. An `intentRef` naming an `#anchor` is dated by the section that anchor names, so an edit elsewhere in its document marks nothing. An `intentRef` naming another file dates the copy by that file. A unit naming a `reference` is dated by that file instead. An anchor naming no heading dates the whole file. A unit naming `repoOwnedKeys` lists the dotted JSON keys of that reference whose value the repository chooses, such as the SDK line in `global.json`. A copy holding every other leaf its reference holds is current whatever those keys hold, and a leaf the copy adds is its own too. A copy missing or changing one of those other leaves is reported as trailing, whatever the dates read. So a repository on another line than the hub's baseline never reads as trailing it, unless its copy is not plain JSON. A key the reference drops goes unreported. A registry `driftNote` naming `(files.intent)` acknowledges a copy verified against the change the advisory cites, per `AUDIT.md` section 7, until that canonical changes again. +- **intent** - carried faithfully but judged by meaning, not bytes. A downstream copy legitimately differs (a governed divergence or a paraphrase), and equivalence is a human call via `intentRef`. The audit asserts presence, plus a last-modified staleness advisory at drift. A hub canonical changing after the copy's own last commit marks the copy as possibly trailing, a hint rather than proof. Content is never judged, except that a copy hashing equal to the hub's file is current. That file is its canonical, or the hub's own copy at its path where the unit names no `reference`. A `repoOwnedKeys` unit's JSON is also read for its fleet-owned values. That "changing" walks past a revision whose diff is normalized-only (the same line-ending, action-pin, and job-needs normalization as verbatim below). So a Dependabot pin bump on a workflow file does not by itself mark every carrier as trailing. An `intentRef` naming an `#anchor` is dated by the section that anchor names, so an edit elsewhere in its document marks nothing. An `intentRef` naming another file dates the copy by that file. An anchor naming no heading dates the whole file. A unit naming a `reference` is dated by that file instead. The three line-ending configs name the hub's own copy at their path. So a rewording of the line-endings reference dates none of them, while an edit to the hub's copy does. A unit naming `repoOwnedKeys` lists the dotted JSON keys of that reference whose value the repository chooses. Two are the SDK line in `global.json` and the `Exclude` list in `.editorconfig-checker.json`. A copy holding every other leaf its reference holds, and adding none inside an object the reference holds, is current whatever those keys hold. A top-level key the copy adds is its own. A leaf added inside such an object is reported, since it can switch a fleet check off. An owned array is judged apart, since the copy may add entries but must keep every entry the reference holds. A copy missing or changing one of those other leaves is reported as trailing, whatever the dates read. So a repository on another line than the hub's baseline never reads as trailing it, unless its copy is not plain JSON. A top-level key the reference drops goes unreported, while a leaf it drops from an object it keeps reads as an added leaf. A registry `driftNote` naming `(files.intent)` acknowledges a copy verified against the change the advisory cites, per `AUDIT.md` section 7, until that canonical changes again. - **verbatim** - byte-identical to the hub's canonical after line-ending, action-pin, and job-needs normalization. The audit content-hashes the downstream copy against canonical. It applies to a whole file, a workflow job region, or a Markdown section region. A job region is a job selected by key, and a section region is a `## heading` block selected by name. The section granularity lets one file be **intent overall while a few of its sections are verbatim**. A universal rule block stays byte-identical fleet-wide even though the rest of the document is a repo-adapted paraphrase. So a stale section or a missing rule is caught while its heading still passes the presence check. - **interface** - an overridable body that must honor a named contract. The audit checks the contract by name and wiring, never the body. @@ -41,7 +41,7 @@ The unit decides, never the file. `GOVERNANCE.md` is `intent` as a file while 18 - **verbatim** - detected. The content hash is compared against the canonical and every past revision, and "Stale Versus Modified" below reads the result. An edit matching no revision reports as modified fixed content, and one restoring an earlier revision reports as stale. That is because the hash cannot say how the bytes got there. - **verbatim-tree** - detected, by git blob identity rather than by that content hash. A tree entry is compared against the canonical blob and, on a mismatch, against that path's blob history, which gives the same stale-or-modified split. It also fails structurally, on a missing included path or an extra one under a pruned root. - **interface** - detected only where the edit moves the contract. A changed job key, check name, or hub task token is a finding. An edit to the owned body is the override this tier exists for. -- **intent** - not detected. Content is never judged beyond the version-literal scan below, and the staleness advisory never identifies a local edit. It compares last-change dates, so the edit first suppresses the advisory by making the copy newer. After the hub's next substantive change to its canonical, the advisory fires and reports the copy as trailing. For an anchored `intentRef`, that change is one to the section it names. Here substantive means a change the line-ending, action-pin, and job-needs normalization does not explain away. That report routes to a re-vendor that overwrites the edit rather than to the edit itself. A `repoOwnedKeys` unit whose copy is plain JSON is the exception. An edit to one of its fleet-owned leaves is reported at once, naming the leaf, whatever the dates read. An edit to an owned key alone never fires the advisory, and its re-vendor carries only the keys the repository does not own. +- **intent** - not detected. Content is never judged beyond the version-literal scan below, and the staleness advisory never identifies a local edit. It compares last-change dates, so the edit first suppresses the advisory by making the copy newer. After the hub's next substantive change to its canonical, the advisory fires and reports the copy as trailing. For an anchored `intentRef`, that change is one to the section it names. Here substantive means a change the line-ending, action-pin, and job-needs normalization does not explain away. That report routes to a re-vendor that overwrites the edit rather than to the edit itself. A `repoOwnedKeys` unit whose copy is plain JSON is the exception. An edit to one of its fleet-owned leaves is reported at once, naming the leaf, whatever the dates read. So is a leaf added inside an object the reference holds. An edit to an owned key alone fires the advisory only where it drops an entry of an owned array the reference holds. A re-vendor carries the keys the repository does not own, and each owned array's missing entries. It drops a leaf added inside an object the reference holds. - **presence** - a content edit is not detected. The unit is asserted to exist and is never read, so deleting it is still a finding and editing it is not. So a local rule edit to `CODESTYLE.md` or `WORKFLOW.md`, both `intent` and whole, is reported nowhere. That silence is intended for a repo's own additions, which `CODESTYLE.md` is a declared destination for. The same silence is the hazard for a patch of carried rule text, since the two read alike to every check. Three checks reach some non-verbatim prose, and only the third reaches those two files. [`section-model.md`][section-model]'s undeclared-section advisory names a heading the hub does not declare, and it runs only against `AGENTS.md`, `GOVERNANCE.md` and `.github/copilot-instructions.md`. It reads headings rather than rule text, so a rule rewritten under a declared heading stays invisible. [`audit.py`][audit]'s `template_ref_outside_verbatim` reads the prose itself, and it catches only a coordination reference rather than a changed rule. Its `version_literals_outside_verbatim` reads the prose of all four instruction documents. It catches only a version literal or a commit SHA, full or abbreviated, never a changed rule. diff --git a/spec/files.json b/spec/files.json index 6a49c07c5..93eecf6c6 100644 --- a/spec/files.json +++ b/spec/files.json @@ -18,9 +18,9 @@ { "path": "HISTORY.md", "appliesTo": "*" }, { "path": "OPERATIONS.md", "appliesTo": "*" }, { "path": ".github/copilot-instructions.md", "fidelity": "intent", "whole": true, "sections": ["Commit Messages and Pull Request Titles", "Reviewing Carried Fleet Content", "GitHub Copilot Review Runbook", "When in Doubt"], "appliesTo": "*" }, - { "path": ".editorconfig", "fidelity": "intent", "whole": true, "intentRef": ".agents/skills/comment-and-doc-style/references/line-endings.md", "appliesTo": "*" }, - { "path": ".editorconfig-checker.json", "fidelity": "intent", "whole": true, "intentRef": ".agents/skills/comment-and-doc-style/references/line-endings.md", "appliesTo": "*" }, - { "path": ".gitattributes", "fidelity": "intent", "whole": true, "intentRef": ".agents/skills/comment-and-doc-style/references/line-endings.md", "appliesTo": "*" }, + { "path": ".editorconfig", "fidelity": "intent", "whole": true, "reference": ".editorconfig", "intentRef": ".agents/skills/comment-and-doc-style/references/line-endings.md", "appliesTo": "*" }, + { "path": ".editorconfig-checker.json", "fidelity": "intent", "whole": true, "reference": ".editorconfig-checker.json", "repoOwnedKeys": ["Exclude"], "intentRef": ".agents/skills/comment-and-doc-style/references/line-endings.md", "appliesTo": "*" }, + { "path": ".gitattributes", "fidelity": "intent", "whole": true, "reference": ".gitattributes", "intentRef": ".agents/skills/comment-and-doc-style/references/line-endings.md", "appliesTo": "*" }, { "path": ".markdownlint-cli2.jsonc", "fidelity": "verbatim", "whole": true, "appliesTo": "*" }, { "path": "cspell.json", "fidelity": "intent", "whole": true, "appliesTo": "*" }, { "path": ".gitignore", "appliesTo": "*" }, diff --git a/spec/validate.py b/spec/validate.py index f8e1c6e2e..8558b7276 100755 --- a/spec/validate.py +++ b/spec/validate.py @@ -1371,6 +1371,48 @@ def json_leaves(value, prefix=""): yield from json_leaves(child, f"{prefix}.{key}" if prefix else key) +def fleet_owned_differences(item, canon_text, down_text): + """The leaves where a unit's copy differs from its JSON canonical, or None where the two cannot be compared. + + That is a leaf outside `repoOwnedKeys` held differently or lacked, an owned array lacking an entry, + or a leaf added inside a canonical object. + That last can switch a fleet check off. + A top-level key the copy adds, and a value at an owned key, are the repository's own. + A leaf the canonical drops from an object it keeps reads as an added leaf. + """ + owned = item.get("repoOwnedKeys") + if not owned or canon_text is None: + return None + try: + canon = dict(json_leaves(json.loads(canon_text))) + held = dict(json_leaves(json.loads(down_text.lstrip("\ufeff")))) + except ValueError: + return None + + def key(value): + return json.dumps(value, sort_keys=True) + + def above(k): + parts = k.split(".") + return {".".join(parts[:i]) for i in range(1, len(parts))} + + differences = [] + for k, v in canon.items(): + mine = held.get(k) + if k in owned: + have = {key(e) for e in mine} if isinstance(mine, list) else set() + trails = isinstance(v, list) and any(key(e) not in have for e in v) + else: + trails = k not in held or key(mine) != key(v) + if trails: + differences.append(k) + objects = set().union(*map(above, canon)) + differences.extend( + k for k in held if k not in canon and above(k) & objects and not above(k) & canon.keys() + ) + return differences + + def repo_owned_errors(path, fid, ref, owned): """What is wrong with a files.json unit's repoOwnedKeys, which only a JSON intent reference can carry.""" if not (is_str_list(owned) and owned and all(owned)): diff --git a/tests/test_audit_helpers.py b/tests/test_audit_helpers.py index e0e169b98..0f30efa6a 100755 --- a/tests/test_audit_helpers.py +++ b/tests/test_audit_helpers.py @@ -743,11 +743,11 @@ def test_a_gate_without_a_pull_request_trigger_gets_the_trigger_finding(self) -> self.assertIn(want, message) -def carried_contract(path: str) -> dict[str, Any]: - """The contract spec/files.json gives the carried interface unit at `path`.""" +def manifest_unit(path: str) -> dict[str, Any]: + """The unit spec/files.json declares at `path`.""" spec = json.loads((REPO_ROOT / "spec/files.json").read_text(encoding="utf-8")) return next( - unit["contract"] + unit for units in spec.values() if isinstance(units, list) for unit in units @@ -755,6 +755,11 @@ def carried_contract(path: str) -> dict[str, Any]: ) +def carried_contract(path: str) -> dict[str, Any]: + """The contract spec/files.json gives the carried interface unit at `path`.""" + return manifest_unit(path)["contract"] + + class ShippedPullRequestStubCase(unittest.TestCase): """Every pull request stub the hub ships passes the contract spec/files.json gives a carried one.""" @@ -3475,9 +3480,9 @@ def test_a_repo_owned_key_never_reads_as_trailing(self) -> None: ), ("a fleet value dropped", '{"sdk": {"version": "11.0.100"}}', rolled), ( - "a leaf of its own inside a block", + "a leaf added inside a canonical block", '{"sdk": {"version": "11.0.100", "rollForward": "latestFeature", "paths": ["x"]}}', - None, + ("snip/global.json", dates, ["sdk.paths"]), ), ( "a byte-order mark", @@ -3506,6 +3511,56 @@ def test_a_json_number_never_matches_a_json_boolean(self) -> None: with self.subTest(down=down): self.assertEqual(audit.fleet_owned_differences(unit, canon, down), want) + def test_an_owned_array_may_grow_but_not_shrink(self) -> None: + unit = {"repoOwnedKeys": ["skip"]} + canon = '{"skip": ["a", true], "on": 1}' + cases = [ + ('{"skip": [true, "z", "a"], "on": 1}', []), + ('{"skip": ["a"], "on": 1}', ["skip"]), + ('{"skip": ["a", 1], "on": 1}', ["skip"]), + ('{"skip": "a", "on": 1}', ["skip"]), + ('{"on": 1}', ["skip"]), + ] + for down, want in cases: + with self.subTest(down=down): + self.assertEqual(audit.fleet_owned_differences(unit, canon, down), want) + + def test_an_added_leaf_is_reported_only_inside_a_canonical_object(self) -> None: + unit = {"repoOwnedKeys": ["sdk.version", "skip"]} + canon = '{"sdk": {"version": "10.0.100"}, "Disable": {"Charset": false}, "skip": ["a"]}' + base = '"sdk": {"version": "11.0.100"}, "Disable": {"Charset": false}, "skip": ["a"]' + cases = [ + ( + "an added Disable leaf", + '{"sdk": {"version": "11.0.100"}, "Disable": {"Charset": false, "EndOfLine": true}, "skip": ["a"]}', + ["Disable.EndOfLine"], + ), + ("an added top-level key", "{" + base + ', "test": {"runner": "x"}}', []), + ( + "an added leaf under an owned key", + '{"sdk": {"version": {"min": 1}}, "Disable": {"Charset": false}, "skip": ["a"]}', + [], + ), + ( + "a nested object added inside a canonical object", + '{"sdk": {"version": "1"}, "Disable": {"Charset": false, "X": {"EndOfLine": true}}, "skip": ["a"]}', + ["Disable.X.EndOfLine"], + ), + ( + "a canonical leaf turned into an object", + '{"sdk": {"version": "1"}, "Disable": {"Charset": {"x": 1}}, "skip": ["a"]}', + ["Disable.Charset"], + ), + ( + "a leaf dropped from an object the canonical keeps", + '{"sdk": {"version": "1"}, "Disable": {"Charset": false, "Old": 1}, "skip": ["a"]}', + ["Disable.Old"], + ), + ] + for label, down, want in cases: + with self.subTest(label): + self.assertEqual(audit.fleet_owned_differences(unit, canon, down), want) + def test_a_repo_owned_verdict_outranks_the_dates(self) -> None: unit = { "path": "global.json", @@ -3549,6 +3604,32 @@ def test_a_unit_without_repo_owned_keys_compares_whole(self) -> None: ) self.assertIsNotNone(got) + def test_the_line_ending_configs_date_by_the_hub_copy_at_their_path(self) -> None: + for path in (".editorconfig", ".editorconfig-checker.json", ".gitattributes"): + with self.subTest(path=path): + self.assertEqual(audit.intent_ref(manifest_unit(path), path), (path, None)) + + def test_the_checker_config_is_judged_by_its_disable_block(self) -> None: + unit = manifest_unit(".editorconfig-checker.json") + canon = (REPO_ROOT / ".editorconfig-checker.json").read_text(encoding="utf-8") + local = json.loads(canon) + local["Exclude"] = [*local["Exclude"], "^\\.artifacts/"] + dropped = json.loads(canon) + dropped["Exclude"] = dropped["Exclude"][1:] + flipped = json.loads(canon) + flipped["Disable"]["Charset"] = False + added = json.loads(canon) + added["Disable"]["EndOfLine"] = True + cases = [ + ("a local Exclude entry", json.dumps(local), []), + ("an added Disable rule", json.dumps(added), ["Disable.EndOfLine"]), + ("a dropped baseline Exclude entry", json.dumps(dropped), ["Exclude"]), + ("a flipped Disable rule", json.dumps(flipped), ["Disable.Charset"]), + ] + for label, down, want in cases: + with self.subTest(label): + self.assertEqual(audit.fleet_owned_differences(unit, canon, down), want) + def test_the_trail_dates_by_the_intent_ref_anchor(self) -> None: asked: list[tuple[str, str | None]] = []