backups: policy-confirm-and-edit — confirm the drafted policy, then edit it #86

Closed
opened 2026-07-25 04:59:13 +00:00 by ben · 3 comments
Owner

Parent

Feature spec: #20 (backups).

What to build

The policy screen (P7-S2) where the operator turns the drafted recommended policy into a dataset's confirmed backup policy and, later, edits it. Confirming is a single act: the drafted policy (nightly 02:00, 30-day retention, recommended targets) becomes the dataset's confirmed policy and scheduled runs begin — the system recommends, the operator confirms; advice never veto (DDR 0085). Target recommendations are drawn from fleet topology with zone spread: each recommended target shows its reason, and both a cross-device and an offsite target are recommended where the fleet allows (ADR 0079/DDR 0085). An intermittent-tagged helper is offered only as an additional copy with its candid status shown, never as a dataset's sole target (DDR 0085). Encryption is shown as "Encrypted — always" — a fact with no toggle; snapshots are encrypted with keys in the community's crown-jewel secret store, so offsite holders only ever hold ciphertext (DDR 0085/ADR 0082).

Editing keeps the defaults a starting point, not a cage: changing a dataset's frequency, retention window, or targets saves to the policy and takes effect on the next scheduled run. Policy commits ride the existing clan Config hatch — no new seam amendment — and the policy is homed in the config repo (versioned; the operator app's replica means Tier-1 rescue already holds the arrangements, ADR 0082). Every policy confirm and edit lands a structured entry in the standing logging pipeline, attributed to the acting operator and drillable from the overview (ADR 0027).

Notes: the Identity dataset is in the drafted default policy from day one (ADR 0078) — a founding-seeded runtime coupling to members, not a build edge. This slice carries one open human decision — the offsite pairing mechanism (see below) — which does not block building the confirm/edit path against operator-supplied and node targets.

Acceptance criteria

  • (story 6) Given the drafted policy (nightly 02:00, 30-day retention, recommended targets), when I review and confirm it, then it becomes the dataset's confirmed backup policy and scheduled runs begin — confirming is my act, the system recommends and the operator confirms.
  • (story 7) Given I open the policy screen, when the system recommends targets, then it draws them from fleet topology with zone spread, shows each target's reason, and recommends both a cross-device and an offsite target where the fleet allows.
  • (story 8) Given the policy screen, then it shows "Encrypted — always" as a fact with no toggle; snapshots are encrypted with keys held in the community's crown-jewel secret store, so offsite holders only ever hold ciphertext.
  • (story 9) Given target recommendation includes an intermittent-tagged helper, then it is offered only as an additional copy with its candid status shown, never as a dataset's sole target.
  • (story 10) Given a confirmed policy, when I change frequency, retention window, or targets, then the change is saved to the policy (homed in the config repo) and takes effect on the next scheduled run.
  • (story 32) Given a policy confirm or edit, then a structured entry lands in the standing logging pipeline attributed to the acting operator, drillable from the overview.

Blocked by

  • #82 — datasets and drafted policy exist
  • #25 — policy commits ride the Config hatch

Task manifest

task: backups:policy-confirm-and-edit
implements_flow: p7-backups
implements_edge: S1x→S2, S1→S2, S2→S3
wireframe: docs/ux/wireframes/p7-backups/p7-s2-policy.html
interface: backup orchestrator — draft policy from fleet topology (zone-spread target recommendation with reasons, cross-device + offsite, intermittent as additional-only), confirm policy (starts scheduled runs), edit policy (frequency/retention/targets); policy persisted via the clan Config hatch to the config repo; audit entry emitted per confirm/edit
seam: backup orchestrator seam tests (control plane, Go) — fake fleet-state provider (topology, zones, intermittent tag), in-memory policy store faking the config-repo commit path, in-memory audit ledger
acceptance:
  - given: the drafted policy (nightly 02:00, 30-day, recommended targets)
    when: I confirm it
    then: it becomes the dataset's confirmed policy and scheduled runs begin — the confirm is the operator's act
  - given: I open the policy screen
    when: targets are recommended
    then: they are drawn with zone spread, each reason shown, a cross-device and an offsite target recommended where the fleet allows
  - given: the policy screen
    then: encryption shows "Encrypted — always" with no toggle; keys live in the crown-jewel store; offsite holds ciphertext only
  - given: an intermittent-tagged helper among candidates
    then: it is offered only as an additional copy with candid status, never as the sole target
  - given: a confirmed policy
    when: I change frequency, retention window, or targets
    then: the change is saved to the config-repo policy and takes effect on the next scheduled run
  - given: a policy confirm or edit
    then: a structured audit entry lands attributed to the operator, drillable from the overview
