rescue: operator-key-ledger — standing ledger to mint/revoke operator keys #32

Closed
opened 2026-07-25 04:54:33 +00:00 by ben · 1 comment
Owner

Parent

Feature spec: #21 (rescue).

What to build

The standing operator-key ledger (reached from Rescue → Operator keys, surfaced on P8-S7) lets the community see, add, and revoke who can rescue the fleet. It lists every operator key — standing operators and time-boxed supporters alike — with mint date, status and expiry, and lets the operator mint or revoke (ADR 0089).

Minting or revoking is one honest action across both sides: a mint pairs the mesh identity and the SSH side (recipient-set membership + SSH principals, the S13 Q3 model); a revoke cuts both paths together (ADR 0087), so an operator's departure is a single dashboard action. The ledger is also the fix for a lockout: an operator whose key was revoked (the P8-S3x variant-A route) has their access restored from a live control plane — another operator opens the ledger and "restore your access" mints them a fresh operator key. And a members operator-role grant does not mint keys itself — it invokes this ledger's mint (ADR 0089), so one ledger and one revocation discipline serve everywhere, mirroring the enrollment-code ledger's.

This slice reuses enroll's ledger/state-machine family (mint/revoke) and is upstream of remote-support-engagement, share-ceremony, and members' operator-grant. Thin UI over the rescue orchestrator.

Notes: this is a standing ledger surface, consumed by S3x variant-A restore and by members' operator grant.

Acceptance criteria

  • (story 21) Given the Rescue → Operator keys ledger, when the operator opens it, then it lists every operator key — standing operators and time-boxed supporters alike — with mint date, status and expiry, and lets the operator mint or revoke.
  • (story 22) Given a mint, when it runs, then it pairs the mesh identity and the SSH side (recipient-set membership + principals, the S13 Q3 model); given a revoke, when it runs, then it cuts both paths together (ADR 0087), so an operator's departure is one dashboard action.
  • (story 23) Given an operator whose key was revoked (the P8-S3x variant-A route), when another operator opens the ledger, then "restore your access" mints them a fresh operator key from this ledger (the fix for S3x runs from a live control plane).
  • (story 31) Given a member is granted the operator role in member detail (members, P6), when the grant is made, then it invokes rescue's key mint (ADR 0089) — one ledger, one revocation discipline, mirroring the enrollment-code ledger's.

Blocked by

  • #26 — reuses enroll's ledger/state-machine family

Task manifest

task: rescue:operator-key-ledger
implements_flow: p8-rescue
implements_edge: standing ledger surface — consumed by S3x variant-A restore and members' operator grant
wireframe: docs/ux/wireframes/p8-rescue/p8-s7-recovery-readiness.html
interface: rescue orchestrator (control plane) — list/mint/revoke operator keys (standing + time-boxed supporter); mint pairs mesh identity + SSH principals, revoke cuts both; restore-your-access re-mints a fresh key; members' operator-role grant invokes the mint
seam: rescue orchestrator seam tests (control plane, Go) — in-memory operator-key ledger, fake clan/enroll-style recipient-set + principals side; assert mint/revoke pair the mesh and SSH sides together and restore-your-access re-mints
acceptance:
  - given: the operator-key ledger
    when: opened
    then: it lists every operator key (standing + time-boxed supporter) with mint date, status, expiry, and offers mint/revoke
  - given: a mint
    when: it runs
    then: it pairs the mesh identity and the SSH side (recipient-set + principals); a revoke cuts both together (ADR 0087)
  - given: an operator whose key was revoked (S3x variant A)
    when: another operator opens the ledger
    then: "\"restore your access\" mints them a fresh operator key from this ledger"
  - given: a member granted the operator role in members (P6)
    when: the grant is made
    then: it invokes rescue's key mint (ADR 0089) — one ledger, one revocation discipline
depends_on: [bootstrap:enroll-seam]
out_of_scope:
  - stories 17–20 remote-support engagement (uses supporter keys minted here) — remote-support-engagement's
  - members' operator-role grant UI and role machinery (P6) — members'; this slice is the mint it invokes
  - recovery shares and the share ceremony — recovery-readiness's and share-ceremony's
