Repository navigation
Apply One Naming Convention to Every Env and Secret File - #3506
Conversation
CODESTYLE.md now states the env and secret file rule the maintainer chose in #3503. It reaches every file a repository names, tracked or host-side. Fields are joined by `_` and each keeps its own valid form, so a host name keeps its hyphens. The name carries no dot but its extension. The rule also sets the consumer limits and how a field converts to a variable name. The `secrets.stems` audit check now reads that grammar instead of a snake_case stem. It also reads tracked `.env` files outside `.secrets/` whose name no tool fixes. AUDIT.md and the spec catalog state what the check reads and what stays judged by hand: a hyphen joining words, the consumer limits, and host-side names. Refs #3503 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A field may now carry a run of hyphens, as an IDN host label does. The scope test folds case before setting a `.example` suffix aside, so an uppercase suffix is judged rather than skipped. The finding names the GOVERNANCE.md rule a bare `.env` breaks, and the catalog entry names CODESTYLE.md as the rule's home. Long sentences are split, and the judged-by-hand list drops its count. Refs #3503 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AUDIT.md and the unreadable-tree message described the check as reading secret-file stems, which it no longer does. The catalog assert's list gains its missing conjunction. Refs #3503 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟡 Changes recommended
Two unresolved review findings remain regarding host-field dots and sentence-length compliance.
2 open issues
What changed in this PR
This pull request standardizes env and secret file naming across tracked and host-side files, updating the audit tooling, documentation, specifications, and tests.
Changes:
- Defines a shared filename grammar with underscore-separated fields and support for hyphenated host fields.
- Extends
secret_stem_findingsto validate applicable.secretsand tracked.envfiles. - Synchronizes governance, audit metadata, project-type specifications, and test coverage.
| File | Description |
|---|---|
tests/test_audit.py |
Updates end-to-end audit expectations. |
tests/test_audit_helpers.py |
Adds coverage for valid and invalid env and secret names. |
spec/project-types.json |
Updates the runtime-secrets naming assertion. |
spec/checks.json |
Points the secrets naming check at CODESTYLE.md. |
spec/audit.py |
Implements the new filename grammar and validation scope. |
GOVERNANCE.md |
Aligns repo-scoped secret naming guidance with the new rule. |
CODESTYLE.md |
Defines the fleet-wide env and secret filename convention. |
AUDIT.md |
Documents the runtime-secrets audit scope and manual judgment boundaries. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3506 +/- ##
===========================================
+ Coverage 81.10% 81.11% +0.01%
===========================================
Files 26 26
Lines 8907 8914 +7
===========================================
+ Hits 7224 7231 +7
Misses 1683 1683
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:
|
The maintainer answered the open local-review finding on a fully qualified host name field. A host field is the host's first DNS label or a logical role name, never the fully qualified name, which the check already rejects for its dots. The AUDIT.md list sentence this change lengthened is split. Refs #3503 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A role name such as `vps-staging` joins its words with `-`, which the rule otherwise reserves to `_`. The host field now takes the DNS label form whichever kind of name it holds, and the hyphen rule scopes to the other fields. AUDIT.md says where the check misses a host's dots, and the list sentence it lengthened is split under the limit. Refs #3503 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AUDIT.md's hyphen sentence now matches CODESTYLE.md, which allows a hyphen to join words only inside a host field. The check's gap is stated by its cause: it cannot tell an extension from a dot-joined last field of an extensionless name. The separator reasoning names a host name label, since a DNS label in general can carry `_`. Refs #3503 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
The assert's drift list read as covering a root `.env.local`, which CODESTYLE.md exempts and the check skips. Refs #3503 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
## Summary Promotes the pull requests merged into develop since release 2.0.1195. - [#3506](#3506): `CODESTYLE.md` "Script and Utility File Names" now states one naming convention for every env and secret file a repository names, tracked or host-side. Fields are joined by `_`. A host field is a short name in DNS label form, never a fully qualified name. The name carries no dot but its extension. The `secrets.stems` check reads that grammar and now also reaches tracked `.env` files outside `.secrets/`. `AUDIT.md`, `GOVERNANCE.md` "Repo-Scoped Secrets", and the spec catalog follow. - [#3508](#3508): answers this promotion's first Copilot headline. `CODESTYLE.md`'s tool-fixed env exemption now says an env or secret file in a `.secrets/` directory is never tool-fixed, so it no longer reads as contradicting `GOVERNANCE.md`'s rule against a bare `.env` there. Closes #3503 ## Constituent coverage Each change this promotion carries had coverage on its own pull request into develop: | Pull request | Merged head | Coverage | | --- | --- | --- | | [#3506](#3506) | `5753c6da` | attested local pass at the merged head, base `develop`, and a Copilot round on an earlier head whose two findings were fixed and resolved | | [#3508](#3508) | `2d6cdbee` | attested local pass at the merged head, base `develop`, and a Copilot table on the merged head naming exactly its 1 changed file, approval recommended, no findings | 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Summary
Writes the env and secret file naming rule the maintainer decided in #3503 into
CODESTYLE.md"Script and Utility File Names", and moves thesecrets.stemscheck onto it._joins fields, each field keeps its own valid form so a host name keeps its hyphens, and the name carries no dot but its extension. It also states the variable-name conversion, the Docker and POSIX limits, and the tool-fixed.env*exemption.secret_stem_findingsreads the new grammar rather than a snake_case stem. It now also reads tracked.envfiles outside.secrets/whose name opens on no dot. A trailing.exampleis set aside, case-folded for the scope test.AUDIT.md"runtime-secrets",spec/project-types.json,spec/checks.json, andGOVERNANCE.md"Repo-Scoped Secrets" state the same rule, and say what stays judged by hand: a hyphen joining words, the consumer limits, and host-side names.Closes #3503
Verification
uv run --no-project --with-requirements tests/requirements.txt python -m unittest discover -s tests: 2965 tests, OK (skipped=7).spec/audit.py --selftestpasses, andspec/validate.pypasses.Maintainer answer folded in
The first local pass asked how a fully qualified host name is written in a field. The maintainer answered on #3503. A host field is a short name, the host's first DNS label or a logical role name such as
vps-staging, in DNS label form, never a fully qualified name.CODESTYLE.md,AUDIT.md, and the catalog assert now say so.Declined local review findings
db-root-passwordto a judge-by-hand DRIFT. The audit has no advisory level, only DEFECT, DRIFT, ERROR, and LETTER, and this check has no exemption path. So every validly host-named file such asapp_web-01_prod.envwould carry a DRIFT it could never clear.AUDIT.mdstates the hyphen judgment instead.HYPHENATED_FILE_STEM. The field allows a run of hyphens, as an IDN labelxn--bcher-kvadoes, and the script-stem pattern does not.*.envoutside.secrets/.gh search code --owner ptr727 --extension envfinds only.secrets/example.envin one repository, which passes. The input is trusted maintainer content, and the tool-fixed env names are dotfiles, which the check skips, perGOVERNANCE.md"Trust Boundaries and Hardening Effort".Dropped findings
AUDIT.md:72,style. The opt-insentence-lengthcheck flags two sentences on this line that this change does not touch.🤖 Generated with Claude Code