backups: coverage-map-and-first-run — overview shows every dataset, honest from day one #82

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

Parent

Feature spec: #20 (backups).

What to build

The Backups tab's coverage map, mounted in shell's dashboard frame, and its never-empty first visit. On the overview (P7-S1) each dataset is a row showing its verified copies count, whether it has an offsite copy, and its last good moment — counting verified snapshot copies only, never a live service replica and never a copy sitting on a target that is known gone (CONTEXT: Coverage). Gaps are named proactively as a state on the row — single copy, no offsite, or stale — never a dated "last good: 9 days ago" timestamp standing in for a fault. The backup control-plane orchestrator computes this projection (ADR 0079); the Vue tab is thin UI over it.

Datasets appear by themselves. Every dataset the fleet holds is listed the first time Backups is opened (P7-S1x, DDR 0085) — Identity present from the moment founding ends (its built-in backup contract ships in the control plane, ADR 0080), each catalogue service's declared dataset(s) as provisioning deploys them (the port's dataset contract, ADR 0080) — with no operator action to register or add one. Before any policy is confirmed each dataset reads honestly not backed up yet, and the drafted recommended policy is offered to review and confirm (the confirm itself is the next slice's screen). On a just-founded single-node fleet the honest floor is stated plainly: no on-fleet target can give real coverage until a second device joins — an offsite target is the only real coverage — shown beside an "Add a device" cross-link (into device-add's flow), and no same-node copy is ever counted as coverage.

Coverage reads per-service health from the shared fleet-state provider: a service that failed its health check contributes no coverage anywhere, consistent with provisioning's "a failed service claims no coverage" invariant (ADR 0079/0061) — hence this slice's edge to provisioning's active-and-partial health. Notes: the Identity dataset (kanidm store) is a founding-seeded runtime coupling — present because founding created it, not because of a build edge.

Acceptance criteria

  • (story 1) Given datasets exist with backup policies, when I open Backups, then each row shows the dataset, its verified copies count, whether it has an offsite copy, and its last good moment — counting verified snapshot copies only, never live replicas and never a copy on a gone target.
  • (story 2) Given a dataset with a single copy, or no offsite anywhere, or a stale run, when I view the coverage map, then the gap is named as a state on the row (single copy / no offsite / stale), never a dated timestamp standing in for a fault.
  • (story 3) Given a freshly founded community that has confirmed no policy yet, when I open Backups, then every dataset that exists is listed — Identity from founding, each service's datasets as provisioned — each shown honestly not backed up yet, with the drafted recommended policy offered to review and confirm.
  • (story 4) Given a catalogue service is provisioned, when I next view Backups, then its declared dataset(s) appear as rows automatically from the port's dataset contract, with no operator action to add them.
  • (story 5) Given the fleet is one gateway with no second node, when I view first-run Backups, then it states that no on-fleet target can give real coverage until a second device joins — an offsite target is the only real coverage — offered beside an "Add a device" cross-link, and no same-node copy is ever counted as coverage.
  • (story 31) Given a service that failed its health check, then its dataset's target contributes no coverage, consistent with provisioning's "a failed service claims no coverage" invariant.

Blocked by

  • #29 — Backups tab mounts in dashboard frame
  • #73 — per-service health gates coverage

Task manifest

task: backups:coverage-map-and-first-run
implements_flow: p7-backups
implements_edge: S1 (overview render), S1x→S2, S1→S2
wireframe:
  - docs/ux/wireframes/p7-backups/p7-s1-backups-overview.html
  - docs/ux/wireframes/p7-backups/p7-s1x-overview-nothing-backed-up-yet.html