needs_human_decision: []
## Parent Feature spec: #21 (rescue). ## What to build The standing **operator-key ledger** (reached from Rescue → Operator keys, surfaced on P8-S7) lets the community see, add, and revoke who can rescue the fleet. It lists **every operator key** — standing operators and time-boxed supporters alike — with mint date, status and expiry, and lets the operator mint or revoke (ADR 0089). Minting or revoking is **one honest action across both sides**: a mint pairs the mesh identity and the SSH side (recipient-set membership + SSH principals, the S13 Q3 model); a revoke cuts both paths together (ADR 0087), so an operator's departure is a single dashboard action. The ledger is also the fix for a lockout: an operator whose key was revoked (the P8-S3x variant-A route) has their access **restored from a live control plane** — another operator opens the ledger and "restore your access" mints them a fresh operator key. And a members **operator-role grant** does not mint keys itself — it **invokes this ledger's mint** (ADR 0089), so one ledger and one revocation discipline serve everywhere, mirroring the enrollment-code ledger's. This slice reuses enroll's ledger/state-machine family (mint/revoke) and is upstream of remote-support-engagement, share-ceremony, and members' operator-grant. Thin UI over the `rescue` orchestrator. Notes: this is a standing ledger surface, consumed by S3x variant-A restore and by members' operator grant. ## Acceptance criteria - [ ] (story 21) Given the Rescue → Operator keys ledger, when the operator opens it, then it lists every operator key — standing operators and time-boxed supporters alike — with mint date, status and expiry, and lets the operator mint or revoke. - [ ] (story 22) Given a mint, when it runs, then it pairs the mesh identity and the SSH side (recipient-set membership + principals, the S13 Q3 model); given a revoke, when it runs, then it cuts both paths together (ADR 0087), so an operator's departure is one dashboard action. - [ ] (story 23) Given an operator whose key was revoked (the P8-S3x variant-A route), when another operator opens the ledger, then "restore your access" mints them a fresh operator key from this ledger (the fix for S3x runs from a live control plane). - [ ] (story 31) Given a member is granted the operator role in member detail (members, P6), when the grant is made, then it invokes rescue's key mint (ADR 0089) — one ledger, one revocation discipline, mirroring the enrollment-code ledger's. ## Blocked by - #26 — reuses enroll's ledger/state-machine family ## Task manifest ```yaml task: rescue:operator-key-ledger implements_flow: p8-rescue implements_edge: standing ledger surface — consumed by S3x variant-A restore and members' operator grant wireframe: docs/ux/wireframes/p8-rescue/p8-s7-recovery-readiness.html interface: rescue orchestrator (control plane) — list/mint/revoke operator keys (standing + time-boxed supporter); mint pairs mesh identity + SSH principals, revoke cuts both; restore-your-access re-mints a fresh key; members' operator-role grant invokes the mint seam: rescue orchestrator seam tests (control plane, Go) — in-memory operator-key ledger, fake clan/enroll-style recipient-set + principals side; assert mint/revoke pair the mesh and SSH sides together and restore-your-access re-mints acceptance: - given: the operator-key ledger when: opened then: it lists every operator key (standing + time-boxed supporter) with mint date, status, expiry, and offers mint/revoke - given: a mint when: it runs then: it pairs the mesh identity and the SSH side (recipient-set + principals); a revoke cuts both together (ADR 0087) - given: an operator whose key was revoked (S3x variant A) when: another operator opens the ledger then: "\"restore your access\" mints them a fresh operator key from this ledger" - given: a member granted the operator role in members (P6) when: the grant is made then: it invokes rescue's key mint (ADR 0089) — one ledger, one revocation discipline depends_on: [bootstrap:enroll-seam] out_of_scope: - stories 17–20 remote-support engagement (uses supporter keys minted here) — remote-support-engagement's - members' operator-role grant UI and role machinery (P6) — members'; this slice is the mint it invokes - recovery shares and the share ceremony — recovery-readiness's and share-ceremony's needs_human_decision: [] ```
Author
Owner

Done — the standing operator-key ledger shipped as a control-plane slice of the rescue orchestrator (ADR 0089), seam-tested in Go. Commit d5ee070.

What landed (internal/rescue/):

  • keys.go — the Keyring orchestrator: List / Mint / Revoke, plus RestoreAccess and GrantOperator. Lists every operator key — standing operators (KindOperator, no expiry) and time-boxed supporters (KindSupporter, TTL) alike — with mint date, read-time-derived status (active/expired/revoked), and expiry.
  • keys_side.go — the IdentitySide port: one interface with paired verbs so a mint or revoke cannot touch one path and forget the other.
  • keys_ledger.go — OperatorKey (first-class, never deleted), KeyLedger + JSON-round-tripping MemoryKeyLedger, StatusAt deriving status.
  • keys_fakes.go — FakeIdentitySide holding the mesh recipient set and the SSH principals as separate maps, so a one-sided mint/revoke is caught.
  • keys_test.go — 6 Given/When/Then seam tests.

