Repository navigation
Check Deployment Environment Secret and Variable Names in the Audit - #4480
Conversation
Each registry environments[] entry now declares the secret and variable names its environment holds. A new secrets.environments check in spec/audit_environments.py reads every live environment's stores by name only and reports missing, unlisted, and wrong-kind names. It also reports any value in an environment the registry does not declare. spec/validate.py gates the new lists' shape. The unread environments object leaves spec/secrets.schema.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read environment stores through spec/resolve_secrets.py's gh_run, and report a forbidden name held in an environment store as a defect, as the repository stores do. Judge requiredSecrets and the environment name lists with one validate.py helper, and drop a test that could not fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e Check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 38 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Approval is blocked by an unresolved documentation contradiction and a validator bug that permits forbidden environment names, preventing clean configurations.
2 open issues
What changed in this PR
This pull request adds registry-backed auditing for deployment-environment secret and variable names, with names-only GitHub API reads and updated validation, documentation, schemas, registry data, and tests.
Changes:
- Adds optional environment secret and variable declarations to registry entries.
- Audits missing, stale, forbidden, and wrong-kind environment names.
- Updates audit wiring, guidance, schemas, onboarding documentation, and test coverage.
| File | Description |
|---|---|
| TODO.md | Records the completed environment-store declaration decision. |
| tests/test_spec_validate.py | Tests environment store-list validation and schema pattern parity. |
| tests/test_audit.py | Stubs environment reads for existing audit tests. |
| tests/test_audit_size.py | Adds a size ceiling for the new audit module. |
| tests/test_audit_environments.py | Tests environment comparison, API reads, host pinning, and read failures. |
| STANDUP.md | Documents environment store names as registry declarations. |
| spec/validate.py | Validates optional environment secret and variable name lists. |
| spec/secrets.schema.json | Removes the retired unread environment declaration shape. |
| spec/secrets.json | Documents registry-based environment name auditing. |
| spec/checks.json | Registers the secrets.environments audit check. |
| spec/audit.py | Wires the environment audit into repository checks. |
| spec/audit_environments.py | Implements names-only environment store reads and declaration comparisons. |
| registry/repos.schema.json | Adds the environment store name schema definition. |
| registry/repos.json | Declares Blog's environment secret and variable names. |
| docs/repo-config.md | Clarifies ownership of environment store auditing. |
| AUDIT.md | Updates audit dimensions and operator instructions. |
Review effort: Lite
|
A recorded local strict-review pass covers head |
|
@coderabbitai review |
|
/review |
Action not completed
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4480 +/- ##
===========================================
- Coverage 81.60% 78.97% -2.64%
===========================================
Files 26 50 +24
Lines 9070 16769 +7699
===========================================
+ Hits 7402 13243 +5841
- Misses 1668 3526 +1858
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…s, Environment Secret Audit, and macOS Bash Floor (#4485) Promotes the 26 pull requests that landed on develop since the last promotion (#4428), from the away-mode backlog burndown run. - #4447: Bump markdownlint-cli2-action from 25.0.0 to 25.1.0. - #4449: Have the agent open and drive the promotion after an audit's file fix merges. - #4453: Pass over a signal handled as the prose gate's first handler starts. - #4456: Record a managed copy for claude and codex in install-agents and report any other copy as a stray. - #4457: Name the PowerShell suppression form and correct the Python CI backstop text. - #4458: Read the metrics report's reviewed heads from the gate's one filter (part of #3880, completed by #4481). - #4460: Cross-check Python directories against Dependabot's pip and uv entries (items 2 and 3 of #2286, which stays open for item 1). - #4461: Pin the Docker lint images by digest through a Dependabot-tracked manifest. - #4464: State the platform weighting and correct the hook-promotion worked example. - #4463: Key Qodo findings without links or commit hashes and ask dismissal by title and location. - #4465: Hand a caller's hook-input to the validate and resolve-upstream hooks. - #4466: Require an empty workflow-level permissions block on entry-point callers. - #4467: Remove the npm and bun upgrade paths no managed tool reaches. - #4469: Add a hub-hosted script that enables a clone's hook framework once. - #4472: Select each repository's Python line from its root `.python-version` (the part of #4187 needing no decision; #4187 stays open). - #4479: Report dotnet and powershell as unmanaged while Microsoft's feed is unconfigured. - #4477: Bound the shell trap's child wait and give the heading search a file. - #4480: Check deployment environment secret and variable names in the audit. - #4478: Add a macOS bash 4.4 floor with a platform-scoped host tool entry. - #4481: Build the gate's comment readers on one trusted-comment reader. - #4484: Record the measured absence of a git floor for `--end-of-options`. - #4496: Narrow the Qodo acknowledgment key's normalization to a link and a hash after `commit`. - #4500: Pass over a signal handled as the hook enabler's first handler starts. - #4502: Pin the GitHub host for every `gh` child the hub's Python scripts start. - #4503: Write the Docker pull retry once, with one backoff schedule. - #4505: Pin the repo gate's `gh` read and parse the Docker pin manifest once. ## Release notes for callers - #4472: A caller passing no `python-versions` input and carrying no root `.python-version` moves from Python 3.13 to 3.14 for its `unit-test` leg and its `lint` job's Python steps once its hub pin reaches this change. Its nested check name moves from `Unit test job (Python 3.13)` to `Unit test job (Python 3.14)`, and its Codecov flag from `python-3.13` to `python-3.14`, so a `.codecov.yml` naming the old flag stops matching. Its `lint` job warns on each run until it carries a selector. A caller whose `requires-python` or locked dependencies exclude 3.14 adds a `.python-version` before moving its pin. A `.python-version` naming no `X.Y` line, or an explicit `python-versions` whose first entry differs from the file's line, now fails validate. - #4479: The Linux `install-tools.sh --json` report schema moves from 1 to 2, because a not-installed `dotnet` or `powershell` can now read `unmanaged` with `installed: null`. A hand-installed amd64 `powershell` with no Microsoft feed now reads `unmanaged`. The Windows `-Json` report stays at schema 1. - #4466: Each entry-point caller must declare an empty workflow-level `permissions: {}` block. A site repository's `deploy-site.yml` carrying only job-level blocks now reports this as drift, and the fix belongs to that repository. - #4461: Dependabot's docker ecosystem listing tags on mirror.gcr.io for the shellcheck and shfmt lines is unconfirmed until its first docker run for that directory. - #4478: macOS now has a bash 4.4 floor, met by Homebrew's bash ahead of the system bash on `PATH`. Not yet verified on a native macOS host. - #4480: The audit gains the `secrets.environments` check. Registry `environments[]` entries may now declare their secret and variable names. - #4463 and #4496: The Qodo acknowledgment key changed. A `fleet-finding-ack` already posted on a still-open pull request stops matching its finding once a caller's hub pin reaches this change. Post it again, since `merge` refuses until then. - #4502: Every `gh` child the Python scripts under the hub's `scripts/` and `spec/` start now runs with `GH_HOST=github.com`, so an exported `GH_HOST` no longer moves their reads and writes. #4505 pins the repo gate's own `gh_read` the same way. The `gh-write-guard` hook (#4501) and the shell and PowerShell scripts are unchanged. - #4503: The `validate-task.yml` EditorConfig, shell, and PowerShell lint steps now pull their images through `docker_lint.py --pull`, with one retry schedule of 3 attempts waiting 15s, then 30s. The `docker-lint-pins` action gains a `docker-lint` output naming that script at the calling workflow's own ref. A caller pinned before this change keeps its inline retry. - #4505: The `docker-lint-pins` action now reads the pin manifest through `docker_lint.py --pin` rather than `sed`, so its step runs `python3`. It now refuses an empty tag or a stage named twice, which the old `sed` accepted, and on a failure it writes no outputs and one `::error::` annotation carrying the reason. - A fleet resync is owed, because carried text changed: AGENTS.md, GOVERNANCE.md, CODESTYLE.md, and several skills. ## Findings from the local strict review The attested local pass on c25ec49 (`main...develop`) raised five findings. Their outcomes: - Tracked: the hub's own `dependabot.ecosystems` DRIFT on `/tests` is the question #4459 holds, so it changes nothing here. - Fixed by #4500: `scripts/enable_hooks.py` `on_signal` now passes over a signal handled as its first handler starts. - Fixed by #4503: the bounded Docker pull retry is now written once, `scripts/docker_lint.py` `pull_image`, with one schedule. - Fixed by #4502: `spec/audit_environments.py` `names()` is gone, and both environment readers read through `spec/resolve_secrets.py` `read_names`. - Release note: the Qodo acknowledgment key change from #4463 and #4496 is stated under "Release notes for callers" above. The attested local pass on f93f34a (`main...develop`) raised 57 findings. Their outcomes: - Declined, 52 `prose_lint` `comment-added` lines: each comment was added by a feature pull request carrying the `comments` label (#4456, #4461, #4463, #4465, #4467, #4472, #4480), and the promotion re-carries them without that label. - Tracked: `spec/audit_dependabot.py:93`, the hub's own `/tests` pip drift, is the question #4459 holds. - Tracked: the nested-signal guard missing at `scripts/docker_lint.py:416`, `scripts/backlog_metrics.py:1290`, and `catalog/snippets/hub_fetch_run.py:193` is the class #4452 holds. - Release note: the Qodo key change at `scripts/pr_review_answers.py:158` is stated above. - Fixed by #4505: `.github/actions/repo-gate/repo_gate.py` `gh_read` now starts its `gh api` child under `gh_env()`, which pins `GH_HOST=github.com`. - Fixed by #4505: `scripts/docker_lint.py` `read_pins` is now the pin manifest's one parser. The repo gate dropped `SHELLCHECK_PIN`, and the `docker-lint-pins` action dropped its `sed` for `docker_lint.py --pin`. The attested local pass on 3183644 (`main...develop`) raised 53 findings. Their outcomes: - Declined, 51 `prose_lint` `comment-added` lines: the same comments the pass on f93f34a named, less the `docker-lint-pins` `action.yml` line #4505 removed, each added by a feature pull request carrying the `comments` label. - Tracked: the nested-signal guard missing at `scripts/docker_lint.py:448`, `scripts/backlog_metrics.py:1290`, `scripts/pr_review.py:2174`, and `catalog/snippets/hub_fetch_run.py:193` is the class #4452 holds. - `introduced`, design, `scripts/docker_lint.py:856`: `resolve_digest` runs one more `docker image inspect` per linter to read a digest the pin manifest's tag-and-digest reference already gives, since #4461 pins every image, and it takes `RepoDigests[0]`, which can name another repository holding the same image. Deferred to #4508 by the maintainer's decision, which is this finding's outcomes. Fixes #3468 Fixes #3880 Fixes #4408 Fixes #2070 Fixes #4473 Fixes #4474 Fixes #2594 Fixes #4327 Fixes #4450 Fixes #1783 Fixes #3325 Fixes #3917 Fixes #4448 Fixes #1164 Fixes #1613 Fixes #1727 Fixes #4403 Fixes #4407 Fixes #4158 Fixes #4210 Fixes #4429 Fixes #4406 Fixes #4488 Fixes #4498 Fixes #4489 Fixes #4499 Fixes #4504 🤖 Generated with [Claude Code](https://claude.com/claude-code)


Check each deployment environment's secret and variable names against the registry, in the hub-hosted audit. This follows the maintainer's 2026-11-01 answer on #2070, option 1.
What changes
registry/repos.jsonenvironments[]entry may now carrysecretsandvariablesname lists. An absent list declares an empty store. Blog's two environments declare the names they hold today. aiopurpleair'spypideclares none, and it holds none.secrets.environmentscheck lives in the newspec/audit_environments.py. It reads every environment GitHub has for the repo, and each one's two stores:gh api --paginate --hostname github.com ... --jq '.<key>[].name', throughspec/resolve_secrets.py'sgh_run. So no variable value ever reaches the audit's process, and the host is pinned againstGH_HOST.gh_runraises on a non-zeroghexit or a missinggh, andaudit.mainreports that as the repo's ERROR rather than as an empty store.spec/validate.pyshape-checks the two new lists with the samename_list_errorshelperrequiredSecretsnow uses. Each name must matchSECRET_NAME_PATTERN, and a name a publish mechanism forbids is refused. The schema's copy of the pattern is held byte-identical byRegistrySchemaMirrorCase.environmentsobject leavesspec/secrets.schema.json. Thespec/secrets.jsonnotes, Blog's driftNote, AUDIT.md sections 4 and 6 (thehugobullet and therepo-setupdimension now grade environment names),docs/repo-config.md,STANDUP.md, and the "Locally Required Secrets" entry inTODO.mdno longer say that environment names go unchecked.spec/audit.pygains only the import and a three-line wrapper, and it ends at 2994 of its 3000-line ceiling.tests/test_audit_size.pygives the new module a 200-line ceiling of its own.Verification
python -m unittest discover -s testspasses on the head, 5076 tests, including the newtests/test_audit_environments.py. It uses constructed names only.spec/validate.pyreports OK.ruff format --check,ruff check, andmypyon the changed files are clean.Open findings from the local pass
The local pass's edit budget was spent, so these two
introducedfindings were handed to this pull request's review loop. Both are now fixed:spec/project-types.json:116,introduced, fixed in c2cbad6. Thehugotype's note said no audit inventories per-environment deploy credentials. It now namesspec/audit_environments.py(thesecrets.environmentscheck).spec/audit_environments.pywithspec/validate.py,introduced, fixed in 7ffe971. An environment list could declare a name the repo's mechanisms forbid, which the audit reports missing until stored and forbidden once stored.spec/validate.pynow refuses that declaration throughforbidden_environment_names(), as it refuses a forbiddenrequiredSecretsname.Declined local-pass findings
spec/validate.pyforbidden_environment_names, raised as over-hardening: declined. It mirrors the existingrequiredSecretsforbids cross-check in the same per-publish-target loop, so the gate treats both declaration surfaces alike, and the mirror covers exactly the mechanism forbids that check covers. A baseline-forbidden name in an environment is still a DEFECT on every audit run. Without the gate, a declared mechanism-forbidden name sends the audit's first finding the wrong way: "missing", which reads as "store it".Pre-existing findings, not filed
spec/audit.pygh()andspec/resolve_secrets.pyread_live_names: neither pins--hostname github.com, soGH_HOSTmoves their reads to another host while this change's environment reads stay on github.com. Class: correctness, raised by the local pass against unchanged code.Dependants
#2174 (its option 6) and #1801 (its option 2) were waiting on this answer. Neither is changed here.
Closes on promotion: #2070
🤖 Generated with Claude Code