engine-adapters: smoke-backups — family-3 proven on the clan-lab #177

Closed
opened 2026-07-29 05:10:15 +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

Family-3 proof: confirm Identity's policy → a real scheduled run snapshots, seals, replicates cross-node and verifies; force a target failure and watch coverage drop through monitoring; run a real in-place restore end to end (pre-restore snapshot, quiesce/resume, verify); read the target back with nothing but the keys and age. Executes spec #20's standing smoke clause.

Acceptance criteria

  • Given the lab fleet, When the smoke runs, Then run→verify→coverage→restore all pass with evidence attached
  • Given a target read cold with keys + age only, When parsed, Then all facts recover (ADR 0104's rebuild bar)

Blocked by

  • engine-adapters:backup-engine-schedule

Task manifest

task: engine-adapters:smoke-backups
implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)"
interface: "the family's public seam, driven end-to-end on the clan-lab"
seam: "the clan-lab run itself (clan-lab + lab-dns skills); evidence (logs, verdicts) posted to this ticket"
acceptance:
  - given: a real 3-node lab fleet; when: the scripted smoke drives the family; then: every listed leg passes and evidence is attached (spec #20)
depends_on: [engine-adapters:backup-engine-schedule]
out_of_scope: [performance / resource-floor numbers (honesty limits: measure only what the substrate can honestly show)]
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 Family-3 proof: confirm Identity's policy → a real scheduled run snapshots, seals, replicates cross-node and verifies; force a target failure and watch coverage drop through monitoring; run a real in-place restore end to end (pre-restore snapshot, quiesce/resume, verify); read the target back with nothing but the keys and age. Executes spec #20's standing smoke clause. ## Acceptance criteria - [ ] Given the lab fleet, When the smoke runs, Then run→verify→coverage→restore all pass with evidence attached - [ ] Given a target read cold with keys + age only, When parsed, Then all facts recover (ADR 0104's rebuild bar) ## Blocked by - engine-adapters:backup-engine-schedule ## Task manifest ```yaml task: engine-adapters:smoke-backups implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)" interface: "the family's public seam, driven end-to-end on the clan-lab" seam: "the clan-lab run itself (clan-lab + lab-dns skills); evidence (logs, verdicts) posted to this ticket" acceptance: - given: a real 3-node lab fleet; when: the scripted smoke drives the family; then: every listed leg passes and evidence is attached (spec #20) depends_on: [engine-adapters:backup-engine-schedule] out_of_scope: [performance / resource-floor numbers (honesty limits: measure only what the substrate can honestly show)] needs_human_decision: [] ```
Author
Owner

Family 3 (the backup engine, ADR 0104) proven on a real 3-node clan-lab (kanidm 1.10.3, golden pin clan-core db4db726) on 2026-07-29. Commit ae0152f.

The production *backupengine.Engine composed into the real *backup.Orchestrator (the exact #170 composition) driven end to end against real kanidm over the remote-SSH transport the engine_integration_test.go cannot exercise. All four legs PASS:

  • run (AC1) — a confirmed Identity policy's scheduled run snapshots kanidm over SSH, seals under the crown-jewel key, replicates cross-node to node2 + an offsite target, and verifies (kanidm's own database verify); coverage counts both verified copies.
  • coverage (AC1) — node2's VM is genuinely virsh destroyed; coverage drops 2→1 and a coverage-gap fault names node2 for monitoring (ADR 0081).
  • restore (AC1) — a real in-place restore end to end: pre-restore snapshot → quiesce (systemctl stop kanidm) → replace (kanidm database restore) → resume → verify; kanidm active again after.
  • coldread (AC2) — the offsite target read back COLD with keys + a JSON reader alone (backup.ReadInventory + backup.Open) recovers the 609,813-byte kanidm export byte-for-byte (319 directory entries; operators/members/kaitiaki present), opaque without the keys; backup.RebuildFromNothing closes ADR 0104's rebuild bar.

The gate did its job — two load-bearing bugs the fakes masked, both FIXED:

  1. backupengine.SSHLauncher sent verb argv unquoted, so the remote shell re-parsed metacharacters — Identity's sed 's|^db_path.*|...|' shattered and a run read verification-failed though the snapshot was perfect (invisible to the localhost launcher). Now shell-quotes each argv element (conn.go), locked by conn_ssh_test.go.
  2. kanidm 1.10 writes database backup gzip'd while restore/verify read plain JSON (real exit 1 on gzip) — verify-sample of the raw artifact failed. The snapshot verb now decompresses to a plain-JSON artifact (identity.go); the contract-test double is made faithful in backupengine_test.go.

One naming/impl discrepancy for post-hoc review: ADR 0104 names the sealing tool age, but the shipped one-encryption-story is AES-GCM (backup.Seal/Open, ADR 0082 §4) — the rebuild bar is real and proven either way.

Evidence + full verdict JSON: docs/spike-findings/smoke-backups-177.md. Binary + CI seam test: control-plane/cmd/smoke-backups/. Lab config: spikes/smoke-backups/. Re-run: scripts/smoke-backups.sh [<lab-name>]. Lab destroyed after the run. Honesty limits (clan-lab): functional verdicts only; the cross-node/offsite byte surfaces are SSH-reached directories (the honest stand-in for the mesh/S3 stores the compose #181 wires).

Family 3 (the backup engine, ADR 0104) proven on a real 3-node clan-lab (kanidm 1.10.3, golden pin clan-core `db4db726`) on 2026-07-29. Commit `ae0152f`. The production `*backupengine.Engine` composed into the real `*backup.Orchestrator` (the exact #170 composition) driven end to end against **real kanidm** over the **remote-SSH transport** the `engine_integration_test.go` cannot exercise. All four legs PASS: - **run (AC1)** — a confirmed Identity policy's scheduled run snapshots kanidm over SSH, seals under the crown-jewel key, replicates cross-node to node2 + an offsite target, and verifies (kanidm's own `database verify`); coverage counts both verified copies. - **coverage (AC1)** — node2's VM is genuinely `virsh destroy`ed; coverage drops 2→1 and a coverage-gap fault names node2 for monitoring (ADR 0081). - **restore (AC1)** — a real in-place restore end to end: pre-restore snapshot → quiesce (`systemctl stop kanidm`) → replace (`kanidm database restore`) → resume → verify; kanidm active again after. - **coldread (AC2)** — the offsite target read back COLD with keys + a JSON reader alone (`backup.ReadInventory` + `backup.Open`) recovers the 609,813-byte kanidm export **byte-for-byte** (319 directory entries; operators/members/kaitiaki present), opaque without the keys; `backup.RebuildFromNothing` closes ADR 0104's rebuild bar. **The gate did its job — two load-bearing bugs the fakes masked, both FIXED:** 1. `backupengine.SSHLauncher` sent verb argv **unquoted**, so the remote shell re-parsed metacharacters — Identity's `sed 's|^db_path.*|...|'` shattered and a run read verification-failed though the snapshot was perfect (invisible to the localhost launcher). Now shell-quotes each argv element (`conn.go`), locked by `conn_ssh_test.go`. 2. kanidm 1.10 writes `database backup` **gzip'd** while `restore`/`verify` read **plain JSON** (real exit 1 on gzip) — verify-sample of the raw artifact failed. The snapshot verb now decompresses to a plain-JSON artifact (`identity.go`); the contract-test double is made faithful in `backupengine_test.go`. **One naming/impl discrepancy for post-hoc review:** ADR 0104 names the sealing tool `age`, but the shipped one-encryption-story is AES-GCM (`backup.Seal`/`Open`, ADR 0082 §4) — the rebuild bar is real and proven either way. Evidence + full verdict JSON: `docs/spike-findings/smoke-backups-177.md`. Binary + CI seam test: `control-plane/cmd/smoke-backups/`. Lab config: `spikes/smoke-backups/`. Re-run: `scripts/smoke-backups.sh [<lab-name>]`. Lab destroyed after the run. Honesty limits (clan-lab): functional verdicts only; the cross-node/offsite byte surfaces are SSH-reached directories (the honest stand-in for the mesh/S3 stores the compose #181 wires).
ben closed this issue 2026-07-29 22:53:44 +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#177
No description provided.