backups: per-target-honesty-and-staleness — per-target outcomes, stale runs, gone targets #90

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

Parent

Feature spec: #20 (backups).

What to build

The honesty layer over runs: a run outcome is per target, staleness is a failure not an absence, and a gone target drops its coverage at once — all surfaced through monitoring, because backup publishes fault and coverage state and never grows its own alert channel (ADR 0081). When a run replicates to several targets and one fails mid-run (P7-S3 → S3x), the copies that verified are kept and counted, the failed target is named and its outcome retryable (per-target steps and outcome shown), and a copy that has not passed its sampled restore test counts nowhere (DDR 0083). A failed run or failed verification publishes the fault as control-plane state with plain-language evidence; monitoring classifies it critical and notifies — backups never set a severity or touch the notifier (ADR 0081). A dataset whose scheduled run has not completed by the time the next is due is stale — nightly means stale by the second 02:00, one missed cycle with no grace (DDR 0083) — shown as a loud state on the coverage map and publishing a critical fault, computed from policy and clock against the target inventories, not from the scheduler's belief that it ran.

A target that becomes known gone — a node removed in provisioning, or an offsite endpoint whose credentials died — has every copy it held leave the coverage map immediately (down to single copy → warning, or no copies → critical when it was the last), with a fault alerting through monitoring (P7-S1 → P5-S2, DDR 0083). Acting on a monitoring diagnosis lands the operator where they can fix it: a general gap lands on the policy screen (P5-S2 → S2) to close or retry; a diagnosis naming a gone target lands on the policy's gone-target state (P5-S2 → S2x) with the dead target named and a replace affordance. Picking a replacement target has the next scheduled run rebuild the lost copies onto it, and coverage recovers (P7-S2x → S3). Every target replace is audit-logged, attributed to the operator, drillable from the overview (ADR 0027).

Notes: this slice publishes the fault state monitoring's classifier raises — hence the edge to monitoring's status-surface classifier; the classifier must exist to classify.

Acceptance criteria

  • (story 13) Given a run replicating to several targets where one fails mid-run, when the run completes, then the copies that verified are kept and counted, the failed target is named and its outcome retryable (per-target steps and outcome shown), and a copy that has not passed its sampled restore test counts nowhere.
  • (story 15) Given a run fails to write to a target, or a snapshot fails its sampled restore test, when the fault occurs, then backup publishes the fault as control-plane state with plain-language evidence, and monitoring classifies it (critical) and notifies — backups never set a severity or touch the notifier.
  • (story 16) Given a dataset's scheduled run has not completed by the time the next is due (nightly: stale by the second 02:00, one missed cycle no grace), when staleness is detected, then the dataset shows stale as a loud state on the coverage map and publishes a critical fault through monitoring — computed from policy and clock against the target inventories, not from the scheduler's belief that it ran.
  • (story 17) Given a target becomes known gone (a node removed, an offsite endpoint whose credentials died), when the fleet learns it is gone, then every copy it held leaves the coverage map immediately (single copy → warning, or no copies → critical when it was the last), and a fault alerts through monitoring.
  • (story 18) Given I act on a backup fault's plain-language diagnosis, when the diagnosis is a general gap, then I land on the policy screen to close it or retry; when the diagnosis names a gone target, then I land on the policy's gone-target state with the dead target named and a replace affordance.
  • (story 19) Given the gone-target state, when I pick a replacement target, then the next scheduled run rebuilds the lost copies onto it and coverage recovers.
  • (story 32) Given a target replace, then a structured audit entry lands attributed to the operator, drillable from the overview.

Blocked by

  • #88 — runs must exist to have outcomes
  • #80 — the classifier must exist to raise faults

Task manifest

task: backups:per-target-honesty-and-staleness
implements_flow: p7-backups
implements_edge: S3→S3x, S3x→P5-S2, S1→P5-S2 (stale), S1→P5-S2 (target gone), P5-S2→S2, P5-S2→S2x, S2x→S3
interface: backup orchestrator — per-target run outcome (keep verified, name failed, retryable), publish fault/coverage state with evidence for monitor to classify, staleness computed from policy+clock vs target inventories (one missed cycle, no grace), gone-target coverage drop, gone-target policy state + replace-and-rebuild; audit entry per target replace
wireframe:
  - docs/ux/wireframes/p7-backups/p7-s3x-run-failed-per-target.html
  - docs/ux/wireframes/p7-backups/p7-s2x-policy-target-gone.html
