Spec: rescue — recover services, devices and a dead control plane; tiered recovery (P8) #21

Open
opened 2026-07-25 00:13:38 +00:00 by ben · 1 comment
Owner

Parent

Wayfinder map: Matou/ourcloud#7 — rescue's definition was locked on ticket #9 (2026-07-21). This child spec inherits the map's cross-feature constraints (clan substrate behind the clan seam; kanidm/OIDC behind the member orchestrator's idp port; the seeded-cache supply chain; the cross-cutting UX rulings — advice never veto, logging with Open/Download drill-in everywhere, the tiered-recovery doctrine of ADR 0006) and links back to it as the parent artifact. Grilled 2026-07-24 (/grill-ux-with-docs, auto-accept mode at Ben's instruction — the P4b/monitoring precedent: the agent made its recommended call at each decision point rather than grilling live); Ben reviewed and signed off both gates (flow gate + seam gate) on 2026-07-24, keeping every agent-invented number and posture. Decisions: ADRs 0086/0087/0089/0090/0091 + DDRs 0088/0092, all accepted.

Flow: docs/ux/flows/p8-rescue.mermaid (10 screens).
Wireframes: docs/ux/wireframes/p8-rescue/ (10 pages, confirmed).

Problem Statement

Something in the community's fleet has broken past what monitoring can advise, and the operator — low-skill, low-time, and now frightened — has to get it back. The breakage spans a spectrum the operator cannot be asked to diagnose: a single service that keeps crashing; a device that has gone dark; or, at the far end, the control plane itself — the sign-in service, the mesh coordination, the dashboard — is the patient, so the very surface the operator would use to fix things is down. Left to raw tools this means: knowing which rung of which recovery procedure to try and remembering what already failed; reaching nodes over a mesh whose coordinator may be dead; judging whether a config replica is fresh enough to safely re-apply; deciding when to call for outside help without handing over standing access to the community's infrastructure; and, in the worst case, reconstituting the community's root secrets from shares held by different people and rebuilding a control plane from nothing. None of that should require systems expertise. And the one surface that must be believed when everything else is down must never claim a recovery it did not achieve, never render a tool it cannot back, and never leave the operator at a dead end.

Solution

Rescue splits on the one line that defines the feature — whether the control plane is alive — into two operator journeys on two different surfaces (ADR 0086).

The dashboard tracks (control plane alive). When a service or a device is the patient but the fleet can still self-manage, rescue is a set of advised ladders on the web dashboard, driven server-side so a closed browser interrupts nothing. A service ladder climbs restart → redeploy → move → restore; a device ladder climbs wait → rehome → remove. Each ladder is a stateful object that remembers every rung tried and failed with its evidence, degrades honestly (a move that cannot be placed is a failed rung, not an attempted deploy; a restore hands to backups, never reimplements it), and never dead-ends (an exhausted ladder always offers the next tier). When a ladder is exhausted, the operator can open a Tier-2 remote-support engagement — community-initiated, per incident, granting at most a log bundle and an optional time-boxed supporter key, both revocable, never standing access. Standing beside all of this is recovery readiness: a surface that always shows whether the community is actually prepared for total loss — kit exported, recovery shares held and by whom, the threshold, and any degraded coverage — and lets the community run the share ceremony on the live fleet.

The operator-app tracks (control plane is the patient). When the control plane, the dashboard, or the mesh coordination is down, no dashboard can serve its own rescue, so the operator app is the standing fallback seat and drives the fleet directly — break-glass. It probes every node on both paths — the mesh first, direct SSH as fallback with the config repo replica as the address book — and is honest per node about which path answered and which nodes it could not reach at all. It offers curated break-glass actions (restart a node's services, re-apply config against reachable nodes only, move the control plane to a healthy node), each honest about reach, each logged, and a failed or not-holding action is a first-class state with its evidence, never a toast claiming success. When break-glass's own preconditions fail — a revoked operator key, or no replica on this machine — the app says why and who can act instead rather than rendering dead tools. And at total loss, the app runs the Tier-3 ceremony: combine the recovery kit with the community's threshold of recovery shares (insufficient shares are an honest stuck state, never a partial ceremony), reconstitute the crown jewels in memory only, and rebuild a control plane from the freshest config checkout by driving founding's own stand-up machinery with recovered material — then re-scrub. Data comes back afterwards, per dataset, through backups' restore, Identity first.

User Stories

Acceptance criteria are Given/When/Then, sourced from the flow nodes and edges of docs/ux/flows/p8-rescue.mermaid, including every unhappy branch. Stories are grouped by the seam that executes them — rescue (control plane, the dashboard tracks) and breakglass (helper, the operator-app tracks), per ADR 0086.


Seam A — rescue (control plane): the dashboard tracks

Entry and escalation (from monitoring, P5)

  1. As an operator, I want a downed service that monitoring could not fix to arrive in rescue with its history attached, so that I start from what has already been tried, not a blank slate.

    • Given monitoring's respond ladder escalates a downed service (P5-S4), When rescue opens, Then P8-S1 shows the service rescue ladder for that service with the incident summary ("Chat keeps crashing on rimu — failed to start 3 times since 14:02") and its logs.
    • Given monitoring escalates after a fix that did not hold (P5-S4x), When rescue opens, Then the failed-fix evidence is carried in and attached to the ladder, not discarded.
  2. As an operator, I want a degraded device that monitoring could not fix to arrive as a device rescue, so that the track matches what is actually down.

    • Given monitoring escalates a degraded device (P5-S4), When rescue opens, Then P8-S2 shows the device rescue ladder with the device's impact stated in service terms ("rimu unreachable 38 min · Files & documents lost a copy, still safe on tōtara · Chat is down").
  3. As an operator, I want a lost control plane or dashboard to route me to the operator app, so that I am never asked to rescue a dead dashboard from that same dashboard.

    • Given monitoring escalates a lost control plane or dashboard, When I go to rescue, Then the route is to the operator app's break-glass surface (P8-S3), because the dashboard cannot serve its own rescue (ADRs 0086/0087).

Track 1 — the service rescue ladder (P8-S1)

  1. As an operator, I want a service rescue to be an advised ladder I climb, so that I try the least-disruptive fix first and escalate only as needed.

    • Given a downed service, When P8-S1 loads, Then it shows the rungs in order — restart → redeploy → move to a healthy device → restore the last good snapshot — each with a plain "what this does" line.
  2. As an operator, I want the ladder to remember what I already tried, so that I never re-try a rung that already failed.

    • Given a rung has been tried, When I reopen the rescue, Then that rung shows its outcome with a timestamp and its own log ("Restart — tried at 14:06, crashed again"), and reopening shows the worked ladder, never a fresh menu (DDR 0088 §1).
  3. As an operator, I want a move rung capacity-checked before it runs, so that I am not advised to move a service somewhere it cannot fit.

    • Given a "move to a healthy device" rung, When it is offered, Then it names the target and states its capacity was checked ("tōtara has capacity — checked"); a move that cannot be placed is shown as a failed rung with that reason, not an attempted deploy (DDR 0088 §2).
  4. As an operator, I want the restore rung to hand off to backups rather than invent its own restore, so that recovery of data stays the one machinery I already trust.

    • Given a restore rung, When I choose it, Then it names the dataset and snapshot ("Chat's dataset, yesterday 02:00") and invokes backups' restore machinery (P7-S4), reporting its outcome; rescue never reimplements restore (DDR 0088 §3).
  5. As an operator, I want a recovered service to close the incident, so that the alert clears and the fleet is self-managing again.

    • Given a rung recovers the service, When it passes, Then the action is audit-logged, the ladder reports recovered, and the monitoring alert resolves (back to P5-S1).
  6. As an operator, I want an exhausted service ladder to offer remote support rather than a wall of red, so that I always have a next step.

    • Given every rung has been tried and named failed, When the ladder is exhausted, Then P8-S1 shows the exhausted state ("bigger than the ladder — time for the next tier") and offers Request remote support (P8-S6) with the worked ladder's evidence already bundled (DDR 0088 §7).

Track 2 — the device rescue ladder (P8-S2)

  1. As an operator, I want a degraded device shown with its impact first, so that I understand what is at stake before I act on the machine.

    • Given a degraded device, When P8-S2 loads, Then the impact is stated first in service terms (which data lost a copy but is still safe, which services are down), then the advised options.
  2. As an operator, I want to wait out an intermittent device on its own pattern, so that I do not tear down a machine that is simply asleep on schedule.

    • Given a device with an intermittent pattern, When I choose Wait, Then the ladder holds and says why it is the right call for that device's pattern (and names when it is not, e.g. "rimu is always-on").
  3. As an operator, I want to rehome a device's services while it is gone, so that the community keeps running without the machine.

    • Given a gone device, When I choose Rehome, Then services are placed onto healthy nodes P4-style, capacity-checked before anything moves, and the impact is reviewed before deploy.
  4. As an operator, I want removing a device to go through provisioning's destructive confirm, so that dropping a machine that holds the last copy of data is never a casual click.

    • Given I choose Remove the device, When the removal would drop the last copy of data, Then it hands to provisioning's standing change surface and its LOSES destructive confirm (P4-S3x, ADRs 0060/0063); keys are revoked and secrets rotated if warranted; rescue never grows a second, scarier removal path (DDR 0088 §4).
  5. As an operator, I want a device that comes back to rejoin cleanly, so that a temporary outage does not force a rebuild.

    • Given the device returns, When it rejoins, Then it either rejoins cleanly or re-provisions through provisioning's assess surface (P4-S1).
  6. As an operator whose degraded device is the gateway, I want to be sent to the operator app, so that I can rescue a fleet whose dashboard is down.

    • Given the degraded device is the gateway, When P8-S2 recognises it, Then no dashboard can serve this rescue and it summons the operator app's break-glass surface (P8-S3, ADRs 0086/0087).
  7. As an operator, I want an exhausted device ladder to offer remote support, so that a device I cannot recover is not a dead end.

    • Given every device option has been tried and named failed, When the ladder is exhausted, Then it offers Request remote support (P8-S6) with the evidence bundled.

Tier-2 — remote support (P8-S6)

  1. As an operator, I want to open a remote-support engagement myself, so that outside help is something the community asks for, never something imposed.

    • Given an exhausted ladder, When I request remote support, Then P8-S6 opens an engagement stamped community-initiated ("opened by Ana, operator") and states the Matou Collective cannot open one; the incident's evidence is bundled at request.
  2. As an operator, I want to share a log bundle with a supporter, so that they can diagnose without any access to the fleet.

    • Given an open engagement, When I share the log bundle, Then the worked ladder with every rung's tried/failed log is shared, and this grant is audit-logged.
  3. As an operator, I want a supporter key to be time-boxed and revocable, so that outside help never becomes standing access.

    • Given an open engagement, When I optionally grant a supporter key, Then it is a time-boxed operator key scoped to the engagement, shows its expiry counting down, is revocable in one action (cutting mesh and SSH sides together), and is auto-revoked at expiry (ADR 0089).
  4. As an operator, I want closing the engagement to revoke everything, so that nothing is left granted after help is done.

    • Given an engagement with grants standing, When I close it, Then anything still granted is revoked with it, the closure is audit-logged, and the alert then resolves (back to P5-S1).

The operator-key ledger (ADR 0089)

  1. As an operator, I want a standing ledger of operator keys, so that I can see, add, and revoke who can rescue the fleet.

    • Given the Rescue → Operator keys ledger, When I open it, Then it lists every operator key — standing operators and time-boxed supporters alike — with mint date, status and expiry, and lets me mint or revoke.
  2. As a community, I want minting or revoking a key to pair its mesh and SSH sides, so that granting or removing an operator is one honest action.

    • 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.
  3. As an operator locked out by a revoked key, I want another operator to restore my access from the ledger, so that a mistaken or lapsed revocation is fixable without a rebuild.

    • 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).

