engine-adapters: backup-engine-exec — port-declared verbs run on the owning node; Identity's contract ships #168

Closed
opened 2026-07-29 05:09:43 +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 execution half of the backup engine (ADR 0104): run each dataset's port-declared snapshot / verify-sample / restore / quiesce / resume verbs on the owning node over the fleet's established SSH trust — the reconciler channel AttachService already admits, reached through the clan adapter's connection. Identity's built-in contract (kanidm's consistent snapshot) ships here and is the proving dataset.

Acceptance criteria

  • Given Identity's declared contract, When the snapshot verb runs, Then a consistent point-in-time artifact is produced on the owning node
  • Given a verify-sample verb, When it runs against a restored sample, Then the port's own ‘checks out’ definition decides the verdict
  • Given a quiesce/resume bracket, When an in-place restore runs, Then the service is paused, replaced, resumed per the port's declaration

Blocked by

  • engine-adapters:clan-adapter-core

Task manifest

task: engine-adapters:backup-engine-exec
implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)"
interface: "the backup engine ports' execution half (Snapshot/VerifySample/Restore/Quiesce/Resume) — contracts unchanged (ADR 0080)"
seam: "internal/backup seam tests with fakes; contract tests driving Identity's real verb set against a disposable kanidm store"
acceptance:
  - given: Identity's contract; when: snapshot/verify/restore verbs execute; then: artifacts and verdicts are real, consistent, and honest
depends_on: [engine-adapters:clan-adapter-core]
out_of_scope: [screen changes (no UI surface in this arc), the release source / rollout mechanics (out of arc, wayfinder #160)]
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 execution half of the backup engine (ADR 0104): run each dataset's port-declared snapshot / verify-sample / restore / quiesce / resume verbs on the owning node over the fleet's established SSH trust — the reconciler channel AttachService already admits, reached through the clan adapter's connection. Identity's built-in contract (kanidm's consistent snapshot) ships here and is the proving dataset. ## Acceptance criteria - [ ] Given Identity's declared contract, When the snapshot verb runs, Then a consistent point-in-time artifact is produced on the owning node - [ ] Given a verify-sample verb, When it runs against a restored sample, Then the port's own ‘checks out’ definition decides the verdict - [ ] Given a quiesce/resume bracket, When an in-place restore runs, Then the service is paused, replaced, resumed per the port's declaration ## Blocked by - engine-adapters:clan-adapter-core ## Task manifest ```yaml task: engine-adapters:backup-engine-exec implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)" interface: "the backup engine ports' execution half (Snapshot/VerifySample/Restore/Quiesce/Resume) — contracts unchanged (ADR 0080)" seam: "internal/backup seam tests with fakes; contract tests driving Identity's real verb set against a disposable kanidm store" acceptance: - given: Identity's contract; when: snapshot/verify/restore verbs execute; then: artifacts and verdicts are real, consistent, and honest depends_on: [engine-adapters:clan-adapter-core] out_of_scope: [screen changes (no UI surface in this arc), the release source / rollout mechanics (out of arc, wayfinder #160)] needs_human_decision: [] ```
Author
Owner

Done in commit 90f7927 (on origin/main).

ADR 0104's execution half lands as the new package internal/backupengine: the port-declared verbs (Snapshot / VerifySample / Restore / RestoreInPlace / Quiesce / Resume) run on the owning node over a Conn — the reconciler channel AttachService admits, reached through the clan adapter's connection, never a second transport (ADR 0080). The transport is a Launcher (SSHLauncher in production, a local one for the contract test), so the engine and port contracts are identical either way. A composed engine adapter compile-time-asserts as backup.Ports (contracts unchanged).

Identity's built-in contract ships here (IdentityContract): kanidm's own database backup (consistent point-in-time artifact), a sampled-restore verify that restores aside into a scratch store and lets kanidm's own integrity check be the "checks out" verdict, an in-place database restore run only while quiesced, and quiesce/resume as the unit's stop/start. A clean non-zero from verify is an honest ok=false (typed ExitError), never an engine failure masquerading as a verdict.

Acceptance (contract tests over a disposable kanidm store, internal/backupengine/backupengine_test.go):

  • AC1 — snapshot verb produces a real point-in-time artifact on the owning node that survives a later live mutation.
  • AC2 — a good sample checks out; a tampered one is an honest false verdict (kanidm's own check decides), touching nothing live.
  • AC3 — an in-place restore is refused into a running server and succeeds only once quiesced, then resumes (the quiesce is load-bearing).

Scope: sealing (age) / movement / TargetInventory / headroom / retention are the engine's own parts and land in backup-engine-targets (#169); the family close wires it into main.go at backup-engine-schedule (#170). Not in main.go yet (ADR 0100). The real-remote-SSH proof is the family-3 clan-lab smoke (#177). go build/vet/golangci-lint/tests clean; STATUS.md updated.

Done in commit `90f7927` (on origin/main). ADR 0104's execution half lands as the new package `internal/backupengine`: the port-declared verbs (Snapshot / VerifySample / Restore / RestoreInPlace / Quiesce / Resume) run **on the owning node** over a `Conn` — the reconciler channel `AttachService` admits, reached through the clan adapter's connection, never a second transport (ADR 0080). The transport is a `Launcher` (`SSHLauncher` in production, a local one for the contract test), so the engine and port contracts are identical either way. A composed engine adapter compile-time-asserts as `backup.Ports` (contracts unchanged). **Identity's built-in contract ships here** (`IdentityContract`): kanidm's own `database backup` (consistent point-in-time artifact), a sampled-restore `verify` that restores aside into a scratch store and lets kanidm's own integrity check be the "checks out" verdict, an in-place `database restore` run only while quiesced, and quiesce/resume as the unit's stop/start. A clean non-zero from verify is an honest `ok=false` (typed `ExitError`), never an engine failure masquerading as a verdict. **Acceptance (contract tests over a disposable kanidm store, `internal/backupengine/backupengine_test.go`):** - AC1 — snapshot verb produces a real point-in-time artifact on the owning node that survives a later live mutation. - AC2 — a good sample checks out; a tampered one is an honest false verdict (kanidm's own check decides), touching nothing live. - AC3 — an in-place restore is refused into a running server and succeeds only once quiesced, then resumes (the quiesce is load-bearing). Scope: sealing (age) / movement / TargetInventory / headroom / retention are the engine's own parts and land in backup-engine-targets (#169); the family close wires it into main.go at backup-engine-schedule (#170). Not in main.go yet (ADR 0100). The real-remote-SSH proof is the family-3 clan-lab smoke (#177). `go build`/`vet`/`golangci-lint`/tests clean; STATUS.md updated.
ben closed this issue 2026-07-29 19:35:22 +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#168
No description provided.