Repository navigation
fix(infra): this repo is PRIVATE, and lock the destroy guard with a test - #362
Merged
Merged
Conversation
Two things, both found by looking at what the last PR actually shipped. **The repository is private, and five files said otherwise.** `gh repo view --json visibility` returns PRIVATE. I had propagated "public repository" into the plan-step comment, `docs/infrastructure.md` §14.2, the infra-platform skill, and — worst — the PR comment template, which renders that sentence onto every infra PR. Two pre-existing claims in `ci-terraform.tf` and `ses.tf`, plus two in `sccache.tf`, said the same. Every decision those comments justify stays correct, so none of them is a word swap; each needed its premise replaced: - `-refresh=false` on the plan tier: the path was never "the whole internet reads the log", it is that the plan role is assumable from any PR branch, a PR can edit the workflow it runs under, and the resulting build log needs no AWS access to read, is readable by every collaborator, and persists in the run history. Private narrows who, not whether. - zero repository secrets: the argument never depended on visibility — secrets are not readable by anonymous visitors on a public repo either. It is that a static key does not expire, is reachable by every workflow rather than one job, and is rotated only by someone remembering to. - the sccache writer split: cache poisoning now has to come from a collaborator rather than from anyone, which narrows who can attempt it without closing the path — and poisoning outlives the credential that planted it, which is why it is worth a second role. Left alone deliberately: six `rust.yml` sccache comments and `build-cost.md`'s runner-cost paragraph, which claims standard minutes are free — materially wrong on a private repo. Both files belong to #359, which is in flight and already corrects one line of build-cost.md. Sweeping them here would only conflict with it. **The destroy guard had never refused anything in CI.** Every real apply has planned `0 to destroy`, so the one mechanism between a merge and an unattended production teardown had its refusal path verified exactly once, by hand, by me. That is the state this repo keeps getting burned by — a gate nobody has watched fail is indistinguishable from a gate that cannot. `scripts/ci/tf-helpers-test.sh` asserts 31 behaviours of the three helpers against fixtures: the refusal, the `ALLOW-DESTROY` override, the fail-closed branch, the import-form summary a full-line pattern would miss, the 65536-character comment cap, the backtick-in-plan-text fence, and that a plan-only stack never gets the "merging applies this" warning. No toolchain, no credentials, no network, no terraform binary. `apply` now gates on it, which is the reason it is a CI job and not a local convenience: a broken guard stops the apply instead of being discovered by it. The suite is mutation-checked — breaking the guard's refusal, its fail-closed branch, the metadata parser's import handling, the comment cap or the plan-only warning skip each turns it red. The first attempt at that check reported a false CAUGHT from a `sed` that matched nothing, which is why the mutations are applied by assertion now. One bug in the test itself, worth recording because it is the same class the suite exists to catch: the "names ALLOW-DESTROY in the refusal" assertion piped the guard into `grep -q`. With `pipefail` on, the pipeline returned the guard's own exit 1 — the behaviour under test — so the assertion read false however correct the message was, and `grep -q` would have SIGPIPEd the guard on the way. Captured and matched with `case` instead. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
terraform plan
|
athvin
added a commit
that referenced
this pull request
Nov 1, 2026
…g the Rust gate (#366) The tail of #362, which corrected the "public repository" claim in the files it owned and deliberately left `rust.yml` and `build-cost.md` to #359. #359 has corrected one line of `build-cost.md` and is still open, so these are the remaining ones — the edits sit in different hunks from its, and a rebase either way is clean. **`rust.yml`'s six sccache comments.** The cache-poisoning argument stands; only its premise moves. Poisoning outlives the credential that planted it, which is why writes are restricted to `main` — and the repository being private means the branch has to come from a collaborator rather than from anyone at all. Narrower, not closed. **`build-cost.md` claimed "its minutes are free, because standard GitHub-hosted runners are free for public repositories" and that the bill for all of this CI is zero.** That is materially wrong on a private repo: the runtime this whole file measures is a cost, not only a wait. Two downstream conclusions moved with it — an organisation on the Team plan trades one metered rate for another rather than giving up a free one, which is a smaller step than it read; and the usual objection to self-hosted runners (a fork PR executing arbitrary code) mostly does not apply, so what remains is the ordinary compromised-collaborator case and the runner wanting its own least-privileged identity. No replacement figure is asserted. The allowance and consumption are account settings rather than repository state, and `gh api /users/{user}/settings/billing/actions` needs a `user` scope this session does not hold — so the text says where to read them instead of substituting one unverified number for another. **`.github/workflows/infra.yml` joins `rust.yml`'s detect denylist**, with `scripts/ci/tf-*` which was already exempt in `infra.yml`'s own detect but not here. An infra-only PR was paying the full ~40-minute backend gate — `test` plus the DuckLake e2e — and `infra.yml` defines no Rust job and cannot affect the workspace build. Every infra PR in this series paid it. Named FILE BY FILE and not as `^\.github/workflows/`: `rust.yml`, `frontend.yml` and `images.yml` must keep triggering the gates they define, or a change to a gate would stop reporting on exactly the PR most likely to break it. Simulated over nine shapes — infra.yml alone, with terraform, and with a tf helper all skip; rust.yml, frontend.yml, images.yml, docs, `scripts/ci/actionlint.sh`, and infra.yml+rust all still run. `rust/deny.toml`'s "Public repo" is left alone: it describes `github.com/athvin/feather-flow`, the ff-analysis dependency, which really is public (checked). Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two things, both found by looking at what #360 actually shipped rather than at the diff.
1. The repository is private, and five files said otherwise
gh repo view --json visibility→PRIVATE. I had propagated "public repository" into the plan-step comment,docs/infrastructure.md§14.2, the infra-platform skill, and — worst — the PR comment template, so that sentence renders onto every infra PR. Two pre-existing claims inci-terraform.tfandses.tf, plus two insccache.tf, said the same.Every decision those comments justify stays correct, so none of this is a word swap. Each needed its premise replaced:
-refresh=falseon the plan tierLeft alone deliberately: six
rust.ymlsccache comments, andbuild-cost.md's runner-cost paragraph claiming standard minutes are free — materially wrong on a private repo, with real cost implications. Both files belong to #359, which is in flight and already corrects one line ofbuild-cost.md. Sweeping them here would only conflict with it; I'll do it as a small follow-up once #359 lands.2. The destroy guard had never refused anything in CI
Every real apply has planned
0 to destroy, so the one mechanism between a merge and an unattended production teardown had its refusal path verified exactly once, by hand, by me. That is the state this repo keeps getting burned by — a gate nobody has watched fail is indistinguishable from a gate that cannot fail.scripts/ci/tf-helpers-test.shasserts 31 behaviours of the three helpers against fixtures:ALLOW-DESTROYoverride, the fail-closed branch, and thePlan: 1 to import, …, 3 to destroyform a full-line pattern would miss~~~~fence surviving a triple-backtick inside plan text, and that a plan-only stack never gets the "merging applies this" warningNo toolchain, no credentials, no network, no
terraformbinary — pure shell, 5-minute job, runnable locally asbash scripts/ci/tf-helpers-test.sh.applygates on it, which is the reason it's a CI job and not a local convenience: a broken guard stops the apply instead of being discovered by it.Verification
exit 1→exit 0), its fail-closed branch, the metadata parser's import handling, the comment cap, or the plan-only warning skip each turns it red with the matching assertion named. Helpers restored byte-identical (cmp) afterwards and the suite confirmed green again.sedthat matched nothing — so the mutations are now applied by assertion (assert old in s) rather than by a regex that can silently no-op.terraform fmt -check -recursive,actionlintacross all four workflows,scripts/skills-check.sh allgreen.One bug in the test itself, worth recording because it's the same class the suite exists to catch: the "names ALLOW-DESTROY in the refusal" assertion piped the guard into
grep -q. Withpipefailon, the pipeline returned the guard's own exit 1 — the behaviour under test — so the assertion read false however correct the message was, andgrep -qwould have SIGPIPEd the guard on the way. Captured into a variable and matched withcaseinstead.required-checks.mdwill conflict with #359 — both PRs add a job, and it's generated. Whoever merges second re-runsscripts/skills-check.sh regen.🤖 Generated with Claude Code