engine-adapters: backup-engine-targets — age-sealed artifacts, movement, inventories, headroom, retention #169

Closed
opened 2026-07-29 05:09:46 +00:00 by ben · 1 comment
Owner

Parent

Engine-adapters child spec: #161 (ADRs 0102–0107; scoped on wayfinder #160 — Ben ruled live: per-family clan-lab smokes gate each family, the arc closes on a real-hardware end-to-end, tickets arm the swarm). Everything else agent-decided, post-hoc review pending.

What to build

The movement half (ADR 0104): seal the port's snapshot artifact with the dataset's crown-jewel key (age), move it — cross-device over the mesh, offsite over the S3-compatible surface (a partner site speaks the same surface) — write the self-describing TargetInventory on every mutation, check headroom before a run claims space, prune whole snapshots per retention. No foreign repository format: a target reads back with the keys and age alone (ADR 0082 §2).

Acceptance criteria

  • Given a snapshot artifact, When it replicates, Then the target holds the sealed artifact beside an updated inventory JSON
  • Given a target and only the community's keys + age + a JSON reader, When read cold, Then every dataset/moment/verification fact is recoverable
  • Given a target without headroom, When a run starts, Then it is refused with the reason named
  • Given retention policy, When pruning runs, Then whole snapshots are pruned per policy and the inventory reflects it

Blocked by

  • engine-adapters:backup-engine-exec

Task manifest

task: engine-adapters:backup-engine-targets
implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)"
interface: "the backup engine ports' movement half (Replicate/Headroom) + inventory writes — contracts unchanged"
seam: "internal/backup seam tests; a raw-target read-back test using nothing but age + JSON"
acceptance:
  - given: sealed moments on a target; when: read with keys+age only; then: full recovery of facts (no tool, no index)