interface: backup orchestrator — coverage projection per dataset (verified-copies count, offsite present, last good), dataset enumeration from port dataset contracts (Identity built-in), first-run drafted-policy read; reads per-service health + topology from the fleet-state provider (failed service → no coverage; single-node floor)
seam: backup orchestrator seam tests (control plane, Go) — fake port dataset contracts, fake fleet-state provider (per-service health, topology, zones), in-memory coverage state read the way monitor reads it
acceptance:
  - given: datasets exist with policies
    when: I open Backups
    then: each row shows dataset, verified-copies count, offsite present, last good — verified snapshot copies only, never live replicas, never a gone-target copy
  - given: a single-copy / no-offsite / stale dataset
    when: I view the coverage map
    then: the gap is named as a row state, never a dated timestamp standing in for a fault
  - given: a freshly founded community with no policy confirmed
    when: I open Backups
    then: every dataset is listed (Identity from founding, service datasets as provisioned), each honestly "not backed up yet", drafted policy offered
  - given: a catalogue service is provisioned
    when: I next view Backups
    then: its declared dataset(s) appear automatically from the port's dataset contract, no operator action
  - given: a one-gateway fleet
    when: I view first-run Backups
    then: the single-node floor is stated (offsite is the only real coverage until a second device joins), with an "Add a device" cross-link, and no same-node copy is counted
  - given: a service that failed its health check
    then: its dataset's target contributes no coverage anywhere
depends_on: [shell:ui-kit-mount-slot-contract, provisioning:provision-active-and-partial]
out_of_scope:
  - story 6–10 policy confirm/edit — policy-confirm-and-edit's
  - stories 11–14 runs/verification — scheduled-runs-and-verification's
  - stories 20–28 restore/export — the restore/export slices'
  - filesystem-level generic backup (rejected, ADR 0080)
  - a run/coverage database as durable state (rejected, ADR 0082)
