make key-mint drops a removed key's state entry before the mint (SL-23) #24

Merged
pit merged 2 commits from hermes/23-stale-key-state into main 2026-11-09 12:48:19 +00:00
Owner

Addresses SL-23: make store-plan shows two updates on the tracker deploy keys.

Summary

The cause, measured and recorded on SL-23: SC-15's two deploy keys were created by make store, which wrote secret_key_wo_version = 1 into their state entries. They were then removed and re-created by hand under the same access keys, and the old entries stayed. The provider's read never clears that field, so make store-plan reads 2 to change, each one secret_key_wo_version -> null. The 19 keys that were imported hold null and plan clean.

make key-mint left the same diff on the path its own refusal recommends: remove an implied key, then run the mint again with the same pair. On that second run the address was already in the state, so it imported nothing.

 key-mint.sh
   info <access key>
     exists  -> refuse if wrong name / implied, else adopt
     absent
+      init
+      if state holds the address    # a removed key's entry
+        state rm <address>
       accesskey create --policy <file> ...
   init
   if state holds the address -> "already in the state"
   else import <address> <access key>
+  if dropped -> "re-adopted ..."

The stale entry is dropped before the create, so a run that stops at any point leaves nothing behind for the re-run to miss. Dropping it after the create would leave it in place if the run died between the two steps, because the re-run then sees the key as existing.

Runbook 0003 §7 gets one paragraph on this, with the commands for a key re-created by hand outside the Target: state rm, import, store-plan.

Evidence

  • Before: with main's scripts/key-mint.sh, the new recreated case in scripts/tests/key-mint.test.sh fails 5 checks: no state rm, no import, no re-adopted line, and both order checks fail (key-mint-test: 5 case(s) failed).
    After: mise exec -- make key-mint-test prints key-mint-test: every case passed. That includes:
    • the entry is dropped before the key is minted
    • and the key is minted before it is imported
    • an entry for a key the store holds is kept
    • a mint with no entry in the state drops nothing
  • mise exec -- make check exits 0: env-test, key-audit-test and key-mint-test all pass, and validate prints Success! The configuration is valid. make fmt leaves git status --porcelain empty.
  • Live, read-only: make store-plan on main reads Plan: 0 to add, 2 to change, 0 to destroy on the two tofu-deploy-state-tracker-* addresses. Nothing else changes.

Not in this PR: the live fix for those two entries (state backup, state rm and import of both, then make store-plan to No changes, make key-audit, and both deploy pairs checked against their record and the two records they must be refused on). That needs the Operator's go-ahead and runs after review. Its results go on SL-23.

Merge Danger

Door: two-way. A revert restores the old import logic; no state or store is touched by the merge.

Blast Radius: make key-mint.

The Target can now run tofu state rm on its own. It does so only when the store says it has no key under the supplied access key while the state still has the address. A transient info failure would also take that path. The create then fails too, and the re-run imports the key again. The merge itself changes nothing on PROD: key-mint is the Operator's Target and runs only when called.