seam: backup orchestrator seam tests (control plane, Go) — fake clock (one-missed-cycle staleness), fake targets that accept/refuse/vanish (per-target partial + target-gone), fake port verify-sample, in-memory fault/coverage state read the way monitor reads it, in-memory audit ledger
acceptance:
  - given: a run to several targets, one failing mid-run
    when: the run completes
    then: verified copies are kept and counted, the failed target is named and retryable, an unverified copy counts nowhere
  - given: a run fails to write, or a snapshot fails verification
    when: the fault occurs
    then: backup publishes the fault with plain-language evidence; monitoring classifies critical and notifies; backups set no severity and touch no notifier
  - given: a scheduled run not completed by the next due (one missed cycle, no grace)
    when: staleness is detected
    then: the dataset shows stale on the coverage map and publishes a critical fault, computed from policy+clock vs target inventories
  - given: a target becomes known gone
    when: the fleet learns it is gone
    then: its copies leave coverage immediately (single copy → warning, last copy → critical) and a fault alerts through monitoring
  - given: I act on a fault's diagnosis
    then: a general gap lands me on the policy screen; a gone-target diagnosis lands me on the gone-target policy state with a replace affordance
  - given: the gone-target state
    when: I pick a replacement target
    then: the next scheduled run rebuilds the lost copies and coverage recovers
  - given: a target replace
    then: a structured audit entry lands attributed to the operator
depends_on: [scheduled-runs-and-verification, monitoring:status-surface-classifier]
out_of_scope:
  - classification/notification delivery itself — monitoring's (backups only publish state)
  - stories 20–28 restore/export — the restore/export slices'
needs_human_decision: []
## Parent Feature spec: #20 (backups). ## What to build The honesty layer over runs: a run outcome is **per target**, staleness is a **failure not an absence**, and a gone target drops its coverage at once — all surfaced through **monitoring**, because `backup` publishes fault and coverage state and never grows its own alert channel (ADR 0081). When a run replicates to several targets and one fails mid-run (P7-S3 → S3x), the copies that verified are **kept and counted**, the failed target is **named** and its outcome **retryable** (per-target steps and outcome shown), and a copy that has not passed its sampled restore test counts **nowhere** (DDR 0083). A failed run or failed verification publishes the fault as control-plane state with plain-language evidence; **monitoring** classifies it critical and notifies — backups never set a severity or touch the notifier (ADR 0081). A dataset whose scheduled run has not completed by the time the next is due is **stale** — nightly means stale by the second 02:00, **one missed cycle with no grace** (DDR 0083) — shown as a loud state on the coverage map and publishing a critical fault, computed from policy and clock against the target inventories, not from the scheduler's belief that it ran. A target that becomes known gone — a node removed in provisioning, or an offsite endpoint whose credentials died — has every copy it held **leave the coverage map immediately** (down to single copy → warning, or no copies → critical when it was the last), with a fault alerting through monitoring (P7-S1 → P5-S2, DDR 0083). Acting on a monitoring diagnosis lands the operator where they can fix it: a general gap lands on the policy screen (P5-S2 → S2) to close or retry; a diagnosis naming a gone target lands on the policy's **gone-target** state (P5-S2 → S2x) with the dead target named and a replace affordance. Picking a replacement target has the next scheduled run **rebuild the lost copies** onto it, and coverage recovers (P7-S2x → S3). Every target replace is audit-logged, attributed to the operator, drillable from the overview (ADR 0027). Notes: this slice publishes the fault state monitoring's classifier raises — hence the edge to monitoring's status-surface classifier; the classifier must exist to classify. ## Acceptance criteria - [ ] (story 13) Given a run replicating to several targets where one fails mid-run, when the run completes, then the copies that verified are kept and counted, the failed target is named and its outcome retryable (per-target steps and outcome shown), and a copy that has not passed its sampled restore test counts nowhere. - [ ] (story 15) Given a run fails to write to a target, or a snapshot fails its sampled restore test, when the fault occurs, then backup publishes the fault as control-plane state with plain-language evidence, and monitoring classifies it (critical) and notifies — backups never set a severity or touch the notifier. - [ ] (story 16) Given a dataset's scheduled run has not completed by the time the next is due (nightly: stale by the second 02:00, one missed cycle no grace), when staleness is detected, then the dataset shows stale as a loud state on the coverage map and publishes a critical fault through monitoring — computed from policy and clock against the target inventories, not from the scheduler's belief that it ran. - [ ] (story 17) Given a target becomes known gone (a node removed, an offsite endpoint whose credentials died), when the fleet learns it is gone, then every copy it held leaves the coverage map immediately (single copy → warning, or no copies → critical when it was the last), and a fault alerts through monitoring. - [ ] (story 18) Given I act on a backup fault's plain-language diagnosis, when the diagnosis is a general gap, then I land on the policy screen to close it or retry; when the diagnosis names a gone target, then I land on the policy's gone-target state with the dead target named and a replace affordance. - [ ] (story 19) Given the gone-target state, when I pick a replacement target, then the next scheduled run rebuilds the lost copies onto it and coverage recovers. - [ ] (story 32) Given a target replace, then a structured audit entry lands attributed to the operator, drillable from the overview. ## Blocked by - #88 — runs must exist to have outcomes - #80 — the classifier must exist to raise faults ## Task manifest ```yaml task: backups:per-target-honesty-and-staleness implements_flow: p7-backups implements_edge: S3→S3x, S3x→P5-S2, S1→P5-S2 (stale), S1→P5-S2 (target gone), P5-S2→S2, P5-S2→S2x, S2x→S3 interface: backup orchestrator — per-target run outcome (keep verified, name failed, retryable), publish fault/coverage state with evidence for monitor to classify, staleness computed from policy+clock vs target inventories (one missed cycle, no grace), gone-target coverage drop, gone-target policy state + replace-and-rebuild; audit entry per target replace wireframe: - docs/ux/wireframes/p7-backups/p7-s3x-run-failed-per-target.html - docs/ux/wireframes/p7-backups/p7-s2x-policy-target-gone.html seam: backup orchestrator seam tests (control plane, Go) — fake clock (one-missed-cycle staleness), fake targets that accept/refuse/vanish (per-target partial + target-gone), fake port verify-sample, in-memory fault/coverage state read the way monitor reads it, in-memory audit ledger acceptance: - given: a run to several targets, one failing mid-run when: the run completes then: verified copies are kept and counted, the failed target is named and retryable, an unverified copy counts nowhere - given: a run fails to write, or a snapshot fails verification when: the fault occurs then: backup publishes the fault with plain-language evidence; monitoring classifies critical and notifies; backups set no severity and touch no notifier - given: a scheduled run not completed by the next due (one missed cycle, no grace) when: staleness is detected then: the dataset shows stale on the coverage map and publishes a critical fault, computed from policy+clock vs target inventories - given: a target becomes known gone when: the fleet learns it is gone then: its copies leave coverage immediately (single copy → warning, last copy → critical) and a fault alerts through monitoring - given: I act on a fault's diagnosis then: a general gap lands me on the policy screen; a gone-target diagnosis lands me on the gone-target policy state with a replace affordance - given: the gone-target state when: I pick a replacement target then: the next scheduled run rebuilds the lost copies and coverage recovers - given: a target replace then: a structured audit entry lands attributed to the operator depends_on: [scheduled-runs-and-verification, monitoring:status-surface-classifier] out_of_scope: - classification/notification delivery itself — monitoring's (backups only publish state) - stories 20–28 restore/export — the restore/export slices' needs_human_decision: [] ```
Author
Owner

Done in 8d75f81 (on origin/main).

