Declare the Semaphore projects Stack's state keys (SL-24) #23

Merged
pit merged 1 commit from hermes/sl24-semaphore-projects-state-keys into main 2026-11-07 14:05:39 +00:00
Owner

Summary

Declares the semaphore/projects record's two state keys, in the shape the runner's keys got (CP-42). infra-cockpit's CP-43 Stack keeps its state at prod/semaphore-projects.tfstate; before this, that record had no keys.

 silo/store/
 ├── semaphore-projects-deploy-state-policy.json   # + Get/Put on the record, Get/Put/Delete on its .tflock, ListBucket
 ├── semaphore-projects-plan-state-policy.json     # + Get on the record, Get/Put/Delete on its .tflock, ListBucket
 └── variables.tf                                  # + tofu-deploy-semaphore-projects, + tofu-plan-semaphore-projects

Docs that count or list the keys move with them: runbook 0003 §7 (two table rows, nine Stacks, twenty-one declared), README, ADR 0010, runbook 0001.

Evidence

  • make check exits 0 on this branch (env-check, env-test, key-audit-test, key-mint-test, fmt-check, validate); fmt leaves the tree clean.
  • Minted, both keys, make key-mint with the policy embedded at creation and imported into the declaration: spd6c519d4d / sppca093ef5.
  • make store-plan: Plan: 0 to add, 2 to change, 0 to destroy — no create left for either key.
  • make key-audit: 25 key(s) under silo/, 24 audited, 1 out of scope, 0 failing, with both new keys ok.
  • Reach: each key lists tfstate/prod/, reads its own (absent) record (Object does not exist, not a denial), and is refused on prod/semaphore.tfstate and prod/openbao.tfstate — Insufficient permissions. The plan key's write to its own record is refused too.
  • Store paths: secret/tofu-state/semaphore-projects/deploy reads back PROJECTS_STATE_AWS_ACCESS_KEY_ID, PROJECTS_STATE_AWS_SECRET_ACCESS_KEY; .../plan reads back AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY.
  • olympus/infra-cockpit secrets: COCKPIT_PROJECTS_PLAN_STATE_ACCESS_KEY_ID and COCKPIT_PROJECTS_PLAN_STATE_SECRET_ACCESS_KEY written (201) and listed back.

SL-24

Merge Danger

Door: two-way — the merge writes nothing to PROD; it lands a declaration and two policy files.

Blast Radius: store

Two things a reader should know:

  • Until this merges, a make store from main plans two destroys. The keys are minted and in the store's state already, so main's map knows nothing of them; the plan reads 2 to destroy and the prevent_destroy guard refuses it. Merging closes that window, so it should not sit long.
  • Two in-place updates are already in the plan and are not this change's: tofu-deploy-state-tracker-guest and tofu-deploy-state-tracker-edge each plan secret_key_wo_version -> null. Both were minted before make key-mint existed (SC-15); applying that update would send no secret, so it is a decision of its own and is left alone here.
## Summary Declares the `semaphore/projects` record's two state keys, in the shape the runner's keys got (CP-42). `infra-cockpit`'s CP-43 Stack keeps its state at `prod/semaphore-projects.tfstate`; before this, that record had no keys. ```diff silo/store/ ├── semaphore-projects-deploy-state-policy.json # + Get/Put on the record, Get/Put/Delete on its .tflock, ListBucket ├── semaphore-projects-plan-state-policy.json # + Get on the record, Get/Put/Delete on its .tflock, ListBucket └── variables.tf # + tofu-deploy-semaphore-projects, + tofu-plan-semaphore-projects ``` Docs that count or list the keys move with them: runbook 0003 §7 (two table rows, nine Stacks, twenty-one declared), README, ADR 0010, runbook 0001. ## Evidence - **`make check`** exits 0 on this branch (`env-check`, `env-test`, `key-audit-test`, `key-mint-test`, `fmt-check`, `validate`); `fmt` leaves the tree clean. - **Minted, both keys**, `make key-mint` with the policy embedded at creation and imported into the declaration: `spd6c519d4d` / `sppca093ef5`. - **`make store-plan`:** `Plan: 0 to add, 2 to change, 0 to destroy` — no create left for either key. - **`make key-audit`:** `25 key(s) under silo/, 24 audited, 1 out of scope, 0 failing`, with both new keys `ok`. - **Reach:** each key lists `tfstate/prod/`, reads its own (absent) record (`Object does not exist`, not a denial), and is refused on `prod/semaphore.tfstate` and `prod/openbao.tfstate` — `Insufficient permissions`. The plan key's write to its own record is refused too. - **Store paths:** `secret/tofu-state/semaphore-projects/deploy` reads back `PROJECTS_STATE_AWS_ACCESS_KEY_ID`, `PROJECTS_STATE_AWS_SECRET_ACCESS_KEY`; `.../plan` reads back `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`. - **`olympus/infra-cockpit` secrets:** `COCKPIT_PROJECTS_PLAN_STATE_ACCESS_KEY_ID` and `COCKPIT_PROJECTS_PLAN_STATE_SECRET_ACCESS_KEY` written (`201`) and listed back. SL-24 ## Merge Danger **Door:** two-way — the merge writes nothing to PROD; it lands a declaration and two policy files. **Blast Radius:** store Two things a reader should know: - **Until this merges, a `make store` from `main` plans two destroys.** The keys are minted and in the store's state already, so `main`'s map knows nothing of them; the plan reads `2 to destroy` and the `prevent_destroy` guard refuses it. Merging closes that window, so it should not sit long. - **Two in-place updates are already in the plan and are not this change's:** `tofu-deploy-state-tracker-guest` and `tofu-deploy-state-tracker-edge` each plan `secret_key_wo_version -> null`. Both were minted before `make key-mint` existed (SC-15); applying that update would send no secret, so it is a decision of its own and is left alone here.
Declare the Semaphore projects Stack's state keys (SL-24)
All checks were successful
pr-checks / check (pull_request) Successful in 23s
af7b73bf11
Member