Acceptance criteria:

  • Story 21 — TestStory21_LedgerListsStandingAndSupporterKeys: lists both a standing operator key and a time-boxed supporter key, each with mint date, status, expiry; mint/revoke offered.
  • Story 22 — TestStory22_MintPairsRevokeCutsBothSides: a mint pairs the mesh recipient-set membership and the SSH principals (S13 Q3); a revoke cuts both together (ADR 0087). (TestRevoke_UnknownAndDoubleRevokeError covers the honesty edges.)
  • Story 23 — TestStory23_RestoreAccessRemintsAfterRevoke: a revoked-out holder is restored when another operator opens the same standing ledger — RestoreAccess mints a fresh key and re-pairs both sides; the revoked key stays for the audit trail.
  • Story 31 — TestStory31_MembersOperatorGrantInvokesMint: GrantOperator is exactly the ledger's mint (one ledger, one revocation discipline) — the granted key lands in the one ledger and is revocable by the same discipline.

Verification: go test ./internal/rescue/ (all pass), go vet, gofmt clean.

Out of scope (left to their slices): the thin dashboard UI over this orchestrator; remote-support's engagement lifecycle (auto-revoke at expiry / close-revokes-all — consumes supporter keys minted here); members' operator-grant UI + role machinery; recovery shares / share ceremony. No dedicated operator-key wireframe exists (p8-s7 is the recovery-shares ledger), so this shipped against the manifest's Go seam contract as the interface.

Done — the standing **operator-key ledger** shipped as a control-plane slice of the `rescue` orchestrator (ADR 0089), seam-tested in Go. Commit `d5ee070`. **What landed** (`internal/rescue/`): - `keys.go` — the `Keyring` orchestrator: `List` / `Mint` / `Revoke`, plus `RestoreAccess` and `GrantOperator`. Lists **every** operator key — standing operators (`KindOperator`, no expiry) and time-boxed supporters (`KindSupporter`, TTL) alike — with mint date, read-time-derived status (active/expired/revoked), and expiry. - `keys_side.go` — the `IdentitySide` port: one interface with paired verbs so a mint or revoke cannot touch one path and forget the other. - `keys_ledger.go` — `OperatorKey` (first-class, never deleted), `KeyLedger` + JSON-round-tripping `MemoryKeyLedger`, `StatusAt` deriving status. - `keys_fakes.go` — `FakeIdentitySide` holding the mesh recipient set and the SSH principals as **separate maps**, so a one-sided mint/revoke is caught. - `keys_test.go` — 6 Given/When/Then seam tests. **Acceptance criteria:** - **Story 21** — `TestStory21_LedgerListsStandingAndSupporterKeys`: lists both a standing operator key and a time-boxed supporter key, each with mint date, status, expiry; mint/revoke offered. - **Story 22** — `TestStory22_MintPairsRevokeCutsBothSides`: a mint pairs the mesh recipient-set membership **and** the SSH principals (S13 Q3); a revoke cuts **both** together (ADR 0087). (`TestRevoke_UnknownAndDoubleRevokeError` covers the honesty edges.) - **Story 23** — `TestStory23_RestoreAccessRemintsAfterRevoke`: a revoked-out holder is restored when another operator opens the *same* standing ledger — `RestoreAccess` mints a **fresh** key and re-pairs both sides; the revoked key stays for the audit trail. - **Story 31** — `TestStory31_MembersOperatorGrantInvokesMint`: `GrantOperator` is exactly the ledger's mint (one ledger, one revocation discipline) — the granted key lands in the one ledger and is revocable by the same discipline. **Verification:** `go test ./internal/rescue/` (all pass), `go vet`, `gofmt` clean. **Out of scope (left to their slices):** the thin dashboard UI over this orchestrator; remote-support's engagement lifecycle (auto-revoke at expiry / close-revokes-all — consumes supporter keys minted here); members' operator-grant UI + role machinery; recovery shares / share ceremony. No dedicated operator-key wireframe exists (p8-s7 is the recovery-shares ledger), so this shipped against the manifest's Go seam contract as the interface.
ben closed this issue 2026-07-25 11:05:21 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#32
No description provided.