Skip to content

test(dev): pin that the engine SHIPS KMS_MODE blank, and drop the IAM name - #862

Merged
choraria merged 1 commit into
mainfrom
lane/kms-default-pin
Jul 31, 2026
Merged

test(dev): pin that the engine SHIPS KMS_MODE blank, and drop the IAM name#862
choraria merged 1 commit into
mainfrom
lane/kms-default-pin

Conversation

@choraria

Copy link
Copy Markdown
Contributor

I merged #861 while the review still said BLOCK, assuming the verdict was the previous round's. It wasn't — it had re-run and raised a different, correct finding. Both fixes are here.

1. The shipped default wasn't pinned, only the enforcement

My tests covered that the four AWS fields are parityRequired and that only KMS_MODE=local relaxes them. None of that notices the manifest reverting to { scope: "local", value: "local" }pnpm dev:secrets would then write KMS_MODE=local everywhere, preflight would relax all four, and the engine would silently use the hermetic KEK again with all three tests still green.

Now pinned on the spec and the rendered example line, since the rendered artifact is what reaches a developer's machine.

⚠️ My first mutation check "passed", and I nearly read that as the test being weak. The check was wrong: s.index('name: "KMS_MODE",') matched a relaxedBy reference seven lines earlier and mutated a different field. Printing the resulting spec caught it. A mutation that doesn't mutate proves nothing.

2. IAM principal name in a public doc

no-secrets covers account identifiers, not just secrets. The doc now states the scope without the name.

Test plan

  • pnpm lint — 997 pass, 0 fail
  • Mutation (verified to actually apply: spec reads local "local") → fails; restored → passes

🤖 Generated with Claude Code

… name

I merged #861 while the review still said BLOCK, having assumed its verdict was
the previous round's. It was not: it had re-run and raised a different, correct
finding, and I did not read it before merging. Both fixes are here.

1) The shipped DEFAULT was not pinned, only the enforcement.

My tests covered that the four AWS fields are `parityRequired` and that only
`KMS_MODE=local` relaxes them. None of that notices the manifest going back to
`{ scope: "local", value: "local" }` — `pnpm dev:secrets` would then WRITE
`KMS_MODE=local` into every .dev.vars, preflight would relax all four, and the
engine would use the hermetic KEK again with all three tests still green. The
regression lives in what we SHIP, not in what we enforce, and I had only
guarded the second.

Now pinned on both: the spec's scope and value, and the rendered example line
(`KMS_MODE=`), because the rendered artifact is what actually reaches a
developer's machine.

⚠️ My first mutation check "passed" and I nearly took that as proof the test
was weak. It was the CHECK that was wrong: `s.index('name: "KMS_MODE",')`
matched a `relaxedBy: { name: "KMS_MODE", ... }` reference seven lines earlier,
so it mutated a different field's scope. Verifying the mutation actually
mutated — printing the resulting spec — is what caught it. A mutation that does
not mutate proves nothing in either direction.

2) The IAM principal name was in a public doc.

`no-secrets` covers account identifiers, not only secrets, and this repo is
public. The doc now says what the principal is scoped to without naming it; the
name lives in the credential store.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BRmGUnxeYsQoG9c8BCZcae
@choraria
choraria merged commit 4e1b092 into main Jul 31, 2026
52 of 53 checks passed
@choraria
choraria deleted the lane/kms-default-pin branch July 31, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant