control-panel observability child spec: backup replication matrix (P7-S7) — the standing dataset → target drill-down #793

Closed
opened 2026-08-25 08:08:01 +00:00 by matou-build-agent · 1 comment

Parent

Program map: #7 — Wayfinder map: OurCloud v1 program scope (Phase 0).
Design ticket: #762 — control-panel observability: backup replication matrix (sender → destination drill-down) (filed from the 2026-08-24 matou-distributed-servers comparison rather than charted on the map; the map's v1 scope is what it lands inside).

Design tier this spec is written against (all present, all accepted):

  • DDR docs/adr/0205-design-replication-matrix-standing-dataset-target-drilldown.md — the ruling DDR: P7-S7 is its own screen-state drilled into from P7-S1 (not embedded in S1, not folded into S3); dataset-centric parents with the sender named on the row; the field set and the grade table; how stale and unreachable render without red; the projection rule; three open gates.
  • Flow docs/ux/flows/p7-backups.mermaid — node P7-S7 ✎ and its three edges: S1 → S7 (opens replication), S7 → S3 (a pair drills into its runs), S7 → S2x (a gone target routes to replace).
  • Wireframes docs/ux/wireframes/p7-backups/ — p7-s7-replication-matrix.html ✎ new (depicting current, stale, not-backed-up-yet and unreachable-pair states in one matrix) and p7-s1-backups-overview.html ✎ amended (the open-replication entry beside Restore/Export). Their data-field / data-action / data-status attributes are the stable element-ID contract every acceptance criterion below is written against.
  • Vocabulary CONTEXT.md — Replication matrix, Current (pair), Size on target / Snapshots held, merged with the design arc (alongside the standing Coverage, Last good, Backup target, Sampled restore test entries this surface inherits).

No sibling dependency. Unlike #791/#792, this spec consumes nothing from #769: DDR 0205 explicitly rejects the LED-dot primitive (the P7 tab already speaks the pill vocabulary — two health glyphs on one tab is the thing being avoided) and mints no thresholds of its own, so OcStatusDot and statusGrades are neither used nor re-minted here. This feature can be built before, after or beside every sibling.

Siblings in the same observability arc (each specs separately, then all fan in at one /slice-map, #770): #759 device telemetry (specced, #769), #760 logs (specced, #791), #761 network (specced, #792), #763 activity feed, #764 topology map (deferred).

Problem Statement

The operator can see that a dataset is covered, and can see that a run happened — but not where the copies actually are.

The Backups tab is the most complete surface in the panel. P7-S1 answers is the data safe? with one row per dataset — verified copies, offsite, last good, gaps named loudly. P7-S3 answers did last night work? with a run log, and P7-S3x fans one failed run out per target. P7-S2 holds the arrangement. All of it is built and live over the backup orchestrator (ADR 0079).

Between the headline and the log there is a hole: the standing fan-out. Nothing anywhere answers which dataset is replicating to which target, and how is each of those pairs doing right now?

The consequences are ordinary and daily:

  • "2 verified copies" doesn't say which two. S1's VERIFIED COPIES cell names devices, but the moment a dataset has three or four targets — a node, a second node, an offsite partner — the operator cannot see which pair is carrying and which is drifting without opening the run log and reading backwards through per-run outcomes.
  • A pair can be quietly behind without the dataset being stale. The dataset grade is an aggregate: last good is the max over its pairs. A dataset whose offsite copy has been failing for four nights while its on-fleet copy verifies nightly reads covered on S1 and shows four partial runs on S3 — and there is no surface that says, in one line, "the offsite copy has been behind since Wednesday."
  • Run history is the wrong shape for a topology question. S3 is a log over time. Answering "where do Photos' copies live?" from a log means reconstructing standing state by replaying events — exactly the work a projection should have done.
  • The rebuild story is invisible. ADR 0082's whole promise is that each target holds a self-describing inventory — which datasets, which moments, verified or not — so a total loss is genuinely recoverable. The artifacts exist and are tested. The operator has never been shown them. There is no screen where "tōtara holds 30 snapshots of Identity, 560 MB, latest verified last night" is a sentence anyone can read.

The matou-distributed-servers admin dashboard has had this widget working for months (BackupMatrix.vue): expandable sender rows over a nested destinations table. It is the right information design and the wrong vocabulary — restic/ansible topology, dest_* env-derived fields, host-centric parents, a three-state LED. This spec takes the mechanics and leaves the nouns.

Solution

One new screen-state in the Backups tab — P7-S7, the replication matrix — drilled into from the overview: one parent row per dataset, its sender node named, expanding into that dataset's target pairs.

Five things land:

  1. The placement is a drill-down, not a tab and not an embed (DDR 0205's ruling). ADR 0094's six tabs stay closed and unamended. A Replication… outline button joins Restore and Export on P7-S1 (data-action="open-replication", already in the amended wireframe) and mounts P7-S7 over the overview through BackupsSurface's existing intent-composition — the exact pattern the policy, runs, run-failed, gone-target, restore and export screens already use. Back returns to the overview and re-reads. This is the smallest design delta of the six observability siblings: no new tab, no new mount-table entry, no chrome wiring, no placement cluster.

  2. Dataset-centric parents; the sender rides the row. The prototype's parent is a sender host. Here the parent is the dataset — policy, coverage, runs and last good are all per-dataset, and a host-centric axis would be a second organizing principle competing with the coverage map. The ticket's "which sender" half is satisfied on the row: Identity — from the gateway, Photos — from rimu. Rows expand, multi-open (adopted from the prototype), into a nested per-target table.

  3. It is a projection, and the spec enforces that mechanically. Every figure the matrix shows already exists in the backup orchestrator's state or in the target inventories ADR 0082 already builds: per-pair last good is targetLastGood, snapshots held is the count of retained verified moments InventoryFor already emits, reachability is the last thing the fleet actually observed. No new source of truth, no new collection loop, no probe minted at render time. Each pair links to its run log rather than restating run rows.

  4. The honesty rules carry over whole — no stale-green cell, ever. An unreachable target's size and snapshot count render labelled last known and are never counted as current; a run that didn't happen is stale — a failure, not an absence (DDR 0083 §1); a failed copy is named and retryable (§2); a gone target leaves counted coverage at once and its row routes to P7-S2x (§3); a not-backed-up-yet dataset shows its drafted targets rather than a blank row (DDR 0085). The kit compiles no red: stale and unreachable wear the loudest available weight and both grade to the warning tone, distinguished by copy — the built BackupsOverviewScreen precedent ({ok, warn, bad} → {healthy, warning, warning}), unchanged.

  5. The prototype's down sender grade does not exist here. A sender that stops running its schedule manifests as stale. A device's own down-ness is monitoring's classification (ADR 0070/0081) — alerted through P5, linked from here, never duplicated as a second device-health verdict on a backups screen.

Two truths this spec is deliberately loud about, because the design tier described figures the engine does not yet keep:

  • Size on target is a recorded figure, not a measurement. The movement engine already knows the exact sealed size of every copy it writes — it computes it to check the target's headroom and it logs it (bytes) — and then discards it. This spec has it recorded alongside the copy, so size on target and the parent's on targets sum are real numbers the fleet actually produced. A copy whose sealed size was never recorded (written before this lands, or re-derived from an inventory that carried none) renders — with the figure stated as not recorded — never 0, never an estimate (ADR 0100).
  • Reachability is last observed, never probed on render. There is no standing per-target prober in IDSS and minting one would be a new collection loop with its own cadence, failure modes and alert surface. The matrix therefore reports the last thing the fleet genuinely observed about each target — the last replicate attempt's outcome, plus (for a node target) the fleet-state provider's standing presence and its ADR 0061 health bit, the same default-deny gate coverage already consults — and states when that was. A target never attempted and not yet configured reads not configured, never reachable.

Read-only, with exactly one lever inherited. The matrix adds no verb of its own. The single act on the surface is retry this copy on a failed pair — and that is not new: it is TargetRetryClient.retryTarget, the same seam verb P7-S3's inline failed-row retry and P7-S3x already act over. Everything else routes out: runs… to P7-S3, a gone target to P7-S2x, confirm policy… to P7-S2.

User Stories

A. Entry, placement and the surface's shape

  1. As an operator, I want a Replication… entry beside Restore and Export on the backups overview, so that the fan-out is reachable from the surface that aggregates it.

    • Given the coverage map is resting (P7-S1) when it renders then an element with data-action="open-replication" sits in the actions row beside open-restore and open-export.
    • Given the replication client is wired when the operator activates open-replication then the P7-S7 matrix mounts over the overview and the coverage map is no longer rendered.
    • Given the replication client is not wired when the operator activates open-replication then the intent is emitted out to the shell's navigator and the overview stays put — the same absent-client behaviour every other P7 drill-in has.
  2. As an operator, I want the matrix to be a screen-state inside the Backups tab, so that no new tab or mount appears in the panel's chrome.

    • Given the matrix is open when the tab strip is read then it still shows exactly the six tabs of ADR 0094, with Backups selected.
    • Given the matrix is open when the chrome's standing-indicator slot is read then it is unchanged — this feature raises no indicator and adds no tenant.
  3. As an operator, I want a way back to the overview, so that the drill-down is a drill-down and not a dead end.

    • Given the matrix is open when the operator activates the back affordance then the coverage map renders again and the overview projection is re-read, so anything a retry changed is reflected.
  4. As an operator, I want the matrix to say what it is, so that I never mistake it for a second source of truth.

    • Given the matrix renders when its header is read then it carries the DATASET → TARGET marker and the projection marker naming runs & verification as the source.
  5. As an operator, I want the matrix to be operators-only, so that the community's replication topology is not member-facing.

    • Given an unauthenticated caller when the replication read is requested then it is refused by the existing auth gate with no fact disclosed, exactly as every other backups route is.
  6. As an operator, I want one read to compose the whole screen, so that the surface holds no truth of its own.

    • Given the matrix mounts when it loads then it issues exactly one replication read and every rendered figure, label, pill wording and count comes from that read's answer.

B. Parent rows — the dataset and its grade

  1. As an operator, I want one parent row per dataset, so that the matrix's spine matches the coverage map's.

    • Given the fleet holds datasets identity, files, chat, photos, git when the matrix renders then data-field="replication-matrix" contains a data-field="matrix-row-<id>" row for each, in the same enumeration order the coverage map uses.
    • Given Identity exists from founding (ADR 0078/0080) when the matrix renders then its row is present before any catalogue service has been provisioned.
  2. As an operator, I want each parent row to name its sender node, so that "which sender replicates to which destinations" is answered on the row.

    • Given identity is sourced from the gateway when its parent row renders then the dataset name is followed by the sender hint from the gateway.
    • Given photos is sourced from rimu when its parent row renders then the sender hint reads from rimu.
  3. As an operator, I want a dataset whose every pair is current to read as replicating, so that a healthy fan-out is legible at a glance.

    • Given every pair of identity holds the latest scheduled snapshot verified when its parent row renders then its grade pill carries data-status="replicating" in the healthy tone and TARGETS CURRENT reads 2 of 2.
  4. As an operator, I want a dataset with some pairs behind to say how many, so that a partial fan-out is not rounded up to healthy or down to broken.

    • Given git has one current pair of two when its parent row renders then its grade pill carries data-status="target-behind" with the wording 1 of 2 current in the warning tone and TARGETS CURRENT reads 1 of 2.
  5. As an operator, I want a stale dataset to be as loud here as it is on the overview, so that the two surfaces cannot disagree.

    • Given chat's 02:00 run did not complete before the next was due (DDR 0083 §1) when its parent row renders then its grade pill carries data-status="stale" with wording naming the due time and that no run completed and TARGETS CURRENT reads 0 of 2.
    • Given the same dataset when the coverage map is read then its S1 row is also stale — the two surfaces read the same orchestrator state and can never disagree about staleness.
  6. As an operator, I want a not-backed-up-yet dataset to appear in the matrix, so that the fan-out exists before I have acted (DDR 0085).

    • Given photos has no confirmed policy when its parent row renders then its grade pill carries data-status="not-backed-up-yet" in the warning tone, LAST RUN reads — and ON TARGETS reads —.
  7. As an operator, I want the last run stated in the fleet's own words, so that no component invents a duration against a clock.

    • Given the read supplies the run wording last night 02:00 when the parent row renders then the LAST RUN cell renders that string verbatim.
    • Given the read supplies 2 nights ago when the parent row renders then that string renders verbatim — the seam words every time, as it already does for lastGoodLabel, when and momentWhen.
  8. As an operator, I want the parent's summed size labelled as copies, so that I never read it as the dataset's live size.

    • Given identity's copies sum to 1.1 GB across its targets when its parent row renders then the ON TARGETS cell reads 1.1 GB under a column header naming it as on targets.
    • Given a dataset none of whose copies has a recorded sealed size when its parent row renders then ON TARGETS reads — and never 0 B.
  9. As an operator, I want the parent grade to be the aggregate of its pairs and nothing else, so that the row cannot contradict the rows beneath it.

    • Given a dataset's pairs are all current when the row is graded then the grade is replicating; given at least one pair is behind but the run completed then it is target-behind; given the run did not complete then it is stale; given no policy is confirmed then it is not-backed-up-yet.
    • Given any dataset when the parent's TARGETS CURRENT count is read then it equals the number of its pair rows whose pair state is current.
  10. As an operator, I want the matrix's counted figures to agree with the coverage map's, so that the drill-down aggregates rather than competes.

    • Given a dataset's coverage-map VERIFIED COPIES count is 2 when its matrix parent row renders then its current-pair count is also 2 — both are the count of pairs holding a counted verified copy.
    • Given a dataset's coverage-map LAST GOOD is last night 02:00 when its pairs are read then the newest pair last-verified moment is that same moment — S1's last good is the max over the pairs.

C. Expansion mechanics

  1. As an operator, I want to expand a dataset to see its targets, so that the fan-out is one click from the spine.

    • Given a collapsed parent row when the operator activates data-action="toggle-<id>" then a nested data-field="targets-<id>" table renders beneath it with one row per target.
  2. As an operator, I want to collapse it again, so that a long matrix stays readable.

    • Given an expanded parent row when the operator activates its toggle again then the nested table is removed from the document.
  3. As an operator, I want several datasets open at once, so that I can compare two fan-outs side by side (the prototype's multi-open, adopted).

    • Given identity is expanded when the operator expands chat then both nested tables are rendered simultaneously and neither collapses the other.
  4. As an operator, I want the chevron to say which way it goes, so that the affordance is not guesswork.

    • Given a collapsed row when it renders then its toggle shows the collapsed chevron; given an expanded row then it shows the expanded chevron.
  5. As an operator, I want the matrix to open in a legible resting state, so that the screen is useful before I touch it.

    • Given the matrix mounts when it first renders then every dataset carrying a named problem (stale, target-behind) is expanded and healthy datasets are collapsed.
  6. As an operator, I want the nested table to be readable, so that a drill-down is not a wall of micro-type.

    • Given any nested table renders when its type scale is measured then no label renders below the ADR 0122 amendment's floor (0.75rem / 0.85em) — the wireframe's miniature sizes are artboard values, not the contract.

D. Pair rows — a current copy

  1. As an operator, I want one row per dataset → target pair, so that every copy has a place it is accounted for.

    • Given identity replicates to tōtara and an offsite partner site when its nested table renders then it holds data-field="pair-identity-totara" and data-field="pair-identity-offsite".
    • Given any pair row when it renders then it carries the target's operator-facing name, a reachability cell, a last-verified-snapshot cell, a size-on-target cell and a snapshots-held cell.
  2. As an operator, I want a current pair to say so plainly, so that "verified on that target" is the thing I read.

    • Given tōtara holds identity's latest scheduled snapshot verified when its pair row renders then the last-verified cell renders the verified marker with the seam's moment wording and the row counts toward the parent's current count.
  3. As an operator, I want a reachable target marked reachable, so that the pair's two questions — is it there, is it current — are answered separately.

    • Given a node target present in fleet topology whose backup service passed its health check (ADR 0061) when its pair row renders then the reachability cell carries data-status="reachable" in the healthy tone.
  4. As an operator, I want per-pair size and snapshot count, so that I can see what each target is actually holding.

    • Given tōtara holds 30 retained verified snapshots of identity totalling 560 MB when its pair row renders then SIZE ON TARGET reads 560 MB and SNAPSHOTS HELD reads 30.
    • Given a pair whose copies have no recorded sealed size when its row renders then SIZE ON TARGET reads — with the not-recorded reason available, and never 0 B.
  5. As an operator, I want every pair to link to its run log, so that the matrix explains itself without restating runs.

    • Given any pair row of dataset <id> when it renders then it offers data-action="open-runs-<id>".
    • Given the runs client is wired when the operator activates it then P7-S3 mounts for that dataset — the existing open-runs-<id> intent and its existing parser, reused unchanged.

E. Ageing and stale

  1. As an operator, I want a reachable-but-ageing pair distinguished from an unreachable one, so that "the run didn't happen" and "the copy failed" are never conflated.

    • Given chat's run did not fire and rimu is reachable when the pair row renders then the reachability cell is reachable and the last-verified cell carries data-status="ageing" with wording naming how long since a run.
    • Given the same pair when the parent count is computed then the pair does not count as current.
  2. As an operator, I want a stale dataset's pairs to all read ageing, so that the aggregate and the detail tell one story.

    • Given chat is stale with two reachable targets when it is expanded then both pair rows carry ageing and the parent reads 0 of 2.
  3. As an operator, I want ageing to be the read's verdict and not the browser's, so that two operators in different timezones see the same word.

    • Given the read marks a pair ageing when the component renders then it renders that verdict and its wording verbatim; no component computes a duration against a clock.
  4. As an operator, I want stale never rendered in red, so that the panel's palette keeps its one meaning.

    • Given a stale parent pill or an ageing pair pill when its computed style is read then its status token resolves to --oc-status-warning and no destructive/red token appears anywhere on this surface.
  5. As an operator, I want ageing to survive a partial read, so that a gap never quietly clears a known fault.

    • Given a pair known ageing when the next read cannot resolve that target's figures then the pair stays ageing with its last-known figures labelled, and never reverts to current (DDR 0096's rule, worn here).

F. Unreachable copies and the last-known discipline

  1. As an operator, I want a failed copy named on its own row, so that I know which target broke and not merely that something did.

    • Given git's copy on tōtara failed to write on the last run when its pair row renders then the reachability cell carries data-status="unreachable" with the loud weight, wording naming the target.
  2. As an operator, I want an unreachable target's figures labelled last known, so that no cell is ever a stale green.

    • Given an unreachable pair whose last successful read showed 1.4 GB and 29 snapshots when its row renders then both figures render with an explicit last known marker and the last-verified cell states the moment is not counted while unreachable.
    • Given the same pair when the parent's current count and ON TARGETS sum are computed then the pair's last-known figures are excluded from both.
  3. As an operator, I want to retry a failed copy without leaving the matrix, so that the obvious next action is where the problem is (the P7-S3 inline-retry precedent).

    • Given an unreachable pair marked retryable when its row renders then it offers data-action="retry-pair-<id>-<field>".
    • Given the operator activates it then the existing retryTarget(datasetId, field) seam verb runs and the matrix re-reads afterwards so the row shows what the seam now says.
  4. As an operator, I want a successful retry to be visible immediately, so that I can tell the fix landed.

    • Given a retry succeeds when the matrix re-reads then the pair reads reachable and current, its figures lose the last known marker, and the parent's current count increases by one.
  5. As an operator, I want a failed retry to stay honest, so that trying is never mistaken for fixing.

    • Given a retry fails when the matrix re-reads then the pair still reads unreachable, its figures still read last known, the parent count is unchanged, and the failure is stated.
  6. As an operator, I want a retry's failure to be a rendered state, so that a lost action is never silent.

    • Given the retry request itself fails at the transport when the surface handles it then an honest, retriable state renders naming what could not be done — never a toast, never a blank table.
  7. As an operator, I want reachability to carry when it was observed, so that I know how fresh the verdict is.

    • Given any pair row when its reachability cell is read then the read's as-of wording for that observation is available on the row — because the matrix reports the last thing the fleet observed, not a probe run at render time.

G. Gone targets

  1. As an operator, I want a target that has left the fleet marked gone, so that its copies stop being counted the moment it is known gone (DDR 0083 §3).

    • Given a target no longer in fleet topology or no longer in the dataset's policy when its pair row renders then it carries the gone state with the loud weight.
    • Given the same pair when the parent's current count and ON TARGETS sum are computed then it contributes to neither.
  2. As an operator, I want a gone target's row to route me to the fix, so that the matrix hands the problem to the surface that owns it.

    • Given a gone pair row when the operator activates its action then the existing open-gone-target-<id> intent is emitted and, with the gone-target client wired, P7-S2x mounts for that dataset (flow edge S7 → S2x).
  3. As an operator, I want a gone target still named, so that I can tell what was lost.

    • Given a target that has left the fleet when its row renders then its operator-facing name still renders — the name resolved when the copy was recorded, exactly as the orchestrator already keeps it for this purpose.
  4. As an operator, I want replacing a gone target to be reflected on return, so that the matrix never shows a resolved problem.

    • Given the operator replaced the gone target on P7-S2x when they return to the matrix then it re-reads and the pair reflects the new policy — the replacement pair present, the gone pair absent.

H. Not backed up yet, and drafted targets

  1. As an operator, I want a not-yet-backed-up dataset to show its drafted targets, so that the matrix is never a blank row (DDR 0085).

    • Given photos has no confirmed policy but a drafted recommended policy when it is expanded then its nested table renders one row per drafted target rather than an empty table or a "nothing here" message.
  2. As an operator, I want a drafted target marked drafted, so that I never mistake a recommendation for an arrangement.

    • Given a drafted node target recommended for zone spread when its row renders then its name carries the drafted hint naming the reason.
    • Given a drafted offsite target that has not been configured when its row renders then its reachability cell carries data-status="not-configured" in the muted tone — never reachable, because nothing has ever been attempted.
  3. As an operator, I want a pair with no snapshots to say exactly that, so that empty is not confused with failed.

    • Given a drafted pair that has never held a copy when its row renders then the last-verified cell carries data-status="no-snapshots-yet" in the muted tone, SIZE ON TARGET reads — and SNAPSHOTS HELD reads 0.
  4. As an operator, I want the drafted row to offer the act that would make it real, so that the honest empty state is also the way forward.

    • Given a drafted pair on a dataset with no confirmed policy when its row renders then it offers data-action="confirm-policy-<id>" and activating it routes to that dataset's P7-S2 policy screen through the existing open-policy intent.
  5. As an operator, I want a single-node fleet's matrix to stay honest, so that the floor DDR 0085 names is not contradicted here.

    • Given a one-device fleet when the matrix renders then no same-node pair is offered as coverage, and a dataset whose only drafted target is offsite reads that way — the matrix inherits the orchestrator's counting rules and invents none.

I. Attention, failure and empty

  1. As an operator, I want the matrix's problems summarised in one plain-language line, so that I do not have to scan every nested table.

    • Given at least one dataset is stale or holds a failed pair when the matrix renders then data-field="matrix-attention" renders in the warning posture naming each problem in plain language and stating that monitoring alerted.
    • Given every dataset is replicating when the matrix renders then no attention callout renders.
  2. As an operator, I want the attention line to point at monitoring rather than replace it, so that this screen is never the only place a failure shows (ADR 0081).

    • Given the attention callout renders when it is read then it names that the operator was alerted through monitoring (P5 · S2) and offers no alert-management verb of its own.
  3. As an operator, I want a failed read to be a rendered state with a retry, so that a broken control plane is never a blank screen (the fail-loud sweep, #304).

    • Given the replication read fails when the surface handles it then an error state renders with the failure named and a retry affordance, and no partial matrix is shown.
    • Given the operator retries and the read succeeds then the matrix renders normally.
  4. As an operator, I want a fleet with no datasets at all to say so, so that an empty matrix is a statement and not a bug.

    • Given the read returns no datasets when the matrix renders then it states that the fleet holds no datasets yet rather than rendering an empty table.
  5. As an operator, I want the matrix to reflect what the fleet holds now, so that a service provisioned since my last visit simply appears.

    • Given a new catalogue service was provisioned since the last visit when the matrix is opened then its dataset's parent row is present, because the read enumerates from the port-declared dataset contracts on every call.
  6. As an operator, I want the matrix's copy to use the community's vocabulary, so that the panel speaks one language.

    • Given any label, pill or sentence on this surface when it is read then it uses backup target, size on target, snapshots held, current, stale, last good — and never destination, repo size, sender/destination matrix, up to date, in sync or any restic/ansible noun.

J. The projection discipline

  1. As an operator, I want the matrix to invent no facts, so that it can never disagree with the surfaces it drills out of.

    • Given the replication read is computed when its sources are traced then every field derives from the orchestrator's existing state — confirmed policies, verified copies, the snapshot ledger, run outcomes, fleet topology, ADR 0061 health — or from the recorded sealed sizes, and from nothing else.
    • Given the read runs when its effects are observed then it dials no target, runs no probe, fires no run, and mutates no orchestrator state.
  2. As an operator, I want the matrix to be as re-derivable as everything else in backups, so that ADR 0082's promise is not quietly broken by a new surface.

    • Given an orchestrator re-derived from policies plus target inventories alone (Rederive) when the replication read runs against it then it answers with the same shape and the same per-pair verdicts as the live one, with sizes present exactly where the inventories carried them.
  3. As an operator, I want the surface to hold no state, so that back-and-forth navigation cannot drift.

    • Given the operator leaves the matrix for P7-S3 and returns when the matrix re-mounts then it re-reads and renders the seam's current answer; the only client state it keeps is which rows are expanded.
  4. As a maintainer, I want one route and one client face, so that the matrix costs the transport layer as little as it costs the design.

    • Given the replication read when the transport is inspected then it is a single GET on the backups route family, served by a thin handler over the orchestrator, mapped snake_case → camelCase at the existing wire.ts boundary, with faults on the shared Problem body — no new client class, no hand-rolled fetch.

Implementation Decisions

The backup orchestrator (ADR 0079 — THE seam)

  • One new read method on the orchestrator, Replication, returning the whole P7-S7 view: the dataset rows, each row's pairs, the counts, the seam-worded labels and pill statuses, and the attention sentences. It joins Overview, RunsView, RunFailedView, GoneTargetView, RestoreView and ExportDatasets as another projection over the same in-memory state. No new orchestrator field is added for the view itself.
  • The pair is the unit. A row's pairs are the union of its confirmed policy targets and the targets it holds verified copies on — so a target dropped from policy that still holds copies is visible as gone rather than vanishing silently, and a policy target that has never been written is visible as awaiting its first copy.
  • Per-pair state is derived, not stored. Current is "this pair holds the latest scheduled snapshot, verified"; ageing is "reachable, but no run since"; unreachable is "the last replicate attempt to this target failed"; gone is "no longer in fleet topology, or no longer in the policy"; not-configured is "a drafted target never attempted". The dataset grade is the aggregate of those, per the table in DDR 0205.
  • Reachability reuses the gates coverage already applies. For a node target: presence in the fleet-state provider's topology plus its default-deny Healthy bit (ADR 0061). For an offsite target: the outcome of the last replicate attempt. Nothing dials anything.
  • Snapshots held is the count the inventory already carries. The self-describing target inventory (ADR 0082 §2) is precisely "which datasets, which moments, verified or not, on this target"; the count of a dataset's retained verified moments on a target is read from that same projection path rather than a parallel tally.
  • Size on target is a recorded sealed size, added to the copy ledger. The movement engine computes len(cipher.Sealed) to check headroom before every write and currently only logs it. That figure is threaded back so the copy carries it, and size on target is the sum over the moments the target retains; the parent's on targets is the sum over its counted pairs. Absent is absent: a copy with no recorded size contributes nothing to the sum and renders — with the reason stated. The re-derived path takes the size from the inventory's ciphertext length where the inventory carried it.
  • The retry verb is not re-minted. The matrix's retry this copy is TargetRetryClient.retryTarget(datasetID, field) — the same seam verb, the same RetryResult, the same attribution-in-request-context rule (ADR 0027). The field is the pair row's field (node id or offsite), identical to P7-S3x's.
  • Faults stay monitoring's. The matrix publishes nothing, classifies nothing and notifies nobody. Stale and gone-target faults already publish as state for monitoring (ADR 0081); the attention callout is a rendering of the read's sentences, and the P5 link is a statement, not a lever.

The transport

  • One route, one method: a GET on the backups route family returning the replication view, registered beside the existing overview/runs/policy routes and behind the same auth gate. OpenAPI spec first (the spec is the contract, ADR 0037), generated client, thin handler over the orchestrator, faults on the shared Problem body.
  • One more face on the existing client class. HttpBackupsClient grows a replication() method and implements one more interface; it is already the single instance satisfying all seven P7 faces, and the surface composes them from that one instance. camelize at the boundary as everywhere (standards:wire-snake-case, #126) — the wire stays snake_case and no component ever sees it.

The dashboard

  • A new screen component mounted by the existing surface composer. BackupsSurface gains one more optional injected client and one more branch in its onRoute chain, following the shape of isOpenRestoreIntent / isOpenExportIntent exactly: an openReplicationRoute() / isOpenReplicationIntent() pair in src/lib/backups.ts, a ref holding whether the matrix is open, a close handler that clears it and re-reads the overview. No router change, no mount-table entry, no chrome wiring.
  • The screen renders the read verbatim and computes only expansion. Its entire local state is the set of expanded dataset ids (a set, because multi-open). Every pill wording, every status token, every count, every time phrase and every sentence comes from the read. This is the BackupsOverviewScreen contract, unchanged.
  • The tone map is the built one, not a new one. Wireframe {ok, warn, bad} → {healthy, warning, warning}, the exact map BackupsOverviewScreen already applies, with the muted tone for not-configured / no-snapshots-yet. The kit compiles no red and this surface introduces none; --oc-* tokens only, no raw hex (ADR 0122).
  • No new kit primitive. OcPill, OcButton and OcErrorState cover the surface; the nested table is plain markup at product type scale. DDR 0205 rejects the LED dot deliberately — the P7 tab speaks pills, and a second health glyph on one tab is the thing being avoided.
  • The read runs behind the shared async guard, so a failed read is a rendered, retriable state and never a blank tab (#304); no component-invented setInterval — the matrix re-reads on mount, after a retry, and on return from a drill-out.
  • Every data-field / data-action / data-status attribute in the P7-S7 wireframe is the built contract, carried verbatim so design-verify can check the shipped UI against it.

Element-contract rulings this spec makes

  • The pair runs… action is dataset-scoped: open-runs-<datasetId>. The wireframe depicts per-pair variants (open-runs-identity-offsite, open-runs-git-totara); those are depiction, not contract. P7-S3 is a per-dataset log with no per-target filter, and a target-suffixed intent would be ambiguous for any dataset id containing a hyphen. The dataset-scoped intent reuses the existing openRunsDatasetId parser unchanged, and S3's own per-target outcomes already name the target. A ✎ wireframe amendment normalises the depiction with the implementing slice.
  • The retry action is retry-pair-<datasetId>-<field>, and the gone pair's action emits the existing open-gone-target-<datasetId> intent. Both are new depictions the same amendment adds (the wireframe depicts the retry and describes the gone row in its caption without a frame row).
  • ON TARGETS is kept (DDR 0205's open gate 2 default), labelled as the sum of copies. Dropping it is a one-field change to the read and one column in the component.

Testing Decisions

A good test states externally-observable behaviour at a seam and never reaches into implementation detail. Three seams, all pre-existing — this feature mints no new seam.

  1. The Go orchestrator seam (ADR 0079's THE seam) — the primary one. The orchestrator driven headlessly in-process over fake port dataset contracts, a fake fleet-state provider and a fake clock, asserting on the replication view's answer. Every state is proven here: all-current, some-behind, stale, not-backed-up-yet; the four pair states and their transitions; the parent counts equalling the current pairs; the last-known exclusion from both the count and the sum; a gone target still named but uncounted; a drafted target reading not-configured; sizes summing only over recorded ones and absent staying absent; the agreement invariants against Overview (current-pair count == verified copies; newest pair moment == last good); the read mutating nothing and dialling nothing; and the Rederive equivalence (the re-derived orchestrator answers the same shape). Prior art: coverage_test.go, pertarget_test.go, rebuild_test.go, run_test.go.
  2. The component seam. The matrix screen driven against a hand-written fake replication client, asserting on the wireframe's data-field / data-action / data-status contract: parent rows and their grades, sender hints, expansion/collapse/multi-open, the problem-rows-open resting state, every pair state's pills and cells, the last known markers, the retry round-trip (success re-reads and clears; failure stays honest; a transport failure renders an error state), the attention callout present and absent, the failed-read error state and its retry, the never-empty drafted table, and the empty-fleet statement. Plus the surface composition: open-replication mounts the matrix, back returns to the overview and re-reads, and the intent emits out when no client is wired. Prior art: backupsOverview.test.ts, backupPerTargetHonesty.test.ts, backupRuns.test.ts, backupsSurfaceGuard.test.ts.
  3. The transport seam. The route driven against a real control-plane process over the generated client: the view round-trips snake_case → camelCase intact, an unauthenticated call is refused disclosing nothing, and a control-plane fault surfaces as the shared Problem body the surface renders honestly. Prior art: backups_integration_test.go, backupsLive.test.ts, backupsGuard304.test.ts.

Two cross-cutting checks ride existing harnesses rather than new ones: the theming contract tests (no raw hex in the new component; every grade resolves to an --oc-status-* token and the surface compiles no red — ADR 0122) and the callout vocabulary test (the attention callout wears the warning posture and the honest-limits voice where a limit is stated, not a warning).

The movement-engine change (recording the sealed size) is proven at the existing movement seam: a replicated copy's recorded size equals the sealed byte length headroom checked, and a copy written before the ledger existed reads absent rather than zero. Prior art: movement_test.go, movement_production_test.go.

Out of Scope

  • Any new lever on the matrix. No run-now, no re-verify, no prune, no add-target, no remove-target. The single act is the inherited per-target retry; policy changes belong to P7-S2/S2x, runs to P7-S3.
  • A live reachability probe. Nothing on this surface dials a target at render time. Growing a standing per-target prober is a new collection loop with its own cadence, failure modes and alert surface — a separate ticket if it is ever wanted (spec gate G5 below).
  • Measuring a target's real disk usage. Size on target is the sealed size the fleet recorded when it wrote each copy, not a du over the target. A target's total free space is headroom's concern (ADR 0104), not this screen's.
  • A host-centric matrix. Rejected in DDR 0205: the dataset is the organizing axis everywhere else in backups, and a second axis would compete with the coverage map. "Which sender" rides the parent row.
  • A second device-health verdict. A target device being down is monitoring's classification (ADR 0070/0081), alerted through P5 and linked from here — never re-decided on a backups screen. The prototype's down sender grade does not exist in IDSS.
  • The LED-dot primitive and any shared status-grading constants. DDR 0205 rejects them for this tab; #769's OcStatusDot and statusGrades are neither used nor re-minted.
  • A seventh tab, an Overview row, a chrome indicator, a Settings section. None of these; the feature lives entirely inside the Backups tab and raises nothing.
  • /backups/replication as a deep-linkable URL. The wireframe's address bar is depiction. The served router is the flat six-tab map; non-tab paths are a shared refactor across every drilled-to surface (a later ticket, noted in #792).
  • Restic/ansible vocabulary and topology. No dest_* fields, no repo/repository nouns, no env-derived target sets.
  • A member-facing replication view. The panel is operators-only behind the community door (DDR 0172), inherited from the tab.
  • The other observability siblings' surfaces — telemetry (#759 → #769), logs (#760 → #791), network (#761 → #792), activity feed (#763), topology map (#764, deferred).

Further Notes

Vertical slices (named for the fan-in /slice-map, #770)

  1. backup:pair-projection — the orchestrator's replication projection over existing state: dataset rows and their four grades, pairs and their four states, current/total counts, the seam-worded labels and pill statuses, the attention sentences, the last-known exclusion discipline, and the Rederive equivalence. Sizes render absent at this point. No dependencies.
  2. backup:sealed-size-ledger — the movement engine records each copy's sealed size (the figure headroom already computes and logs) and the projection sums it into size on target / on targets; absent stays absent, never zero. Depends on 1 only for where the number lands — buildable in parallel and mergeable in either order.
  3. transport:replication-read — the OpenAPI route, the thin handler, the generated client and HttpBackupsClient.replication(), behind the existing auth gate, on the shared Problem body. Depends on 1.
  4. dashboard:replication-matrix — the P7-S7 screen over its injected client: parent rows, expansion (multi-open, problems-open at rest), nested pair tables, every state, the attention callout, the error and empty states, the retry round-trip. Depends on 3.
  5. dashboard:replication-entry-and-mount — the open-replication intent pair in lib/backups.ts, the BackupsSurface branch and back-with-re-read, and the two drill-out edges (pair → P7-S3, gone → P7-S2x) reusing the existing intents. The ✎ wireframe amendment for the normalised element contract rides here. Depends on 4.

Cross-arc note for the fan-in: this feature is a root with no cross-feature dependency — it consumes nothing from #769, #791 or #792 and blocks none of them. Its only shared surface is the Backups tab, and its only shared file is BackupsSurface.vue, which every P7 slice has already amended in turn without conflict. If the fan-in needs a scheduling hint: this is the arc's cheapest feature and the one whose acceptance criteria are most fully covered by existing seams and existing prior art.

The DDR's three open gates, plus two this spec adds (all veto-open, not blocking)

DDR 0205 is accepted with three decisions held open for Ben under the ADR 0174 posture; this spec is written against their proposed defaults, and the veto is asynchronous.

  • G1 — the entry affordance (default: a Replication… button beside Restore/Export, already shipped in the amended P7-S1 frame). A veto preferring "dataset rows click through to S7" changes one affordance in slice 5 and one story's Given/When/Then; nothing else moves, and the button is the smaller contract.
  • G2 — the ON TARGETS summed size on the parent row (default: keep it, labelled as the sum of copies). A veto drops one field from the read, one column from the component and one story; slice 2 still earns its keep for the per-pair figure.
  • G3 — stale keeps the loud pill weight in the matrix (default: yes, S1's precedent; both grade to warning in product). A veto demotes stale to the warning weight here — one entry in the tone map, one test.

Two the spec adds, because the design tier described figures the engine does not yet keep:

  • G4 — size on target comes from a recorded sealed size, not a measurement (default: record it in slice 2; the movement engine already computes it for headroom and throws it away). A veto retires slice 2 entirely and the two size fields render permanently absent with their reason stated — the surface stays honest and every other story is untouched. This is the only change in the whole feature that touches the write path; everything else is read-only.
  • G5 — reachability is last-observed, never probed on render (default: report the last replicate attempt's outcome plus the fleet-state presence/health gate, with an as-of). A veto wanting a live per-target probe is a new collection loop and belongs to its own ticket; the view shape would be unchanged, only the provenance and the as-of wording.

Neither gate is a placement question, so — unlike #792 and #763 — this spec has no D1 exposure and is fully sliceable now. Any veto touches at most one slice.

Implementation-time notes

  • One ✎ wireframe amendment rides slice 5 (ADR 0042 discipline, #769/#792's precedent): p7-s7-replication-matrix.html normalises the pair runs… action to the dataset-scoped open-runs-<id> and adds the depicted rows for the retry action and the gone-target pair. docs/ux/flows/p7-backups.mermaid is untouched — none of this is a new state, and all three S7 edges are already drawn.
  • The prototype (matou-distributed-servers, src/components/backups/BackupMatrix.vue) is a reference for information design and mechanics only: the expandable parent → nested destinations table, multi-open, relative-time recency, per-pair size and count, the "n of total" summary. Its styling is a drifted fork of the same Mātou visual language; nothing visual transfers, and every colour re-encodes as an --oc-* token (ADR 0122). Not adopted: host-centric parents, the LED-dot glyph, the up/stale/down triad, dest_* env-derived topology, snake_case wire fields in components.
  • CONTEXT.md rules the copy: say replication matrix, backup target, size on target, snapshots held, current, stale, last good, verified copies. Never destination, never repo size, never sender/destination matrix, never up to date or in sync, never backup as the noun for a snapshot, and never a bare healthy where a state has a name.
  • docs/GOTCHAS.md is worth a read before touching the movement path for slice 2 — the sealed-size figure crosses the same boundary the crown-jewel sealing does, and nothing may be logged or persisted that discloses key material or plaintext length beyond the sealed size already recorded for headroom.
  • The backup package's file layout suggests where the projection lands: coverage.go holds the S1 projection, pertarget.go the S3x/S2x ones, rebuild.go the inventory path. The pair projection reads from all three and should not edit any of their rules.

Produced by /to-spec in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #762.

## Parent Program map: [#7 — Wayfinder map: OurCloud v1 program scope (Phase 0)](https://git.matou.nz/Matou/idss/issues/7). Design ticket: [#762 — control-panel observability: backup replication matrix (sender → destination drill-down)](https://git.matou.nz/Matou/idss/issues/762) (filed from the 2026-08-24 `matou-distributed-servers` comparison rather than charted on the map; the map's v1 scope is what it lands inside). Design tier this spec is written against (all present, all `accepted`): - **DDR** [`docs/adr/0205-design-replication-matrix-standing-dataset-target-drilldown.md`](https://git.matou.nz/Matou/idss/src/branch/main/docs/adr/0205-design-replication-matrix-standing-dataset-target-drilldown.md) — the ruling DDR: P7-S7 is its own screen-state drilled into from P7-S1 (not embedded in S1, not folded into S3); dataset-centric parents with the sender named on the row; the field set and the grade table; how *stale* and *unreachable* render without red; the projection rule; three open gates. - **Flow** `docs/ux/flows/p7-backups.mermaid` — node **P7-S7 ✎** and its three edges: S1 → S7 (opens replication), S7 → S3 (a pair drills into its runs), S7 → S2x (a gone target routes to replace). - **Wireframes** `docs/ux/wireframes/p7-backups/` — `p7-s7-replication-matrix.html` ✎ new (depicting current, stale, not-backed-up-yet and unreachable-pair states in one matrix) and `p7-s1-backups-overview.html` ✎ amended (the `open-replication` entry beside Restore/Export). Their `data-field` / `data-action` / `data-status` attributes are the stable element-ID contract every acceptance criterion below is written against. - **Vocabulary** `CONTEXT.md` — *Replication matrix*, *Current (pair)*, *Size on target* / *Snapshots held*, merged with the design arc (alongside the standing *Coverage*, *Last good*, *Backup target*, *Sampled restore test* entries this surface inherits). **No sibling dependency.** Unlike #791/#792, this spec consumes nothing from #769: DDR 0205 explicitly **rejects** the LED-dot primitive (the P7 tab already speaks the pill vocabulary — two health glyphs on one tab is the thing being avoided) and mints no thresholds of its own, so `OcStatusDot` and `statusGrades` are neither used nor re-minted here. This feature can be built before, after or beside every sibling. Siblings in the same observability arc (each specs separately, then all fan in at one `/slice-map`, #770): #759 device telemetry (specced, #769), #760 logs (specced, #791), #761 network (specced, #792), #763 activity feed, #764 topology map (deferred). ## Problem Statement **The operator can see that a dataset is covered, and can see that a run happened — but not where the copies actually are.** The Backups tab is the most complete surface in the panel. P7-S1 answers *is the data safe?* with one row per dataset — verified copies, offsite, last good, gaps named loudly. P7-S3 answers *did last night work?* with a run log, and P7-S3x fans one failed run out per target. P7-S2 holds the arrangement. All of it is built and live over the `backup` orchestrator (ADR 0079). Between the headline and the log there is a hole: **the standing fan-out**. Nothing anywhere answers *which dataset is replicating to which target, and how is each of those pairs doing right now?* The consequences are ordinary and daily: - **"2 verified copies" doesn't say which two.** S1's `VERIFIED COPIES` cell names devices, but the moment a dataset has three or four targets — a node, a second node, an offsite partner — the operator cannot see which pair is carrying and which is drifting without opening the run log and reading backwards through per-run outcomes. - **A pair can be quietly behind without the dataset being stale.** The dataset grade is an aggregate: `last good` is the max over its pairs. A dataset whose offsite copy has been failing for four nights while its on-fleet copy verifies nightly reads *covered* on S1 and shows four `partial` runs on S3 — and there is no surface that says, in one line, "the offsite copy has been behind since Wednesday." - **Run history is the wrong shape for a topology question.** S3 is a log over time. Answering "where do Photos' copies live?" from a log means reconstructing standing state by replaying events — exactly the work a projection should have done. - **The rebuild story is invisible.** ADR 0082's whole promise is that each target holds a self-describing inventory — which datasets, which moments, verified or not — so a total loss is genuinely recoverable. The artifacts exist and are tested. **The operator has never been shown them.** There is no screen where "tōtara holds 30 snapshots of Identity, 560 MB, latest verified last night" is a sentence anyone can read. The `matou-distributed-servers` admin dashboard has had this widget working for months (`BackupMatrix.vue`): expandable sender rows over a nested destinations table. It is the right information design and the wrong vocabulary — restic/ansible topology, `dest_*` env-derived fields, host-centric parents, a three-state LED. This spec takes the mechanics and leaves the nouns. ## Solution **One new screen-state in the Backups tab — P7-S7, the replication matrix — drilled into from the overview: one parent row per dataset, its sender node named, expanding into that dataset's target pairs.** Five things land: 1. **The placement is a drill-down, not a tab and not an embed (DDR 0205's ruling).** ADR 0094's six tabs stay closed and unamended. A `Replication…` outline button joins Restore and Export on P7-S1 (`data-action="open-replication"`, already in the amended wireframe) and mounts P7-S7 over the overview through `BackupsSurface`'s existing intent-composition — the exact pattern the policy, runs, run-failed, gone-target, restore and export screens already use. Back returns to the overview and re-reads. **This is the smallest design delta of the six observability siblings: no new tab, no new mount-table entry, no chrome wiring, no placement cluster.** 2. **Dataset-centric parents; the sender rides the row.** The prototype's parent is a sender host. Here the parent is the **dataset** — policy, coverage, runs and last good are all per-dataset, and a host-centric axis would be a second organizing principle competing with the coverage map. The ticket's "which sender" half is satisfied on the row: `Identity — from the gateway`, `Photos — from rimu`. Rows expand, multi-open (adopted from the prototype), into a nested per-target table. 3. **It is a projection, and the spec enforces that mechanically.** Every figure the matrix shows already exists in the `backup` orchestrator's state or in the target inventories ADR 0082 already builds: per-pair last good is `targetLastGood`, snapshots held is the count of retained verified moments `InventoryFor` already emits, reachability is the last thing the fleet actually observed. **No new source of truth, no new collection loop, no probe minted at render time.** Each pair links to its run log rather than restating run rows. 4. **The honesty rules carry over whole — no stale-green cell, ever.** An unreachable target's size and snapshot count render **labelled *last known*** and are never counted as current; a run that didn't happen is *stale* — a failure, not an absence (DDR 0083 §1); a failed copy is named and retryable (§2); a gone target leaves counted coverage at once and its row routes to P7-S2x (§3); a not-backed-up-yet dataset shows its **drafted** targets rather than a blank row (DDR 0085). The kit compiles no red: *stale* and *unreachable* wear the loudest available weight and both grade to the **warning** tone, distinguished by copy — the built `BackupsOverviewScreen` precedent (`{ok, warn, bad} → {healthy, warning, warning}`), unchanged. 5. **The prototype's `down` sender grade does not exist here.** A sender that stops running its schedule manifests as *stale*. A device's own down-ness is monitoring's classification (ADR 0070/0081) — alerted through P5, linked from here, never duplicated as a second device-health verdict on a backups screen. **Two truths this spec is deliberately loud about, because the design tier described figures the engine does not yet keep:** - **Size on target is a recorded figure, not a measurement.** The movement engine already knows the exact sealed size of every copy it writes — it computes it to check the target's headroom and it logs it (`bytes`) — and then discards it. This spec has it **recorded** alongside the copy, so *size on target* and the parent's *on targets* sum are real numbers the fleet actually produced. A copy whose sealed size was never recorded (written before this lands, or re-derived from an inventory that carried none) renders **`—` with the figure stated as not recorded** — never `0`, never an estimate (ADR 0100). - **Reachability is *last observed*, never probed on render.** There is no standing per-target prober in IDSS and minting one would be a new collection loop with its own cadence, failure modes and alert surface. The matrix therefore reports the last thing the fleet genuinely observed about each target — the last replicate attempt's outcome, plus (for a node target) the fleet-state provider's standing presence and its ADR 0061 health bit, the same default-deny gate coverage already consults — **and states when that was**. A target never attempted and not yet configured reads *not configured*, never *reachable*. **Read-only, with exactly one lever inherited.** The matrix adds no verb of its own. The single act on the surface is `retry this copy` on a failed pair — and that is not new: it is `TargetRetryClient.retryTarget`, the same seam verb P7-S3's inline failed-row retry and P7-S3x already act over. Everything else routes out: `runs…` to P7-S3, a gone target to P7-S2x, `confirm policy…` to P7-S2. ## User Stories ### A. Entry, placement and the surface's shape 1. As an operator, I want a `Replication…` entry beside Restore and Export on the backups overview, so that the fan-out is reachable from the surface that aggregates it. - **Given** the coverage map is resting (P7-S1) **when** it renders **then** an element with `data-action="open-replication"` sits in the actions row beside `open-restore` and `open-export`. - **Given** the replication client is wired **when** the operator activates `open-replication` **then** the P7-S7 matrix mounts over the overview and the coverage map is no longer rendered. - **Given** the replication client is **not** wired **when** the operator activates `open-replication` **then** the intent is emitted out to the shell's navigator and the overview stays put — the same absent-client behaviour every other P7 drill-in has. 2. As an operator, I want the matrix to be a screen-state inside the Backups tab, so that no new tab or mount appears in the panel's chrome. - **Given** the matrix is open **when** the tab strip is read **then** it still shows exactly the six tabs of ADR 0094, with Backups selected. - **Given** the matrix is open **when** the chrome's standing-indicator slot is read **then** it is unchanged — this feature raises no indicator and adds no tenant. 3. As an operator, I want a way back to the overview, so that the drill-down is a drill-down and not a dead end. - **Given** the matrix is open **when** the operator activates the back affordance **then** the coverage map renders again **and** the overview projection is re-read, so anything a retry changed is reflected. 4. As an operator, I want the matrix to say what it is, so that I never mistake it for a second source of truth. - **Given** the matrix renders **when** its header is read **then** it carries the `DATASET → TARGET` marker and the projection marker naming runs & verification as the source. 5. As an operator, I want the matrix to be operators-only, so that the community's replication topology is not member-facing. - **Given** an unauthenticated caller **when** the replication read is requested **then** it is refused by the existing auth gate with no fact disclosed, exactly as every other backups route is. 6. As an operator, I want one read to compose the whole screen, so that the surface holds no truth of its own. - **Given** the matrix mounts **when** it loads **then** it issues exactly one replication read **and** every rendered figure, label, pill wording and count comes from that read's answer. ### B. Parent rows — the dataset and its grade 7. As an operator, I want one parent row per dataset, so that the matrix's spine matches the coverage map's. - **Given** the fleet holds datasets `identity`, `files`, `chat`, `photos`, `git` **when** the matrix renders **then** `data-field="replication-matrix"` contains a `data-field="matrix-row-<id>"` row for each, in the same enumeration order the coverage map uses. - **Given** Identity exists from founding (ADR 0078/0080) **when** the matrix renders **then** its row is present before any catalogue service has been provisioned. 8. As an operator, I want each parent row to name its sender node, so that "which sender replicates to which destinations" is answered on the row. - **Given** `identity` is sourced from the gateway **when** its parent row renders **then** the dataset name is followed by the sender hint `from the gateway`. - **Given** `photos` is sourced from `rimu` **when** its parent row renders **then** the sender hint reads `from rimu`. 9. As an operator, I want a dataset whose every pair is current to read as replicating, so that a healthy fan-out is legible at a glance. - **Given** every pair of `identity` holds the latest scheduled snapshot verified **when** its parent row renders **then** its grade pill carries `data-status="replicating"` in the healthy tone **and** `TARGETS CURRENT` reads `2 of 2`. 10. As an operator, I want a dataset with some pairs behind to say how many, so that a partial fan-out is not rounded up to healthy or down to broken. - **Given** `git` has one current pair of two **when** its parent row renders **then** its grade pill carries `data-status="target-behind"` with the wording `1 of 2 current` in the warning tone **and** `TARGETS CURRENT` reads `1 of 2`. 11. As an operator, I want a stale dataset to be as loud here as it is on the overview, so that the two surfaces cannot disagree. - **Given** `chat`'s 02:00 run did not complete before the next was due (DDR 0083 §1) **when** its parent row renders **then** its grade pill carries `data-status="stale"` with wording naming the due time and that no run completed **and** `TARGETS CURRENT` reads `0 of 2`. - **Given** the same dataset **when** the coverage map is read **then** its S1 row is also `stale` — the two surfaces read the same orchestrator state and can never disagree about staleness. 12. As an operator, I want a not-backed-up-yet dataset to appear in the matrix, so that the fan-out exists before I have acted (DDR 0085). - **Given** `photos` has no confirmed policy **when** its parent row renders **then** its grade pill carries `data-status="not-backed-up-yet"` in the warning tone, `LAST RUN` reads `—` and `ON TARGETS` reads `—`. 13. As an operator, I want the last run stated in the fleet's own words, so that no component invents a duration against a clock. - **Given** the read supplies the run wording `last night 02:00` **when** the parent row renders **then** the `LAST RUN` cell renders that string verbatim. - **Given** the read supplies `2 nights ago` **when** the parent row renders **then** that string renders verbatim — the seam words every time, as it already does for `lastGoodLabel`, `when` and `momentWhen`. 14. As an operator, I want the parent's summed size labelled as copies, so that I never read it as the dataset's live size. - **Given** `identity`'s copies sum to 1.1 GB across its targets **when** its parent row renders **then** the `ON TARGETS` cell reads `1.1 GB` under a column header naming it as on targets. - **Given** a dataset none of whose copies has a recorded sealed size **when** its parent row renders **then** `ON TARGETS` reads `—` and never `0 B`. 15. As an operator, I want the parent grade to be the aggregate of its pairs and nothing else, so that the row cannot contradict the rows beneath it. - **Given** a dataset's pairs are all current **when** the row is graded **then** the grade is `replicating`; **given** at least one pair is behind but the run completed **then** it is `target-behind`; **given** the run did not complete **then** it is `stale`; **given** no policy is confirmed **then** it is `not-backed-up-yet`. - **Given** any dataset **when** the parent's `TARGETS CURRENT` count is read **then** it equals the number of its pair rows whose pair state is current. 16. As an operator, I want the matrix's counted figures to agree with the coverage map's, so that the drill-down aggregates rather than competes. - **Given** a dataset's coverage-map `VERIFIED COPIES` count is 2 **when** its matrix parent row renders **then** its current-pair count is also 2 — both are the count of pairs holding a counted verified copy. - **Given** a dataset's coverage-map `LAST GOOD` is last night 02:00 **when** its pairs are read **then** the newest pair last-verified moment is that same moment — S1's last good is the max over the pairs. ### C. Expansion mechanics 17. As an operator, I want to expand a dataset to see its targets, so that the fan-out is one click from the spine. - **Given** a collapsed parent row **when** the operator activates `data-action="toggle-<id>"` **then** a nested `data-field="targets-<id>"` table renders beneath it with one row per target. 18. As an operator, I want to collapse it again, so that a long matrix stays readable. - **Given** an expanded parent row **when** the operator activates its toggle again **then** the nested table is removed from the document. 19. As an operator, I want several datasets open at once, so that I can compare two fan-outs side by side (the prototype's multi-open, adopted). - **Given** `identity` is expanded **when** the operator expands `chat` **then** both nested tables are rendered simultaneously and neither collapses the other. 20. As an operator, I want the chevron to say which way it goes, so that the affordance is not guesswork. - **Given** a collapsed row **when** it renders **then** its toggle shows the collapsed chevron; **given** an expanded row **then** it shows the expanded chevron. 21. As an operator, I want the matrix to open in a legible resting state, so that the screen is useful before I touch it. - **Given** the matrix mounts **when** it first renders **then** every dataset carrying a named problem (`stale`, `target-behind`) is expanded **and** healthy datasets are collapsed. 22. As an operator, I want the nested table to be readable, so that a drill-down is not a wall of micro-type. - **Given** any nested table renders **when** its type scale is measured **then** no label renders below the ADR 0122 amendment's floor (0.75rem / 0.85em) — the wireframe's miniature sizes are artboard values, not the contract. ### D. Pair rows — a current copy 23. As an operator, I want one row per dataset → target pair, so that every copy has a place it is accounted for. - **Given** `identity` replicates to `tōtara` and an offsite partner site **when** its nested table renders **then** it holds `data-field="pair-identity-totara"` and `data-field="pair-identity-offsite"`. - **Given** any pair row **when** it renders **then** it carries the target's operator-facing name, a reachability cell, a last-verified-snapshot cell, a size-on-target cell and a snapshots-held cell. 24. As an operator, I want a current pair to say so plainly, so that "verified on that target" is the thing I read. - **Given** `tōtara` holds `identity`'s latest scheduled snapshot verified **when** its pair row renders **then** the last-verified cell renders the verified marker with the seam's moment wording **and** the row counts toward the parent's current count. 25. As an operator, I want a reachable target marked reachable, so that the pair's two questions — is it there, is it current — are answered separately. - **Given** a node target present in fleet topology whose backup service passed its health check (ADR 0061) **when** its pair row renders **then** the reachability cell carries `data-status="reachable"` in the healthy tone. 26. As an operator, I want per-pair size and snapshot count, so that I can see what each target is actually holding. - **Given** `tōtara` holds 30 retained verified snapshots of `identity` totalling 560 MB **when** its pair row renders **then** `SIZE ON TARGET` reads `560 MB` and `SNAPSHOTS HELD` reads `30`. - **Given** a pair whose copies have no recorded sealed size **when** its row renders **then** `SIZE ON TARGET` reads `—` with the not-recorded reason available, and never `0 B`. 27. As an operator, I want every pair to link to its run log, so that the matrix explains itself without restating runs. - **Given** any pair row of dataset `<id>` **when** it renders **then** it offers `data-action="open-runs-<id>"`. - **Given** the runs client is wired **when** the operator activates it **then** P7-S3 mounts for that dataset — the existing `open-runs-<id>` intent and its existing parser, reused unchanged. ### E. Ageing and stale 28. As an operator, I want a reachable-but-ageing pair distinguished from an unreachable one, so that "the run didn't happen" and "the copy failed" are never conflated. - **Given** `chat`'s run did not fire and `rimu` is reachable **when** the pair row renders **then** the reachability cell is `reachable` **and** the last-verified cell carries `data-status="ageing"` with wording naming how long since a run. - **Given** the same pair **when** the parent count is computed **then** the pair does **not** count as current. 29. As an operator, I want a stale dataset's pairs to all read ageing, so that the aggregate and the detail tell one story. - **Given** `chat` is stale with two reachable targets **when** it is expanded **then** both pair rows carry `ageing` **and** the parent reads `0 of 2`. 30. As an operator, I want ageing to be the read's verdict and not the browser's, so that two operators in different timezones see the same word. - **Given** the read marks a pair ageing **when** the component renders **then** it renders that verdict and its wording verbatim; no component computes a duration against a clock. 31. As an operator, I want stale never rendered in red, so that the panel's palette keeps its one meaning. - **Given** a `stale` parent pill or an `ageing` pair pill **when** its computed style is read **then** its status token resolves to `--oc-status-warning` **and** no destructive/red token appears anywhere on this surface. 32. As an operator, I want ageing to survive a partial read, so that a gap never quietly clears a known fault. - **Given** a pair known ageing **when** the next read cannot resolve that target's figures **then** the pair stays ageing with its last-known figures labelled, and never reverts to current (DDR 0096's rule, worn here). ### F. Unreachable copies and the last-known discipline 33. As an operator, I want a failed copy named on its own row, so that I know which target broke and not merely that something did. - **Given** `git`'s copy on `tōtara` failed to write on the last run **when** its pair row renders **then** the reachability cell carries `data-status="unreachable"` with the loud weight, wording naming the target. 34. As an operator, I want an unreachable target's figures labelled last known, so that no cell is ever a stale green. - **Given** an unreachable pair whose last successful read showed 1.4 GB and 29 snapshots **when** its row renders **then** both figures render with an explicit `last known` marker **and** the last-verified cell states the moment is not counted while unreachable. - **Given** the same pair **when** the parent's current count and `ON TARGETS` sum are computed **then** the pair's last-known figures are excluded from both. 35. As an operator, I want to retry a failed copy without leaving the matrix, so that the obvious next action is where the problem is (the P7-S3 inline-retry precedent). - **Given** an unreachable pair marked retryable **when** its row renders **then** it offers `data-action="retry-pair-<id>-<field>"`. - **Given** the operator activates it **then** the existing `retryTarget(datasetId, field)` seam verb runs **and** the matrix re-reads afterwards so the row shows what the seam now says. 36. As an operator, I want a successful retry to be visible immediately, so that I can tell the fix landed. - **Given** a retry succeeds **when** the matrix re-reads **then** the pair reads reachable and current, its figures lose the `last known` marker, and the parent's current count increases by one. 37. As an operator, I want a failed retry to stay honest, so that trying is never mistaken for fixing. - **Given** a retry fails **when** the matrix re-reads **then** the pair still reads unreachable, its figures still read last known, the parent count is unchanged, and the failure is stated. 38. As an operator, I want a retry's failure to be a rendered state, so that a lost action is never silent. - **Given** the retry request itself fails at the transport **when** the surface handles it **then** an honest, retriable state renders naming what could not be done — never a toast, never a blank table. 39. As an operator, I want reachability to carry when it was observed, so that I know how fresh the verdict is. - **Given** any pair row **when** its reachability cell is read **then** the read's as-of wording for that observation is available on the row — because the matrix reports the last thing the fleet observed, not a probe run at render time. ### G. Gone targets 40. As an operator, I want a target that has left the fleet marked gone, so that its copies stop being counted the moment it is known gone (DDR 0083 §3). - **Given** a target no longer in fleet topology or no longer in the dataset's policy **when** its pair row renders **then** it carries the gone state with the loud weight. - **Given** the same pair **when** the parent's current count and `ON TARGETS` sum are computed **then** it contributes to neither. 41. As an operator, I want a gone target's row to route me to the fix, so that the matrix hands the problem to the surface that owns it. - **Given** a gone pair row **when** the operator activates its action **then** the existing `open-gone-target-<id>` intent is emitted **and**, with the gone-target client wired, P7-S2x mounts for that dataset (flow edge S7 → S2x). 42. As an operator, I want a gone target still named, so that I can tell what was lost. - **Given** a target that has left the fleet **when** its row renders **then** its operator-facing name still renders — the name resolved when the copy was recorded, exactly as the orchestrator already keeps it for this purpose. 43. As an operator, I want replacing a gone target to be reflected on return, so that the matrix never shows a resolved problem. - **Given** the operator replaced the gone target on P7-S2x **when** they return to the matrix **then** it re-reads and the pair reflects the new policy — the replacement pair present, the gone pair absent. ### H. Not backed up yet, and drafted targets 44. As an operator, I want a not-yet-backed-up dataset to show its drafted targets, so that the matrix is never a blank row (DDR 0085). - **Given** `photos` has no confirmed policy but a drafted recommended policy **when** it is expanded **then** its nested table renders one row per drafted target rather than an empty table or a "nothing here" message. 45. As an operator, I want a drafted target marked drafted, so that I never mistake a recommendation for an arrangement. - **Given** a drafted node target recommended for zone spread **when** its row renders **then** its name carries the drafted hint naming the reason. - **Given** a drafted offsite target that has not been configured **when** its row renders **then** its reachability cell carries `data-status="not-configured"` in the muted tone — never `reachable`, because nothing has ever been attempted. 46. As an operator, I want a pair with no snapshots to say exactly that, so that empty is not confused with failed. - **Given** a drafted pair that has never held a copy **when** its row renders **then** the last-verified cell carries `data-status="no-snapshots-yet"` in the muted tone, `SIZE ON TARGET` reads `—` and `SNAPSHOTS HELD` reads `0`. 47. As an operator, I want the drafted row to offer the act that would make it real, so that the honest empty state is also the way forward. - **Given** a drafted pair on a dataset with no confirmed policy **when** its row renders **then** it offers `data-action="confirm-policy-<id>"` **and** activating it routes to that dataset's P7-S2 policy screen through the existing open-policy intent. 48. As an operator, I want a single-node fleet's matrix to stay honest, so that the floor DDR 0085 names is not contradicted here. - **Given** a one-device fleet **when** the matrix renders **then** no same-node pair is offered as coverage, and a dataset whose only drafted target is offsite reads that way — the matrix inherits the orchestrator's counting rules and invents none. ### I. Attention, failure and empty 49. As an operator, I want the matrix's problems summarised in one plain-language line, so that I do not have to scan every nested table. - **Given** at least one dataset is stale or holds a failed pair **when** the matrix renders **then** `data-field="matrix-attention"` renders in the warning posture naming each problem in plain language and stating that monitoring alerted. - **Given** every dataset is replicating **when** the matrix renders **then** no attention callout renders. 50. As an operator, I want the attention line to point at monitoring rather than replace it, so that this screen is never the only place a failure shows (ADR 0081). - **Given** the attention callout renders **when** it is read **then** it names that the operator was alerted through monitoring (P5 · S2) **and** offers no alert-management verb of its own. 51. As an operator, I want a failed read to be a rendered state with a retry, so that a broken control plane is never a blank screen (the fail-loud sweep, #304). - **Given** the replication read fails **when** the surface handles it **then** an error state renders with the failure named and a retry affordance, and no partial matrix is shown. - **Given** the operator retries and the read succeeds **then** the matrix renders normally. 52. As an operator, I want a fleet with no datasets at all to say so, so that an empty matrix is a statement and not a bug. - **Given** the read returns no datasets **when** the matrix renders **then** it states that the fleet holds no datasets yet rather than rendering an empty table. 53. As an operator, I want the matrix to reflect what the fleet holds now, so that a service provisioned since my last visit simply appears. - **Given** a new catalogue service was provisioned since the last visit **when** the matrix is opened **then** its dataset's parent row is present, because the read enumerates from the port-declared dataset contracts on every call. 54. As an operator, I want the matrix's copy to use the community's vocabulary, so that the panel speaks one language. - **Given** any label, pill or sentence on this surface **when** it is read **then** it uses *backup target*, *size on target*, *snapshots held*, *current*, *stale*, *last good* — and never *destination*, *repo size*, *sender/destination matrix*, *up to date*, *in sync* or any restic/ansible noun. ### J. The projection discipline 55. As an operator, I want the matrix to invent no facts, so that it can never disagree with the surfaces it drills out of. - **Given** the replication read is computed **when** its sources are traced **then** every field derives from the orchestrator's existing state — confirmed policies, verified copies, the snapshot ledger, run outcomes, fleet topology, ADR 0061 health — or from the recorded sealed sizes, and from nothing else. - **Given** the read runs **when** its effects are observed **then** it dials no target, runs no probe, fires no run, and mutates no orchestrator state. 56. As an operator, I want the matrix to be as re-derivable as everything else in backups, so that ADR 0082's promise is not quietly broken by a new surface. - **Given** an orchestrator re-derived from policies plus target inventories alone (`Rederive`) **when** the replication read runs against it **then** it answers with the same shape and the same per-pair verdicts as the live one, with sizes present exactly where the inventories carried them. 57. As an operator, I want the surface to hold no state, so that back-and-forth navigation cannot drift. - **Given** the operator leaves the matrix for P7-S3 and returns **when** the matrix re-mounts **then** it re-reads and renders the seam's current answer; the only client state it keeps is which rows are expanded. 58. As a maintainer, I want one route and one client face, so that the matrix costs the transport layer as little as it costs the design. - **Given** the replication read **when** the transport is inspected **then** it is a single GET on the backups route family, served by a thin handler over the orchestrator, mapped snake_case → camelCase at the existing `wire.ts` boundary, with faults on the shared Problem body — no new client class, no hand-rolled fetch. ## Implementation Decisions ### The `backup` orchestrator (ADR 0079 — THE seam) - **One new read method on the orchestrator**, `Replication`, returning the whole P7-S7 view: the dataset rows, each row's pairs, the counts, the seam-worded labels and pill statuses, and the attention sentences. It joins `Overview`, `RunsView`, `RunFailedView`, `GoneTargetView`, `RestoreView` and `ExportDatasets` as another projection over the same in-memory state. **No new orchestrator field is added for the view itself.** - **The pair is the unit.** A row's pairs are the union of its confirmed policy targets and the targets it holds verified copies on — so a target dropped from policy that still holds copies is visible as gone rather than vanishing silently, and a policy target that has never been written is visible as awaiting its first copy. - **Per-pair state is derived, not stored.** Current is "this pair holds the latest scheduled snapshot, verified"; ageing is "reachable, but no run since"; unreachable is "the last replicate attempt to this target failed"; gone is "no longer in fleet topology, or no longer in the policy"; not-configured is "a drafted target never attempted". The dataset grade is the aggregate of those, per the table in DDR 0205. - **Reachability reuses the gates coverage already applies.** For a node target: presence in the fleet-state provider's topology plus its default-deny `Healthy` bit (ADR 0061). For an offsite target: the outcome of the last replicate attempt. Nothing dials anything. - **Snapshots held is the count the inventory already carries.** The self-describing target inventory (ADR 0082 §2) is precisely "which datasets, which moments, verified or not, on this target"; the count of a dataset's retained verified moments on a target is read from that same projection path rather than a parallel tally. - **Size on target is a recorded sealed size, added to the copy ledger.** The movement engine computes `len(cipher.Sealed)` to check headroom before every write and currently only logs it. That figure is threaded back so the copy carries it, and *size on target* is the sum over the moments the target retains; the parent's *on targets* is the sum over its counted pairs. **Absent is absent**: a copy with no recorded size contributes nothing to the sum and renders `—` with the reason stated. The re-derived path takes the size from the inventory's ciphertext length where the inventory carried it. - **The retry verb is not re-minted.** The matrix's `retry this copy` is `TargetRetryClient.retryTarget(datasetID, field)` — the same seam verb, the same `RetryResult`, the same attribution-in-request-context rule (ADR 0027). The `field` is the pair row's field (node id or `offsite`), identical to P7-S3x's. - **Faults stay monitoring's.** The matrix publishes nothing, classifies nothing and notifies nobody. Stale and gone-target faults already publish as state for monitoring (ADR 0081); the attention callout is a rendering of the read's sentences, and the P5 link is a statement, not a lever. ### The transport - **One route, one method**: a `GET` on the backups route family returning the replication view, registered beside the existing overview/runs/policy routes and behind the same auth gate. OpenAPI spec first (the spec is the contract, ADR 0037), generated client, thin handler over the orchestrator, faults on the shared `Problem` body. - **One more face on the existing client class.** `HttpBackupsClient` grows a `replication()` method and implements one more interface; it is already the single instance satisfying all seven P7 faces, and the surface composes them from that one instance. `camelize` at the boundary as everywhere (`standards:wire-snake-case`, #126) — the wire stays snake_case and no component ever sees it. ### The dashboard - **A new screen component mounted by the existing surface composer.** `BackupsSurface` gains one more optional injected client and one more branch in its `onRoute` chain, following the shape of `isOpenRestoreIntent` / `isOpenExportIntent` exactly: an `openReplicationRoute()` / `isOpenReplicationIntent()` pair in `src/lib/backups.ts`, a ref holding whether the matrix is open, a close handler that clears it and re-reads the overview. **No router change, no mount-table entry, no chrome wiring.** - **The screen renders the read verbatim and computes only expansion.** Its entire local state is the set of expanded dataset ids (a set, because multi-open). Every pill wording, every status token, every count, every time phrase and every sentence comes from the read. This is the `BackupsOverviewScreen` contract, unchanged. - **The tone map is the built one, not a new one.** Wireframe `{ok, warn, bad}` → `{healthy, warning, warning}`, the exact map `BackupsOverviewScreen` already applies, with the muted tone for `not-configured` / `no-snapshots-yet`. The kit compiles no red and this surface introduces none; `--oc-*` tokens only, no raw hex (ADR 0122). - **No new kit primitive.** `OcPill`, `OcButton` and `OcErrorState` cover the surface; the nested table is plain markup at product type scale. DDR 0205 rejects the LED dot deliberately — the P7 tab speaks pills, and a second health glyph on one tab is the thing being avoided. - **The read runs behind the shared async guard**, so a failed read is a rendered, retriable state and never a blank tab (#304); no component-invented `setInterval` — the matrix re-reads on mount, after a retry, and on return from a drill-out. - **Every `data-field` / `data-action` / `data-status` attribute in the P7-S7 wireframe is the built contract**, carried verbatim so `design-verify` can check the shipped UI against it. ### Element-contract rulings this spec makes - **The pair `runs…` action is dataset-scoped: `open-runs-<datasetId>`.** The wireframe depicts per-pair variants (`open-runs-identity-offsite`, `open-runs-git-totara`); those are depiction, not contract. P7-S3 is a per-dataset log with no per-target filter, and a target-suffixed intent would be ambiguous for any dataset id containing a hyphen. The dataset-scoped intent reuses the existing `openRunsDatasetId` parser unchanged, and S3's own per-target outcomes already name the target. A ✎ wireframe amendment normalises the depiction with the implementing slice. - **The retry action is `retry-pair-<datasetId>-<field>`**, and the gone pair's action emits the existing `open-gone-target-<datasetId>` intent. Both are new depictions the same amendment adds (the wireframe depicts the retry and describes the gone row in its caption without a frame row). - **`ON TARGETS` is kept** (DDR 0205's open gate 2 default), labelled as the sum of copies. Dropping it is a one-field change to the read and one column in the component. ## Testing Decisions A good test states externally-observable behaviour at a seam and never reaches into implementation detail. Three seams, **all pre-existing** — this feature mints no new seam. 1. **The Go orchestrator seam (ADR 0079's THE seam) — the primary one.** The orchestrator driven headlessly in-process over fake port dataset contracts, a fake fleet-state provider and a fake clock, asserting on the replication view's answer. Every state is proven here: all-current, some-behind, stale, not-backed-up-yet; the four pair states and their transitions; the parent counts equalling the current pairs; the last-known exclusion from both the count and the sum; a gone target still named but uncounted; a drafted target reading not-configured; sizes summing only over recorded ones and absent staying absent; the agreement invariants against `Overview` (current-pair count == verified copies; newest pair moment == last good); the read mutating nothing and dialling nothing; and the `Rederive` equivalence (the re-derived orchestrator answers the same shape). Prior art: `coverage_test.go`, `pertarget_test.go`, `rebuild_test.go`, `run_test.go`. 2. **The component seam.** The matrix screen driven against a hand-written fake replication client, asserting on the wireframe's `data-field` / `data-action` / `data-status` contract: parent rows and their grades, sender hints, expansion/collapse/multi-open, the problem-rows-open resting state, every pair state's pills and cells, the `last known` markers, the retry round-trip (success re-reads and clears; failure stays honest; a transport failure renders an error state), the attention callout present and absent, the failed-read error state and its retry, the never-empty drafted table, and the empty-fleet statement. Plus the surface composition: `open-replication` mounts the matrix, back returns to the overview and re-reads, and the intent emits out when no client is wired. Prior art: `backupsOverview.test.ts`, `backupPerTargetHonesty.test.ts`, `backupRuns.test.ts`, `backupsSurfaceGuard.test.ts`. 3. **The transport seam.** The route driven against a real control-plane process over the generated client: the view round-trips snake_case → camelCase intact, an unauthenticated call is refused disclosing nothing, and a control-plane fault surfaces as the shared Problem body the surface renders honestly. Prior art: `backups_integration_test.go`, `backupsLive.test.ts`, `backupsGuard304.test.ts`. Two cross-cutting checks ride existing harnesses rather than new ones: the **theming contract tests** (no raw hex in the new component; every grade resolves to an `--oc-status-*` token and the surface compiles no red — ADR 0122) and the **callout vocabulary test** (the attention callout wears the warning posture and the honest-limits voice where a limit is stated, not a warning). The movement-engine change (recording the sealed size) is proven at the existing movement seam: a replicated copy's recorded size equals the sealed byte length headroom checked, and a copy written before the ledger existed reads absent rather than zero. Prior art: `movement_test.go`, `movement_production_test.go`. ## Out of Scope - **Any new lever on the matrix.** No run-now, no re-verify, no prune, no add-target, no remove-target. The single act is the inherited per-target retry; policy changes belong to P7-S2/S2x, runs to P7-S3. - **A live reachability probe.** Nothing on this surface dials a target at render time. Growing a standing per-target prober is a new collection loop with its own cadence, failure modes and alert surface — a separate ticket if it is ever wanted (spec gate G5 below). - **Measuring a target's real disk usage.** *Size on target* is the sealed size the fleet recorded when it wrote each copy, not a `du` over the target. A target's total free space is headroom's concern (ADR 0104), not this screen's. - **A host-centric matrix.** Rejected in DDR 0205: the dataset is the organizing axis everywhere else in backups, and a second axis would compete with the coverage map. "Which sender" rides the parent row. - **A second device-health verdict.** A target device being down is monitoring's classification (ADR 0070/0081), alerted through P5 and linked from here — never re-decided on a backups screen. The prototype's `down` sender grade does not exist in IDSS. - **The LED-dot primitive and any shared status-grading constants.** DDR 0205 rejects them for this tab; #769's `OcStatusDot` and `statusGrades` are neither used nor re-minted. - **A seventh tab, an Overview row, a chrome indicator, a Settings section.** None of these; the feature lives entirely inside the Backups tab and raises nothing. - **`/backups/replication` as a deep-linkable URL.** The wireframe's address bar is depiction. The served router is the flat six-tab map; non-tab paths are a shared refactor across every drilled-to surface (a later ticket, noted in #792). - **Restic/ansible vocabulary and topology.** No `dest_*` fields, no repo/repository nouns, no env-derived target sets. - **A member-facing replication view.** The panel is operators-only behind the community door (DDR 0172), inherited from the tab. - **The other observability siblings' surfaces** — telemetry (#759 → #769), logs (#760 → #791), network (#761 → #792), activity feed (#763), topology map (#764, deferred). ## Further Notes ### Vertical slices (named for the fan-in `/slice-map`, #770) 1. **`backup:pair-projection`** — the orchestrator's replication projection over existing state: dataset rows and their four grades, pairs and their four states, current/total counts, the seam-worded labels and pill statuses, the attention sentences, the last-known exclusion discipline, and the `Rederive` equivalence. Sizes render absent at this point. No dependencies. 2. **`backup:sealed-size-ledger`** — the movement engine records each copy's sealed size (the figure headroom already computes and logs) and the projection sums it into *size on target* / *on targets*; absent stays absent, never zero. Depends on 1 only for where the number lands — buildable in parallel and mergeable in either order. 3. **`transport:replication-read`** — the OpenAPI route, the thin handler, the generated client and `HttpBackupsClient.replication()`, behind the existing auth gate, on the shared Problem body. Depends on 1. 4. **`dashboard:replication-matrix`** — the P7-S7 screen over its injected client: parent rows, expansion (multi-open, problems-open at rest), nested pair tables, every state, the attention callout, the error and empty states, the retry round-trip. Depends on 3. 5. **`dashboard:replication-entry-and-mount`** — the `open-replication` intent pair in `lib/backups.ts`, the `BackupsSurface` branch and back-with-re-read, and the two drill-out edges (pair → P7-S3, gone → P7-S2x) reusing the existing intents. The ✎ wireframe amendment for the normalised element contract rides here. Depends on 4. **Cross-arc note for the fan-in:** this feature is a **root with no cross-feature dependency** — it consumes nothing from #769, #791 or #792 and blocks none of them. Its only shared surface is the Backups tab, and its only shared file is `BackupsSurface.vue`, which every P7 slice has already amended in turn without conflict. If the fan-in needs a scheduling hint: this is the arc's cheapest feature and the one whose acceptance criteria are most fully covered by existing seams and existing prior art. ### The DDR's three open gates, plus two this spec adds (all veto-open, not blocking) DDR 0205 is `accepted` with three decisions held open for Ben under the ADR 0174 posture; this spec is written against their proposed defaults, and the veto is asynchronous. - **G1 — the entry affordance** (default: a `Replication…` button beside Restore/Export, already shipped in the amended P7-S1 frame). A veto preferring "dataset rows click through to S7" changes one affordance in slice 5 and one story's Given/When/Then; nothing else moves, and the button is the smaller contract. - **G2 — the `ON TARGETS` summed size on the parent row** (default: keep it, labelled as the sum of copies). A veto drops one field from the read, one column from the component and one story; slice 2 still earns its keep for the per-pair figure. - **G3 — stale keeps the loud pill weight in the matrix** (default: yes, S1's precedent; both grade to warning in product). A veto demotes stale to the warning weight here — one entry in the tone map, one test. Two the spec adds, because the design tier described figures the engine does not yet keep: - **G4 — size on target comes from a recorded sealed size, not a measurement** (default: record it in slice 2; the movement engine already computes it for headroom and throws it away). A veto retires slice 2 entirely and the two size fields render permanently absent with their reason stated — the surface stays honest and every other story is untouched. **This is the only change in the whole feature that touches the write path**; everything else is read-only. - **G5 — reachability is last-observed, never probed on render** (default: report the last replicate attempt's outcome plus the fleet-state presence/health gate, with an as-of). A veto wanting a live per-target probe is a new collection loop and belongs to its own ticket; the view shape would be unchanged, only the provenance and the as-of wording. Neither gate is a placement question, so — unlike #792 and #763 — **this spec has no D1 exposure and is fully sliceable now**. Any veto touches at most one slice. ### Implementation-time notes - **One ✎ wireframe amendment rides slice 5** (ADR 0042 discipline, #769/#792's precedent): `p7-s7-replication-matrix.html` normalises the pair `runs…` action to the dataset-scoped `open-runs-<id>` and adds the depicted rows for the retry action and the gone-target pair. `docs/ux/flows/p7-backups.mermaid` is **untouched** — none of this is a new state, and all three S7 edges are already drawn. - The prototype (`matou-distributed-servers`, `src/components/backups/BackupMatrix.vue`) is a **reference for information design and mechanics only**: the expandable parent → nested destinations table, multi-open, relative-time recency, per-pair size and count, the "n of total" summary. Its styling is a drifted fork of the same Mātou visual language; nothing visual transfers, and every colour re-encodes as an `--oc-*` token (ADR 0122). **Not adopted:** host-centric parents, the LED-dot glyph, the `up/stale/down` triad, `dest_*` env-derived topology, snake_case wire fields in components. - `CONTEXT.md` rules the copy: say **replication matrix**, **backup target**, **size on target**, **snapshots held**, **current**, **stale**, **last good**, **verified copies**. Never *destination*, never *repo size*, never *sender/destination matrix*, never *up to date* or *in sync*, never *backup* as the noun for a snapshot, and never a bare *healthy* where a state has a name. - `docs/GOTCHAS.md` is worth a read before touching the movement path for slice 2 — the sealed-size figure crosses the same boundary the crown-jewel sealing does, and nothing may be logged or persisted that discloses key material or plaintext length beyond the sealed size already recorded for headroom. - The `backup` package's file layout suggests where the projection lands: `coverage.go` holds the S1 projection, `pertarget.go` the S3x/S2x ones, `rebuild.go` the inventory path. The pair projection reads from all three and should not edit any of their rules. --- *Produced by `/to-spec` in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #762.*
Owner

Closed in the 2026-08-27 other-state sweep (Ben's ruling) — child spec complete: all derived tickets closed (#819–#823).

Closed in the 2026-08-27 `other`-state sweep (Ben's ruling) — child spec complete: all derived tickets closed (#819–#823).
ben closed this issue 2026-08-27 04:44:12 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#793
No description provided.