The store half declares the other Stacks' state keys (SL-19) #18
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!18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hermes/sl19-declare-stacks-state-keys"
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?
SL-19 — Declare the other Stacks' state keys in infra-silo's store half.
What this changes
Every state key in runbook 0003 section 7's table except this Stack's own two is now a resource of the store half, applied with the provisioning key the way the application's credential already is. One file of declaration, one variable naming the set, and no policy file typed a second time: each key's inline policy is the
*-policy.jsonthe hand mint named, so what a key may reach is a diff insilo/store/and amake store.silo/store/state-keys.tf— oneminio_iam_service_accountper entry ofvar.state_keys:target_user = var.state_key_owner,namefrom the table's own names,policy = file(...),secret_key_woand its version fromvar.state_key_secrets, andprevent_destroy.silo/store/variables.tf— the 15-entry map, the owner, and the supplied-secret map with two validations (a name nothing declares; a Silo secret's length).silo/variables.tf,silo/main.tf,silo/outputs.tf— the secret map passed through, the access keys re-exported beside the application's.Makefile—validatecomparesvar.state_key_ownerwith thesilo_root_userthe service layer templates into/etc/default/silo: two copies of one name, compared credential-free, because a disagreement would plan a replacement of every declared key.Acceptance criteria
tofu plan -target=module.storeagainst an empty state in a copy with no backend readsPlan: 21 to add, 0 to change, 0 to destroy, 15 of them the declared keys. Nothing in it is a destroy or a replace.make store, thenmake store-plan.secret_key_wois write-only, nothing is supplied for an imported key, and the plan's per-resource output showssecret_key_wo = (write-only attribute)and no version on any of the fifteen. The live check is an apply followed by atofu show -jsonread — the Operator's.Evidence
mise exec -- make checkgreen:env-check,env-test,fmt-check,validate(which now carries the owner check).git status --porcelainempty aftermake fmt.state_key_secrets names a key that var.state_keys does not declare, andA Silo secret key is 8 to 40 characters; one of these is not.module.store.minio_iam_service_account.state_keyentry by its name plans that one resource, so the addresses in the runbook's loop are the map's own..envon this machine and a regular agent'smake envis refused by design. The import, the apply, the post-apply plan and the five other-repository plans are the Operator's, and the runbook names each.The one decision to overrule if you disagree
SL-19 says a user, a policy from that Stack's existing state policy, and a key. The keys that exist are service accounts of the store's own account (
silo-admin) with their policy inline, and a service account cannot change parent — the provider markstarget_userForceNew — so declaring them under a user of their own would replace each one: a new access key, a new secret, and every consumer's.envedited in step. That is the rotation the ticket forbids, so the declaration keeps the owner the keys were minted with, and ADR 0010 records why. The literal shape is a rotation of fifteen live keys across five repositories, not a change to this diff's structure; say so and I will scope it separately.Second:
tofu-plan-state-silostays out of the map too. The apply key must (the Stack runs the declaration with it), and the plan key's pair has no store path yet, so declaring it now would create it with no supplied secret and land the server's secret in the record — the one thing ADR 0005 refuses. It joinsvar.state_keysin the change that plans this repository's pull requests, where its mint belongs.Known nits, left deliberately
state keyis used throughout the docs and is still not a glossary entry; that predates this change.Review started (round 1/5) on
5bdf2dc09c— reading the diff now.olympus/infra-silo#18 · head5bdf2dc· round 1/5 (dispatch round 1/5) · base431309fRecommendation: fix
Spec source: SL-19 (Vikunja project 7, index 19) acceptance criteria, plus the PR body's own four criteria. This is round 1, so there are no prior findings to re-drive.
Spec
BLOCKER —
docs/runbooks/0003-the-state-in-the-store.md:392-405: the first-import loop imports nothing and exits 0.declaredis newline-separated (15 lines); the membership test at :400 iscase " $declared " in *" $name "*), which needs a space-separated list. Every key therefore takes*) continue, so the loop prints nothing, runs notofu import, and returns 0. Driven the page's block verbatim — extracted by marker from the page, a stubmclianswering the listing andinfoshapes the page uses, and atofushim loggingimportcalls — from the repo root:The same guard fires correctly once the list is space-joined (
MATCHfor all three probe names), so the defect is the join, not the idea.What it costs: the Operator sees a clean exit and moves to
make store-plan, which still reads 15 to add. The next step in the page ismake store— and that creates fifteen service accounts instead of adopting the live ones. No secret is supplied for any of them, so the provider records the server-generatedsecret_keyin the state (thesecret_key_wopath only blanks it when a value was supplied), which is exactly what ADR 0005 refuses and what criterion 4 ("no secret value is in the store half's state") forbids. The fifteen live keys stay undeclared. The change's central promise — the existing keys are brought under the declaration without being rotated — fails silently at the one step that implements it.Clearing it: space-join the list, e.g.
case " $(printf '%s ' $declared) " in *" $name "*), or replace thecasewithprintf '%s\n' "$declared" | grep -qxF -- "$name" || continue, then re-drive the block until it logs fifteen imports.ADVISORY —
docs/adr/0010-a-declared-state-key-keeps-the-owner-it-was-minted-with.md:4-15: the record misstates the population it governs.:4 says "eighteen of them across the fleet, one of which is not minted yet"; the set is seventeen (the fifteen in
var.state_keysplus this repo's apply and plan keys), andsilo/store/variables.tfdeclares the semaphore deploy key that :14-15 calls "not minted at all yet". That key is live:infra-secrets/docs/store-layout.md:91records it minted 2026-11-04, and runbook 0003:333 in this same diff says it was "minted from that file in the working tree before the file reachedmain". :12 then says the three keys the record "does not cover" include the semaphore deploy key, which the declaration does cover.ADVISORY —
README.md:133anddocs/runbooks/0003-the-state-in-the-store.md:444-447: the number of hand mints left is stated two ways.README says of the two root-credential steps that "they are the last that do". The runbook's own gate says "The two mints … are the whole of it … and this repository's plan key is a third". Three keys stay outside the declaration (apply, plan, and — per ADR 0010's intent — nothing else), so "the last" is one short.
ADVISORY —
silo/store/state-keys.tf:28-29withREADME.md:148-150: a key added without a secret lands a generated secret in the state, and the prose says it cannot.secret_key_wo/secret_key_wo_versionaretry(...)-nullable, so a new entry invar.state_keyswith novar.state_key_secretsentry is created with a server-generated secret, which the provider stores as the computedsecret_key. The runbook says so plainly ("a key created without one is recorded with the secret the server generated"); the README states the exclusion unconditionally ("they reach neither.envnor the state's plaintext"). Nothing in the configuration refuses that create — the validations cover only a name the map lacks and a secret's length.Standards
Standards source:
AGENTS.md(§Code comments,§Docs),docs/agents/workflow.md, and the neighbouring files in the change.ADVISORY —
docs/agents/workflow.md:63-67: the guard count is now stale."The Guest (
silo/guest/container.tf) and the store's bucket map (silo/store/buckets.tf) each carryprevent_destroy" — this change adds a third (silo/store/state-keys.tf:40-47) and updates 0001 §5 and 0003 §5 to say three, but leaves the Agent contract saying two. A teardown read off that page lifts two guards and is refused by the third.ADVISORY —
silo/store/.terraform.lock.hcl:5: a stray lock file that disagrees with the root's.The file pins
aminueza/minio3.46.0;silo/.terraform.lock.hcl:5pins 3.45.0. No Target initialisessilo/store(the store half is a module reached throughsilo/main.tf), so this is a byproduct of a localtofu initin that directory rather than a dependency the repo declares — and if anyone ever does init there, they get a different provider than every plan this repo runs.ADVISORY —
silo/store/state-keys.tf:1-22: twenty lines of comment over a fourteen-line resource.AGENTS.md:39keeps comments to a minimum and sends what code cannot carry todocs/. This header restates ADR 0010 and runbook 0003 §7 a third time. Judgement call, not a rule broken outright:silo/store/buckets.tfcarries a header of the same kind, so this is a trim toward the neighbour's length rather than a rewrite.What I verified
refs/pull/18/headfetched and resolved5bdf2dc…make checkgreenmise exec -- make checkon the head worktreeSuccess! The configuration is valid.tofu plan -target=module.storePlan: 21 to add, 0 to change, 0 to destroy; 15state_keyresources, allcreatetofu show -jsonon that plan, plus a plan with a supplied secretsecret_key_wonull,secret_key_wo_versionnull on all fifteen; supplied value appears 0 times in plan outputtofu plan -target='module.store.minio_iam_service_account.state_key["tofu-plan-state-openbao"]'1 to addmake validateowner checksilo_root_userdrift, variable block removed)silo-adminaminueza/miniov3.45.0 source:commonAddServiceAccount(denyOnly for the caller's own parent, no explicit deny) andNewServiceAccountsettingParentUserto the targettarget_userreads back assilo-admin, so no replacement is plannedWhat I could not verify
Nothing was run against the store at
10.12.0.150: there is no.envon this host and a regular agent'smake envis refused by design. So the live import, the apply, the post-apply plan, and the five consuming repositories' plans remain unproven here — as the PR body itself says. I also could not drive a real MinIO to settle the provisioning key's rights empirically; that finding rests on the provider and server source read at the pinned version.Summary
docs/agents/workflow.md.Acknowledged (round 1/5) — fixing now; what changed and how I verified it follows.
Round 1 addressed — head
8c20eeaTwo commits on
hermes/sl19-declare-stacks-state-keys, pushed as new commits; no force-push, no history rewrite, no new branch or PR.docs/runbooks/0003-the-state-in-the-store.md:392-405— the first-import loop imports nothing and exits 07d255b7docs/adr/0010-…:4-15— the record misstates the population it governs8c20eeaREADME.md:133and runbook 0003:444-447 — the number of hand mints is stated two ways8c20eeasilo/store/state-keys.tf:28-29withREADME.md:148-150— a key added without a secret lands a generated secret, and the prose says it cannot8c20eeadocs/agents/workflow.md:63-67— the guard count is stale8c20eeasilo/store/.terraform.lock.hcl:5— a stray lock file that disagrees with the root's8c20eeasilo/store/state-keys.tf:1-22— twenty lines of comment over a fourteen-line resource8c20eea1 — the blocker
declaredis one name per line; the test wascase " $declared " in *" $name "*), which needs spaces. Every key tookcontinue, the loop printed nothing, ran no import and returned 0. I took your second clearing —printf '%s\n' "$declared" | grep -qxF -- "$name" || continue— becausegrep -qxFis the idiommake validatealready uses for the bucket it compares against the same map, and it reads the list in the shape the list is in.Drive of the page's own block, extracted by marker from
docs/runbooks/0003-the-state-in-the-store.md, in a scratch tree holding the realsilo/store/variables.tf, a stubmclianswering the listing andinfoshapes, atofushim logging everyimport, and amiseshim. Eighteen keys listed: the fifteen declared names plus three that are not.The three undeclared keys are still skipped, so the guard is doing its job rather than being bypassed.
Verification
Ran what
AGENTS.mdnames, through the dependency manager:make checkleft the tree as it found it —fmt-checkreformatted nothing, andtofu initreused the root'ssilo/.terraform.lock.hcland installedaminueza/miniov3.45.0, so the deleted module-directory lock file was never the one any plan ran against.Read back at the pushed head rather than in my clone (
GET /repos/olympus/infra-silo/raw/<path>?ref=8c20eea) — present: the new membership line; absent: thecaseform,eighteen of,not minted at all yet.silo/store/.terraform.lock.hclanswers 404. PRhead.shareads8c20eea,mergeable: true.Width and the orphan test over the lines these two commits add: no added prose line over 80 characters, no break that would have fitted its next word.
Disagreed with, or left alone
None. All seven are addressed; nothing was argued and nothing is left standing.
One note on advisory 7: you called it a judgement call, not a rule broken, and I took the trim — the header now points at ADR 0010 and runbook 0003 §7 instead of restating them, which is what
AGENTS.md§Code comments asks for.What I could not verify
The live import, the post-import plan and the five consuming Stacks' plans are still the Operator's, exactly as the PR body says: there is no
.envon this host and a regular agent'smake envis refused by design. What is proved here is the block's behaviour against stubs — the same instrument your finding used — not the store's answer.Review started (round 2/5) on
8c20eeaac2— reading the diff now.olympus/infra-silo#18 · head8c20eea· round 2/5 (dispatch 2/5) · base431309fRecommendation: merge
Spec source: SL-19 (Vikunja project 7, index 19), read live this round — its four
acceptance criteria — plus the PR body's own four. Fixed point:
5bdf2dc, round 1'sreviewed head.
git merge-base --is-ancestor 5bdf2dc 8c20eeais true, so the fix stackedand this round's delta is
git diff 5bdf2dc 8c20eea— six files, two commits (7d255b7,8c20eea). One reviewer held both axes in this pass; the separation lives in the headings.Round 1 — each finding driven
docs/runbooks/0003-the-state-in-the-store.md:392-405— the first-import loop imports nothing and exits 07d255b7· now:400docs/adr/0010-…:4-15— the record misstates the population it governs8c20eea·:4-5,:12README.md:133+ runbook 0003:444-447 — the number of hand mints stated two ways8c20eea·README.md:132-135silo/store/state-keys.tf:28-29+README.md:148-150— a key added without a secret lands a generated secret, and the prose says it cannot8c20eea·README.md:154-157docs/agents/workflow.md:63-67— the guard count is stale8c20eea·:60-650001:157and0003:236agree on threesilo/store/.terraform.lock.hcl:5— a stray lock file that disagrees with the root's8c20eeasilo/store/state-keys.tf:1-22— twenty lines of comment over a fourteen-line resource8c20eeabuckets.tf's 91 — the blocker, as a red/green pair
The page's block was extracted by marker from
docs/runbooks/0003-the-state-in-the-store.mdat each revision and driven from a tree holding that revision's own
silo/store/variables.tf,a stub
mclianswering the listing andinfoshapes the block uses (eighteen rows: thefifteen declared names plus three nothing declares), a
tofushim logging everyimport,and a
miseshim:The three undeclared rows are still skipped, so the guard is doing its job rather than being
bypassed. The fix is
printf '%s\n' "$declared" | grep -qxF -- "$name" || continueat:400— the list is newline-separated, and
-xreads it in the shape it is in.Spec
ADVISORY —
docs/adr/0010-a-declared-state-key-keeps-the-owner-it-was-minted-with.md:4-5with
:12: the record now claims a fleet population the sibling layout contradicts — and thisis the earlier round's error, not the author's.
At head the record reads a key per record per shape, seventeen of them across the fleet, every
one of them minted, and
:12narrows the uncovered set to this Stack's own apply key and plankey.
infra-secretsdocs/store-layout.mdatorigin/main, read this round, says otherwise::72heads that section eighteen paths;:92recordssecret/tofu-state/semaphore-runner/deploy— the deploy key for the Semaphore runner's Guest Stack — as not minted; and
:95says TheOperator mints the runner's and writes it here. So the fleet carries a key-shaped path that is
neither minted nor declared here, and the record now reads as though nothing in it is outstanding.
Round 1 charged this record with the opposite: that eighteen … one of which is not minted yet
and the Semaphore runner's deploy key, which is not minted at all yet were wrong, because
tofu-deploy-state-semaphoreis live (store-layout.md:91). Those are two different keys —:91is the semaphore deploy key this change does declare,
:92is the runner's — and the ADR'ssentences at
5bdf2dcwere right. The fix took the charge and replaced a correct count with onethat silently drops the outstanding key. That is the reviewer's error, recorded here so the
author is not billed for it twice.
Clearing, one clause: add and the Semaphore runner's deploy key, the eighteenth, which is not
minted yet — or restore the earlier sentence. Either keeps
:12's the two it does not coverhonest.
ADVISORY —
README.md:157: the pointer(§4)sends the reader to a section that does notcarry the case it names.
The added sentence is right — an entry added to the map without a secret is created and the
server's generated one is what the record keeps — and the runbook says it at
:422, under### Adding, rotating, removing oneinside §7 (:419). §4 is## 4. Rotating the key(
:151), which covers this Stack's own key and says nothing about an added entry or a generatedsecret;
0002-store-contents.md§4 isTearing the layer down, for the other reading of anunqualified §4. Clearing:
(§7).Standards
No new findings on this axis; all three round-1 standards advisories are cleared (rows 5–7
above). The delta adds no code —
silo/store/state-keys.tf's change is comment-only, verifiedline by line — and the repository's rules (
AGENTS.md§Code comments, §Docs, §Secrets) hold:the trimmed header now points at ADR 0010 and §7 rather than restating them, every relative
link added by the change resolves, and nothing secret appears in the diff —
state_key_secretsis
sensitive, and the rotation example carries a placeholder.What I verified
refs/pull/18/headfetched and resolved8c20eea…merge-base --is-ancestor 5bdf2dc 8c20eea,git diff --name-statusmake checkgreen at headmise exec -- make checkin a detached head worktreeSuccess! The configuration is valid.;git status --porcelainempty aftersilo/.terraform.lock.hclread; the check's own init lineaminueza/miniov3.45.0 reused;silo/store/.terraform.lock.hclabsent at headpolicy =invar.state_keysresolved undersilo/store/git diff 5bdf2dc 8c20eea -- silo/store/state-keys.tf21 to add, 15 state keys) carries unchangedgrep prevent_destroy silo/; the three pages0001:157,0003:236,workflow.md:60-65all say three (workflow.md:191's two guards is the two test suites, unrelated)What I could not verify
10.12.0.150:9000answers 200 to/minio/health/livefrom this host, but there is no.envhere (neither the head worktreenor the standing clone carries one, and
AGENTS.md§Secrets refuses an agent'smake env).So the import, the apply, the post-apply plan and the five consuming Stacks' plans remain the
Operator's, exactly as the body says.
infra-secrets'docs/store-layout.mdatorigin/main— a record read this round, not thestore's own listing.
Summary
inverted from right to wrong on the previous round's mistaken charge.
mergeand the stateis an approval. Nothing here needs to hold the change: the blocker is cleared and driven, and
both advisories are one-clause edits to two sentences.