Review started (round 1/5) on af7b73bf11 — reading the diff now.

**Review started** (round 1/5) on af7b73bf1124c9d32cc42fa29d54f91a90325e96 — reading the diff now.
bot-minos approved these changes 2026-11-07 11:09:40 +00:00
bot-minos left a comment

repo: olympus/infra-silo · pr: #23 · head: af7b73bf11 · round: 1/5 · verdict: merge

Recommendation: merge

Spec (SL-24) is met in full; one advisory on the docs axis, nothing blocking.

Standards

Source of the standard: AGENTS.md (Secrets, Privacy, Code comments, Docs), docs/agents/workflow.md, docs/index.md.

# Severity Where Finding
S1 ADVISORY docs/runbooks/0003-the-state-in-the-store.md:287 "once seven more records live under that prefix" — §7's own table (lines 295–316) now lists nine records besides prod/silo.tfstate. Already stale on main (eight), so not introduced here, but §7 is the section this PR rewrites and every other count in it moves: Eight→Nine Stacks (259), nineteen→twenty-one declared (263), twenty rows→twenty-two (312–313), four→five deploy rows (342), and runbook 0001:170. One word: seven → nine.

No documented-standard breach: no secret or address in the diff (AGENTS.md §Secrets, §Privacy); the three-line comment at silo/store/variables.tf:86-88 follows the per-group comments the same map already carries for forge, tracker, cockpit and the runner, so it is not the comment rule's target; every relative link in the four changed markdown files resolves; tofu fmt -check clean.

Spec

Spec: Vikunja SL-24 ("Declare and mint the Semaphore projects Stack's state keys"), read through docs/agents/issue-tracker.md. PR body names the task (SL-24), so the reference resolves.

