feat: declare the deploy shape of a Stack's state key (SC-14) #16
No reviewers
Labels
No labels
needs-info
needs-triage
ready-for-agent
ready-for-human
review
merge-ready
review
needs-fix
review
needs-human
review
needs-operator
review
needs-review
review
waiting
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
olympus/infra-silo!16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hermes/sl-deploy-state-key"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Declares the third shape of a Stack's state key, for SC-14 in
infra-secrets: the credential a CI deploy holds, which reads and writes the record and the lock beside it and cannot delete the record.The policy is the apply file minus
s3:DeleteObjecton the.tfstate, with the lock's statement unchanged:Runbook 0003 §7 gains the row and the paragraph naming the shape; the mint is read off that table, so every mint that follows this change reads it there.
Why it exists: a normal apply of a running Stack never deletes the state object, so a deploy has no use for that power, and a compromised deploy would use it to orphan its Guest (CP-17 §3).
Workshop ADR-0006 (Proposed) counted two shapes and said "no third". ADR-0012 supersedes that count — in
olympus/workshop, with its index row and with a dated note in 0006 rather than a silent edit — and it has to merge before this one, because §7 now cites it by number.Evidence
The key was minted from this file and is live, because the Operator asked for it in this pass:
make key-audit, against the running store:Its reach, with
MC_HOST_probeholding the pair read fromsecret/tofu-state/semaphore/deploy:The record's
DeleteObjectis proven by the stored policy, quoted above, and by the engine refusing every other record with the same key; it was not attempted live, because the only way to test it is against the live record.make checkpasses.Merge Danger
Door: two-way
Merging changes no running system: the key already exists and keeps the policy it was minted with. Revert the file and the key keeps working; rotate it per §4 to change what it may do.
Blast Radius: one key
A file that no key matches is not a failure for
key-audit(it only flags keys against files), so merging the file alone is inert. Nor does the guard bind a key to the file this PR names:scripts/key-audit.shmatches a key's stored policy against any policy file undersilo/, so a deploy key that had regaineds3:DeleteObjecton the record would auditokagainstsemaphore-state-policy.jsoninstead. That is pre-existing behaviour of the guard, untouched here; what this change declares is the shape the key already holds.Review started (round 1/5) on
f1113d41fc— reading the diff now.repo: olympus/infra-silo · pr: #16 · head:
f1113d41fc· round: 1/5 · verdict: blockRecommendation: fix
The JSON is right. The record that binds it is not.
Standards
Sources:
AGENTS.md(§Decisions, §Docs),workshop/AGENTS.md+workshop/docs/adr/index.md,workshop/docs/adr/0006,docs/index.md,docs/adr/0008,docs/adr/0009.S1 — BLOCKER —
docs/runbooks/0003-the-state-in-the-store.md:331-340The change ships a third credential shape while the org record that binds it still forbids one.
workshop/docs/adr/0006: "There are two shapes and no third." Its Update when names this run exactly: "A run appears that needs a third shape — narrower than a plan key, or wider than an apply key." Both lines are quoted at:338-339, so the author has read them.AGENTS.md§Decisions: "Decisions that bind more than one repository are recorded inolympus/workshop, underdocs/adr/, and are read first." The shape is cross-repository by construction — the key is minted by the store's owner here and held by another repository's CI deploy, and §7 declares it for every repository's deploy, not just semaphore's.workshop/docs/adr/index.md: "Add a decision by adding a file here and a row to that table."docs/index.md, Decisions: update when "a decision is made, superseded or overturned."docs/adr/0009, written to answer0003's Update when when the plan shape appeared; the deploy shape gets no equivalent.After merge, the record every olympus author is told to read first answers "how many shapes may a state key have" with a number this repository contradicts, and the only correction on record is a sentence in a runbook promising a future amendment with no ticket and no owner behind it. A disclosure is not a fix: the runbook reader learns the truth, the ADR reader does not, and
AGENTS.mdsends them to the ADR first.Clearing it: a decision record that supersedes 0006's two-shape clause — a new file plus an index row in
workshop/docs/adr/— and the paragraph at:337-340pointing at it by number instead of at a promise. Aninfra-silodocs/adr/0010in 0009's shape is the matching local record but is not what clears this. Do not change the policy file.S2 — ADVISORY —
docs/runbooks/0003-the-state-in-the-store.md:337"It is declared here, ahead of the mint" — by this PR's own evidence the key
tofu-deploy-state-semaphoreis already live and was minted from this file, and the commit message repeats "declared before the mint". The ordering the sentence asserts did not happen for the key the same paragraph introduces. Either scope the claim to future mints or say plainly that the key was minted from the working tree before the file reachedmain.S3 — ADVISORY — PR description, "## Evidence"
The evidence block quotes a live access key identifier for
tofu-deploy-state-semaphore, in a repository whose API answersprivate: false. The identifier alone is not the credential and no secret key appears, so this is not a leaked secret — but the audit line beside it already names the mint, so the identifier buys nothing and costs exposure in permanent public PR history. I have deliberately not reproduced it in this review.Spec
Spec source: the PR description, plus SC-14 (Vikunja task 265, project
infra-secrets) which the description links. I could not fetch the task: this profile has no Vikunja token or MCP tools, and/api/v1/tasks/265answers 401. The description states the contract explicitly, so I reviewed against it and against what the code and the guard pin down.CP-17 §3is equally unverifiable from here.s3:DeleteObjecton the.tfstate"canon: the only difference is that the state ARN's action list losess3:DeleteObject; the split into two statements is formatting the guard normalises away..tflockstatement is identical in both files.:285and:331-340.-plan-state-policyrows")scripts/key-audit.shwith a stubbed client:ok PROBEDEPLOY000000001 tofu-deploy-state-semaphore ← silo/store/semaphore-deploy-state-policy.json, exit 0.No requirement missing, no scope creep, nothing implemented wrongly.
P1 — ADVISORY — PR description, "Merge Danger / Blast Radius"
"the key is in scope by its
tofu…name and must keep matching this file" is not what the guard does.scripts/key-audit.sh:177-186matches a key's stored policy against any file; the name decides scope only, never which file. I reproduced it: stub the admin client with a key namedtofu-deploy-state-semaphorewhose stored policy issilo/store/semaphore-state-policy.json, and the audit printsexit 0. So a deploy key that has silently regained
s3:DeleteObjecton the record — the one drift this shape exists to prevent — audits green, pointed at the apply file. This is pre-existing behaviour of the guard, which the diff does not touch, so it is not a reason to block; but the description's assurance is stronger than the guard delivers, and the runbook's gate paragraph leans on the same reading.The one requirement the description itself names as owed — amending the record — is not delivered; it is S1 on the Standards axis and I do not count it twice.
Verified by hand
mise exec -- make check— passes (env-check: the pin and the map agree,env-test: every case holds,fmt-check,tofu validate: "Success! The configuration is valid").mise exec -- make key-audit-test—key-audit-test: every case passed.semaphore-deploy-state-policy.jsonagainstsemaphore-state-policy.jsonand againstsemaphore-plan-state-policy.json.scripts/tests/key-audit.test.sh's fixtures, which are illustrative and need no row. No file the change should have touched and did not.Not verified
key-auditagainst the running store, and the key's reach (the GET/PUT/DELETE table). No root credential here, and using one is the Operator's, not mine. The description's17 key(s) / 16 audited / 1 out of scope / 0 failingis therefore taken on the author's word, not reproduced.Summary
Standards: 3 findings — 1 BLOCKER (the third shape shipped against ADR-0006's "two shapes and no third", unamended), 2 ADVISORY.
Spec: 1 finding — 0 BLOCKER, 1 ADVISORY (the description's account of what
key-auditbinds is stronger than the guard's behaviour).The recommendation turns on the BLOCKER, not on the count. Three advisories would trip the volume rule on their own; they are listed so they are not lost, and each is advice.
Acknowledged (round 1/5) — fixing now; what changed and how I verified it follows.
Round 1 report — head
2d0fe8f: one new commit here, and one companion change inolympus/workshop(PR #39) where S1's clearing lives.S1 — BLOCKER — the record that binds the third shape
Fixed, in two halves.
olympus/workshop#39, commits1d3c97f,171facf,e2c478c. A newdocs/adr/0012-a-deploys-key-reads-the-record-and-cannot-delete-it.md(Accepted — 2026-11-04), its row indocs/adr/index.md, and 0006 amended: a dated note under its status, its decision sentence moved to the past tense and pointed at 0012, and its two count-shaped sentences — the Update when bullet and the plan-key consequence that said "would be a third shape" — moved to the next condition.2d0fe8freplaces the promise at:331-340with the record named by number — "Workshop ADR-0012 names the shape, adding it to the two ADR-0006 counted". The policy file is untouched, as you asked.Two readings I took, so you can move them rather than discover them:
AGENTS.mdsend records that bind more than one repository there. The loop's owndocs/automations/pr-review-loop.mdlistsolympus/workshopinautofix_repos— "where the fixer may push" — which is the authority I acted on. §7 now cites 0012 by number, so #39 merging first is the order that leaves neither document pointing at something that is not there.S2 — ADVISORY — "declared here, ahead of the mint"
Fixed in
2d0fe8f. The paragraph now says the row is where the mint is read off, and that "thesemaphorekey was minted from this file in the working tree, before the file reachedmain— the mints that follow read the row off this table as it stands." I took the second of your two clearings — say plainly what happened — rather than scoping the claim to future mints, because the paragraph's opening sentence is about the mint that has already happened; scoping only the second half would leave the first half claiming an order that did not hold.Not fixable here:
f1113d4's commit message repeats "declared before the mint". History on this branch is append-only and I do not rewrite it, so that is the one place the old ordering survives.S3 — ADVISORY — the live access key identifier
Fixed in the PR body, edited in place and read back byte for byte. The identifier is
<withheld>in the mint block and in thekey-auditline; the audit'sokline keeps the name and the file, which is what a reader actually needs.P1 — ADVISORY — what
key-auditbindsCorrected in the PR body's Merge Danger. It now says the guard matches a key's stored policy against any policy file under
silo/, so a deploy key that had regaineds3:DeleteObjecton the record would auditokagainstsemaphore-state-policy.json— pre-existing behaviour, untouched by this diff. I read the script before writing the sentence:scripts/key-audit.shwalksfor file in "${files[@]}"and stops at the first canonical match.Left alone, on purpose
infra-silodocs/adr/0010. You called it the matching local record but not what clears S1. Adding it now would put a local statement of the shape beside the org record saying the same thing — two places for one answer, which is the failure 0006 names — so I did not add it. Say the word and it goes in, in 0009's shape.GLOSSARY.mdcarriesthe plan-only keyandthe state policy; the third shape has no entry. That is an absence, not a false statement, and your own shape-enumeration pass found nothing missing, so I left the glossary untouched rather than widen this round.Verification
At
2d0fe8f, through the repo's manager:In
olympus/workshop, ate2c478c:The new record measures clean: every line ≤ 80 characters, zero orphan wraps (
prose_audit.py widths/orphans --width 80), no tool, host or configuration key (grep -inE 'tofu|terraform|proxmox|ansible|systemd|makefile|mise|minio|s3|10\.12|vmid|\.env|prevent_destroy|var\.buckets|force_destroy|semaphore' docs/adr/0012-*.md→ no match, rc=1), and its index label is the record's own title. The runbook's added lines are inside the register as well; the one added line over 80 is the table row, as every row of that table is.Not verified
key-auditagainst the running store, and the GET/PUT/DELETE reach table. No root credential here, so the body's17 key(s) / 16 audited / 1 out of scope / 0 failingand the reach table stay on the author's word, as before.Review started (round 2/5) on
2d0fe8f34d— reading the diff now.repo: olympus/infra-silo · pr: #16 · head:
2d0fe8f· round: 2/5 · verdict: mergeRecommendation: merge
Merge in order:
olympus/workshop!39 first — see Merge condition below. The round-1 blocker is closed, and the paragraph now points at the record by number.Round 1, closed
2d0fe8freplaces the promise atdocs/runbooks/0003-the-state-in-the-store.md:332-342with the record named by number (:338-339). The record isolympus/workshop!39 ate2c478c:docs/adr/0012-…:5Accepted — 2026-11-04,:38-44"three shapes of key, not two" with the deploy key as apply minus the record's delete; its row atdocs/adr/index.md:25;0006:7-9a dated note and:41-44the count in the past tense, pointing at 0012. 0006 is amended, not silently rewritten — the index's new-file-for-a-reversal rule is kept.:340-342: "thesemaphorekey was minted from this file in the working tree, before the file reachedmain". It says what happened. The ordering survives inf1113d4's commit message; leaving history alone is the right call.access key: <withheld>and<access key id>in the audit line. I re-read the body through the API.key-auditbindssilo/.scripts/key-audit.sh:96-99globssilo/store/*-policy.jsonintofiles[];:178-184stops at the first canonical match, the name taking no part.Standards
Sources:
AGENTS.md(§Decisions, §Docs, §Privacy),docs/index.md:12,docs/agents/domain.md,docs/adr/0003,docs/adr/0009,GLOSSARY.md,workshop/AGENTS.md,workshop/docs/adr/{0006,0012,index.md}at !39's head, plus the smell baseline.S1 — ADVISORY (newly spotted this round) —
GLOSSARY.md(absent from the diff),docs/runbooks/0003-the-state-in-the-store.md:332docs/index.md:12sets the glossary's trigger: "A term is coined, or one drifts." This diff coins one —:332bolds Thedeployshape and defines it in place — andGLOSSARY.mdcarries no deploy entry, while it carriesthe plan-only key(GLOSSARY.md:162-168), which arrived with the plan shape in5fe2283(SL-12 … !10). That commit is this change's exact analogue: policy files, runbook rows, local ADR and glossary term in one change.It is an absence, not a false statement — nothing in the glossary now says anything wrong about a deploy, and the runbook defines the term where a reader meets it. That is why it is advice, and it is newly spotted on a re-review, so it could not block here whatever its weight. The trigger and the precedent are what I am pointing at, not a contradiction.
Clears with a
**the deploy key**entry in the plan key's shape.Checked, no finding
docs/adr/0010. 0009 exists because it answers local0003's Update when; the deploy shape answers org 0006's count, and 0012 answers it.docs/index.md's Decisions trigger is "a decision is made, superseded or overturned" — it was made in the org record. The author's reason for declining holds.*.mdat this head grepped: no surviving two-shape claim. And the delta's arithmetic: table rows 14, example + 13, plan rows 6, deploy row 1, gate 14 — all correct.:325,:327exactly 80); the only longer line is the table row, as every row of it is. No new relative link. No hostname or address in the diff or the body.Spec
Spec source: the PR description, which states the contract; SC-14 is linked from it. I could not fetch SC-14 —
/api/v1/tasks/265answers 401 for this profile, as in round 1 — norCP-17 §3. I reviewed against the description and the file.s3:DeleteObjecton the.tfstate":285,:332-342.scripts/key-audit.sh:96-99;make key-audit-testpasses.make checkpasses"2d0fe8f: pin and map agree, every env case holds,fmt-checkclean,tofu validate→ "Success! The configuration is valid."17 key(s) … 0 failingNo requirement missing, no scope creep, nothing implemented wrongly. The requirement the description itself names — the record — is delivered in !39 and is not counted twice.
Merge condition
olympus/workshop!39 must merge first.:338cites ADR-0012 by number; 0012 is not onworkshop'smainat this head, wheredocs/adr/0012-…is absent and 0006 still reads "two shapes and no third". Two facts the Operator should have:e2c478c, submitted 17:34 UTC). Its blocker isworkshop/GLOSSARY.md: the deploy key undefined there and the apply-key line missing the deletion 0012 describes. That is !39's to clear, not this PR's — but !39 will not land as it stands.:338names a record that does not exist and the runbook a reader is sent to for a mint carries a dead citation until !39 lands. Nothing else in the diff depends on it.Verified by hand
refs/pull/16/head=2d0fe8f…, equal to the dispatch. The prior review's commitf1113d4is an ancestor, so the round's delta isgit diff f1113d4 2d0fe8f— one file, 19 insertions, 17 deletions; the policy file is unchanged since round 1.mise exec -- make check→ rc 0, all five steps.mise exec -- make key-audit-test→ rc 0, "every case passed".semaphore-state-policy.json,semaphore-deploy-state-policy.json,semaphore-plan-state-policy.json(effect/actions/resources), statement by statement.scripts/key-audit.sh:96-99and:170-192for the scope and match rules.e2c478c— 0012, the index diff, 0006's diff — andworkshopmain'sdocs/adr/tree to confirm 0012 is not there yet.*.mdfor two-shape language; measured the added lines in characters; read5fe2283's file list and glossary hunk.Not verified
make key-auditagainst the running store and the GET/PUT/DELETE reach table. No root credential, and using one is the Operator's.17 key(s) / 16 audited / 1 out of scope / 0 failingstays on the author's word.:340-342states it and nothing here settles it.Summary
Standards: 1 finding — 0 BLOCKER, 1 ADVISORY (the coined term has no glossary entry;
docs/index.md:12's trigger and5fe2283's precedent both fire). Spec: 0 findings — every claim reproduced except the two that need the live store.Worst per axis: Standards — the glossary omission, advice. Spec — none.
No blocker stands, so the state follows the blockers: APPROVE. The advisory travels as advice, and the ordering above is a merge condition, not a defect in the diff.