needs_human_decision: []
## Parent Feature spec: #20 (backups). ## What to build The Backups tab's coverage map, mounted in shell's dashboard frame, and its never-empty first visit. On the overview (P7-S1) each dataset is a row showing its **verified copies** count, whether it has an **offsite** copy, and its **last good** moment — counting **verified snapshot copies only**, never a live service replica and never a copy sitting on a target that is known gone (CONTEXT: *Coverage*). Gaps are named proactively as a state on the row — *single copy*, *no offsite*, or *stale* — never a dated "last good: 9 days ago" timestamp standing in for a fault. The `backup` control-plane orchestrator computes this projection (ADR 0079); the Vue tab is thin UI over it. Datasets appear by themselves. Every dataset the fleet holds is listed the first time Backups is opened (P7-S1x, DDR 0085) — Identity present from the moment founding ends (its built-in backup contract ships in the control plane, ADR 0080), each catalogue service's declared dataset(s) as provisioning deploys them (the port's dataset contract, ADR 0080) — with no operator action to register or add one. Before any policy is confirmed each dataset reads honestly **not backed up yet**, and the **drafted recommended policy** is offered to review and confirm (the confirm itself is the next slice's screen). On a just-founded single-node fleet the honest floor is stated plainly: **no on-fleet target can give real coverage until a second device joins — an offsite target is the only real coverage** — shown beside an "Add a device" cross-link (into device-add's flow), and no same-node copy is ever counted as coverage. Coverage reads per-service health from the shared fleet-state provider: a service that failed its health check contributes **no coverage** anywhere, consistent with provisioning's "a failed service claims no coverage" invariant (ADR 0079/0061) — hence this slice's edge to provisioning's active-and-partial health. Notes: the Identity dataset (kanidm store) is a founding-seeded runtime coupling — present because founding created it, not because of a build edge. ## Acceptance criteria - [ ] (story 1) Given datasets exist with backup policies, when I open Backups, then each row shows the dataset, its verified copies count, whether it has an offsite copy, and its last good moment — counting verified snapshot copies only, never live replicas and never a copy on a gone target. - [ ] (story 2) Given a dataset with a single copy, or no offsite anywhere, or a stale run, when I view the coverage map, then the gap is named as a state on the row (single copy / no offsite / stale), never a dated timestamp standing in for a fault. - [ ] (story 3) Given a freshly founded community that has confirmed no policy yet, when I open Backups, then every dataset that exists is listed — Identity from founding, each service's datasets as provisioned — each shown honestly not backed up yet, with the drafted recommended policy offered to review and confirm. - [ ] (story 4) Given a catalogue service is provisioned, when I next view Backups, then its declared dataset(s) appear as rows automatically from the port's dataset contract, with no operator action to add them. - [ ] (story 5) Given the fleet is one gateway with no second node, when I view first-run Backups, then it states that no on-fleet target can give real coverage until a second device joins — an offsite target is the only real coverage — offered beside an "Add a device" cross-link, and no same-node copy is ever counted as coverage. - [ ] (story 31) Given a service that failed its health check, then its dataset's target contributes no coverage, consistent with provisioning's "a failed service claims no coverage" invariant. ## Blocked by - #29 — Backups tab mounts in dashboard frame - #73 — per-service health gates coverage ## Task manifest ```yaml task: backups:coverage-map-and-first-run implements_flow: p7-backups implements_edge: S1 (overview render), S1x→S2, S1→S2 wireframe: - docs/ux/wireframes/p7-backups/p7-s1-backups-overview.html - docs/ux/wireframes/p7-backups/p7-s1x-overview-nothing-backed-up-yet.html interface: backup orchestrator — coverage projection per dataset (verified-copies count, offsite present, last good), dataset enumeration from port dataset contracts (Identity built-in), first-run drafted-policy read; reads per-service health + topology from the fleet-state provider (failed service → no coverage; single-node floor) seam: backup orchestrator seam tests (control plane, Go) — fake port dataset contracts, fake fleet-state provider (per-service health, topology, zones), in-memory coverage state read the way monitor reads it acceptance: - given: datasets exist with policies when: I open Backups then: each row shows dataset, verified-copies count, offsite present, last good — verified snapshot copies only, never live replicas, never a gone-target copy - given: a single-copy / no-offsite / stale dataset when: I view the coverage map then: the gap is named as a row state, never a dated timestamp standing in for a fault - given: a freshly founded community with no policy confirmed when: I open Backups then: every dataset is listed (Identity from founding, service datasets as provisioned), each honestly "not backed up yet", drafted policy offered - given: a catalogue service is provisioned when: I next view Backups then: its declared dataset(s) appear automatically from the port's dataset contract, no operator action - given: a one-gateway fleet when: I view first-run Backups then: the single-node floor is stated (offsite is the only real coverage until a second device joins), with an "Add a device" cross-link, and no same-node copy is counted - given: a service that failed its health check then: its dataset's target contributes no coverage anywhere depends_on: [shell:ui-kit-mount-slot-contract, provisioning:provision-active-and-partial] out_of_scope: - story 6–10 policy confirm/edit — policy-confirm-and-edit's - stories 11–14 runs/verification — scheduled-runs-and-verification's - stories 20–28 restore/export — the restore/export slices' - filesystem-level generic backup (rejected, ADR 0080) - a run/coverage database as durable state (rejected, ADR 0082) needs_human_decision: [] ```
Author
Owner

Done in 70427a5 (on main).

What was built — the first backups slice: the backup control-plane orchestrator (ADR 0079, internal/backup/) and the Backups tab mounted over it at the ADR 0094 backups mount.

  • Story 1 — Overview() projects each dataset row: verified-copies count, offsite present, last good — counting verified snapshot copies only: never a live replica (a fleet-state home is excluded), never a copy on a gone target (a node no longer in the fleet), never a same-node copy.
  • Story 2 — gaps are named states on the row: single copy / no offsite / stale (DDR 0083 missed-cycle rule on the seam fake clock); a stale pill leads with the state (● stale — due 02:00, no run completed · last good 2 nights ago), never a dated timestamp standing in for a fault; the ⚠ banner words each gap.
  • Story 3 — first run is never empty: every existing dataset listed (Identity built in from founding via the control-plane-shipped contract, ADR 0080), each honestly not backed up yet, the drafted policy read offered: Nightly at 02:00 · keep 30 days · Encrypted — always (stated, never offered) with Review & confirm leading (the confirm screen is policy-confirm-and-edit's).
  • Story 4 — dataset enumeration reads the port dataset contracts through the new Ports face: a provisioned service's declared dataset(s) appear as rows automatically, no operator action (seam test provisions a helper mid-test and the rows appear in catalogue order).
  • Story 5 — a one-gateway fleet states the floor plainly (until a second device joins, an offsite target is the only real coverage), offsite offer beside the add-a-device cross-link (routes owner device-add), and no same-node copy is ever counted — even verified and health-passed.
  • Story 31 — node-target coverage consults the fleet-state provider's default-deny per-service health bit (#73's Healthy): failed check, ungated service, unknown device all contribute no coverage.