Requirement (SL-24) Implementation
Deploy key tofu-deploy-semaphore-projects, new policy, runner-deploy shape, never deletes the record silo/store/variables.tf:89, silo/store/semaphore-projects-deploy-state-policy.json — byte-identical to semaphore-runner-deploy-state-policy.json once the record name is normalised; GetObject/PutObject at the record, DeleteObject only on the .tflock
Plan key tofu-plan-semaphore-projects, runner-plan shape variables.tf:90, silo/store/semaphore-projects-plan-state-policy.json — identical to the runner's plan policy modulo the name; the two files differ from each other only in the record's PutObject
32-character cap tofu-deploy-semaphore-projects is 30, tofu-plan-semaphore-projects 28, and the rejected tofu-plan-state-semaphore-projects is 34 as stated
Both in var.state_keys beside the runner's variables.tf:86-90, immediately after the runner block
Store paths secret/tofu-state/semaphore-projects/{deploy,plan} with PROJECTS_STATE_* names scripts/key-mint.sh:99-107 derives record and shape from the policy filename → exactly those two paths; the field names are the ones infra-cockpit's CP-43 env.map row reads
cockpit's COCKPIT_PROJECTS_PLAN_STATE_{ACCESS_KEY_ID,SECRET_ACCESS_KEY} infra-cockpit@hermes/cp43-semaphore-projects:.forgejo/workflows/plan.yml:101-102 names both exactly
Docs that count or list the keys move with them README:136-146 (semaphore seven, 6+6+7+2=21); §7:259-263 (nine Stacks, 21 declared); table 312-313 (22 rows = 21 declared + this repo's plan key); §7:342 (five deploy-shaped rows); runbook 0001:170 (21 guards on the map); ADR 0010:5-7 (23 fleet, 21 declared, 19 hand-minted)

No scope creep: the file set is exactly the one the two CP-42 PRs (!21, !22) touched for the same shape of change.

Count audit, all recounted by hand: map 19→21 entries, table 20→22 rows, policy files 22→24, 6+6+7+2=21 in the README, nine Stacks, five deploy rows. ADR 0010's nineteen minted by hand is correct and repairs an off-by-one main carried (c88d16a said twenty while both CP-42 keys had been minted through make key-mint, not at a console).

Verified by hand

  • mise exec -- make check → exit 0: env-check (pin + 8-name map), env-test, key-audit-test (all cases), key-mint-test (all cases), tofu fmt -check -recursive, tofu validate ("Success! The configuration is valid").
  • Both policy files parse as JSON; both are the named precedent's file with the record name substituted — checked with diff after normalising the name, output IDENTICAL.
  • key-mint's derivation run over the two new filenames yields secret/tofu-state/semaphore-projects/deploy and .../plan.
  • Every relative link in README and the three changed docs resolves; no new IP, hostname or credential in the diff.
  • infra-cockpit's CP-43 branch carries no terraform_remote_state or second-record read, so one record per key is sufficient (the ticket's "refused on prod/semaphore.tfstate" criterion has nothing to contradict it).

Not verified — needs the store's root credential

