From 839a0dde56d3baff2ee958c35e612be2604c348b Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Mon, 9 Nov 2026 20:43:51 -0800 Subject: [PATCH 1/3] Claim Registry Required Secrets in Both Stores A registry requiredSecrets name is now owed in the Dependabot store as well as the Actions store, as a baseline name is, since a workflow run a Dependabot pull request triggers reads the Dependabot store alone. Every registry entry declaring requiredSecrets today already owes each name in both stores through a mechanism, so no other repository gains a finding. Declare EspDinIoT's KICADLIBRARY_READ_TOKEN (repository scope) and CODECOV_TOKEN, and set its target to a two-phase github-release source release, which clears its four secrets DRIFT findings. Fixes #3936 Co-Authored-By: Claude Opus 5.5 --- AUDIT.md | 2 +- registry/repos.json | 10 +++++----- registry/repos.schema.json | 2 +- repo-config/README.md | 2 +- spec/secret_names.py | 4 ++-- spec/secrets.json | 7 ++++--- spec/validate.py | 4 ++-- tests/test_resolve_secrets.py | 4 ++-- 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/AUDIT.md b/AUDIT.md index e8a6992fb..07572fdb1 100644 --- a/AUDIT.md +++ b/AUDIT.md @@ -102,7 +102,7 @@ Run [`WORKFLOW.md`][workflow]'s methodology against the repo's **own** Actions, - **General settings, the registry description, labels, rulesets, the Dependabot security features, the fleet project link, and deployment environments**. Fetch the hub and check out `main`. Run `repo-config/configure.sh check "/" ""` from that checkout. Pass the target repository and its registry `workflowModel` explicitly. The token needs project access as well as the admin the ruleset endpoints require. That is because a token without it cannot read the project link, and the command reports that group as failing rather than as clean. The command's own error names the scope to grant. The host needs a runnable `py -3` or `python3` too. That is because a run against a hub checkout resolves the registry description through [`spec/resolve_description.py`][resolve-description] and exits before the first check when neither interpreter answers. The command checks what `configure.sh apply` writes. That covers the declared settings, the derived settings and the registry description, the declared labels, and the Dependabot security features. It also covers the shared `main` ruleset, the `develop` ruleset the model selects, and the link to the fleet project the hub declares. It reports the live `bypass_actors` list without asserting it, because bypass authority is a per-repository human decision. It also checks one group apply never writes, the deployment environments the registry's `environments` declares for the repo. It checks that each one exists and that its deployment-branch policy is the form declared. It also checks that under a `custom` policy the entries it allows are exactly the declared branches. So anything added by hand reads as drift. An environment the registry declares nothing about is reported rather than asserted, since GitHub creates some on its own. Neither this command nor the **Secrets** bullet below queries an environment's own secret and variable stores. So a clean run says nothing about whether an environment holds what a deploy needs. In those stores the API exposes a secret's name but not its value, and a variable's name and value both. -- **Secrets** - from the same hub checkout, run [`spec/audit.py`][audit-runner] as `uv run --no-project --script spec/audit.py ""` and read the findings it prints with a `secrets:` prefix. That argument is the registry entry name rather than the `/` form `configure.sh` takes, and an `/` argument prints `Not cataloged` and exits 2. The runner reads both the Actions and the Dependabot store on every repo. A token that cannot read either one fails that repo's whole run with an error rather than reporting names as missing. It resolves what each store must hold from the hub's own [`spec/secrets.json`][secrets] plus the registry entry's `publish[]`/`types[]`/`requiredSecrets[]`. That file's `baseline` requires its names in both stores for every fleet repo. A mechanism adds to a store only where the mechanism's own `stores` list names that store. A declared type claims nothing where the entry's profile for it reads `lint-only`. It claims no coverage token where the tree carries no tests for it. So a repo declaring a language can still owe nothing beyond the baseline. It reports three things. They are a required name missing from a store and a forbidden name present in either store. The third is a configured name outside its store's required set, which the baseline and the applicable mechanisms make up. The entry's `requiredSecrets` adds to the Actions store alone. A claim is per store, so a name only the Actions store owes is reported when the Dependabot store holds it. A forbidden name present draws the third as well as the second, since each store's claimed set is built from its required names alone. Names are read, never values. A shallow hub clone fails the whole run, so no `secrets:` line prints, per section 8. +- **Secrets** - from the same hub checkout, run [`spec/audit.py`][audit-runner] as `uv run --no-project --script spec/audit.py ""` and read the findings it prints with a `secrets:` prefix. That argument is the registry entry name rather than the `/` form `configure.sh` takes, and an `/` argument prints `Not cataloged` and exits 2. The runner reads both the Actions and the Dependabot store on every repo. A token that cannot read either one fails that repo's whole run with an error rather than reporting names as missing. It resolves what each store must hold from the hub's own [`spec/secrets.json`][secrets] plus the registry entry's `publish[]`/`types[]`/`requiredSecrets[]`. That file's `baseline` requires its names in both stores for every fleet repo. A mechanism adds to a store only where the mechanism's own `stores` list names that store. A declared type claims nothing where the entry's profile for it reads `lint-only`. It claims no coverage token where the tree carries no tests for it. So a repo declaring a language can still owe nothing beyond the baseline. It reports three things. They are a required name missing from a store and a forbidden name present in either store. The third is a configured name outside its store's required set, which the baseline and the applicable mechanisms make up. The entry's `requiredSecrets` adds to both stores, as the baseline does, since a workflow run a Dependabot pull request triggers reads the Dependabot store alone. A claim is per store, so a name only one store owes is reported when the other store holds it. A forbidden name present draws the third as well as the second, since each store's claimed set is built from its required names alone. Names are read, never values. A shallow hub clone fails the whole run, so no `secrets:` line prints, per section 8. - **Dependabot ecosystem coverage** - for each ecosystem the repo's tree implies, `.github/dependabot.yml` must declare it. That means `github-actions` when `.github/workflows/` holds at least one `.yml` or `.yaml` entry. Those workflows reference actions, and otherwise those versions go stale and a stood-up merge-bot has no action-update PRs to auto-merge. `devcontainers` must likewise be declared when a `.devcontainer` is present. The mechanical check (`spec/audit.py`) asserts each implied ecosystem's **presence**, and it runs at all only where `.github/dependabot.yml` exists and is non-empty. A missing `dependabot.yml` is a file-presence letter of its own. An empty one is caught by neither check, since the file-presence check reports only absence. So an empty file is reported by hand. A tree-implied ecosystem that file declares nowhere is a **drift finding**. Then confirm **by inspection** that each declared ecosystem **dual-targets `main` + `develop`** per the [Branching Model][governance-branching-model]. That is because the regex below cannot pair an ecosystem with its `target-branch`. Language ecosystems (`nuget`/`uv`/`npm`) are directory-scoped and audited by inspection too. diff --git a/registry/repos.json b/registry/repos.json index 7f597c912..67723ddb0 100644 --- a/registry/repos.json +++ b/registry/repos.json @@ -220,11 +220,11 @@ "types": ["eda"], "hasDevelop": true, "pullRequestCheck": false, - "publish": [], - "requiredSecrets": [], + "publish": [{ "target": "github-release", "mechanism": "none" }], + "requiredSecrets": ["CODECOV_TOKEN", "KICADLIBRARY_READ_TOKEN"], "consumerModel": "pull", - "releaseTrigger": "none", - "driftNotes": ["EDA/KiCad PCB design. Its main is a stub - the real design lives on develop and feature/schematic, populate main.", "No CI on any branch, and develop has partial governance adoption (AGENTS.md/.editorconfig) but no workflows."] + "releaseTrigger": "two-phase", + "driftNotes": ["EDA/KiCad PCB design that checks out the private ptr727/KiCadLibrary submodule in CI with KICADLIBRARY_READ_TOKEN, so a Dependabot-triggered run needs the Dependabot copy too.", "Target is a source release on github-release, like KiCadLibrary. Its resync owes the release workflows and a dependabot.yml, and the python type once its scripts and their tests land, which is why CODECOV_TOKEN is declared ahead of them."] }, { "name": "ESPHome-Config", @@ -361,7 +361,7 @@ "consumerModel": "pull", "releaseTrigger": "dispatch-only", "pythonDirectories": ["checks", "scripts"], - "driftNotes": ["Hugo static site migrated off WordPress.com, stood up 2026-08-01. Release model with a dispatch-only publisher that cuts the tag and a source archive.", "content/ is an imported WordPress archive, so the prose, spelling, and style gates are scoped to exclude it.", "Deploy credentials are per-environment GitHub Environment secrets and variables, which the audit does not check, so requiredSecrets leaves them out. Listing them in requiredSecrets would make the audit demand them in the repository actions store.", "Neither deployment environment carries a branch policy, deliberately: the ref gate that admits production from the default branch only runs as a job in the deploy workflow, before anything is installed or written (WORKFLOW.md D2.1). branchPolicy none records that, so a policy appearing later reads as a change rather than as the gate arriving.", "capture/ is one-shot WordPress migration tooling that has already run, so the maintainer kept it out of pythonDirectories (Blog #356, 2026-10-01), forgoing the lint, format, type-check, test, and coverage obligations every Python directory owes. The audit's python-directories drift naming capture/ files is therefore expected."] + "driftNotes": ["Hugo static site migrated off WordPress.com, stood up 2026-08-01. Release model with a dispatch-only publisher that cuts the tag and a source archive.", "content/ is an imported WordPress archive, so the prose, spelling, and style gates are scoped to exclude it.", "Deploy credentials are per-environment GitHub Environment secrets and variables, which the audit does not check, so requiredSecrets leaves them out. Listing them in requiredSecrets would make the audit demand them in the repository secrets stores.", "Neither deployment environment carries a branch policy, deliberately: the ref gate that admits production from the default branch only runs as a job in the deploy workflow, before anything is installed or written (WORKFLOW.md D2.1). branchPolicy none records that, so a policy appearing later reads as a change rather than as the gate arriving.", "capture/ is one-shot WordPress migration tooling that has already run, so the maintainer kept it out of pythonDirectories (Blog #356, 2026-10-01), forgoing the lint, format, type-check, test, and coverage obligations every Python directory owes. The audit's python-directories drift naming capture/ files is therefore expected."] }, { "name": "DiskSpeedTest", diff --git a/registry/repos.schema.json b/registry/repos.schema.json index 75dcf9311..d6dfeabcc 100644 --- a/registry/repos.schema.json +++ b/registry/repos.schema.json @@ -138,7 +138,7 @@ "items": { "type": "string", "pattern": "^(?!GITHUB_)[A-Z_][A-Z0-9_]*(?![\\s\\S])", - "$comment": "The exact string spec/validate.py declares as SECRET_NAME_PATTERN, which tests/test_spec_validate.py asserts. A name here is resolved against the repository actions store by an exact comparison, so a padded element reports as missing on every run while the name it was meant to be goes unrequired. The shape a name must have to resolve against the actions store spec/audit.py compares it to by exact set difference, and it is portable between Python re and ECMA-262 for the reason the grammars above give. Upper case because a stored name is upper case, so a lower-case declaration matches none and reports missing from the store on every run, and where no mechanism maps the name the stored one it meant is reported as claimed by nothing too. The reserved GITHUB_ prefix because GitHub refuses to store such a name at all, so a repo declaring one collects a finding nothing it can do retires." + "$comment": "The exact string spec/validate.py declares as SECRET_NAME_PATTERN, which tests/test_spec_validate.py asserts. A name here is resolved against each repository secrets store by an exact comparison, so a padded element reports as missing on every run while the name it was meant to be goes unrequired. The shape a name must have to resolve against the stores spec/audit.py compares it to by exact set difference, and it is portable between Python re and ECMA-262 for the reason the grammars above give. Upper case because a stored name is upper case, so a lower-case declaration matches none and reports missing from the store on every run, and where no mechanism maps the name the stored one it meant is reported as claimed by nothing too. The reserved GITHUB_ prefix because GitHub refuses to store such a name at all, so a repo declaring one collects a finding nothing it can do retires." } }, "environments": { diff --git a/repo-config/README.md b/repo-config/README.md index 2d0f60ff4..1f93f2b8a 100644 --- a/repo-config/README.md +++ b/repo-config/README.md @@ -53,7 +53,7 @@ Every name whose file is readable is written on every run to each store that nee `apply --dry-run` runs the whole pre-flight and prints, per store, each name with its scope and file, then the missing and refused lists. It writes nothing and prints no value. Only the secrets group has a dry run, so the other groups are not previewed. -`python3 spec/resolve_secrets.py scaffold` pre-creates every expected file so only the values need filling. It walks every cataloged registry entry and reads the tree of each repository's ground branch through read-only `gh` calls. A registry `requiredSecrets` name is owed in the Actions store regardless. The tree decides only whether a repository with tests also owes `CODECOV_TOKEN` in the Dependabot store. It creates a missing directory as mode `700` and each missing file as an empty mode `600` file. It leaves the mode of an existing directory alone. It never opens, changes, or deletes an existing file. It lists what it created, what was already present, and any file nothing claims. A wrong-scope file found anywhere in the directory stops it before it creates anything. A repository with no ground branch yet is listed under its own heading. The other repositories are still scaffolded, and the run exits non-zero. The `--secrets-dir DIR` option chooses another directory, and `--dry-run` creates nothing. +`python3 spec/resolve_secrets.py scaffold` pre-creates every expected file so only the values need filling. It walks every cataloged registry entry and reads the tree of each repository's ground branch through read-only `gh` calls. A registry `requiredSecrets` name is owed in both stores regardless. The tree decides only whether a repository with tests also owes `CODECOV_TOKEN` through the codecov mechanism. It creates a missing directory as mode `700` and each missing file as an empty mode `600` file. It leaves the mode of an existing directory alone. It never opens, changes, or deletes an existing file. It lists what it created, what was already present, and any file nothing claims. A wrong-scope file found anywhere in the directory stops it before it creates anything. A repository with no ground branch yet is listed under its own heading. The other repositories are still scaffolded, and the run exits non-zero. The `--secrets-dir DIR` option chooses another directory, and `--dry-run` creates nothing. `check` lists both secret stores of the repository. It fails on a required name that is absent and on a forbidden name that is present. It reports an unclaimed name without failing, and it notes that values are never readable through the API. diff --git a/spec/secret_names.py b/spec/secret_names.py index af32e1c7a..1d2ff72db 100644 --- a/spec/secret_names.py +++ b/spec/secret_names.py @@ -151,8 +151,8 @@ def resolve_secret_stores( for mech in claimed: for store in mech.get("stores", []): required[store] |= set(mech.get("requires", [])) - # The registry requiredSecrets are the domain-specific additions, per STANDUP.md, expected in the actions store. - required["actions"] |= set(entry.get("requiredSecrets", [])) + for store in STORES: + required[store] |= set(entry.get("requiredSecrets", [])) forbidden = set(secrets["baseline"].get("forbids", [])) for mech in claimed: forbidden |= set(mech.get("forbids", [])) diff --git a/spec/secrets.json b/spec/secrets.json index 09a19d69b..f8654ee6d 100644 --- a/spec/secrets.json +++ b/spec/secrets.json @@ -1,6 +1,6 @@ { "$schema": "./secrets.schema.json", - "note": "Secrets the audit cross-checks. `baseline` applies to every fleet repo (the App-signed merge-bot runs everywhere). `mechanisms` are per-target/per-feature additions: a repo requires the baseline plus the mechanisms its declared publish target (`targetMechanisms`) or declared type (`typeMechanisms`) maps to. All three mappings resolve from the registry entry rather than from workflow content: nothing reads a repo's Actions files to infer a mechanism, and `workflowNeeds` records what a mechanism needs to appear in a workflow for a human or agent reading the audit, rather than being a detector. `featureMechanisms` is shape-validated but claims nothing today, since the one feature it names (codecov) is claimed through `typeMechanisms` wherever the repo carries tests for that type instead. Baseline secrets are implicit and are NOT repeated in a repo's registry `requiredSecrets`, which lists only the domain-specific additions. `typeMechanisms` are per-language requirements: a `csharp` or `python` repo carrying tests for that language must carry the mapped mechanism (codecov) regardless of opt-in, a lint-only language other than Python excepted. A configured secret outside the required set of the store holding it is a stale-secret finding, and a present `forbids` secret is a defect. The schema still allows an `environments` block, whose `environmentSecrets` map would name what one environment carries and another does not, but the block has no per-repo dimension and downstream copies of this file are retired, so no repository has a place here to declare its environment names, and this file carries none. No tool would read one either: neither `spec/validate.py` nor `spec/audit.py` queries an environment-scoped store, so a clean audit is not evidence that an environment is configured. `secretScopes` gives every secret name that a baseline, a mechanism, or a registry `requiredSecrets` list requires one scope. A `fleet` secret has a single value, which repo-config/configure.sh reads from the host file `~/.secrets/github_`. A `repository` secret has a value of its own per repo, read from `~/.secrets/github__`. Both file names are lower case. Only the file a name's scope names is ever read, and the same name at the other scope is a stray that stops the run. A new required name with no scope is a spec/validate.py error, so it is classified explicitly and never by a silent default.", + "note": "Secrets the audit cross-checks. `baseline` applies to every fleet repo (the App-signed merge-bot runs everywhere). `mechanisms` are per-target/per-feature additions: a repo requires the baseline plus the mechanisms its declared publish target (`targetMechanisms`) or declared type (`typeMechanisms`) maps to. All three mappings resolve from the registry entry rather than from workflow content: nothing reads a repo's Actions files to infer a mechanism, and `workflowNeeds` records what a mechanism needs to appear in a workflow for a human or agent reading the audit, rather than being a detector. `featureMechanisms` is shape-validated but claims nothing today, since the one feature it names (codecov) is claimed through `typeMechanisms` wherever the repo carries tests for that type instead. Baseline secrets are implicit and are NOT repeated in a repo's registry `requiredSecrets`, which lists only the domain-specific additions. A `requiredSecrets` name is owed in both stores, as a baseline name is, since a workflow run a Dependabot pull request triggers reads the Dependabot store alone. `typeMechanisms` are per-language requirements: a `csharp` or `python` repo carrying tests for that language must carry the mapped mechanism (codecov) regardless of opt-in, a lint-only language other than Python excepted. A configured secret outside the required set of the store holding it is a stale-secret finding, and a present `forbids` secret is a defect. The schema still allows an `environments` block, whose `environmentSecrets` map would name what one environment carries and another does not, but the block has no per-repo dimension and downstream copies of this file are retired, so no repository has a place here to declare its environment names, and this file carries none. No tool would read one either: neither `spec/validate.py` nor `spec/audit.py` queries an environment-scoped store, so a clean audit is not evidence that an environment is configured. `secretScopes` gives every secret name that a baseline, a mechanism, or a registry `requiredSecrets` list requires one scope. A `fleet` secret has a single value, which repo-config/configure.sh reads from the host file `~/.secrets/github_`. A `repository` secret has a value of its own per repo, read from `~/.secrets/github__`. Both file names are lower case. Only the file a name's scope names is ever read, and the same name at the other scope is a stray that stops the run. A new required name with no scope is a spec/validate.py error, so it is classified explicitly and never by a silent default.", "baseline": { "requires": ["CODEGEN_APP_CLIENT_ID", "CODEGEN_APP_PRIVATE_KEY"], "forbids": ["CODEGEN_APP_ID"], @@ -44,7 +44,7 @@ "forbids": [], "workflowNeeds": ["environment:", "IdentitiesOnly=yes"], "stores": [], - "note": "A deploy to a filesystem on a host the project owns, reached over SSH. requires and stores are empty deliberately rather than for want of credentials: the key and the host values are per-environment GitHub Environment secrets and variables, which neither validate.py nor audit.py queries. Listing the names would force them into the repo's registry requiredSecrets, which the audit resolves against the repository actions store, so a correctly configured repo would report every one of them as missing. The key is confined at the far end by an authorized_keys forced command rooted at the deploy tree, so the workflow names no host path." + "note": "A deploy to a filesystem on a host the project owns, reached over SSH. requires and stores are empty deliberately rather than for want of credentials: the key and the host values are per-environment GitHub Environment secrets and variables, which neither validate.py nor audit.py queries. Listing the names would force them into the repo's registry requiredSecrets, which the audit resolves against the repository secrets stores, so a correctly configured repo would report every one of them as missing. The key is confined at the far end by an authorized_keys forced command rooted at the deploy tree, so the workflow names no host path." } }, "targetMechanisms": { @@ -67,6 +67,7 @@ "NUGET_USERNAME": "fleet", "DOCKER_HUB_USERNAME": "fleet", "DOCKER_HUB_ACCESS_TOKEN": "fleet", - "CODECOV_TOKEN": "repository" + "CODECOV_TOKEN": "repository", + "KICADLIBRARY_READ_TOKEN": "repository" } } diff --git a/spec/validate.py b/spec/validate.py index b37ff3e87..3559bb8e1 100755 --- a/spec/validate.py +++ b/spec/validate.py @@ -88,9 +88,9 @@ GROUND_TRUTH_BRANCH_SHAPE = ( "ASCII letters, digits, and . _ - /, with neither end a . or a /, and no .." ) -# A `requiredSecrets` name is resolved against the repository actions store by an exact comparison. +# A `requiredSecrets` name is resolved against each repository secrets store by an exact comparison. # It is therefore the same class of value as the three above and takes the same treatment. -# This is the shape a name must have to be resolvable against the actions store spec/audit.py compares it to. +# This is the shape a name must have to be resolvable against the stores spec/audit.py compares it to. # It is not a shape fitted to the four names the registry declares today. # That comparison is an exact set difference against the names GitHub's API returns. # A declaration that is not character-for-character one of them is therefore unresolvable rather than merely untidy. diff --git a/tests/test_resolve_secrets.py b/tests/test_resolve_secrets.py index ae8fc46be..706a5d0e7 100755 --- a/tests/test_resolve_secrets.py +++ b/tests/test_resolve_secrets.py @@ -112,10 +112,10 @@ def test_codecov_is_owed_with_a_test_tree_and_not_without_one(self) -> None: def test_an_unread_tree_keeps_the_codecov_claim(self) -> None: self.assertIn("CODECOV_TOKEN", self.stores(entry(), None)["actions"]) - def test_required_secrets_are_added_to_the_actions_store_only(self) -> None: + def test_required_secrets_are_added_to_both_stores(self) -> None: required = self.stores(entry(types=["docs"], requiredSecrets=["NUGET_USERNAME"]), None) self.assertIn("NUGET_USERNAME", required["actions"]) - self.assertNotIn("NUGET_USERNAME", required["dependabot"]) + self.assertIn("NUGET_USERNAME", required["dependabot"]) def test_the_forbidden_names_follow_the_claimed_mechanisms(self) -> None: _, forbidden = secret_names.resolve_secret_stores( From 80e27159a3f41bbdec428c06d36c02a9925763eb Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Mon, 9 Nov 2026 20:50:03 -0800 Subject: [PATCH 2/3] Record Only What EspDinIoT Has, and Restate the Both-Store Rule Keep EspDinIoT's entry to reality, per STANDUP.md section 2: declare KICADLIBRARY_READ_TOKEN alone, and name the planned source release, the python type, and the CODECOV_TOKEN kept for its tests in a driftNote for its resync to write when each lands. Restate the both-store rule where STANDUP.md and the resolve_secrets.py docstring still described the old placement, add the new name to the repo-config scope table, and drop a registry name count that went stale. Co-Authored-By: Claude Opus 5.5 --- STANDUP.md | 2 +- registry/repos.json | 8 ++++---- repo-config/README.md | 1 + spec/resolve_secrets.py | 2 +- spec/validate.py | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/STANDUP.md b/STANDUP.md index e514d198e..1f6b503af 100644 --- a/STANDUP.md +++ b/STANDUP.md @@ -211,7 +211,7 @@ Three conditions fail here, and the two commands together are what separate them Each is step 0A's escalation rather than something to work around. -Run `repo-config/configure.sh apply owner/repo release|operational` from a hub checkout at `main`, naming the repo being stood up and its model. It applies the fleet settings, Dependabot security features, label set, two rulesets, and the link to the fleet project idempotently. Import the JSON, never hand-build it, per [`docs/repo-config.md`][repo-config-doc]. Then run `repo-config/configure.sh check owner/repo release|operational` from the same checkout. Pass the model explicitly because the repository is outside the registry during this step. Both commands need project access on the token, and a token without it fails at this step rather than at any check before it. Configure every required secret per [`spec/secrets.json`][secrets] (the registry `requiredSecrets[]` list plus the implicit baseline) in the right store(s). That means Actions plus Dependabot where the mechanism needs it. Also confirm no forbidden secret is present. The required check binds by name (`Check pull request workflow status job`) and turns green only after the PR workflow has run once. That is why this step follows step 3 rather than preceding it. A ruleset requiring a name no run has ever reported leaves the first pull request waiting on a status nothing produces. On an operational repo the `develop -> main` promotion is a pull request too, so the same wait applies there. +Run `repo-config/configure.sh apply owner/repo release|operational` from a hub checkout at `main`, naming the repo being stood up and its model. It applies the fleet settings, Dependabot security features, label set, two rulesets, and the link to the fleet project idempotently. Import the JSON, never hand-build it, per [`docs/repo-config.md`][repo-config-doc]. Then run `repo-config/configure.sh check owner/repo release|operational` from the same checkout. Pass the model explicitly because the repository is outside the registry during this step. Both commands need project access on the token, and a token without it fails at this step rather than at any check before it. Configure every required secret per [`spec/secrets.json`][secrets] (the registry `requiredSecrets[]` list plus the implicit baseline) in the right store(s). A baseline name and every `requiredSecrets[]` name go in both the Actions and the Dependabot store. A mechanism's names go in the stores its own `stores` list names. Also confirm no forbidden secret is present. The required check binds by name (`Check pull request workflow status job`) and turns green only after the PR workflow has run once. That is why this step follows step 3 rather than preceding it. A ruleset requiring a name no run has ever reported leaves the first pull request waiting on a status nothing produces. On an operational repo the `develop -> main` promotion is a pull request too, so the same wait applies there. For a **private** repo, confirm the owner-level toggle named `Dependabot on self-hosted runners`, which for a user-account owner sits at `https://github.com/settings/security_analysis`, is off, along with `Automatically enable for new repositories` beside it. If self-hosted routing is wanted instead, register a matching self-hosted runner rather than disabling the toggle. Left on with no self-hosted runner registered on the owner, Dependabot's own update jobs queue for up to 24 hours, then get cancelled. Ordinary CI is unaffected throughout. A routed job is visible through the Actions API, carrying `labels: ["dependabot"]` with an empty `runner_name` and no steps. By contrast, a job GitHub's own runners took carries `labels: ["ubuntu-latest"]` with a runner name. [`AUDIT.md`][audit] section 6 carries the query that reads a routed job. GitHub never routes a public repo through this setting, so a public standup is unaffected. A repo standing up from a **partial state** may already carry queued or cancelled jobs from before this check ran. Fixing the toggle does not rerun those. A manual `Check for Updates` click on the repo's own Dependabot page does. diff --git a/registry/repos.json b/registry/repos.json index 67723ddb0..363014137 100644 --- a/registry/repos.json +++ b/registry/repos.json @@ -220,11 +220,11 @@ "types": ["eda"], "hasDevelop": true, "pullRequestCheck": false, - "publish": [{ "target": "github-release", "mechanism": "none" }], - "requiredSecrets": ["CODECOV_TOKEN", "KICADLIBRARY_READ_TOKEN"], + "publish": [], + "requiredSecrets": ["KICADLIBRARY_READ_TOKEN"], "consumerModel": "pull", - "releaseTrigger": "two-phase", - "driftNotes": ["EDA/KiCad PCB design that checks out the private ptr727/KiCadLibrary submodule in CI with KICADLIBRARY_READ_TOKEN, so a Dependabot-triggered run needs the Dependabot copy too.", "Target is a source release on github-release, like KiCadLibrary. Its resync owes the release workflows and a dependabot.yml, and the python type once its scripts and their tests land, which is why CODECOV_TOKEN is declared ahead of them."] + "releaseTrigger": "none", + "driftNotes": ["EDA/KiCad PCB design that checks out the private ptr727/KiCadLibrary submodule in CI with KICADLIBRARY_READ_TOKEN, so a Dependabot-triggered run needs the Dependabot copy too.", "Planned: a two-phase github-release source release like KiCadLibrary's, a dependabot.yml, and the python type once its scripts and their tests land. Its resync writes each into this entry when it lands, and CODECOV_TOKEN, kept in both stores for those tests, reads as unclaimed until then."] }, { "name": "ESPHome-Config", diff --git a/repo-config/README.md b/repo-config/README.md index 1f93f2b8a..6c9a074c7 100644 --- a/repo-config/README.md +++ b/repo-config/README.md @@ -40,6 +40,7 @@ Each name carries a scope in `spec/secrets.json`, and the scope decides the one | `DOCKER_HUB_USERNAME` | fleet | `github_docker_hub_username` | | `DOCKER_HUB_ACCESS_TOKEN` | fleet | `github_docker_hub_access_token` | | `CODECOV_TOKEN` | repository | `github__codecov_token` | +| `KICADLIBRARY_READ_TOKEN` | repository | `github__kicadlibrary_read_token` | A fleet name has one value shared by every repository that needs it. A repository name has a value of its own per repository, and `` is the repository name in lower case with its hyphens kept. That is the repository name field CODESTYLE.md "Script and Utility File Names" defines. A cataloged repository whose name carries `_` or `.` is therefore refused when it owes a repository-scoped name. `spec/validate.py` reads no tree, so a type that owes coverage counts as owing its Codecov name whatever its tree holds. That is `python`, or `csharp` unless the entry declares it `lint-only`. Otherwise one owing only fleet-scoped names is provisioned as any other. A new required name with no scope fails `spec/validate.py`, so every name is classified explicitly. diff --git a/spec/resolve_secrets.py b/spec/resolve_secrets.py index 876e3f962..ab98f3b18 100755 --- a/spec/resolve_secrets.py +++ b/spec/resolve_secrets.py @@ -6,7 +6,7 @@ `names` is run by repo-config/configure.sh for one repo. It reads that repo's tree with read-only gh calls. -The tree decides whether a repo with tests owes its Codecov token in the Dependabot store too. +The tree decides only whether a repo with tests owes the codecov mechanism. It prints a JSON object with the rows (name, scope, file, stores), the forbidden names, and the strays. A stray is the file a name would have at the wrong scope. With `--live` it also reads each secret store and adds the findings of secret_names.compare_stores. diff --git a/spec/validate.py b/spec/validate.py index 3559bb8e1..2fdf91168 100755 --- a/spec/validate.py +++ b/spec/validate.py @@ -91,7 +91,7 @@ # A `requiredSecrets` name is resolved against each repository secrets store by an exact comparison. # It is therefore the same class of value as the three above and takes the same treatment. # This is the shape a name must have to be resolvable against the stores spec/audit.py compares it to. -# It is not a shape fitted to the four names the registry declares today. +# It is not a shape fitted to the names the registry declares today. # That comparison is an exact set difference against the names GitHub's API returns. # A declaration that is not character-for-character one of them is therefore unresolvable rather than merely untidy. # Upper case is part of the shape for that reason. From c6496a1904592dc7044aa39f8b9401c38b6cbc38 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Mon, 9 Nov 2026 20:53:46 -0800 Subject: [PATCH 3/3] Correct Two More Statements of the Actions-Only Placement The hugo type note still said requiredSecrets resolves against the actions store alone, and a validate.py comment still said every declared name is also required by a mechanism, which KICADLIBRARY_READ_TOKEN is not. Co-Authored-By: Claude Opus 5.5 --- spec/project-types.json | 2 +- spec/validate.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/project-types.json b/spec/project-types.json index 520778fed..ab5b7ba09 100644 --- a/spec/project-types.json +++ b/spec/project-types.json @@ -111,7 +111,7 @@ "hugo": { "detect": ["hugo.yaml", "hugo.toml", "config/_default/hugo.yaml"], "intentRefs": ["WORKFLOW.md"], - "note": "Named for the generator rather than for the transport, because what a repo builds and where the result lands are separate axes. The destination is publish[] ({ target, mechanism }), so a repo changes transport without changing type. Every assert below is phrased without naming the generator except hugo.build.strict, where a generator-specific flag is the letter, so promoting the generic ones to a shared type when a second generator arrives is a registry edit. Deploy credentials are per-environment GitHub Environment secrets and variables, which no audit or configuration tool here inventories, the hub's deploy-site-task.yml failing its own run on an empty one it needs instead. A repo does not list them in its registry requiredSecrets, because spec/audit.py resolves that list against the repository actions store and would report an environment-scoped name as missing.", + "note": "Named for the generator rather than for the transport, because what a repo builds and where the result lands are separate axes. The destination is publish[] ({ target, mechanism }), so a repo changes transport without changing type. Every assert below is phrased without naming the generator except hugo.build.strict, where a generator-specific flag is the letter, so promoting the generic ones to a shared type when a second generator arrives is a registry edit. Deploy credentials are per-environment GitHub Environment secrets and variables, which no audit or configuration tool here inventories, the hub's deploy-site-task.yml failing its own run on an empty one it needs instead. A repo does not list them in its registry requiredSecrets, because spec/audit.py resolves that list against the repository secrets stores and would report an environment-scoped name as missing.", "checks": [ { "id": "hugo.build.strict", "verdict": "letter", "assert": "The site build fails on a generator warning rather than rendering around it (hugo --gc --minify --panicOnWarning), and the pull request gate and the deploy run the same build command rather than two variants.", "workflowRef": "WORKFLOW.md#d1---pr-fast-feedback-smoke" }, { "id": "hugo.urls.parity", "verdict": "letter", "assert": "A URL contract gate compares the built tree against a committed list of the URLs that must render and the URLs that must redirect, and asserts a minimum length on each list before comparing it, since a truncated list makes every assertion below it pass vacuously. This is the type's check of record, standing in for the unit tests a site does not have.", "workflowRef": "WORKFLOW.md#6-per-project-type-test-walkthroughs" }, diff --git a/spec/validate.py b/spec/validate.py index 2fdf91168..e0627e08d 100755 --- a/spec/validate.py +++ b/spec/validate.py @@ -101,7 +101,7 @@ # So it is reported missing from the store on every run against a repository whose store is correct. # Where no mechanism maps the name, the stored one it was meant to be is reported as claimed by nothing as well. # This is because requiredSecrets is unioned into the claimed set and a misspelling withdraws the only claim on it. -# A name a mechanism already requires, which is every one the registry declares today, keeps its claim and yields the missing-from-the-store finding alone. +# A name a mechanism already requires keeps its claim and yields the missing-from-the-store finding alone. # The reserved GITHUB_ prefix is the other half, and it is the same never-satisfiable shape one clause away. # GitHub refuses to store such a name at all. # A repo declaring one therefore collects a missing-from-the-store finding that nothing it can do retires.