Per-target honesty over runs (DDR 0083 §1–3, ADR 0081). Backups publish fault + coverage state with plain-language evidence; monitoring classifies severity and notifies — backups set no severity and touch no notifier (classification/delivery stays monitoring's).

  • Story 13 — new Replicate port verb (accept/refuse/vanish per target); a run whose snapshot verified but a target failed to write is RunPartial: good copies kept & counted, the failed target named and retryable (per-target steps + outcome, RunFailedView/RetryTarget), an unverified copy counts nowhere.
  • Story 15 — a per-target run-failed fault and a verification-failed fault publish with evidence; the Fault carries no severity.
  • Story 16 — stale fault computed from policy + clock vs the target inventories (one missed cycle, no grace — nightly by the second 02:00), same state the coverage map shows.
  • Story 17 — a node that left the fleet still holding a copy raises a gone-target coverage-gap fault; its copies leave coverage at once; LastCopy set when it was the last (critical vs warning is monitoring's call).
  • Story 18 — HasGoneTarget/GoneTargetView (P7-S2x) vs the general-gap policy screen (P7-S2); surface routes accordingly.
  • Story 19 — ReplaceTarget swaps the gone target so the next scheduled run rebuilds the lost copies onto the replacement; coverage recovers.
  • Story 32 — every target replace/remove is audit-logged attributed to the operator, drillable from the overview.

Screens shipped: BackupRunFailedScreen.vue (P7-S3x) and BackupPolicyTargetGoneScreen.vue (P7-S2x), built to the wireframes' data-field/data-action/data-status contract, composed under BackupsSurface (S3→S3x drill, P5-S2→S2x routing).

Seams: internal/backup/pertarget_test.go (9 Go tests, every acceptance clause) and dashboard/tests/unit/backupPerTargetHonesty.test.ts (7 component tests). Verified: go build/vet/test + gofmt clean; dashboard vue-tsc build + 389 tests + eslint clean.

Monitor-side consumption of backup.Faults() remains a future monitoring slice (out of scope here — backups only publish state).

Done in `8d75f81` (on `origin/main`). **Per-target honesty over runs (DDR 0083 §1–3, ADR 0081).** Backups publish fault + coverage state with plain-language evidence; monitoring classifies severity and notifies — backups set no severity and touch no notifier (classification/delivery stays monitoring's). - **Story 13** — new `Replicate` port verb (accept/refuse/vanish per target); a run whose snapshot verified but a target failed to write is `RunPartial`: good copies kept & counted, the failed target named and **retryable** (per-target steps + outcome, `RunFailedView`/`RetryTarget`), an unverified copy counts nowhere. - **Story 15** — a per-target `run-failed` fault and a `verification-failed` fault publish with evidence; the `Fault` carries no severity. - **Story 16** — `stale` fault computed from policy + clock vs the target inventories (one missed cycle, no grace — nightly by the second 02:00), same state the coverage map shows. - **Story 17** — a node that left the fleet still holding a copy raises a gone-target `coverage-gap` fault; its copies leave coverage at once; `LastCopy` set when it was the last (critical vs warning is monitoring's call). - **Story 18** — `HasGoneTarget`/`GoneTargetView` (P7-S2x) vs the general-gap policy screen (P7-S2); surface routes accordingly. - **Story 19** — `ReplaceTarget` swaps the gone target so the **next scheduled run rebuilds** the lost copies onto the replacement; coverage recovers. - **Story 32** — every target replace/remove is audit-logged **attributed to the operator**, drillable from the overview. **Screens shipped:** `BackupRunFailedScreen.vue` (P7-S3x) and `BackupPolicyTargetGoneScreen.vue` (P7-S2x), built to the wireframes' `data-field`/`data-action`/`data-status` contract, composed under `BackupsSurface` (S3→S3x drill, P5-S2→S2x routing). **Seams:** `internal/backup/pertarget_test.go` (9 Go tests, every acceptance clause) and `dashboard/tests/unit/backupPerTargetHonesty.test.ts` (7 component tests). Verified: `go build/vet/test` + `gofmt` clean; dashboard `vue-tsc` build + 389 tests + `eslint` clean. Monitor-side consumption of `backup.Faults()` remains a future monitoring slice (out of scope here — backups only publish state).
ben closed this issue 2026-07-26 02:59:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#90
No description provided.