depends_on: [coverage-map-and-first-run, bootstrap:clan-seam]
out_of_scope:
  - stories 11–14 scheduled runs & verification — scheduled-runs-and-verification's
  - the gone-target policy state (story 18–19) — per-target-honesty-and-staleness's
  - window-aware / maintenance-window scheduling (deferred, DDR 0085)
needs_human_decision:
  - "Offsite pairing — partner-community pairing and/or the Matou-brokered offsite target (mechanism and terms)"
## Parent Feature spec: #20 (backups). ## What to build The policy screen (P7-S2) where the operator turns the **drafted recommended policy** into a dataset's confirmed backup policy and, later, edits it. Confirming is a single act: the drafted policy (nightly 02:00, 30-day retention, recommended targets) becomes the dataset's confirmed policy and scheduled runs begin — the system recommends, the operator confirms; advice never veto (DDR 0085). Target recommendations are drawn from fleet topology with **zone spread**: each recommended target shows its reason, and both a cross-device and an offsite target are recommended where the fleet allows (ADR 0079/DDR 0085). An *intermittent*-tagged helper is offered only as an **additional** copy with its candid status shown, never as a dataset's sole target (DDR 0085). Encryption is shown as **"Encrypted — always"** — a fact with no toggle; snapshots are encrypted with keys in the community's crown-jewel secret store, so offsite holders only ever hold ciphertext (DDR 0085/ADR 0082). Editing keeps the defaults a starting point, not a cage: changing a dataset's frequency, retention window, or targets saves to the policy and takes effect on the next scheduled run. Policy commits ride the existing clan **Config** hatch — no new seam amendment — and the policy is homed in the config repo (versioned; the operator app's replica means Tier-1 rescue already holds the arrangements, ADR 0082). Every policy confirm and edit lands a structured entry in the standing logging pipeline, attributed to the acting operator and drillable from the overview (ADR 0027). Notes: the Identity dataset is in the drafted default policy from day one (ADR 0078) — a founding-seeded runtime coupling to members, not a build edge. This slice carries one open human decision — the offsite pairing mechanism (see below) — which does not block building the confirm/edit path against operator-supplied and node targets. ## Acceptance criteria - [ ] (story 6) Given the drafted policy (nightly 02:00, 30-day retention, recommended targets), when I review and confirm it, then it becomes the dataset's confirmed backup policy and scheduled runs begin — confirming is my act, the system recommends and the operator confirms. - [ ] (story 7) Given I open the policy screen, when the system recommends targets, then it draws them from fleet topology with zone spread, shows each target's reason, and recommends both a cross-device and an offsite target where the fleet allows. - [ ] (story 8) Given the policy screen, then it shows "Encrypted — always" as a fact with no toggle; snapshots are encrypted with keys held in the community's crown-jewel secret store, so offsite holders only ever hold ciphertext. - [ ] (story 9) Given target recommendation includes an intermittent-tagged helper, then it is offered only as an additional copy with its candid status shown, never as a dataset's sole target. - [ ] (story 10) Given a confirmed policy, when I change frequency, retention window, or targets, then the change is saved to the policy (homed in the config repo) and takes effect on the next scheduled run. - [ ] (story 32) Given a policy confirm or edit, then a structured entry lands in the standing logging pipeline attributed to the acting operator, drillable from the overview. ## Blocked by - #82 — datasets and drafted policy exist - #25 — policy commits ride the Config hatch ## Task manifest ```yaml task: backups:policy-confirm-and-edit implements_flow: p7-backups implements_edge: S1x→S2, S1→S2, S2→S3 wireframe: docs/ux/wireframes/p7-backups/p7-s2-policy.html interface: backup orchestrator — draft policy from fleet topology (zone-spread target recommendation with reasons, cross-device + offsite, intermittent as additional-only), confirm policy (starts scheduled runs), edit policy (frequency/retention/targets); policy persisted via the clan Config hatch to the config repo; audit entry emitted per confirm/edit seam: backup orchestrator seam tests (control plane, Go) — fake fleet-state provider (topology, zones, intermittent tag), in-memory policy store faking the config-repo commit path, in-memory audit ledger acceptance: - given: the drafted policy (nightly 02:00, 30-day, recommended targets) when: I confirm it then: it becomes the dataset's confirmed policy and scheduled runs begin — the confirm is the operator's act - given: I open the policy screen when: targets are recommended then: they are drawn with zone spread, each reason shown, a cross-device and an offsite target recommended where the fleet allows - given: the policy screen then: encryption shows "Encrypted — always" with no toggle; keys live in the crown-jewel store; offsite holds ciphertext only - given: an intermittent-tagged helper among candidates then: it is offered only as an additional copy with candid status, never as the sole target - given: a confirmed policy when: I change frequency, retention window, or targets then: the change is saved to the config-repo policy and takes effect on the next scheduled run - given: a policy confirm or edit then: a structured audit entry lands attributed to the operator, drillable from the overview depends_on: [coverage-map-and-first-run, bootstrap:clan-seam] out_of_scope: - stories 11–14 scheduled runs & verification — scheduled-runs-and-verification's - the gone-target policy state (story 18–19) — per-target-honesty-and-staleness's - window-aware / maintenance-window scheduling (deferred, DDR 0085) needs_human_decision: - "Offsite pairing — partner-community pairing and/or the Matou-brokered offsite target (mechanism and terms)" ```
Author
Owner

