Spec: rescue — recover services, devices and a dead control plane; tiered recovery (P8) #21
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
clanseam; kanidm/OIDC behind thememberorchestrator'sidpport; 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, allaccepted.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) andbreakglass(helper, the operator-app tracks), per ADR 0086.Seam A —
rescue(control plane): the dashboard tracksEntry and escalation (from monitoring, P5)
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.
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.
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.
Track 1 — the service rescue ladder (P8-S1)
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.
As an operator, I want the ladder to remember what I already tried, so that I never re-try a rung that already failed.
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.
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.
As an operator, I want a recovered service to close the incident, so that the alert clears and the fleet is self-managing again.
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.
Track 2 — the device rescue ladder (P8-S2)
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.
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.
As an operator, I want to rehome a device's services while it is gone, so that the community keeps running without the machine.
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.
As an operator, I want a device that comes back to rejoin cleanly, so that a temporary outage does not force a rebuild.
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.
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.
Tier-2 — remote support (P8-S6)
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.
As an operator, I want to share a log bundle with a supporter, so that they can diagnose without any access to the fleet.
As an operator, I want a supporter key to be time-boxed and revocable, so that outside help never becomes standing access.
As an operator, I want closing the engagement to revoke everything, so that nothing is left granted after help is done.
The operator-key ledger (ADR 0089)
As an operator, I want a standing ledger of operator keys, so that I can see, add, and revoke who can rescue the fleet.
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.
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.
Recovery readiness and the share ceremony (P8-S7)
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.
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.
As an operator, I want the honest floor stated plainly, so that a fresh community knows its real recovery posture.
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.
memberorchestrator — 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).As an operator, I want a share's receipt tracked, so that an unconfirmed share does not falsely count toward coverage.
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.
As a community, I want being below threshold to raise the standing chrome indicator, so that we are never silently unprepared.
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.
Seam B —
breakglass(helper): the operator-app tracksThe Situation probe (P8-S3)
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.
As an operator, I want a node reachable on neither path named unreachable, so that no action silently skips a node it never touched.
As an operator, I want the replica's freshness shown, so that I know whether it is safe to act from.
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.
No usable Tier-1 material (P8-S3x)
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.
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.
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.
Break-glass actions (P8-S4)
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.
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.
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.
As an operator, I want a break-glass action that works to land me on recovered, so that success is unambiguous.
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.
A break-glass action that failed or did not hold (P8-S4x)
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.
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.
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.
Recovered (P8-S5)
Tier-3 — the recovery ceremony (P8-S8)
As an operator, I want recombining shares to stop honestly below threshold, so that a partial ceremony never half-reconstitutes the crown jewels.
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.
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.
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.
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.
Implementation Decisions
rescueis 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);breakglassis 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.breakglassfalls 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 smallbreakglass-owned prober — not aclanseam 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(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) isrescue'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.foundingorchestrator's install → seed → deploy path with recovered material, ending in the same scrub.breakglasscomposes thefoundingpackage (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.rescue; the app's rescue screens are thin UI overbreakglassvia the helper's stdio NDJSON contract (ADR 0051). Neither surface decides state.Testing Decisions
rescue(control plane) — THE seam for the dashboard tracks (ADR 0086), mirroringprovision/monitor(0058/0069). Driven headless in-process against a fake fleet-state provider, a fakeclan.Clan(assert each rung issues the right operation and the ladder records tried/failed), per-serviceHealthCheckfakes (a rung "held" or "didn't"), a fake clock (supporter-key expiry, auto-revocation), a fakememberread (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), mirroringfounding(0052). Driven through its interface with a fake prober (per-node mesh/SSH answers on command), a fakeclanadapter (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.rescue(mirroring provisioning's, ADR 0058), helper stdio NDJSON forbreakglass(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.foundingstand-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/).Out of Scope
foundingorchestrator (install → seed → deploy → scrub, ADRs 0043/0052/0044) with recovered material; rescue composes it, it does not redesign the stand-up path.needs_human_decision(below), not designed here — the ledger, ceremony and readiness design are identical under either.Further Notes
needs_human_decisioncarried, not re-derived:Notifierchannel question (ADR 0089).kaitiakigroup (via thememberorchestrator) 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.foundingorchestrator (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.rescueandbreakglassseams (ADR 0086) — recorded here as that sign-off, not a fresh live confirmation at spec time.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.