Addresses SL-23: `make store-plan` shows two updates on the tracker deploy keys. ## Summary The cause, measured and recorded on SL-23: SC-15's two deploy keys were created by `make store`, which wrote `secret_key_wo_version = 1` into their state entries. They were then removed and re-created by hand under the same access keys, and the old entries stayed. The provider's read never clears that field, so `make store-plan` reads `2 to change`, each one `secret_key_wo_version -> null`. The 19 keys that were imported hold null and plan clean. `make key-mint` left the same diff on the path its own refusal recommends: remove an implied key, then run the mint again with the same pair. On that second run the address was already in the state, so it imported nothing. ```diff key-mint.sh info <access key> exists -> refuse if wrong name / implied, else adopt absent + init + if state holds the address # a removed key's entry + state rm <address> accesskey create --policy <file> ... init if state holds the address -> "already in the state" else import <address> <access key> + if dropped -> "re-adopted ..." ``` The stale entry is dropped *before* the create, so a run that stops at any point leaves nothing behind for the re-run to miss. Dropping it after the create would leave it in place if the run died between the two steps, because the re-run then sees the key as existing. Runbook 0003 §7 gets one paragraph on this, with the commands for a key re-created by hand outside the Target: `state rm`, `import`, `store-plan`. ## Evidence - **Before:** with `main`'s `scripts/key-mint.sh`, the new `recreated` case in `scripts/tests/key-mint.test.sh` fails 5 checks: no `state rm`, no import, no `re-adopted` line, and both order checks fail (`key-mint-test: 5 case(s) failed`). **After:** `mise exec -- make key-mint-test` prints `key-mint-test: every case passed`. That includes: - `the entry is dropped before the key is minted` - `and the key is minted before it is imported` - `an entry for a key the store holds is kept` - `a mint with no entry in the state drops nothing` - `mise exec -- make check` exits 0: env-test, key-audit-test and key-mint-test all pass, and validate prints `Success! The configuration is valid.` `make fmt` leaves `git status --porcelain` empty. - Live, read-only: `make store-plan` on `main` reads `Plan: 0 to add, 2 to change, 0 to destroy` on the two `tofu-deploy-state-tracker-*` addresses. Nothing else changes. **Not in this PR:** the live fix for those two entries (state backup, `state rm` and `import` of both, then `make store-plan` to No changes, `make key-audit`, and both deploy pairs checked against their record and the two records they must be refused on). That needs the Operator's go-ahead and runs after review. Its results go on SL-23. ## Merge Danger **Door:** two-way. A revert restores the old import logic; no state or store is touched by the merge. **Blast Radius:** `make key-mint`. The Target can now run `tofu state rm` on its own. It does so only when the store says it has no key under the supplied access key while the state still has the address. A transient `info` failure would also take that path. The create then fails too, and the re-run imports the key again. The merge itself changes nothing on PROD: `key-mint` is the Operator's Target and runs only when called.
Member

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

**Review started** (round 1/5) on cf535f59ac5ecabd023a1d18f7e81cb8417f7d77 — reading the diff now.
bot-minos approved these changes 2026-11-09 12:03:08 +00:00
Dismissed
bot-minos left a comment

repo olympus/infra-silo · PR #24 · head cf535f59ac · round 1/5 (the thread carries no earlier review; the dispatch also said 1/5) · verdict: merge

Recommendation: merge

Spec source. The PR body (it names SL-23). I tried to read the ticket itself: fetch-vikunja-task.sh 7 23 answered list http=401 — missing, malformed, expired or otherwise invalid token provided — so the SL-23 acceptance criteria were not read. The body's stated behaviour is the contract here: make key-mint drops a removed key's state entry before the mint, imports after, prints re-adopted, and runbook 0003 §7 gains the by-hand commands. Its live-fix half is declared out of this PR.
Standards source. AGENTS.md (§Code comments, §Toolchain, §Pull requests, §Docs), docs/agents/workflow.md. Org ADRs in olympus/workshop were not needed: nothing here touches who approves, credentials, or protected main.

Delta: the whole PR, f8b529e..cf535f5 (3 files, +78/-27); base is current main.

Standards

No BLOCKER, no ADVISORY.

  • §Pull requests (AGENTS.md): the body names SL-23. Met.
  • §Toolchain: mise exec -- make check at head exits 0 (env-test, key-audit-test, key-mint-test, fmt-check, validate: "Success! The configuration is valid."). Forge CI run on cf535f5: success.
  • Smell baseline: nothing worth a finding. expect_order replaces a hand-rolled create/import order check and is reused for the new case, so it removes duplication rather than adding it.

Spec

1. ADVISORY — scripts/key-mint.sh:119-134: the state entry is dropped on an inferred "removed", never read.
The else branch runs on any non-zero info (stderr is sent to /dev/null at :119), and the drop at :132-134 tests only that the address is in the state. The comment at :129 and the runbook (docs/runbooks/0003-the-state-in-the-store.md:449-459) both say the entry belongs to "a key the store no longer holds"; the code never looks at the entry's own access key. I drove it: stub store where the key is live and in the state, info times out. Result: state rm ran, accesskey create was refused ("key already exists"), exit 1, and the state no longer held the address. The error line says nothing about the dropped entry. The re-run (store answering) went through exists → import and restored the entry (rc=0 held=yes). So it is recoverable and the PR body discloses the transient-info path — hence not a blocker.
Smallest improvement: tell a "no such key" answer from any other info failure before the state rm, or print a line when a run that dropped an entry then fails. Read from the code, not driven: the same inference covers a run with a different access key than the entry holds — the entry for the still-live old key would be dropped and the new key imported in its place.

Confirmed against the claims (all reproduced by my hand, scripts and outputs in cache/scratch/silo-24-r1/):

Claim Result
make key-mint-test passes at head every case passed (84 ok lines)
make check exits 0 yes
base key-mint.sh + head test fails 5 checks key-mint-test: 5 case(s) failed — the five the body lists (no state rm, no import, no re-adopted, both order checks)
head script + base test passes, so no existing case was weakened
the new recreated case can fail mutants of the script, each run against the head test: delete the state rm → 4 reds; state rm moved after the create → 1 red (the order check); state rm unconditional → 1 red (a mint with no entry in the state drops nothing); state rm before the info check → 3 reds (an entry for a key the store holds is kept among them); drop the re-adopted print → 1 red; delete the import → 6 reds. No mutant survived.
rm-before-create ordering protects a part-way run read from the code, not driven: the init/state rm now run before the create (:131-135 vs :138), so a failing init aborts before anything is minted; on main the only init sat after the create
second run is a no-op the new case an entry for a key the store holds is kept (mutant rm-always-first turns it red); the recovery re-run above also ends in exists
runbook: bucket versioning keeps the pre-rm state silo/store/variables.tf declares tfstate with versioning = true
runbook commands use the same address and import id as key-mint.sh:116 / :157 yes

Named, not charged

  • The live fix for SC-15's two deploy keys and the make store-plan reading 2 to change on main: the body declares it out of this PR; not reproduced (needs the store's credential).
  • The provider claim ("the read never touches secret_key_wo_version; an import sets it null") is the body's own measurement on SL-23, which I could not read; it is consistent with the comment at silo/store/state-keys.tf ("an imported key sends nothing"). Unverified by me.
  • The new 2-line comment at scripts/key-mint.sh:129-130 is within the file's existing comment density; AGENTS.md §Code comments asks for a minimum, and I did not count it.

Summary

Axis Findings Worst
Standards 0 none
Spec 1 (ADVISORY) the drop is inferred from a bare non-zero info, not read from the entry (scripts/key-mint.sh:119-134)

0 BLOCKER, 1 ADVISORY. State follows blockers only: APPROVED; label review/merge-ready. Merge-time danger the body already names (the Target can now state rm by itself) is two-way and bounded by the re-run recovery I drove above.