Recovery readiness and the share ceremony (P8-S7)

  1. As an operator, I want a standing surface that tells me whether we are actually prepared for total loss, so that being unprepared is never a silent surprise.

    • Given Recovery readiness (P8-S7), When I open it, Then it always shows the kit exported or not, the shares held and by whom, the threshold, and any degraded coverage — it is a standing surface, not a wizard's last page (ADR 0090).
  2. As an operator, I want the founding kit re-prompt to land here until resolved, so that an un-exported kit keeps nagging in one honest place.

    • Given founding's hand-off (P1-S12) offered the recovery kit, When the kit is not yet exported, Then the re-prompt lands on P8-S7 and persists there until the kit is exported.
  3. As an operator, I want the honest floor stated plainly, so that a fresh community knows its real recovery posture.

    • Given a community that has not run the share ceremony, When I view readiness, Then it states the floor is 1-of-1 — "the operator's kit IS the plan" — until the community deliberately runs the ceremony (ADR 0006).
  4. As an operator, I want to run the share ceremony on the live fleet, so that the crown jewels are split across the people the community trusts.

    • Given the ceremony (P8-S7), When I run it, Then I pick holders from operators and kaitiaki (candidates read from members' designations via the member orchestrator — rescue never designates people), set the threshold (default 2-of-N, configurable), mint on the live fleet, and each holder confirms receipt; nothing assembled persists and the crown jewels are written nowhere new (the ADR 0044 scrub discipline holds).
  5. As an operator, I want a share's receipt tracked, so that an unconfirmed share does not falsely count toward coverage.

    • Given a minted share, When the holder has not confirmed receipt, Then it shows unconfirmed and keeps coverage degraded; a confirmed share shows held with the receipt time.
  6. As an operator, I want degraded coverage surfaced and re-mintable, so that a community that falls below its own threshold is prompted to fix it.

    • Given a share holder is suspended or removed in members (the advice-not-veto warning edge from P6-S4 lands here) or a receipt was never confirmed, When readiness computes coverage, Then it shows coverage degraded, names why, and offers Re-mint (which rotates the shares and invalidates the old ones).
  7. As a community, I want being below threshold to raise the standing chrome indicator, so that we are never silently unprepared.

    • Given coverage below the community's own threshold, When readiness detects it, Then it may supply a standing indicator to shell's reserved chrome slot (the ADR 0068 pattern).
  8. As an operator, I want an operator-role grant in members to mint a rescue key, so that adding an operator is one action with one revocation discipline.

    • 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.

Seam B — breakglass (helper): the operator-app tracks

The Situation probe (P8-S3)

  1. As an operator, I want the app to probe every node on both paths and show me both, so that I know exactly what is reachable when the dashboard is gone.

    • Given break-glass opens (P8-S3), When it probes, Then it shows every node with a MESH column and an SSH column — mesh first, direct SSH fallback with the replica as the address book (ADR 0087) — and states what is down ("karaka, running your dashboard, is unreachable; the others are fine — you can move the control plane").
  2. As an operator, I want a node reachable on neither path named unreachable, so that no action silently skips a node it never touched.

    • Given a node answers on neither mesh nor SSH, When the probe completes, Then it is named unreachable and excluded honestly, never silently skipped; a LAN-only node unreachable from my current network is reported as exactly that, with the remedy stated ("rescue from a machine on the community's network").
  3. As an operator, I want the replica's freshness shown, so that I know whether it is safe to act from.

    • Given the config replica, When P8-S3 loads, Then it shows the replica's status and age ("synced 12 min ago — safe to act from").
  4. As an operator, I want a stale replica to warn me before I re-apply config, so that I never push out-of-date history over the live fleet unknowingly.

    • Given a replica N days behind, When I attempt to re-apply configuration, Then a gating confirm (not a passive badge) states the replica is N days behind and that re-applying can push stale history over the fleet, and requires my explicit confirmation (ADR 0032, DDR 0092).
    • Given the same stale replica, When I probe or restart node services, Then those stay available un-gated; it is only re-applying possibly out-of-date config that the warning gates.

No usable Tier-1 material (P8-S3x)

  1. As an operator whose key was revoked, I want to be told why and who can act, so that I am not staring at rescue tools that would all fail.

    • Given my operator key is revoked, When break-glass checks its preconditions, Then P8-S3x variant A states when and by whom it was revoked, names another operator who holds a valid key and can rescue from their own app, and points at restoring my access from the dashboard's operator-key ledger — never a Situation screen of dead tools (DDR 0092).
  2. As an operator on a machine with no replica, I want to be pointed at another app or at cloning the repo, so that a fresh install is not a dead end.

    • Given this machine holds no replica (fresh install or new laptop), When break-glass checks its preconditions, Then P8-S3x variant B states rescue needs the replica (config and address book), points at another operator's synced app, and — if my key is valid — offers Clone the config repo to rescue from here.
  3. As an operator, I want "everything lost" to be a conclusion I reach through a door, not a button beside working tools, so that the Tier-3 ceremony is never begun casually.

    • Given no operator holds usable Tier-1 material — every key gone or revoked and no machine holds a usable replica, When break-glass checks, Then P8-S3x variant C states this plainly and is the only variant that routes onward to the Tier-3 recovery ceremony (P8-S8).
    • Given any S3x variant, When material is regained (key restored, replica cloned), Then Check again returns to the Situation screen (P8-S3).

Break-glass actions (P8-S4)

  1. As an operator, I want curated break-glass actions rather than raw tools, so that I can act without systems expertise in the worst hour.

    • Given the Situation screen picks an action, When P8-S4 loads, Then it offers a curated set — Restart services on a node, Re-apply configuration, Move the control plane to a healthy node — each with a plain "what this does" line and its own Open log.
  2. As an operator, I want a re-apply to be honest about which nodes it reached, so that I am never told the fleet is configured when half of it was unreachable.

    • Given Re-apply configuration, When it runs, Then it runs the replica's config against reachable nodes only, names the nodes it ran against and the nodes it could not reach and excluded, and never reports "configuration re-applied" over a half-reached fleet (DDR 0088 §5).
  3. As an operator, I want moving the control plane to a healthy node to be a first-class action, so that a dead gateway is recoverable from the app.

    • Given a lost control-plane home, When I choose Move the control plane to a healthy node, Then it redeploys the config repo, deploy runner, and dashboard onto the chosen node, and every step is logged.
  4. As an operator, I want a break-glass action that works to land me on recovered, so that success is unambiguous.

    • Given a break-glass action recovers the fleet, When it completes, Then P8-S5 shows the outcome ("Control plane now on rimu; your dashboard is back"), and the actions are audit-logged to the cluster on reconnect.
  5. As an operator, I want to download a log bundle for a remote helper, so that I can get guidance even while the control plane is down.

    • Given P8-S4, When I choose Download log bundle, Then it produces the artifact to hand a remote helper — the app-side Tier-2 start; a supporter guides while the control plane is down, and a supporter key waits for a live control plane (ADR 0089).

A break-glass action that failed or did not hold (P8-S4x)

  1. As an operator, I want a failed action shown as a state with its evidence, so that I am never told something recovered when it did not.

    • Given a break-glass action that fails partway or does not hold, When it fails, Then P8-S4x names the action, its outcome ("failed at step 2 of 4 — deploy runner exited on start"), the load-bearing log excerpt, and exactly what it changed before failing — with nothing claimed recovered (DDR 0088 §6).
  2. As an operator, I want to retry or pick a different action with the evidence in hand, so that a failure is a fork, not a wall.

    • Given P8-S4x, When I decide, Then I can Retry this action (same action, the log naming the blocker to clear first), or Pick a different action (back to P8-S4 with the evidence attached, e.g. move to a different node).
  3. As an operator stuck but not lost, I want to escalate from a failed action, so that outside help or Tier-3 is always reachable.

    • Given P8-S4x, When I am stuck but not lost, Then I can download the log bundle to hand a remote helper (the app-side Tier-2 start); given everything is lost, When I choose, Then I begin the Tier-3 ceremony (P8-S8).
    • Given the dashboard is still up alongside a stuck app action, When I choose, Then requesting remote support (P8-S6) remains available.

Recovered (P8-S5)

  1. As an operator, I want a plain recovered screen with a link back to my dashboard, so that I know the fleet is self-managing again.
    • Given a break-glass recovery, When P8-S5 loads, Then it states what recovered and where the dashboard is now, notes every action was written to the community's audit log on reconnect, and the app goes quiet (back to operator home).

Tier-3 — the recovery ceremony (P8-S8)

  1. As an operator, I want recombining shares to stop honestly below threshold, so that a partial ceremony never half-reconstitutes the crown jewels.

    • Given the Tier-3 ceremony act 1 (P8-S8), When fewer than the threshold of shares combine, Then it is an honest stuck state naming exactly what is missing ("1 of 2 required — Mere's share unconfirmed, Hemi unreachable"), nothing is reconstituted below threshold, and there is no operator-app override — the threshold is the community's decision (ADR 0091).
  2. As an operator, I want the threshold met to reconstitute the jewels in memory only, so that recovery never writes the crown jewels somewhere new.

    • Given the threshold of shares combines with the recovery kit, When act 1 completes, Then the crown jewels are reconstituted in the app's memory only, for this rebuild.
  3. As an operator, I want to rebuild the control plane from the freshest checkout I can reach, so that recovery starts from the least-stale config.

    • Given act 2 (rebuild from checkout), When I pick the checkout, Then it offers this machine's replica, another operator's replica (freshest wins, named), or a repo restored from backup, and I pick the machine to carry the control plane (one that meets the gateway minimum).
  4. As an operator, I want the rebuild to ride founding's own stand-up machinery, so that the most-desperate hour uses the most-tested install path.

    • Given a chosen checkout and machine, When the rebuild runs, Then the helper drives founding's stand-up (install → seed → deploy) with recovered material substituted for newly-born material (ADRs 0091/0043/0052), and ends in the same scrub (ADR 0044) so the machine keeps no ambient crown jewels.
  5. As an operator, I want the rebuild to end at recovered with data still coming back, so that nothing is claimed back that has not been.

    • Given a completed rebuild, When it finishes, Then P8-S5 (rebuilt variant) states the cluster and access are recovered — control plane, sign-in, mesh, dashboard — and that data is not all back yet: restores continue in backups, per dataset, the Identity dataset first so members exist again (ADR 0078), and the spent shares show on Recovery readiness with a prompt to re-run the ceremony.

Implementation Decisions

  • Two orchestrators, two seams, split on the failure line (ADR 0086). rescue is a Go package in the control plane driving the dashboard tracks (service/device ladders, the Tier-2 engagement, the operator-key ledger, recovery readiness + the share ceremony's bookkeeping); breakglass is a Go package in the operator app's bundled helper driving the app tracks (the dual-path situation probe, the curated break-glass actions, the Tier-3 recombination + rebuild). The split is deliberate and not pattern-matched to the "everything in the control plane" placement of the four prior control-plane features: rescue is the one feature whose premise is that the control-plane home may be gone, so its defining scenario would be untestable at a single control-plane seam, while a single helper seam would push routine attended ladders onto the operator's laptop. This is provisioning's two-seam precedent (ADR 0065) with more force — the two journeys differ in object, trigger, scope, cadence, and in which substrate is assumed alive.
  • Break-glass reaches the fleet mesh-first, direct-SSH fallback, replica as address book (ADR 0087). The app is a mesh peer via the operator key; established WireGuard sessions survive the loss of the gateway's Netbird management plane. When the mesh does not answer, breakglass falls back to plain SSH using the operator key's SSH credential (the operator is a trusted principal on every node, S13 Q3/Q4); addresses come from the node configs' captured network facts in the config repo replica (baked in by spike Q2.2). The MESH/SSH columns on P8-S3 are contract. Reachability is a small breakglass-owned prober — not a clan seam verb (transport, not clan orchestration), so no repo-root seam is amended. The helper gains a second lifetime: founding stand-up, wizard preview, P3-join bootstrap, and now on-demand break-glass rescue — still no standing duties.
  • Rescue ladders remember, degrade honestly, never dead-end (DDR 0088). A ladder is a stateful object, not a menu: rungs record tried/failed with timestamp and log; move-rungs are capacity-checked first; the restore rung invokes backups (P7-S4), never reimplements it; remove-the-device routes through provisioning's LOSES confirm (P4-S3x); partial reach is named; a failed/not-holding action is a state (P8-S4x); an exhausted ladder always offers the next tier. This is DDR 0072's honest-degradation discipline carried to rescue's altitude, where the temptation to reassure is strongest.
  • Remote support engagement + operator-key ledger live in rescue (ADR 0089). A remote-support engagement is a control-plane resource: community-initiated per incident, never initiable by Matou, carrying at most a log bundle and an optional time-boxed supporter key (revocable in one action, auto-revoked at expiry, cut on engagement close). The operator-key ledger (list/mint/revoke, standing operators + time-boxed supporters) is rescue's surface; founding seeds the first key, a members operator-role grant invokes rescue's mint, and a mint/revoke pairs the mesh identity and the SSH side. The honest limit: no supporter key without a live control plane — minting is a control-plane act, so when the control plane is the patient Tier-2 degrades to the app producing the log bundle and the supporter guiding rather than driving.
  • Recovery shares minted in a live-fleet ceremony; readiness is standing (ADR 0090). Shares are first-class ledger objects (holder, minted-at, receipt-confirmed, status held|unconfirmed|revoked|holder-degraded), holders drawn from operators and kaitiaki read from members' designations. The ceremony runs on the live fleet (the crown jewels live on in the fleet vars per ADR 0044, so a live fleet can split them; nothing assembled persists). Readiness is a standing surface — kit exported or not (founding's re-prompt lands here), shares + threshold + degraded coverage — that may raise shell's chrome indicator when below threshold.
  • Tier-3 rebuild reuses founding's stand-up machinery (ADR 0091). The Tier-3 ceremony (P8-S8, helper) has two acts: recombine (kit + threshold of shares → reconstitute in memory; insufficient shares are an honest stuck state, never a partial ceremony, no override), then rebuild from checkout by driving the founding orchestrator's install → seed → deploy path with recovered material, ending in the same scrub. breakglass composes the founding package (already bundled in the helper — no new binary target). Data returns through backups' restore, per dataset, Identity first — rescue never grows a data-restore path.
  • No usable Tier-1 material is a first-class state (DDR 0092). Break-glass's own preconditions — a valid operator key and a present, fresh-enough replica — get honest states (P8-S3x) instead of broken tools: revoked key → who can act + the ledger fix; no replica → another app or clone; only no-operator-holds-material routes to Tier-3. A stale replica warns before every re-apply as a gating confirm (ADR 0032), while probing and restarting stay un-gated.
  • Thin UI over both seams. The dashboard's Rescue surfaces are thin UI over rescue; the app's rescue screens are thin UI over breakglass via the helper's stdio NDJSON contract (ADR 0051). Neither surface decides state.

Testing Decisions

  • What a good test is here: it drives one of the two seams and asserts external behaviour — the flow-node state reached, the ladder memory and exhaustion, the reachable-nodes-only honesty, the coverage claimed (or not), the threshold arithmetic, the operator-facing failure and its evidence — never internal step ordering. Fakes simulate the world (clan, the prober, the clock, health checks, the replica, member reads, shares); the state machines under test are real.
  • rescue (control plane) — THE seam for the dashboard tracks (ADR 0086), mirroring provision/monitor (0058/0069). Driven headless in-process against a fake fleet-state provider, a fake clan.Clan (assert each rung issues the right operation and the ladder records tried/failed), per-service HealthCheck fakes (a rung "held" or "didn't"), a fake clock (supporter-key expiry, auto-revocation), a fake member read (kaitiaki designations / share-holder candidates), and an in-memory engagement/operator-key/share ledger. Every dashboard-track criterion executes here: service and device ladder memory and exhaustion, the restore rung's hand-off, removal routing to provisioning's LOSES confirm, the device-returns re-provision, engagement open → bundle → key-grant → auto-revoke → close-revokes-all, the mint/revoke mesh+SSH pairing, share mint/confirm/re-mint, threshold arithmetic, and degraded-coverage derivation from members' events.
  • breakglass (helper) — THE seam for the app tracks (ADR 0086), mirroring founding (0052). Driven through its interface with a fake prober (per-node mesh/SSH answers on command), a fake clan adapter (the S13 fakes: blocked/remedy/partial-failure flows), a fake replica (freshness controllable — the ADR 0032 staleness gate is asserted, not assumed), fake Tier-1 material (key present/revoked/absent for DDR 0092), and fake shares (threshold met / insufficient). Every app-track criterion executes here: the dual-path probe table and unreachable-node honesty, the stale-replica gating confirm, reachable-nodes-only re-apply, action-failed evidence (P8-S4x), the S3x variants and their routes, the Tier-3 ceremony's threshold enforcement (reconstitution never below threshold), the founding stand-up hand-off invoked with recovered-material inputs, and the post-rebuild scrub.
  • Below each seam: one thin round-trip test each — control-plane HTTP for rescue (mirroring provisioning's, ADR 0058), helper stdio NDJSON for breakglass (mirroring founding's, ADRs 0051/0052). Above the seams: nothing — the Vue dashboard and the app's rescue screens render states, they do not decide them.
  • Prior art to copy: the founding stand-up orchestrator's fake harness (in-memory ledger + clock, ADR 0052) for the Tier-3 rebuild path; enroll's ledger/state-machine family (mint/revoke/approve-decline) for the operator-key and share ledgers and the engagement lifecycle; provisioning's partial-failure family (per-service pass/fail, active-for-what-works with no coverage claimed) for the reachable-nodes-only and named-partial-reach outcomes; and the S13 prototype's clan fakes (spikes/S13-clan-orchestration/).
  • Non-gating real-lab rescue smoke (fake-drift insurance), mirroring the five prior features' spec pattern. A scheduled clan-lab rescue smoke, explicitly not an acceptance gate, scoped to what clan-lab can genuinely exercise: (a) kill a real service on a lab node and walk a real ladder rung from the dashboard seam (restart → redeploy), observing the ladder record tried/failed and clear on recovery; and (b) take the lab gateway's control plane down and drive a real break-glass action — probe both paths, move the control plane to a surviving node — over the fallback path from the app seat on an external machine (the S13 Q4 shape, which already demonstrated Tier-1 break-glass live: an external machine holding only a repo clone + operator key drove the surviving nodes to convergence with the runner down). The full Tier-3 recombine + rebuild and the disk-overwrite paths are out of the smoke's scope (share-splitting is unresolved; the takeover itself stays spike #12's / Q2.2's evidence).

Out of Scope

  • Backups' restore machinery and its surfaces. The restore rung and the Tier-3 data return invoke backups' restore (P7-S4) and report its outcome; the backup policy, runs, snapshots and restore UI are the backups feature's (P7). Rescue owns recovery of nodes, cluster and access; data is backups'.
  • Provisioning's change/removal surface. The device ladder's remove rung and the device-returns re-provision hand to provisioning's standing change surface and its LOSES destructive confirm (P4); rescue names the hand-off, it does not implement provisioning.
  • Monitoring's detection and respond ladder. Rescue is the escalation target of monitoring's respond ladder (P5-S4/S4x), not its owner; deciding when to escalate is monitoring's.
  • Founding's stand-up internals. The Tier-3 rebuild drives the existing founding orchestrator (install → seed → deploy → scrub, ADRs 0043/0052/0044) with recovered material; rescue composes it, it does not redesign the stand-up path.
  • Members' designation and role machinery. Kaitiaki designation and the operator-role grant live in members (P6); rescue reads the kaitiaki group for share-holder candidates and is invoked by the operator-role grant to mint a key — it never designates people or owns roles.
  • The share-splitting cryptographic implementation. Whether shares are Shamir over the recovery/escrow key or N sealed full copies with a threshold policy is carried as needs_human_decision (below), not designed here — the ledger, ceremony and readiness design are identical under either.

Further Notes

  • needs_human_decision carried, not re-derived:
    • Share-splitting implementation — Shamir over the recovery/escrow key vs N sealed full copies with a threshold policy. ADR 0006 named it a spike-shaped unknown and S13 Q3 confirmed only the recipient-set substrate; the design above is identical under either. Spike this before the slice builds (ADR 0090).
    • The Tier-2 contact channel — how the community first reaches the Matou Collective to start an engagement (channel, contact mechanics). Same family as monitoring's Notifier channel question (ADR 0089).
    • The summoning mechanism — carried over from monitoring (§12): summoning a person for a critical silence whose only fix is physical. Recorded here as an inherited leftover, not owned by rescue.
  • Cross-feature edges for the slice-map (the coupling this spec makes explicit):
    • monitoring — monitoring's respond ladder escalates into rescue (P5-S4/S4x → P8-S1/S2/S3); the escalate hand-off carries the incident and any failed-fix evidence. Rescue is the receiving side of that edge.
    • backups — the service ladder's restore rung and the Tier-3 data return invoke backups' restore (P7-S4); the Tier-3 return is per dataset, Identity dataset first (ADR 0078). Rescue and backups share the recovery/restore line (ticket #9).
    • provisioning — the device ladder's remove rung routes through provisioning's LOSES destructive confirm (P4-S3x); a returned device re-provisions through P4-S1. Rescue never grows a second removal path.
    • members — rescue reads the kanidm kaitiaki group (via the member orchestrator) for share-holder candidates; a members operator-role grant invokes rescue's key mint (ADR 0089); and the members share-holder suspend/remove advice-not-veto warning (ADR 0015) lands on Recovery readiness (P8-S7) as degraded coverage.
    • founding — the Tier-3 rebuild is a build-dependency edge on the founding orchestrator (install → seed → deploy → scrub); founding's hand-off (P1-S12) seeds the first operator key and offers the recovery kit whose re-prompt lands on P8-S7.
    • shell — the app is the standing fallback seat that serves break-glass when the dashboard is down (ADR 0086); shell's dashboard chrome may deep-link "Get help" to P8-S6, and Recovery readiness may supply a standing indicator to shell's reserved chrome slot (the ADR 0068 pattern) when coverage is below threshold; the break-glass actions' logs use shell's logs viewer (A5). Shell must reserve these — an obligation to record for the slice-map.
  • Seam confirmation: Ben's 2026-07-24 sign-off of the rescue grill's seam gate stands as the confirmation of both the rescue and breakglass seams (ADR 0086) — recorded here as that sign-off, not a fresh live confirmation at spec time.
  • Provenance note: the rescue design was produced by an auto-accept grill session (agent recommendations, no live interview), then reviewed and signed off by Ben on 2026-07-24 with every agent-invented number and posture kept. The decisions are on the record as agent-originated (ADRs 0086/0087/0089/0090/0091, DDRs 0088/0092) but accepted.
## Parent Wayfinder map: https://git.matou.nz/Matou/ourcloud/issues/7 — rescue's definition was locked on ticket #9 (2026-07-21). This child spec inherits the map's cross-feature constraints (clan substrate behind the `clan` seam; kanidm/OIDC behind the `member` orchestrator's `idp` port; the seeded-cache supply chain; the cross-cutting UX rulings — advice never veto, logging with Open/Download drill-in everywhere, the tiered-recovery doctrine of ADR 0006) and links back to it as the parent artifact. Grilled 2026-07-24 (`/grill-ux-with-docs`, auto-accept mode at Ben's instruction — the P4b/monitoring precedent: the agent made its recommended call at each decision point rather than grilling live); **Ben reviewed and signed off both gates (flow gate + seam gate) on 2026-07-24**, keeping every agent-invented number and posture. Decisions: ADRs 0086/0087/0089/0090/0091 + DDRs 0088/0092, all `accepted`. Flow: `docs/ux/flows/p8-rescue.mermaid` (10 screens). Wireframes: `docs/ux/wireframes/p8-rescue/` (10 pages, confirmed). ## Problem Statement Something in the community's fleet has broken past what monitoring can advise, and the operator — low-skill, low-time, and now frightened — has to get it back. The breakage spans a spectrum the operator cannot be asked to diagnose: a single service that keeps crashing; a device that has gone dark; or, at the far end, the control plane itself — the sign-in service, the mesh coordination, the dashboard — is the patient, so the very surface the operator would use to fix things is down. Left to raw tools this means: knowing which rung of which recovery procedure to try and remembering what already failed; reaching nodes over a mesh whose coordinator may be dead; judging whether a config replica is fresh enough to safely re-apply; deciding when to call for outside help without handing over standing access to the community's infrastructure; and, in the worst case, reconstituting the community's root secrets from shares held by different people and rebuilding a control plane from nothing. None of that should require systems expertise. And the one surface that must be believed when everything else is down must never claim a recovery it did not achieve, never render a tool it cannot back, and never leave the operator at a dead end. ## Solution Rescue splits on the one line that defines the feature — **whether the control plane is alive** — into two operator journeys on two different surfaces (ADR 0086). **The dashboard tracks (control plane alive).** When a service or a device is the patient but the fleet can still self-manage, rescue is a set of **advised ladders** on the web dashboard, driven server-side so a closed browser interrupts nothing. A service ladder climbs restart → redeploy → move → restore; a device ladder climbs wait → rehome → remove. Each ladder is a stateful object that **remembers** every rung tried and failed with its evidence, **degrades honestly** (a move that cannot be placed is a failed rung, not an attempted deploy; a restore hands to backups, never reimplements it), and **never dead-ends** (an exhausted ladder always offers the next tier). When a ladder is exhausted, the operator can open a **Tier-2 remote-support engagement** — community-initiated, per incident, granting at most a log bundle and an optional time-boxed supporter key, both revocable, never standing access. Standing beside all of this is **recovery readiness**: a surface that always shows whether the community is actually prepared for total loss — kit exported, recovery shares held and by whom, the threshold, and any degraded coverage — and lets the community run the share ceremony on the live fleet. **The operator-app tracks (control plane is the patient).** When the control plane, the dashboard, or the mesh coordination is down, no dashboard can serve its own rescue, so the operator app is the standing fallback seat and drives the fleet directly — **break-glass**. It probes every node on **both paths** — the mesh first, direct SSH as fallback with the config repo replica as the address book — and is honest per node about which path answered and which nodes it could not reach at all. It offers **curated break-glass actions** (restart a node's services, re-apply config against reachable nodes only, move the control plane to a healthy node), each honest about reach, each logged, and a **failed or not-holding action is a first-class state** with its evidence, never a toast claiming success. When break-glass's own preconditions fail — a revoked operator key, or no replica on this machine — the app says **why and who can act instead** rather than rendering dead tools. And at total loss, the app runs the **Tier-3 ceremony**: combine the recovery kit with the community's threshold of recovery shares (insufficient shares are an honest stuck state, never a partial ceremony), reconstitute the crown jewels in memory only, and rebuild a control plane from the freshest config checkout by driving **founding's own stand-up machinery** with recovered material — then re-scrub. Data comes back afterwards, per dataset, through backups' restore, Identity first. ## User Stories Acceptance criteria are Given/When/Then, sourced from the flow nodes and edges of `docs/ux/flows/p8-rescue.mermaid`, including every unhappy branch. Stories are grouped by the seam that executes them — `rescue` (control plane, the dashboard tracks) and `breakglass` (helper, the operator-app tracks), per ADR 0086. --- ## Seam A — `rescue` (control plane): the dashboard tracks ### Entry and escalation (from monitoring, P5) 1. As an operator, I want a downed service that monitoring could not fix to arrive in rescue with its history attached, so that I start from what has already been tried, not a blank slate. - Given monitoring's respond ladder escalates a downed service (P5-S4), When rescue opens, Then P8-S1 shows the service rescue ladder for that service with the incident summary ("Chat keeps crashing on rimu — failed to start 3 times since 14:02") and its logs. - Given monitoring escalates after a fix that did not hold (P5-S4x), When rescue opens, Then the failed-fix evidence is carried in and attached to the ladder, not discarded. 2. As an operator, I want a degraded device that monitoring could not fix to arrive as a device rescue, so that the track matches what is actually down. - Given monitoring escalates a degraded device (P5-S4), When rescue opens, Then P8-S2 shows the device rescue ladder with the device's impact stated in service terms ("rimu unreachable 38 min · Files & documents lost a copy, still safe on tōtara · Chat is down"). 3. As an operator, I want a lost control plane or dashboard to route me to the operator app, so that I am never asked to rescue a dead dashboard from that same dashboard. - Given monitoring escalates a lost control plane or dashboard, When I go to rescue, Then the route is to the operator app's break-glass surface (P8-S3), because the dashboard cannot serve its own rescue (ADRs 0086/0087). ### Track 1 — the service rescue ladder (P8-S1) 4. As an operator, I want a service rescue to be an advised ladder I climb, so that I try the least-disruptive fix first and escalate only as needed. - Given a downed service, When P8-S1 loads, Then it shows the rungs in order — restart → redeploy → move to a healthy device → restore the last good snapshot — each with a plain "what this does" line. 5. As an operator, I want the ladder to remember what I already tried, so that I never re-try a rung that already failed. - Given a rung has been tried, When I reopen the rescue, Then that rung shows its outcome with a timestamp and its own log ("Restart — tried at 14:06, crashed again"), and reopening shows the worked ladder, never a fresh menu (DDR 0088 §1). 6. As an operator, I want a move rung capacity-checked before it runs, so that I am not advised to move a service somewhere it cannot fit. - Given a "move to a healthy device" rung, When it is offered, Then it names the target and states its capacity was checked ("tōtara has capacity — checked"); a move that cannot be placed is shown as a failed rung with that reason, not an attempted deploy (DDR 0088 §2). 7. As an operator, I want the restore rung to hand off to backups rather than invent its own restore, so that recovery of data stays the one machinery I already trust. - Given a restore rung, When I choose it, Then it names the dataset and snapshot ("Chat's dataset, yesterday 02:00") and invokes backups' restore machinery (P7-S4), reporting its outcome; rescue never reimplements restore (DDR 0088 §3). 8. As an operator, I want a recovered service to close the incident, so that the alert clears and the fleet is self-managing again. - Given a rung recovers the service, When it passes, Then the action is audit-logged, the ladder reports recovered, and the monitoring alert resolves (back to P5-S1). 9. As an operator, I want an exhausted service ladder to offer remote support rather than a wall of red, so that I always have a next step. - Given every rung has been tried and named failed, When the ladder is exhausted, Then P8-S1 shows the exhausted state ("bigger than the ladder — time for the next tier") and offers Request remote support (P8-S6) with the worked ladder's evidence already bundled (DDR 0088 §7). ### Track 2 — the device rescue ladder (P8-S2) 10. As an operator, I want a degraded device shown with its impact first, so that I understand what is at stake before I act on the machine. - Given a degraded device, When P8-S2 loads, Then the impact is stated first in service terms (which data lost a copy but is still safe, which services are down), then the advised options. 11. As an operator, I want to wait out an intermittent device on its own pattern, so that I do not tear down a machine that is simply asleep on schedule. - Given a device with an intermittent pattern, When I choose Wait, Then the ladder holds and says why it is the right call for that device's pattern (and names when it is not, e.g. "rimu is always-on"). 12. As an operator, I want to rehome a device's services while it is gone, so that the community keeps running without the machine. - Given a gone device, When I choose Rehome, Then services are placed onto healthy nodes P4-style, capacity-checked before anything moves, and the impact is reviewed before deploy. 13. As an operator, I want removing a device to go through provisioning's destructive confirm, so that dropping a machine that holds the last copy of data is never a casual click. - Given I choose Remove the device, When the removal would drop the last copy of data, Then it hands to provisioning's standing change surface and its LOSES destructive confirm (P4-S3x, ADRs 0060/0063); keys are revoked and secrets rotated if warranted; rescue never grows a second, scarier removal path (DDR 0088 §4). 14. As an operator, I want a device that comes back to rejoin cleanly, so that a temporary outage does not force a rebuild. - Given the device returns, When it rejoins, Then it either rejoins cleanly or re-provisions through provisioning's assess surface (P4-S1). 15. As an operator whose degraded device is the gateway, I want to be sent to the operator app, so that I can rescue a fleet whose dashboard is down. - Given the degraded device is the gateway, When P8-S2 recognises it, Then no dashboard can serve this rescue and it summons the operator app's break-glass surface (P8-S3, ADRs 0086/0087). 16. As an operator, I want an exhausted device ladder to offer remote support, so that a device I cannot recover is not a dead end. - Given every device option has been tried and named failed, When the ladder is exhausted, Then it offers Request remote support (P8-S6) with the evidence bundled. ### Tier-2 — remote support (P8-S6) 17. As an operator, I want to open a remote-support engagement myself, so that outside help is something the community asks for, never something imposed. - Given an exhausted ladder, When I request remote support, Then P8-S6 opens an engagement stamped community-initiated ("opened by Ana, operator") and states the Matou Collective cannot open one; the incident's evidence is bundled at request. 18. As an operator, I want to share a log bundle with a supporter, so that they can diagnose without any access to the fleet. - Given an open engagement, When I share the log bundle, Then the worked ladder with every rung's tried/failed log is shared, and this grant is audit-logged. 19. As an operator, I want a supporter key to be time-boxed and revocable, so that outside help never becomes standing access. - Given an open engagement, When I optionally grant a supporter key, Then it is a time-boxed operator key scoped to the engagement, shows its expiry counting down, is revocable in one action (cutting mesh and SSH sides together), and is auto-revoked at expiry (ADR 0089). 20. As an operator, I want closing the engagement to revoke everything, so that nothing is left granted after help is done. - Given an engagement with grants standing, When I close it, Then anything still granted is revoked with it, the closure is audit-logged, and the alert then resolves (back to P5-S1). ### The operator-key ledger (ADR 0089) 21. As an operator, I want a standing ledger of operator keys, so that I can see, add, and revoke who can rescue the fleet. - Given the Rescue → Operator keys ledger, When I open it, Then it lists every operator key — standing operators and time-boxed supporters alike — with mint date, status and expiry, and lets me mint or revoke. 22. As a community, I want minting or revoking a key to pair its mesh and SSH sides, so that granting or removing an operator is one honest action. - 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. 23. As an operator locked out by a revoked key, I want another operator to restore my access from the ledger, so that a mistaken or lapsed revocation is fixable without a rebuild. - 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). ### Recovery readiness and the share ceremony (P8-S7) 24. As an operator, I want a standing surface that tells me whether we are actually prepared for total loss, so that being unprepared is never a silent surprise. - Given Recovery readiness (P8-S7), When I open it, Then it always shows the kit exported or not, the shares held and by whom, the threshold, and any degraded coverage — it is a standing surface, not a wizard's last page (ADR 0090). 25. As an operator, I want the founding kit re-prompt to land here until resolved, so that an un-exported kit keeps nagging in one honest place. - Given founding's hand-off (P1-S12) offered the recovery kit, When the kit is not yet exported, Then the re-prompt lands on P8-S7 and persists there until the kit is exported. 26. As an operator, I want the honest floor stated plainly, so that a fresh community knows its real recovery posture. - Given a community that has not run the share ceremony, When I view readiness, Then it states the floor is 1-of-1 — "the operator's kit IS the plan" — until the community deliberately runs the ceremony (ADR 0006). 27. As an operator, I want to run the share ceremony on the live fleet, so that the crown jewels are split across the people the community trusts. - Given the ceremony (P8-S7), When I run it, Then I pick holders from operators and kaitiaki (candidates read from members' designations via the `member` orchestrator — rescue never designates people), set the threshold (default 2-of-N, configurable), mint on the live fleet, and each holder confirms receipt; nothing assembled persists and the crown jewels are written nowhere new (the ADR 0044 scrub discipline holds). 28. As an operator, I want a share's receipt tracked, so that an unconfirmed share does not falsely count toward coverage. - Given a minted share, When the holder has not confirmed receipt, Then it shows unconfirmed and keeps coverage degraded; a confirmed share shows held with the receipt time. 29. As an operator, I want degraded coverage surfaced and re-mintable, so that a community that falls below its own threshold is prompted to fix it. - Given a share holder is suspended or removed in members (the advice-not-veto warning edge from P6-S4 lands here) or a receipt was never confirmed, When readiness computes coverage, Then it shows coverage degraded, names why, and offers Re-mint (which rotates the shares and invalidates the old ones). 30. As a community, I want being below threshold to raise the standing chrome indicator, so that we are never silently unprepared. - Given coverage below the community's own threshold, When readiness detects it, Then it may supply a standing indicator to shell's reserved chrome slot (the ADR 0068 pattern). 31. As an operator, I want an operator-role grant in members to mint a rescue key, so that adding an operator is one action with one revocation discipline. - 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. --- ## Seam B — `breakglass` (helper): the operator-app tracks ### The Situation probe (P8-S3) 32. As an operator, I want the app to probe every node on both paths and show me both, so that I know exactly what is reachable when the dashboard is gone. - Given break-glass opens (P8-S3), When it probes, Then it shows every node with a MESH column and an SSH column — mesh first, direct SSH fallback with the replica as the address book (ADR 0087) — and states what is down ("karaka, running your dashboard, is unreachable; the others are fine — you can move the control plane"). 33. As an operator, I want a node reachable on neither path named unreachable, so that no action silently skips a node it never touched. - Given a node answers on neither mesh nor SSH, When the probe completes, Then it is named unreachable and excluded honestly, never silently skipped; a LAN-only node unreachable from my current network is reported as exactly that, with the remedy stated ("rescue from a machine on the community's network"). 34. As an operator, I want the replica's freshness shown, so that I know whether it is safe to act from. - Given the config replica, When P8-S3 loads, Then it shows the replica's status and age ("synced 12 min ago — safe to act from"). 35. As an operator, I want a stale replica to warn me before I re-apply config, so that I never push out-of-date history over the live fleet unknowingly. - Given a replica N days behind, When I attempt to re-apply configuration, Then a gating confirm (not a passive badge) states the replica is N days behind and that re-applying can push stale history over the fleet, and requires my explicit confirmation (ADR 0032, DDR 0092). - Given the same stale replica, When I probe or restart node services, Then those stay available un-gated; it is only re-applying possibly out-of-date config that the warning gates. ### No usable Tier-1 material (P8-S3x) 36. As an operator whose key was revoked, I want to be told why and who can act, so that I am not staring at rescue tools that would all fail. - Given my operator key is revoked, When break-glass checks its preconditions, Then P8-S3x variant A states when and by whom it was revoked, names another operator who holds a valid key and can rescue from their own app, and points at restoring my access from the dashboard's operator-key ledger — never a Situation screen of dead tools (DDR 0092). 37. As an operator on a machine with no replica, I want to be pointed at another app or at cloning the repo, so that a fresh install is not a dead end. - Given this machine holds no replica (fresh install or new laptop), When break-glass checks its preconditions, Then P8-S3x variant B states rescue needs the replica (config and address book), points at another operator's synced app, and — if my key is valid — offers Clone the config repo to rescue from here. 38. As an operator, I want "everything lost" to be a conclusion I reach through a door, not a button beside working tools, so that the Tier-3 ceremony is never begun casually. - Given no operator holds usable Tier-1 material — every key gone or revoked and no machine holds a usable replica, When break-glass checks, Then P8-S3x variant C states this plainly and is the only variant that routes onward to the Tier-3 recovery ceremony (P8-S8). - Given any S3x variant, When material is regained (key restored, replica cloned), Then Check again returns to the Situation screen (P8-S3). ### Break-glass actions (P8-S4) 39. As an operator, I want curated break-glass actions rather than raw tools, so that I can act without systems expertise in the worst hour. - Given the Situation screen picks an action, When P8-S4 loads, Then it offers a curated set — Restart services on a node, Re-apply configuration, Move the control plane to a healthy node — each with a plain "what this does" line and its own Open log. 40. As an operator, I want a re-apply to be honest about which nodes it reached, so that I am never told the fleet is configured when half of it was unreachable. - Given Re-apply configuration, When it runs, Then it runs the replica's config against reachable nodes only, names the nodes it ran against and the nodes it could not reach and excluded, and never reports "configuration re-applied" over a half-reached fleet (DDR 0088 §5). 41. As an operator, I want moving the control plane to a healthy node to be a first-class action, so that a dead gateway is recoverable from the app. - Given a lost control-plane home, When I choose Move the control plane to a healthy node, Then it redeploys the config repo, deploy runner, and dashboard onto the chosen node, and every step is logged. 42. As an operator, I want a break-glass action that works to land me on recovered, so that success is unambiguous. - Given a break-glass action recovers the fleet, When it completes, Then P8-S5 shows the outcome ("Control plane now on rimu; your dashboard is back"), and the actions are audit-logged to the cluster on reconnect. 43. As an operator, I want to download a log bundle for a remote helper, so that I can get guidance even while the control plane is down. - Given P8-S4, When I choose Download log bundle, Then it produces the artifact to hand a remote helper — the app-side Tier-2 start; a supporter *guides* while the control plane is down, and a supporter key waits for a live control plane (ADR 0089). ### A break-glass action that failed or did not hold (P8-S4x) 44. As an operator, I want a failed action shown as a state with its evidence, so that I am never told something recovered when it did not. - Given a break-glass action that fails partway or does not hold, When it fails, Then P8-S4x names the action, its outcome ("failed at step 2 of 4 — deploy runner exited on start"), the load-bearing log excerpt, and exactly what it changed before failing — with nothing claimed recovered (DDR 0088 §6). 45. As an operator, I want to retry or pick a different action with the evidence in hand, so that a failure is a fork, not a wall. - Given P8-S4x, When I decide, Then I can Retry this action (same action, the log naming the blocker to clear first), or Pick a different action (back to P8-S4 with the evidence attached, e.g. move to a different node). 46. As an operator stuck but not lost, I want to escalate from a failed action, so that outside help or Tier-3 is always reachable. - Given P8-S4x, When I am stuck but not lost, Then I can download the log bundle to hand a remote helper (the app-side Tier-2 start); given everything is lost, When I choose, Then I begin the Tier-3 ceremony (P8-S8). - Given the dashboard is still up alongside a stuck app action, When I choose, Then requesting remote support (P8-S6) remains available. ### Recovered (P8-S5) 47. As an operator, I want a plain recovered screen with a link back to my dashboard, so that I know the fleet is self-managing again. - Given a break-glass recovery, When P8-S5 loads, Then it states what recovered and where the dashboard is now, notes every action was written to the community's audit log on reconnect, and the app goes quiet (back to operator home). ### Tier-3 — the recovery ceremony (P8-S8) 48. As an operator, I want recombining shares to stop honestly below threshold, so that a partial ceremony never half-reconstitutes the crown jewels. - Given the Tier-3 ceremony act 1 (P8-S8), When fewer than the threshold of shares combine, Then it is an honest stuck state naming exactly what is missing ("1 of 2 required — Mere's share unconfirmed, Hemi unreachable"), nothing is reconstituted below threshold, and there is no operator-app override — the threshold is the community's decision (ADR 0091). 49. As an operator, I want the threshold met to reconstitute the jewels in memory only, so that recovery never writes the crown jewels somewhere new. - Given the threshold of shares combines with the recovery kit, When act 1 completes, Then the crown jewels are reconstituted in the app's memory only, for this rebuild. 50. As an operator, I want to rebuild the control plane from the freshest checkout I can reach, so that recovery starts from the least-stale config. - Given act 2 (rebuild from checkout), When I pick the checkout, Then it offers this machine's replica, another operator's replica (freshest wins, named), or a repo restored from backup, and I pick the machine to carry the control plane (one that meets the gateway minimum). 51. As an operator, I want the rebuild to ride founding's own stand-up machinery, so that the most-desperate hour uses the most-tested install path. - Given a chosen checkout and machine, When the rebuild runs, Then the helper drives founding's stand-up (install → seed → deploy) with recovered material substituted for newly-born material (ADRs 0091/0043/0052), and ends in the same scrub (ADR 0044) so the machine keeps no ambient crown jewels. 52. As an operator, I want the rebuild to end at recovered with data still coming back, so that nothing is claimed back that has not been. - Given a completed rebuild, When it finishes, Then P8-S5 (rebuilt variant) states the cluster and access are recovered — control plane, sign-in, mesh, dashboard — and that data is not all back yet: restores continue in backups, per dataset, the Identity dataset first so members exist again (ADR 0078), and the spent shares show on Recovery readiness with a prompt to re-run the ceremony. ## Implementation Decisions - **Two orchestrators, two seams, split on the failure line (ADR 0086).** `rescue` is a Go package in the control plane driving the dashboard tracks (service/device ladders, the Tier-2 engagement, the operator-key ledger, recovery readiness + the share ceremony's bookkeeping); `breakglass` is a Go package in the operator app's bundled helper driving the app tracks (the dual-path situation probe, the curated break-glass actions, the Tier-3 recombination + rebuild). The split is deliberate and **not** pattern-matched to the "everything in the control plane" placement of the four prior control-plane features: rescue is the one feature whose premise is that the control-plane home may be gone, so its defining scenario would be untestable at a single control-plane seam, while a single helper seam would push routine attended ladders onto the operator's laptop. This is provisioning's two-seam precedent (ADR 0065) with more force — the two journeys differ in object, trigger, scope, cadence, *and in which substrate is assumed alive*. - **Break-glass reaches the fleet mesh-first, direct-SSH fallback, replica as address book (ADR 0087).** The app is a mesh peer via the operator key; established WireGuard sessions survive the loss of the gateway's Netbird management plane. When the mesh does not answer, `breakglass` falls back to plain SSH using the operator key's SSH credential (the operator is a trusted principal on every node, S13 Q3/Q4); addresses come from the node configs' captured network facts in the config repo replica (baked in by spike Q2.2). The MESH/SSH columns on P8-S3 are contract. Reachability is a small `breakglass`-owned prober — **not** a `clan` seam verb (transport, not clan orchestration), so **no repo-root seam is amended**. The helper gains a second lifetime: founding stand-up, wizard preview, P3-join bootstrap, and now on-demand break-glass rescue — still no standing duties. - **Rescue ladders remember, degrade honestly, never dead-end (DDR 0088).** A ladder is a stateful object, not a menu: rungs record tried/failed with timestamp and log; move-rungs are capacity-checked first; the restore rung invokes backups (P7-S4), never reimplements it; remove-the-device routes through provisioning's LOSES confirm (P4-S3x); partial reach is named; a failed/not-holding action is a state (P8-S4x); an exhausted ladder always offers the next tier. This is DDR 0072's honest-degradation discipline carried to rescue's altitude, where the temptation to reassure is strongest. - **Remote support engagement + operator-key ledger live in `rescue` (ADR 0089).** A remote-support engagement is a control-plane resource: community-initiated per incident, never initiable by Matou, carrying at most a log bundle and an optional time-boxed supporter key (revocable in one action, auto-revoked at expiry, cut on engagement close). The operator-key ledger (list/mint/revoke, standing operators + time-boxed supporters) is `rescue`'s surface; founding seeds the first key, a members operator-role grant *invokes* rescue's mint, and a mint/revoke pairs the mesh identity and the SSH side. **The honest limit: no supporter key without a live control plane** — minting is a control-plane act, so when the control plane is the patient Tier-2 degrades to the app producing the log bundle and the supporter guiding rather than driving. - **Recovery shares minted in a live-fleet ceremony; readiness is standing (ADR 0090).** Shares are first-class ledger objects (holder, minted-at, receipt-confirmed, status held|unconfirmed|revoked|holder-degraded), holders drawn from operators and kaitiaki read from members' designations. The ceremony runs on the live fleet (the crown jewels live on in the fleet vars per ADR 0044, so a live fleet can split them; nothing assembled persists). Readiness is a standing surface — kit exported or not (founding's re-prompt lands here), shares + threshold + degraded coverage — that may raise shell's chrome indicator when below threshold. - **Tier-3 rebuild reuses founding's stand-up machinery (ADR 0091).** The Tier-3 ceremony (P8-S8, helper) has two acts: recombine (kit + threshold of shares → reconstitute in memory; insufficient shares are an honest stuck state, never a partial ceremony, no override), then rebuild from checkout by driving the `founding` orchestrator's install → seed → deploy path with *recovered* material, ending in the same scrub. `breakglass` composes the `founding` package (already bundled in the helper — no new binary target). Data returns through backups' restore, per dataset, Identity first — rescue never grows a data-restore path. - **No usable Tier-1 material is a first-class state (DDR 0092).** Break-glass's own preconditions — a valid operator key and a present, fresh-enough replica — get honest states (P8-S3x) instead of broken tools: revoked key → who can act + the ledger fix; no replica → another app or clone; only no-operator-holds-material routes to Tier-3. A stale replica warns before every re-apply as a gating confirm (ADR 0032), while probing and restarting stay un-gated. - **Thin UI over both seams.** The dashboard's Rescue surfaces are thin UI over `rescue`; the app's rescue screens are thin UI over `breakglass` via the helper's stdio NDJSON contract (ADR 0051). Neither surface decides state. ## Testing Decisions - **What a good test is here:** it drives one of the two seams and asserts *external behaviour* — the flow-node state reached, the ladder memory and exhaustion, the reachable-nodes-only honesty, the coverage claimed (or not), the threshold arithmetic, the operator-facing failure and its evidence — never internal step ordering. Fakes simulate the world (clan, the prober, the clock, health checks, the replica, member reads, shares); the state machines under test are real. - **`rescue` (control plane) — THE seam for the dashboard tracks (ADR 0086), mirroring `provision`/`monitor` (0058/0069).** Driven headless in-process against a fake fleet-state provider, a fake `clan.Clan` (assert each rung issues the right operation and the ladder records tried/failed), per-service `HealthCheck` fakes (a rung "held" or "didn't"), a fake clock (supporter-key expiry, auto-revocation), a fake `member` read (kaitiaki designations / share-holder candidates), and an in-memory engagement/operator-key/share ledger. Every dashboard-track criterion executes here: service and device ladder memory and exhaustion, the restore rung's hand-off, removal routing to provisioning's LOSES confirm, the device-returns re-provision, engagement open → bundle → key-grant → auto-revoke → close-revokes-all, the mint/revoke mesh+SSH pairing, share mint/confirm/re-mint, threshold arithmetic, and degraded-coverage derivation from members' events. - **`breakglass` (helper) — THE seam for the app tracks (ADR 0086), mirroring `founding` (0052).** Driven through its interface with a fake prober (per-node mesh/SSH answers on command), a fake `clan` adapter (the S13 fakes: blocked/remedy/partial-failure flows), a fake replica (freshness controllable — the ADR 0032 staleness gate is asserted, not assumed), fake Tier-1 material (key present/revoked/absent for DDR 0092), and fake shares (threshold met / insufficient). Every app-track criterion executes here: the dual-path probe table and unreachable-node honesty, the stale-replica gating confirm, reachable-nodes-only re-apply, action-failed evidence (P8-S4x), the S3x variants and their routes, the Tier-3 ceremony's threshold enforcement (reconstitution never below threshold), the founding stand-up hand-off invoked with recovered-material inputs, and the post-rebuild scrub. - **Below each seam:** one thin round-trip test each — control-plane HTTP for `rescue` (mirroring provisioning's, ADR 0058), helper stdio NDJSON for `breakglass` (mirroring founding's, ADRs 0051/0052). Above the seams: nothing — the Vue dashboard and the app's rescue screens render states, they do not decide them. - **Prior art to copy:** the `founding` stand-up orchestrator's fake harness (in-memory ledger + clock, ADR 0052) for the Tier-3 rebuild path; `enroll`'s ledger/state-machine family (mint/revoke/approve-decline) for the operator-key and share ledgers and the engagement lifecycle; provisioning's partial-failure family (per-service pass/fail, active-for-what-works with no coverage claimed) for the reachable-nodes-only and named-partial-reach outcomes; and the S13 prototype's clan fakes (`spikes/S13-clan-orchestration/`). - **Non-gating real-lab rescue smoke (fake-drift insurance), mirroring the five prior features' spec pattern.** A scheduled clan-lab rescue smoke, explicitly **not** an acceptance gate, scoped to what clan-lab can genuinely exercise: (a) kill a real service on a lab node and walk a real ladder rung from the dashboard seam (restart → redeploy), observing the ladder record tried/failed and clear on recovery; and (b) take the lab gateway's control plane down and drive a real break-glass action — probe both paths, move the control plane to a surviving node — over the fallback path from the app seat on an external machine (the S13 Q4 shape, which already demonstrated Tier-1 break-glass live: an external machine holding only a repo clone + operator key drove the surviving nodes to convergence with the runner down). The full Tier-3 recombine + rebuild and the disk-overwrite paths are out of the smoke's scope (share-splitting is unresolved; the takeover itself stays spike #12's / Q2.2's evidence). ## Out of Scope - **Backups' restore machinery and its surfaces.** The restore rung and the Tier-3 data return *invoke* backups' restore (P7-S4) and report its outcome; the backup policy, runs, snapshots and restore UI are the backups feature's (P7). Rescue owns recovery of nodes, cluster and access; data is backups'. - **Provisioning's change/removal surface.** The device ladder's remove rung and the device-returns re-provision hand to provisioning's standing change surface and its LOSES destructive confirm (P4); rescue names the hand-off, it does not implement provisioning. - **Monitoring's detection and respond ladder.** Rescue is the escalation target of monitoring's respond ladder (P5-S4/S4x), not its owner; deciding *when* to escalate is monitoring's. - **Founding's stand-up internals.** The Tier-3 rebuild drives the existing `founding` orchestrator (install → seed → deploy → scrub, ADRs 0043/0052/0044) with recovered material; rescue composes it, it does not redesign the stand-up path. - **Members' designation and role machinery.** Kaitiaki designation and the operator-role grant live in members (P6); rescue *reads* the kaitiaki group for share-holder candidates and *is invoked by* the operator-role grant to mint a key — it never designates people or owns roles. - **The share-splitting cryptographic implementation.** Whether shares are Shamir over the recovery/escrow key or N sealed full copies with a threshold policy is carried as `needs_human_decision` (below), not designed here — the ledger, ceremony and readiness design are identical under either. ## Further Notes - **`needs_human_decision` carried, not re-derived:** - **Share-splitting implementation** — Shamir over the recovery/escrow key vs N sealed full copies with a threshold policy. ADR 0006 named it a spike-shaped unknown and S13 Q3 confirmed only the recipient-set substrate; the design above is identical under either. **Spike this before the slice builds** (ADR 0090). - **The Tier-2 contact channel** — how the community first *reaches* the Matou Collective to start an engagement (channel, contact mechanics). Same family as monitoring's `Notifier` channel question (ADR 0089). - **The summoning mechanism** — carried over from monitoring (§12): summoning a person for a critical silence whose only fix is physical. Recorded here as an inherited leftover, not owned by rescue. - **Cross-feature edges for the slice-map (the coupling this spec makes explicit):** - **monitoring** — monitoring's respond ladder escalates into rescue (P5-S4/S4x → P8-S1/S2/S3); the escalate hand-off carries the incident and any failed-fix evidence. Rescue is the receiving side of that edge. - **backups** — the service ladder's restore rung and the Tier-3 data return invoke backups' restore (P7-S4); the Tier-3 return is per dataset, **Identity dataset first** (ADR 0078). Rescue and backups share the recovery/restore line (ticket #9). - **provisioning** — the device ladder's remove rung routes through provisioning's LOSES destructive confirm (P4-S3x); a returned device re-provisions through P4-S1. Rescue never grows a second removal path. - **members** — rescue reads the kanidm `kaitiaki` group (via the `member` orchestrator) for share-holder candidates; a members operator-role grant *invokes* rescue's key mint (ADR 0089); and the members share-holder suspend/remove **advice-not-veto warning** (ADR 0015) lands on Recovery readiness (P8-S7) as degraded coverage. - **founding** — the Tier-3 rebuild is a **build-dependency edge** on the `founding` orchestrator (install → seed → deploy → scrub); founding's hand-off (P1-S12) seeds the first operator key and offers the recovery kit whose re-prompt lands on P8-S7. - **shell** — the app is the standing fallback seat that serves break-glass when the dashboard is down (ADR 0086); shell's dashboard chrome may deep-link "Get help" to P8-S6, and Recovery readiness may supply a standing indicator to shell's reserved chrome slot (the ADR 0068 pattern) when coverage is below threshold; the break-glass actions' logs use shell's logs viewer (A5). Shell must reserve these — an obligation to record for the slice-map. - **Seam confirmation:** Ben's 2026-07-24 sign-off of the rescue grill's seam gate stands as the confirmation of both the `rescue` and `breakglass` seams (ADR 0086) — recorded here as that sign-off, not a fresh live confirmation at spec time. - **Provenance note:** the rescue design was produced by an auto-accept grill session (agent recommendations, no live interview), then reviewed and signed off by Ben on 2026-07-24 with every agent-invented number and posture kept. The decisions are on the record as agent-originated (ADRs 0086/0087/0089/0090/0091, DDRs 0088/0092) but accepted.
Author
Owner

Ruled by Ben 2026-08-27: all slices of this spec are done for v1; the remaining scope (#310/#353 for backups; #306/#307 for rescue) is a FUTURE DRIVE. Spec stays open, labelled deferred, as the seed of that drive.

Ruled by Ben 2026-08-27: all slices of this spec are done for v1; the remaining scope (#310/#353 for backups; #306/#307 for rescue) is a FUTURE DRIVE. Spec stays open, labelled `deferred`, as the seed of that drive.
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.

Dependencies

No dependencies set.

Reference
Matou/idss#21
No description provided.