This was generated by AI during triage.

Triage: routed ready-for-human

Judgement call, not a spec gap: the ticket body names its own open decision — "This slice carries one open human decision — the offsite pairing mechanism." The confirm/edit path against operator-supplied and node targets, the zone-spread recommendation logic, the intermittent-helper handling, and the always-encrypted framing (DDR 0085) are all fully specified and buildable now.

What needs deciding: the offsite pairing mechanism — whether an offsite backup target is a partner-community pairing, and/or a Matou-brokered offsite target, and on what terms. This determines what a recommended offsite target actually is in the UI, which is a partnership/commercial arrangement outside this agent's authority to invent.

Not blocking: per the ticket, this decision "does not block building the confirm/edit path against operator-supplied and node targets" — the agent can build the full policy screen now; wiring the offsite-target source waits on the human call.

> *This was generated by AI during triage.* ## Triage: routed `ready-for-human` **Judgement call, not a spec gap:** the ticket body names its own open decision — *"This slice carries one open human decision — the offsite pairing mechanism."* The confirm/edit path against operator-supplied and node targets, the zone-spread recommendation logic, the intermittent-helper handling, and the always-encrypted framing (DDR 0085) are all fully specified and buildable now. **What needs deciding:** the **offsite pairing mechanism** — whether an offsite backup target is a partner-community pairing, and/or a Matou-brokered offsite target, and on what terms. This determines what a recommended offsite target actually *is* in the UI, which is a partnership/commercial arrangement outside this agent's authority to invent. **Not blocking:** per the ticket, this decision "does not block building the confirm/edit path against operator-supplied and node targets" — the agent can build the full policy screen now; wiring the offsite-target *source* waits on the human call.
Author
Owner

Human decision: offsite pairing mechanism (resolves needs_human_decision)

Ruled by Ben, 2026-07-25. The ticket moves to ready-for-agent.

Offsite target = the community's own devices, in another location; Matou as fallback

  1. Primary offsite mechanism — intra-community. An offsite backup target is a device in the community's own clan located at a different place from the dataset's home node. Offsite is achieved internally: at least one community device in a different location, surfaced through the existing zone-spread recommendation (ADR 0079 / DDR 0085). Partner-community pairing is not needed and is dropped — no community-to-community pairing mechanism at v1.

  2. Matou-brokered fallback. If the community has no offsite-located device provisioned as a backup target yet, the recommendation offers a Matou-brokered offsite target as the fallback, so day-one fleets still get an offsite ciphertext copy. Once the community provisions its own offsite device, that becomes the recommended offsite target (the Matou target is the stopgap, not the default).

  3. Terms of the Matou fallback — same commercial model as #39 (see the decision comment on #39): Matou absorbs the underlying provider storage cost and re-bills the community at 100% margin (2× cost), monthly via Stripe, under the same drafted ToS family as the server broker (⚠ same legal-review gate before real payments). Matou only ever holds ciphertext (ADR 0082), same as any offsite holder.

Build note: in the target-recommendation UI this means the "offsite" slot is filled by (a) a community device tagged with a different location/zone when one exists, else (b) the Matou-brokered target with its price and "your community's own offsite device will replace this" framing. The fake fleet-state provider in the seam should cover both cases.

## Human decision: offsite pairing mechanism (resolves `needs_human_decision`) Ruled by Ben, 2026-07-25. The ticket moves to `ready-for-agent`. ### Offsite target = the community's own devices, in another location; Matou as fallback 1. **Primary offsite mechanism — intra-community.** An offsite backup target is a device **in the community's own clan located at a different place** from the dataset's home node. Offsite is achieved internally: at least one community device in a different location, surfaced through the existing zone-spread recommendation (ADR 0079 / DDR 0085). **Partner-community pairing is not needed and is dropped** — no community-to-community pairing mechanism at v1. 2. **Matou-brokered fallback.** If the community has **no offsite-located device provisioned as a backup target yet**, the recommendation offers a **Matou-brokered offsite target** as the fallback, so day-one fleets still get an offsite ciphertext copy. Once the community provisions its own offsite device, that becomes the recommended offsite target (the Matou target is the stopgap, not the default). 3. **Terms of the Matou fallback — same commercial model as #39** (see the decision comment on #39): Matou absorbs the underlying provider storage cost and re-bills the community at **100% margin (2× cost)**, monthly via Stripe, under the same drafted ToS family as the server broker (⚠ same legal-review gate before real payments). Matou only ever holds ciphertext (ADR 0082), same as any offsite holder. **Build note:** in the target-recommendation UI this means the "offsite" slot is filled by (a) a community device tagged with a different location/zone when one exists, else (b) the Matou-brokered target with its price and "your community's own offsite device will replace this" framing. The fake fleet-state provider in the seam should cover both cases.
Author
Owner