<!-- minos review-loop: repo=olympus/infra-silo pr=24 head=cf535f59ac5ecabd023a1d18f7e81cb8417f7d77 round=1/5 axes=standards,spec --> repo olympus/infra-silo · PR #24 · head cf535f59ac5ecabd023a1d18f7e81cb8417f7d77 · round 1/5 (the thread carries no earlier review; the dispatch also said 1/5) · verdict: merge Recommendation: merge **Spec source.** The PR body (it names SL-23). I tried to read the ticket itself: `fetch-vikunja-task.sh 7 23` answered `list http=401` — `missing, malformed, expired or otherwise invalid token provided` — so the SL-23 acceptance criteria were **not read**. The body's stated behaviour is the contract here: `make key-mint` drops a removed key's state entry before the mint, imports after, prints `re-adopted`, and runbook 0003 §7 gains the by-hand commands. Its live-fix half is declared out of this PR. **Standards source.** `AGENTS.md` (§Code comments, §Toolchain, §Pull requests, §Docs), `docs/agents/workflow.md`. Org ADRs in `olympus/workshop` were not needed: nothing here touches who approves, credentials, or protected `main`. Delta: the whole PR, `f8b529e..cf535f5` (3 files, +78/-27); base is current `main`. ## Standards No BLOCKER, no ADVISORY. - §Pull requests (`AGENTS.md`): the body names `SL-23`. Met. - §Toolchain: `mise exec -- make check` at head exits 0 (env-test, key-audit-test, key-mint-test, fmt-check, validate: "Success! The configuration is valid."). Forge CI run on cf535f5: success. - Smell baseline: nothing worth a finding. `expect_order` replaces a hand-rolled create/import order check and is reused for the new case, so it removes duplication rather than adding it. ## Spec **1. ADVISORY — `scripts/key-mint.sh:119-134`: the state entry is dropped on an inferred "removed", never read.** The `else` branch runs on any non-zero `info` (stderr is sent to `/dev/null` at :119), and the drop at :132-134 tests only that the *address* is in the state. The comment at :129 and the runbook (`docs/runbooks/0003-the-state-in-the-store.md:449-459`) both say the entry belongs to "a key the store no longer holds"; the code never looks at the entry's own access key. I drove it: stub store where the key is live and in the state, `info` times out. Result: `state rm` ran, `accesskey create` was refused ("key already exists"), exit 1, and the state no longer held the address. The error line says nothing about the dropped entry. The re-run (store answering) went through `exists` → `import` and restored the entry (`rc=0 held=yes`). So it is recoverable and the PR body discloses the transient-`info` path — hence not a blocker. Smallest improvement: tell a "no such key" answer from any other `info` failure before the `state rm`, or print a line when a run that dropped an entry then fails. Read from the code, not driven: the same inference covers a run with a *different* access key than the entry holds — the entry for the still-live old key would be dropped and the new key imported in its place. Confirmed against the claims (all reproduced by my hand, scripts and outputs in `cache/scratch/silo-24-r1/`): | Claim | Result | |---|---| | `make key-mint-test` passes at head | `every case passed` (84 ok lines) | | `make check` exits 0 | yes | | base `key-mint.sh` + head test fails 5 checks | `key-mint-test: 5 case(s) failed` — the five the body lists (no `state rm`, no import, no `re-adopted`, both order checks) | | head script + base test | passes, so no existing case was weakened | | the new `recreated` case can fail | mutants of the script, each run against the head test: delete the `state rm` → 4 reds; `state rm` moved after the create → 1 red (the order check); `state rm` unconditional → 1 red (`a mint with no entry in the state drops nothing`); `state rm` before the `info` check → 3 reds (`an entry for a key the store holds is kept` among them); drop the `re-adopted` print → 1 red; delete the import → 6 reds. No mutant survived. | | rm-before-create ordering protects a part-way run | read from the code, not driven: the `init`/`state rm` now run before the create (`:131-135` vs `:138`), so a failing `init` aborts before anything is minted; on `main` the only `init` sat after the create | | second run is a no-op | the new case `an entry for a key the store holds is kept` (mutant `rm-always-first` turns it red); the recovery re-run above also ends in `exists` | | runbook: bucket versioning keeps the pre-`rm` state | `silo/store/variables.tf` declares `tfstate` with `versioning = true` | | runbook commands use the same address and import id as `key-mint.sh:116` / :157 | yes | ## Named, not charged - The live fix for SC-15's two deploy keys and the `make store-plan` reading `2 to change` on `main`: the body declares it out of this PR; not reproduced (needs the store's credential). - The provider claim ("the read never touches `secret_key_wo_version`; an import sets it null") is the body's own measurement on SL-23, which I could not read; it is consistent with the comment at `silo/store/state-keys.tf` ("an imported key sends nothing"). Unverified by me. - The new 2-line comment at `scripts/key-mint.sh:129-130` is within the file's existing comment density; `AGENTS.md` §Code comments asks for a minimum, and I did not count it. ## Summary | Axis | Findings | Worst | |---|---|---| | Standards | 0 | none | | Spec | 1 (ADVISORY) | the drop is inferred from a bare non-zero `info`, not read from the entry (`scripts/key-mint.sh:119-134`) | 0 BLOCKER, 1 ADVISORY. State follows blockers only: APPROVED; label `review/merge-ready`. Merge-time danger the body already names (the Target can now `state rm` by itself) is two-way and bounded by the re-run recovery I drove above.
pit force-pushed hermes/23-stale-key-state from cf535f59ac
All checks were successful
pr-checks / check (pull_request) Successful in 24s
to 62e6a508e8
All checks were successful
pr-checks / check (pull_request) Successful in 20s
2026-11-09 12:31:37 +00:00
Compare
pit dismissed bot-minos's review 2026-11-09 12:31:37 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