CI is make check and nothing else (docs/agents/workflow.md, What nothing here checks), so these stay the PR's claims and the Operator's to confirm:

  • the two mints (spd6c519d4d, sppca093ef5) and that each holds its policy embedded rather than implied;
  • make key-audit → 25 key(s) under silo/, 24 audited, 1 out of scope, 0 failing (arithmetically consistent with !19's 21/20/1/0 plus four mints since);
  • make store-plan → 0 to add, 2 to change, 0 to destroy, and that the two changes are the tracker keys' secret_key_wo_version;
  • the reach tests and the two store paths' read-back, and the two repository secrets on olympus/infra-cockpit.

The Merge Danger note is accurate as far as the tree shows: the keys sit in the shared state, so main plans two destroys until this lands, and prevent_destroy on silo/store/state-keys.tf:28-30 refuses them.

Summary

  • Standards: 1 finding, 0 blockers. Worst: S1 — a stale record count one paragraph below the counts this PR corrects (advisory).
  • Spec: 0 findings. Every acceptance criterion has its implementation in the diff; the live ones are named above as unverified.
repo: olympus/infra-silo · pr: #23 · head: af7b73bf1124c9d32cc42fa29d54f91a90325e96 · round: 1/5 · verdict: merge Recommendation: merge Spec (SL-24) is met in full; one advisory on the docs axis, nothing blocking. ## Standards Source of the standard: `AGENTS.md` (Secrets, Privacy, Code comments, Docs), `docs/agents/workflow.md`, `docs/index.md`. | # | Severity | Where | Finding | | --- | --- | --- | --- | | S1 | ADVISORY | `docs/runbooks/0003-the-state-in-the-store.md:287` | "once **seven** more records live under that prefix" — §7's own table (lines 295–316) now lists **nine** records besides `prod/silo.tfstate`. Already stale on `main` (eight), so not introduced here, but §7 is the section this PR rewrites and every other count in it moves: `Eight`→`Nine` Stacks (259), nineteen→twenty-one declared (263), twenty rows→twenty-two (312–313), four→five deploy rows (342), and runbook 0001:170. One word: `seven` → `nine`. | No documented-standard breach: no secret or address in the diff (`AGENTS.md` §Secrets, §Privacy); the three-line comment at `silo/store/variables.tf:86-88` follows the per-group comments the same map already carries for forge, tracker, cockpit and the runner, so it is not the comment rule's target; every relative link in the four changed markdown files resolves; `tofu fmt -check` clean. ## Spec Spec: Vikunja SL-24 ("Declare and mint the Semaphore projects Stack's state keys"), read through `docs/agents/issue-tracker.md`. PR body names the task (`SL-24`), so the reference resolves. | Requirement (SL-24) | Implementation | | --- | --- | | Deploy key `tofu-deploy-semaphore-projects`, new policy, runner-deploy shape, never deletes the record | `silo/store/variables.tf:89`, `silo/store/semaphore-projects-deploy-state-policy.json` — byte-identical to `semaphore-runner-deploy-state-policy.json` once the record name is normalised; `GetObject`/`PutObject` at the record, `DeleteObject` only on the `.tflock` | | Plan key `tofu-plan-semaphore-projects`, runner-plan shape | `variables.tf:90`, `silo/store/semaphore-projects-plan-state-policy.json` — identical to the runner's plan policy modulo the name; the two files differ from each other only in the record's `PutObject` | | 32-character cap | `tofu-deploy-semaphore-projects` is 30, `tofu-plan-semaphore-projects` 28, and the rejected `tofu-plan-state-semaphore-projects` is 34 as stated | | Both in `var.state_keys` beside the runner's | `variables.tf:86-90`, immediately after the runner block | | Store paths `secret/tofu-state/semaphore-projects/{deploy,plan}` with `PROJECTS_STATE_*` names | `scripts/key-mint.sh:99-107` derives record and shape from the policy filename → exactly those two paths; the field names are the ones `infra-cockpit`'s CP-43 `env.map` row reads | | cockpit's `COCKPIT_PROJECTS_PLAN_STATE_{ACCESS_KEY_ID,SECRET_ACCESS_KEY}` | `infra-cockpit@hermes/cp43-semaphore-projects:.forgejo/workflows/plan.yml:101-102` names both exactly | | Docs that count or list the keys move with them | README:136-146 (semaphore seven, 6+6+7+2=21); §7:259-263 (nine Stacks, 21 declared); table 312-313 (22 rows = 21 declared + this repo's plan key); §7:342 (five deploy-shaped rows); runbook 0001:170 (21 guards on the map); ADR 0010:5-7 (23 fleet, 21 declared, 19 hand-minted) | No scope creep: the file set is exactly the one the two CP-42 PRs (!21, !22) touched for the same shape of change. Count audit, all recounted by hand: map 19→21 entries, table 20→22 rows, policy files 22→24, `6+6+7+2=21` in the README, nine Stacks, five deploy rows. ADR 0010's `nineteen minted by hand` is correct and repairs an off-by-one `main` carried (`c88d16a` said twenty while both CP-42 keys had been minted through `make key-mint`, not at a console). ## Verified by hand - `mise exec -- make check` → **exit 0**: `env-check` (pin + 8-name map), `env-test`, `key-audit-test` (all cases), `key-mint-test` (all cases), `tofu fmt -check -recursive`, `tofu validate` ("Success! The configuration is valid"). - Both policy files parse as JSON; both are the named precedent's file with the record name substituted — checked with `diff` after normalising the name, output `IDENTICAL`. - `key-mint`'s derivation run over the two new filenames yields `secret/tofu-state/semaphore-projects/deploy` and `.../plan`. - Every relative link in README and the three changed docs resolves; no new IP, hostname or credential in the diff. - `infra-cockpit`'s CP-43 branch carries no `terraform_remote_state` or second-record read, so one record per key is sufficient (the ticket's "refused on `prod/semaphore.tfstate`" criterion has nothing to contradict it). ## Not verified — needs the store's root credential CI is `make check` and nothing else (`docs/agents/workflow.md`, *What nothing here checks*), so these stay the PR's claims and the Operator's to confirm: - the two mints (`spd6c519d4d`, `sppca093ef5`) and that each holds its policy embedded rather than implied; - `make key-audit` → `25 key(s) under silo/, 24 audited, 1 out of scope, 0 failing` (arithmetically consistent with !19's `21/20/1/0` plus four mints since); - `make store-plan` → `0 to add, 2 to change, 0 to destroy`, and that the two `change`s are the tracker keys' `secret_key_wo_version`; - the reach tests and the two store paths' read-back, and the two repository secrets on `olympus/infra-cockpit`. The Merge Danger note is accurate as far as the tree shows: the keys sit in the shared state, so `main` plans two destroys until this lands, and `prevent_destroy` on `silo/store/state-keys.tf:28-30` refuses them. ## Summary - **Standards:** 1 finding, 0 blockers. Worst: S1 — a stale record count one paragraph below the counts this PR corrects (advisory). - **Spec:** 0 findings. Every acceptance criterion has its implementation in the diff; the live ones are named above as unverified.
pit merged commit f8b529ed4f into main 2026-11-07 14:05:39 +00:00
pit deleted branch hermes/sl24-semaphore-projects-state-keys 2026-11-07 14:05:39 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
olympus/infra-silo!23
No description provided.