Done in 023ef69 (on origin/main).

Seam — internal/backup/policy.go (7 Go tests, policy_test.go): the P7-S2 face of the backup orchestrator. PolicyView(dataset) composes the screen (drafted-or-confirmed frequency/keep/due, EncryptionFact "Encrypted — always" — a fact with no toggle, ADR 0082, and the recommended targets). RecommendTargets draws from fleet topology with zone spread — the first always-on candidate in a different building is the recommended cross-device copy, an offsite target recommended wherever the fleet allows (the only real coverage on a one-device fleet), each with its reason; an intermittent-tagged helper is additional-only, candid status shown, never a dataset's sole copy (DDR 0085 §5), read from a new Zone field on fleetstate.Device + the uptime pattern. Confirm/Edit are the operator's act: attribution mandatory (ErrUnattributed), committed to the config repo via a faked PolicyStore commit path (ADR 0082 — versioned, an edit a new commit), the in-memory policy the scheduler reads updated (scheduled runs begin / edit takes effect next run), and a structured AuditEntry landed in the standing logging pipeline attributed to the operator, drillable per dataset (ADR 0027).

UI — BackupPolicyScreen.vue (6 Vue tests, backupPolicy.test.ts): to the wireframe's data-field/data-action/data-status contract (frequency/keep selects, the encryption fact, target rows with target-selected / target-additional-only / target-unselected, confirm→save), composed under BackupsSurface (edges S1 → S2 / S1x → S2, back re-reads the overview). backups.ts gains the policy types + FakeBackupPolicyClient.

All 6 acceptance clauses (stories 6, 7, 8, 9, 10, 32) covered. Full Go suite + all 344 dashboard tests green; vue-tsc + eslint + gofmt clean.

Deferred (out of scope): the offsite pairing mechanism stays a human decision — built against operator-supplied + node targets per the issue note; scheduled runs & verification (stories 11–14) and the gone-target state (S2x) are their own slices.

Done in `023ef69` (on `origin/main`). **Seam — `internal/backup/policy.go` (7 Go tests, `policy_test.go`):** the P7-S2 face of the `backup` orchestrator. `PolicyView(dataset)` composes the screen (drafted-or-confirmed frequency/keep/due, `EncryptionFact` "Encrypted — always" — a fact with no toggle, ADR 0082, and the recommended targets). `RecommendTargets` draws from fleet topology with **zone spread** — the first always-on candidate in a different building is the recommended cross-device copy, an **offsite** target recommended wherever the fleet allows (the only real coverage on a one-device fleet), each with its reason; an **intermittent**-tagged helper is **additional-only**, candid status shown, never a dataset's sole copy (DDR 0085 §5), read from a new `Zone` field on `fleetstate.Device` + the uptime pattern. `Confirm`/`Edit` are the operator's act: attribution mandatory (`ErrUnattributed`), committed to the config repo via a faked `PolicyStore` commit path (ADR 0082 — versioned, an edit a new commit), the in-memory policy the scheduler reads updated (scheduled runs begin / edit takes effect next run), and a structured `AuditEntry` landed in the standing logging pipeline attributed to the operator, drillable per dataset (ADR 0027). **UI — `BackupPolicyScreen.vue` (6 Vue tests, `backupPolicy.test.ts`):** to the wireframe's `data-field`/`data-action`/`data-status` contract (frequency/keep selects, the encryption fact, target rows with `target-selected` / `target-additional-only` / `target-unselected`, confirm→save), composed under `BackupsSurface` (edges S1 → S2 / S1x → S2, back re-reads the overview). `backups.ts` gains the policy types + `FakeBackupPolicyClient`. All 6 acceptance clauses (stories 6, 7, 8, 9, 10, 32) covered. Full Go suite + all 344 dashboard tests green; `vue-tsc` + eslint + gofmt clean. **Deferred (out of scope):** the offsite pairing mechanism stays a human decision — built against operator-supplied + node targets per the issue note; scheduled runs & verification (stories 11–14) and the gone-target state (S2x) are their own slices.
ben closed this issue 2026-07-26 00:38:37 +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#86
No description provided.