Member

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

**Review started** (round 1/5) on 62e6a508e8fcb3973529303f7b2f4db4cdfc52d8 — reading the diff now.
bot-minos approved these changes 2026-11-09 12:35:26 +00:00
bot-minos left a comment

repo olympus/infra-silo · PR #24 · head 62e6a508e8 · round 2/5 by the thread (one review posted, round=1/5 at cf535f5; the dispatch said 1/5, its counter restarted when the label moved) · verdict: merge

Recommendation: merge

One reviewer held both axes (no sub-agent runner); the sections are kept apart and not reranked.

What this round is. A rebase, nothing else. The prior head cf535f5 is not an ancestor of 62e6a50 (history rewritten onto main 58818b3, where !25 / SC-16 had merged). git range-diff f8b529e..cf535f5 58818b3..62e6a50 answers = for both commits, so the patch is identical. Blob ids at the two heads: scripts/key-mint.sh 7740173 = 7740173, scripts/tests/key-mint.test.sh 743122b = 743122b. The runbook blob differs (8c34d7f vs 331ef5b) only because !25 edited that page; its addition is the same 21 lines (git diff --stat 58818b3 62e6a50 and the round-1 stat agree). The fixed point is cf535f5; the round's own delta is empty, and the base's files (README, runbooks 0001/0003, three deploy-state policy files, silo/store/variables.tf) are !25's to answer for. Currency: the PR's base.sha equals git ls-remote origin refs/heads/main (58818b3); git merge-tree --write-tree origin/main <head> exits 0.

Prior findings. Round 1 had 0 BLOCKER and 1 ADVISORY. The advisory stands unchanged (Spec §1 below). Round 1's could not verify line, that the SL-23 ticket could not be read, is retired: fetch-vikunja-task.sh 7 23 answers task id=302 http=200 this time (the profile key still gets 401; the shared key gets 200), and the ticket and its two comments were read.

Spec source. SL-23 (Vikunja task 302), read live, plus the PR body. Its acceptance criteria against this PR, which carries the code and runbook half only:

Criterion (SL-23) Where it stands
Cause recorded in a comment Ticket comment, not this PR. Its figures match the body's and the runbook's account (two entries at secret_key_wo_version = 1, the 19 imported keys null).
make store-plan reads No changes Live act, not in this PR. The ticket's second comment says it waits on SC-16; !25 is now the base of this PR, so that wait is over.
Neither key rotated, records still refused where they must be Live act, not in this PR.
make key-audit still 0 failing Live act, not in this PR. Not reproduced by me (needs the store credential).
Runbook 0003 §7 names the adoption step Met: docs/runbooks/0003-the-state-in-the-store.md:457 onward, under ## 7, with state rm, import, store-plan.