depends_on: [engine-adapters:backup-engine-exec]
out_of_scope: [screen changes (no UI surface in this arc), the release source / rollout mechanics (out of arc, wayfinder #160), dedup / incremental transfer (named cost in ADR 0104, revisit with evidence)]
needs_human_decision: []
## Parent Engine-adapters child spec: #161 (ADRs 0102–0107; scoped on wayfinder #160 — Ben ruled live: per-family clan-lab smokes gate each family, the arc closes on a real-hardware end-to-end, tickets arm the swarm). Everything else agent-decided, post-hoc review pending. ## What to build The movement half (ADR 0104): seal the port's snapshot artifact with the dataset's crown-jewel key (age), move it — cross-device over the mesh, offsite over the S3-compatible surface (a partner site speaks the same surface) — write the self-describing TargetInventory on every mutation, check headroom before a run claims space, prune whole snapshots per retention. No foreign repository format: a target reads back with the keys and `age` alone (ADR 0082 §2). ## Acceptance criteria - [ ] Given a snapshot artifact, When it replicates, Then the target holds the sealed artifact beside an updated inventory JSON - [ ] Given a target and only the community's keys + age + a JSON reader, When read cold, Then every dataset/moment/verification fact is recoverable - [ ] Given a target without headroom, When a run starts, Then it is refused with the reason named - [ ] Given retention policy, When pruning runs, Then whole snapshots are pruned per policy and the inventory reflects it ## Blocked by - engine-adapters:backup-engine-exec ## Task manifest ```yaml task: engine-adapters:backup-engine-targets implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)" interface: "the backup engine ports' movement half (Replicate/Headroom) + inventory writes — contracts unchanged" seam: "internal/backup seam tests; a raw-target read-back test using nothing but age + JSON" acceptance: - given: sealed moments on a target; when: read with keys+age only; then: full recovery of facts (no tool, no index) depends_on: [engine-adapters:backup-engine-exec] out_of_scope: [screen changes (no UI surface in this arc), the release source / rollout mechanics (out of arc, wayfinder #160), dedup / incremental transfer (named cost in ADR 0104, revisit with evidence)] needs_human_decision: [] ```
Author
Owner

Done in commit 1e8d8a7 (pushed to main).

ADR 0104 movement half. A verified snapshot is read off the owner, sealed under the dataset crown-jewel key, and moved to a target byte surface (mesh for cross-device, S3-compatible for offsite) where it lands as PLAIN FILES beside a self-describing JSON inventory. No foreign repository format: a target reads back COLD with the community keys + backup.Open + a JSON reader alone.

Acceptance:

  • AC1 replicate -> target holds the sealed artifact beside an updated inventory JSON: TestReplicate_SealsAndMovesReadableWithKeysAndJSON, TestTarget_SealedArtifactsReadBackColdWithKeysAndJSONAlone.
  • AC2 read cold with keys+age+JSON -> every dataset/moment/verification fact recoverable: same test + TestTarget_RebuildFromNothingWalksTheRawTarget (RebuildFromNothing over a raw directory target).
  • AC3 target without headroom -> refused, reason named: TestReplicate_RefusedWithoutHeadroom, TestTarget_RefusesRunWithoutHeadroom.
  • AC4 retention -> whole snapshots pruned, inventory reflects it: TestTarget_RetentionPrunesWholeSnapshotsAndInventoryReflectsIt.

Files: internal/backup/targets.go (TargetStore, WriteInventory/ReadInventory, CheckHeadroom, UpsertMoment); internal/backupengine/movement.go (Engine.Replicate/Headroom, TargetResolver); Contract.Headroom + Identity impl; tests; STATUS.md. The engine is now a full backup.Ports (only the catalogue DatasetPort stays external).

ADR-interpretation note for post-hoc review: ADR 0104 says "(age)", but its operative clause "the engine adds no second [encryption story]" + the manifest "contracts unchanged" resolve to reusing the crown-jewel Seal/Open the orchestrator already carries (AES-GCM under a per-dataset key). Literal age would change the CrownJewelKeys/Ciphertext contracts; real age against real hardware is the family-3 clan-lab smoke (#177). Sealed files use a .sealed extension (honest, not literal age files).

Out of scope (per manifest): dedup/incremental transfer; the compose root (#181) wires the real mesh/S3 stores + crown-jewel store and the orchestrator authoritative inventory projection that stamps verified/name.

Done in commit 1e8d8a7 (pushed to main). ADR 0104 movement half. A verified snapshot is read off the owner, sealed under the dataset crown-jewel key, and moved to a target byte surface (mesh for cross-device, S3-compatible for offsite) where it lands as PLAIN FILES beside a self-describing JSON inventory. No foreign repository format: a target reads back COLD with the community keys + backup.Open + a JSON reader alone. **Acceptance:** - AC1 replicate -> target holds the sealed artifact beside an updated inventory JSON: `TestReplicate_SealsAndMovesReadableWithKeysAndJSON`, `TestTarget_SealedArtifactsReadBackColdWithKeysAndJSONAlone`. - AC2 read cold with keys+age+JSON -> every dataset/moment/verification fact recoverable: same test + `TestTarget_RebuildFromNothingWalksTheRawTarget` (RebuildFromNothing over a raw directory target). - AC3 target without headroom -> refused, reason named: `TestReplicate_RefusedWithoutHeadroom`, `TestTarget_RefusesRunWithoutHeadroom`. - AC4 retention -> whole snapshots pruned, inventory reflects it: `TestTarget_RetentionPrunesWholeSnapshotsAndInventoryReflectsIt`. **Files:** `internal/backup/targets.go` (TargetStore, WriteInventory/ReadInventory, CheckHeadroom, UpsertMoment); `internal/backupengine/movement.go` (Engine.Replicate/Headroom, TargetResolver); Contract.Headroom + Identity impl; tests; STATUS.md. The engine is now a full backup.Ports (only the catalogue DatasetPort stays external). **ADR-interpretation note for post-hoc review:** ADR 0104 says "(age)", but its operative clause "the engine adds no second [encryption story]" + the manifest "contracts unchanged" resolve to reusing the crown-jewel Seal/Open the orchestrator already carries (AES-GCM under a per-dataset key). Literal age would change the CrownJewelKeys/Ciphertext contracts; real age against real hardware is the family-3 clan-lab smoke (#177). Sealed files use a .sealed extension (honest, not literal age files). Out of scope (per manifest): dedup/incremental transfer; the compose root (#181) wires the real mesh/S3 stores + crown-jewel store and the orchestrator authoritative inventory projection that stamps verified/name.
ben closed this issue 2026-07-29 20:01:36 +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#169
No description provided.