Evidence — internal/backup/coverage_test.go: 6 seam tests over fake port contracts, fake fleet-state provider (per-service health + topology) and a fake clock, one per acceptance story. dashboard/tests/unit/backupsOverview.test.ts: 11 component tests over BackupsSurface + BackupsOverviewScreen (P7-S1) + BackupsFirstRunScreen (P7-S1x), built to the wireframes' data-field/data-action/data-status contract. Full Go + pnpm suites and lint green. ConfirmPolicy/RecordVerified are the minimal state verbs the policy-confirm and scheduled-runs slices drive next. STATUS.md updated in the same commit.

Done in 70427a5 (on main). **What was built** — the first backups slice: the `backup` control-plane orchestrator (ADR 0079, `internal/backup/`) and the Backups tab mounted over it at the ADR 0094 `backups` mount. - **Story 1** — `Overview()` projects each dataset row: verified-copies count, offsite present, last good — counting **verified snapshot copies only**: never a live replica (a fleet-state home is excluded), never a copy on a gone target (a node no longer in the fleet), never a same-node copy. - **Story 2** — gaps are named states on the row: `single copy` / `no offsite` / `stale` (DDR 0083 missed-cycle rule on the seam fake clock); a stale pill leads with the state (`● stale — due 02:00, no run completed · last good 2 nights ago`), never a dated timestamp standing in for a fault; the ⚠ banner words each gap. - **Story 3** — first run is never empty: every existing dataset listed (Identity built in from founding via the control-plane-shipped contract, ADR 0080), each honestly *not backed up yet*, the drafted policy read offered: `Nightly at 02:00 · keep 30 days · Encrypted — always` (stated, never offered) with Review & confirm leading (the confirm screen is policy-confirm-and-edit's). - **Story 4** — dataset enumeration reads the port dataset contracts through the new `Ports` face: a provisioned service's declared dataset(s) appear as rows automatically, no operator action (seam test provisions a helper mid-test and the rows appear in catalogue order). - **Story 5** — a one-gateway fleet states the floor plainly (*until a second device joins, an offsite target is the only real coverage*), offsite offer beside the `add-a-device` cross-link (routes owner `device-add`), and no same-node copy is ever counted — even verified and health-passed. - **Story 31** — node-target coverage consults the fleet-state provider's default-deny per-service health bit (#73's `Healthy`): failed check, ungated service, unknown device all contribute no coverage. **Evidence** — `internal/backup/coverage_test.go`: 6 seam tests over fake port contracts, fake fleet-state provider (per-service health + topology) and a fake clock, one per acceptance story. `dashboard/tests/unit/backupsOverview.test.ts`: 11 component tests over `BackupsSurface` + `BackupsOverviewScreen` (P7-S1) + `BackupsFirstRunScreen` (P7-S1x), built to the wireframes' `data-field`/`data-action`/`data-status` contract. Full Go + pnpm suites and lint green. `ConfirmPolicy`/`RecordVerified` are the minimal state verbs the policy-confirm and scheduled-runs slices drive next. STATUS.md updated in the same commit.
ben closed this issue 2026-07-25 18:40:53 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#82
No description provided.