Standards source. AGENTS.md at the head worktree (§Code comments, §Toolchain, §Pull requests, §Docs), docs/agents/workflow.md. Org ADRs in olympus/workshop: not needed, the change touches no approval rule, credential path or protected-main rule.

Standards

No BLOCKER, no ADVISORY.

  • §Toolchain: mise exec -- make check at the head worktree exits 0 (84 ok lines in key-mint-test: key-mint-test: every case passed). Forge CI pr-checks / check (pull_request) is success on 62e6a50.
  • §Pull requests: the body names SL-23. Met.
  • §Docs: the runbook paragraph is inside the existing section; no relative link added.
  • Smell baseline: nothing to charge. expect_order (scripts/tests/key-mint.test.sh:53) replaces a hand-rolled create/import order check and is reused at :283, :392 and :393.

Spec

1. ADVISORY (carried from round 1, unchanged by this delta) — scripts/key-mint.sh:119-134: the state entry is dropped on an inferred "removed", never read.
The else branch at :128 runs on any non-zero info (stderr is discarded at :119), and :132-134 tests only that the address is in the state. The comment at :129 and the runbook (docs/runbooks/0003-the-state-in-the-store.md:457-466) both call the entry a removed key's; the code never checks the entry's own access key. Re-driven at this head (cache/scratch/silo-24-r2/wave2.sh): stub store with the key live and in the state, info timing out. Result: state rm ran, accesskey create was refused ("key already exists"), rc=1 held=no, and the error line does not mention the dropped entry. The re-run with the store answering went through exists → import and ended rc=0 held=yes. It is recoverable, and the body's Merge Danger section discloses the transient-info path, so it is not a blocker.
Smallest improvement: tell a "no such key" answer from any other info failure before the state rm, or print a line when a run that dropped an entry then fails.

Confirmed at this head, by my hand (scripts and outputs in cache/scratch/silo-24-r2/):

Claim Result
make key-mint-test passes every case passed (84 ok lines)
make check exits 0 yes, rc=0
Base key-mint.sh (origin/main) with the head test fails key-mint-test: 5 case(s) failed, matching the body's five
Head script with main's test passes rc=0, so no existing case was weakened
The new recreated case can fail Mutants of the head script run against the head test: delete state rm → 4 reds; state rm after the create → 1 red (order); state rm unconditional → 1 red (a mint with no entry in the state drops nothing); state rm before the info check → 3 reds; drop the re-adopted print → 1 red; delete the import → 6 reds. No mutant survived. One mutant (import before create) was VOID, its sed missed, as in round 1; the order check is covered by the state rm after-create mutant and the import-deleted mutant.
Runbook commands use the same address and import id as the script Yes (scripts/key-mint.sh:116, :157).

Named, not charged

  • The body's "Not in this PR" paragraph is out of date, not wrong about the PR. It says the live fix "runs after review" and quotes make store-plan reading 2 to change on main. SL-23's second comment says the live state rm and import already ran on the Operator's go-ahead, and that a full make store-plan waited on SC-16 (now merged). No code or page moves; it is the record the ticket carries now. Not counted.
  • key-mint.sh itself is beyond the ticket's "What to build", which asks only for the runbook paragraph where the cause is procedural. The title and body disclose it and the ticket's own comment calls the PR approved. Not charged.
  • The provider claim (the read never sets secret_key_wo_version; an import leaves it null) is the ticket's recorded measurement (provider v3.45.0 minioReadServiceAccount). I read the ticket's account of it, not the provider source.
  • The live acts (criteria 2-4 above) are not reproduced; they need the store credential and are the Operator's.
  • The two-line comment at scripts/key-mint.sh:129-130 is within the file's existing density; AGENTS.md §Code comments asks for a minimum. Byte-identical to round 1.

Summary

Axis Findings Worst
Standards 0 none
Spec 1 (ADVISORY, carried, unchanged) the drop is inferred from a bare non-zero info, not read from the entry (scripts/key-mint.sh:119-134)

