Backups (P7) — child spec: coverage, verified runs, deliberate restore, rebuild-from-nothing #20
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#20
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: #7 (OurCloud v1 program scope — Phase 0). Backups' definition and boundary rulings were locked on #9 (2026-07-21); this child spec consumes the backups grill and wireframe set (2026-07-24, run in auto-accept mode at Ben's instruction — the P4b/monitoring precedent — with both gates signed off by Ben on 2026-07-24): ADRs 0079–0082 (engineering) + DDRs 0083–0085 (design), the rebuilt
docs/ux/flows/p7-backups.mermaid(11 screens), and the confirmed wireframe set indocs/ux/wireframes/p7-backups/(approved in-browser 2026-07-24).Problem Statement
A community's data — its files, chats, photos, git, and the people-and-access truth in kanidm — must survive a dead disk, a lost node, a fat-fingered deletion, or the whole site burning down, and it must survive it without anyone running "backup administration." The operator (low-skill, low-time, the P1 persona) needs to see what is protected and where the gaps are, get real coverage without designing a backup plan from scratch, trust that a "backup" is actually restorable rather than a green light over an unverified copy, bring data back when something goes wrong, and — in the worst hour — rebuild from nothing without any surviving infrastructure to consult. The most dangerous backup system is one that quietly stops running and stays green; today none of this exists, and the moment founding ends the Identity dataset already exists and is unprotected (ADR 0078).
Solution
The Backups tab (in shell's dashboard frame). Coverage exists before the operator does anything (DDR 0085): every dataset appears by itself — Identity from founding, each service's datasets as provisioning deploys them (ADR 0080) — each honestly not backed up yet, with a drafted recommended policy (nightly 02:00, 30-day retention, targets recommended from fleet topology with zone spread) the operator reviews and confirms. Snapshots are always encrypted — stated as a fact, never a toggle (DDR 0085). A backup is not good until its sampled restore test passes; coverage counts verified copies only (CONTEXT: Coverage). A backup that didn't run is a failure, not an absence — a stale dataset is as loud as a failed run (DDR 0083). Backups own the substance and publish faults and coverage as state; monitoring classifies and notifies — backups never grow their own alert channel (ADR 0081). Restore is deliberate: in-place restore promotes to a REPLACES destructive confirm and takes a pre-restore snapshot to fall back to (DDR 0084). Export is the sovereignty valve — the community can take its data and go, dataset by dataset (DDR 0084). And every artifact is shaped so that after a total loss, the recovery kit's keys decrypt ciphertext-only offsite snapshots the config repo names — no step consults infrastructure that burned down (ADR 0082).
User Stories
The overview and first run
Policy
Runs & verification
Faults, staleness, and gone targets (through monitoring)
backuppublishes the fault as control-plane state with plain-language evidence, and monitoring classifies it (critical) and notifies — backups never set a severity or touch the notifier.Restore
Replace & restore, and states headroom needs when space is tight.Export
Recoverability and audit (the whole point)
Implementation Decisions
backupGo package lives in the control plane on the gateway, and only there — it schedules and executes runs (snapshot → replicate → verify), computes coverage and staleness, publishes backup faults for monitoring, and drives restores and exports. The Vue dashboard's Backups tab is thin UI over it; the operator app runs none of this logic. Placement decided on backups' own merits: runs are a standing scheduled duty of the fleet that must fire with every browser closed (ADR 0011); everything backups touches is fleet-side; a restore runs server-side so a closed browser interrupts nothing (the ADR 0058 property). Restore-as-disaster-tooling stays rescue's territory — while the control plane is up, backups belong to it; when it is down, a Tier-3 rebuild consumes backups' artifacts (ADR 0082), never its running engine.AttachServicealready admits (the ADR 0062 parts pattern) — noclanseam amendment. Identity is the one dataset with no catalogue port: kanidm is control-plane infrastructure, so the control plane itself ships Identity's backup contract (same shape, built in), present from the moment founding ends.backupwrites fault conditions (run failed, verification failed, stale, coverage gap) and coverage as control-plane state with plain-language evidence strings;monitorreads that state exactly as it reads per-service health (ADR 0070 already lists coverage/HA gaps among the classifier's inputs).backupnever touches theNotifier, never sets a severity, never decides what the operator is told. The overview and monitoring's alerts render the same underlying record — they cannot disagree.Confighatch; port verbs ride the reconciler contractsAttachServicealready admits (ADR 0080); faults/coverage are control-plane-internal statemonitorreads (ADR 0081). After monitoring, backups is the second Phase-1 feature to leave all three confirmed seams untouched. The repo skeleton (ADR 0040) gains abackuppackage built into the control plane only.backupthrough the OpenAPI-specced control-plane API. Architecture diagram 02 gains thebackupbox; diagram 12 gains the Tier-3 rebuild-from-offsite note (ADR 0042, done at grill time).Testing Decisions
backuporchestrator through its public interface and assert externally visible outcomes — coverage and staleness computations, per-target run outcomes, the fault/coverage state published for monitoring (what fault, with what evidence — never how it is notified), restore-ladder state transitions, and the calls made to the fake port verbs — never internals. A per-target partial failure is a successful run with a named failed target, not an error. A stale dataset is a computed state, not a missing record. A restore ends at verify.backuporchestrator driven headlessly in-process against fakes — a fake clock (schedules, one-missed-cycle staleness, retention windows, "last good three days ago"); fake port backup contracts (per-dataset snapshot / restore / verify-sample verbs that succeed, fail, or hang, including the quiesce an in-place restore relies on); fake targets (node and offsite) that accept, refuse, or vanish (per-target partial outcomes and the target-gone state); a fake fleet-state provider (topology and zones for zone-spread recommendation, the intermittent tag, and per-service health so a failed service contributes no coverage); an in-memory fault/coverage state read the waymonitorwill read it; and the config-repo commit path faked as an in-memory policy store. Above the seam nothing (Vue renders, does not decide); below, one thin HTTP round-trip test against the real control-plane binary, mirroring provisioning's and monitoring's.monitor→ schedules, staleness, retention, and "last good N days ago".backup's harness asserts what fault was published with what evidence; the reciprocalmonitortest replays published backup faults as classifier input.spikes/S13-clan-orchestration/) — the substrate backup verbs ride on.Out of Scope
Further Notes
Cross-feature edges for the slice-map (Phase 2):
backupcode.backupwrites fault/coverage state with evidence strings;monitorclassifies, raises, and notifies (ADR 0081). The overview and monitoring's alerts render the same record.Carried
needs_human_decision:Labelled
no-triage(the #17/#18/#19 precedent): the live swarm must not pick this up before the Phase-2 slice-map orders the DAG.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.preflight-red(the #20 probe has no retry), and the empty verdict error block sends the healer chasing a guard that never broke #1359preflight-red(the #20 probe has no retry), and the empty verdict error block sends the healer chasing a guard that never broke #1359invalid-policy— the #12 policy gate's label check has a 6s retry budget, records no verdict error line, and blames a policy file that is valid (the #1359 defect in the other preflight gate) #2052