0 BLOCKER, 1 counted ADVISORY, so state APPROVED, Recommendation: merge, label review/merge-ready. The count is under three; the volume rule does not fire.

<!-- minos review-loop: repo=olympus/infra-silo pr=24 head=62e6a508e8fcb3973529303f7b2f4db4cdfc52d8 round=2/5 axes=standards,spec --> repo olympus/infra-silo · PR #24 · head 62e6a508e8fcb3973529303f7b2f4db4cdfc52d8 · round 2/5 by the thread (one review posted, round=1/5 at cf535f5; the dispatch said 1/5, its counter restarted when the label moved) · verdict: merge Recommendation: merge One reviewer held both axes (no sub-agent runner); the sections are kept apart and not reranked. **What this round is.** A rebase, nothing else. The prior head `cf535f5` is not an ancestor of `62e6a50` (history rewritten onto `main` `58818b3`, where !25 / SC-16 had merged). `git range-diff f8b529e..cf535f5 58818b3..62e6a50` answers `=` for both commits, so the patch is identical. Blob ids at the two heads: `scripts/key-mint.sh` `7740173` = `7740173`, `scripts/tests/key-mint.test.sh` `743122b` = `743122b`. The runbook blob differs (`8c34d7f` vs `331ef5b`) only because !25 edited that page; its addition is the same 21 lines (`git diff --stat 58818b3 62e6a50` and the round-1 stat agree). The fixed point is `cf535f5`; the round's own delta is empty, and the base's files (README, runbooks 0001/0003, three deploy-state policy files, `silo/store/variables.tf`) are !25's to answer for. Currency: the PR's `base.sha` equals `git ls-remote origin refs/heads/main` (`58818b3`); `git merge-tree --write-tree origin/main <head>` exits 0. **Prior findings.** Round 1 had 0 BLOCKER and 1 ADVISORY. The advisory stands unchanged (Spec §1 below). Round 1's `could not verify` line, that the SL-23 ticket could not be read, is retired: `fetch-vikunja-task.sh 7 23` answers `task id=302 http=200` this time (the profile key still gets 401; the shared key gets 200), and the ticket and its two comments were read. **Spec source.** SL-23 (Vikunja task 302), read live, plus the PR body. Its acceptance criteria against this PR, which carries the code and runbook half only: | Criterion (SL-23) | Where it stands | |---|---| | Cause recorded in a comment | Ticket comment, not this PR. Its figures match the body's and the runbook's account (two entries at `secret_key_wo_version = 1`, the 19 imported keys null). | | `make store-plan` reads No changes | Live act, not in this PR. The ticket's second comment says it waits on SC-16; !25 is now the base of this PR, so that wait is over. | | Neither key rotated, records still refused where they must be | Live act, not in this PR. | | `make key-audit` still 0 failing | Live act, not in this PR. Not reproduced by me (needs the store credential). | | Runbook 0003 §7 names the adoption step | Met: `docs/runbooks/0003-the-state-in-the-store.md:457` onward, under `## 7`, with `state rm`, `import`, `store-plan`. | **Standards source.** `AGENTS.md` at the head worktree (§Code comments, §Toolchain, §Pull requests, §Docs), `docs/agents/workflow.md`. Org ADRs in `olympus/workshop`: not needed, the change touches no approval rule, credential path or protected-`main` rule. ## Standards No BLOCKER, no ADVISORY. - §Toolchain: `mise exec -- make check` at the head worktree exits 0 (84 `ok` lines in `key-mint-test`: `key-mint-test: every case passed`). Forge CI `pr-checks / check (pull_request)` is `success` on `62e6a50`. - §Pull requests: the body names `SL-23`. Met. - §Docs: the runbook paragraph is inside the existing section; no relative link added. - Smell baseline: nothing to charge. `expect_order` (`scripts/tests/key-mint.test.sh:53`) replaces a hand-rolled create/import order check and is reused at :283, :392 and :393. ## Spec **1. ADVISORY (carried from round 1, unchanged by this delta) — `scripts/key-mint.sh:119-134`: the state entry is dropped on an inferred "removed", never read.** The `else` branch at :128 runs on any non-zero `info` (stderr is discarded at :119), and :132-134 tests only that the address is in the state. The comment at :129 and the runbook (`docs/runbooks/0003-the-state-in-the-store.md:457-466`) both call the entry a removed key's; the code never checks the entry's own access key. Re-driven at this head (`cache/scratch/silo-24-r2/wave2.sh`): stub store with the key live and in the state, `info` timing out. Result: `state rm` ran, `accesskey create` was refused ("key already exists"), `rc=1 held=no`, and the error line does not mention the dropped entry. The re-run with the store answering went through `exists` → `import` and ended `rc=0 held=yes`. It is recoverable, and the body's Merge Danger section discloses the transient-`info` path, so it is not a blocker. Smallest improvement: tell a "no such key" answer from any other `info` failure before the `state rm`, or print a line when a run that dropped an entry then fails. Confirmed at this head, by my hand (scripts and outputs in `cache/scratch/silo-24-r2/`): | Claim | Result | |---|---| | `make key-mint-test` passes | `every case passed` (84 ok lines) | | `make check` exits 0 | yes, rc=0 | | Base `key-mint.sh` (`origin/main`) with the head test fails | `key-mint-test: 5 case(s) failed`, matching the body's five | | Head script with `main`'s test passes | rc=0, so no existing case was weakened | | The new `recreated` case can fail | Mutants of the head script run against the head test: delete `state rm` → 4 reds; `state rm` after the create → 1 red (order); `state rm` unconditional → 1 red (`a mint with no entry in the state drops nothing`); `state rm` before the `info` check → 3 reds; drop the `re-adopted` print → 1 red; delete the import → 6 reds. No mutant survived. One mutant (import before create) was VOID, its sed missed, as in round 1; the order check is covered by the `state rm` after-create mutant and the import-deleted mutant. | | Runbook commands use the same address and import id as the script | Yes (`scripts/key-mint.sh:116`, :157). | ## Named, not charged - **The body's "Not in this PR" paragraph is out of date, not wrong about the PR.** It says the live fix "runs after review" and quotes `make store-plan` reading `2 to change` on `main`. SL-23's second comment says the live `state rm` and `import` already ran on the Operator's go-ahead, and that a full `make store-plan` waited on SC-16 (now merged). No code or page moves; it is the record the ticket carries now. Not counted. - **`key-mint.sh` itself is beyond the ticket's "What to build"**, which asks only for the runbook paragraph where the cause is procedural. The title and body disclose it and the ticket's own comment calls the PR approved. Not charged. - The provider claim (the read never sets `secret_key_wo_version`; an import leaves it null) is the ticket's recorded measurement (provider v3.45.0 `minioReadServiceAccount`). I read the ticket's account of it, not the provider source. - The live acts (criteria 2-4 above) are not reproduced; they need the store credential and are the Operator's. - The two-line comment at `scripts/key-mint.sh:129-130` is within the file's existing density; `AGENTS.md` §Code comments asks for a minimum. Byte-identical to round 1. ## Summary | Axis | Findings | Worst | |---|---|---| | Standards | 0 | none | | Spec | 1 (ADVISORY, carried, unchanged) | the drop is inferred from a bare non-zero `info`, not read from the entry (`scripts/key-mint.sh:119-134`) | 0 BLOCKER, 1 counted ADVISORY, so state `APPROVED`, `Recommendation: merge`, label `review/merge-ready`. The count is under three; the volume rule does not fire.
pit merged commit 673c97a062 into main 2026-11-09 12:48:19 +00:00
pit deleted branch hermes/23-stale-key-state 2026-11-09 12:48:19 +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!24
No description provided.