bootstrap: clan-seam — the clan package + fake adapter behind DDR 0010 #25

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

Parent

Wayfinder map: #7 — the engineering foundation (PROCESS.md Phase 2½, emitted as DAG root slices).

What to build

The clan Go package — the single boundary between OurCloud and clan.lol (DDR 0010, the seam contract in docs/seams/clan.md). Nothing outside this package knows clan's config format, CLI flags, phase names, or exit-code lies. The interface's spine is the two hot paths: Deploy (the commit→apply loop the deploy runner runs many times a day) and Enrollment (the resumable, snapshot-durable stand-up of one approved device, blocking on human physical steps for days if needed). Around them: the Readiness eval gate, the thin Config and Vars escape hatches, Supply for closure seeding, and the per-service HealthCheck type. Outcome detection is layered (the S13 amendment); the error taxonomy classifies failures with structured remedies, connectivity before secrets.

Two build targets from day one (the clan seam's founding gate decision, ADR 0043): the package builds into the control plane for steady-state, and into the standalone per-platform Go helper the operator app bundles for founding stand-up. The fake adapter is the other half of this slice — it must simulate the blocked/resume/remedy and partial-failure flows (the S13 fakes) so seam tests can drive the exact disko-recovery path deterministically: a Remedy block, then one more Advance.

Notes: this slice also lands the Q2.2 reconciliation inputs (issue #12, absorbed into the seam) — EnrollRequest carries the fresh host's captured network facts (public IP + CIDR, gateway, DNS, and the public NIC's MAC), the adapter bakes them into a MAC-matched systemd-networkd config with an explicit gateway interface, and the node config uses clan-core's hybrid BIOS+UEFI disko layout. The two progress/embedding gate decisions are settled (checklist-only Events; the app embeds the seam) — agents must not invent progress-bar plumbing the design never asked for.

Acceptance criteria

  • Given the seam contract, when the clan package is built, then Deploy, Enroll/Resume/Enrollment (configure→preflight→install→verify→done, forward-only, phase-bookkept), Readiness, Config, Vars, Supply, and the HealthCheck type all exist as specified.
  • Given a fleet deploy, when a scoped node fails to evaluate, then Deploy excludes-and-reports it (never lets the batch die) and DeployResult still names what reconciled, Restarted, and Skipped.
  • Given the fake adapter, when a seam test drives it, then it simulates blocked/resume/remedy and partial-failure flows — including a disko failure that resumes with the install,reboot subset only after a Remedy + Advance.
  • Given the founding decision (ADR 0043), when the package is built, then it produces both the control-plane build and the standalone helper binary (behind a stdio JSON interface).
  • Given a failure, when the seam classifies it, then it returns a typed {Kind, Node, Summary, Detail, Remedy} with connectivity classified before secrets, and outcomes log-derived (masked-exit proof carried in Detail).
  • Given a fresh-host takeover (Q2.2), when an EnrollRequest arrives, then it carries the host's network facts (public IP/CIDR, gateway, DNS, public-NIC MAC) which the adapter bakes into a MAC-matched systemd-networkd config with an explicit gateway interface and a hybrid BIOS+UEFI disko layout.

Blocked by

  • #23 — needs the Go workspace + dev shell.

Task manifest

task: bootstrap:clan-seam
implements_seam: docs/seams/clan.md
implements_edge: —   # engineering slice; no flow edge
wireframe: —         # no wireframe; the seam contract IS the design
interface: clan.Clan — Deploy(DeployRequest), Enroll(EnrollRequest)/Resume(snapshot)
  returning the Enrollment workflow (Advance/Answer/Snapshot), Readiness gate,
  Config/Vars/Supply hatches, and the per-service HealthCheck type; layered outcome
  detection + the FailureKind taxonomy with structured Remedy
seam: clan seam tests (Go) against the fake clan adapter — simulates
  blocked/resume/remedy + partial-failure (the S13 fakes); disko-recovery path driven
  deterministically; both build targets (control plane + standalone helper) verified
acceptance:
  - given: the seam contract
    when: the package builds
    then: Deploy, Enrollment (forward-only, phase-bookkept, snapshot-resumable), Readiness, Config, Vars, Supply, and HealthCheck exist as specified
  - given: a scoped deploy with one non-evaluating node
    when: Deploy runs
    then: the bad node is excluded-and-reported and DeployResult reports what reconciled/restarted/skipped
  - given: the fake adapter
    when: a seam test drives a disko failure
    then: it simulates blocked/resume/remedy and resumes with install,reboot only after a Remedy + Advance
  - given: ADR 0043
    when: the package builds
    then: it produces both the control-plane build and the standalone helper (stdio JSON)
  - given: a fresh-host takeover EnrollRequest (Q2.2)
    when: the adapter builds the node config
    then: it bakes the captured network facts into a MAC-matched systemd-networkd config with explicit gateway interface and a hybrid BIOS+UEFI disko layout
depends_on: [skeleton]
out_of_scope: [the enroll agent<->control-plane boundary (enroll-seam's), theming
  compile (brandkit-seam's), real provisioning of catalogue services (provisioning
  feature), progress-bar Event plumbing (gate-decided against — checklist only)]
needs_human_decision: []
## Parent Wayfinder map: #7 — the engineering foundation (PROCESS.md Phase 2½, emitted as DAG root slices). ## What to build The `clan` Go package — the single boundary between OurCloud and clan.lol (DDR 0010, the seam contract in `docs/seams/clan.md`). Nothing outside this package knows clan's config format, CLI flags, phase names, or exit-code lies. The interface's spine is the two hot paths: `Deploy` (the commit→apply loop the deploy runner runs many times a day) and `Enrollment` (the resumable, snapshot-durable stand-up of one approved device, blocking on human physical steps for days if needed). Around them: the `Readiness` eval gate, the thin `Config` and `Vars` escape hatches, `Supply` for closure seeding, and the per-service `HealthCheck` type. Outcome detection is layered (the S13 amendment); the error taxonomy classifies failures with structured remedies, connectivity before secrets. Two build targets from day one (the clan seam's founding gate decision, ADR 0043): the package builds into the control plane for steady-state, and into the standalone per-platform Go helper the operator app bundles for founding stand-up. The fake adapter is the other half of this slice — it must simulate the blocked/resume/remedy and partial-failure flows (the S13 fakes) so seam tests can drive the exact disko-recovery path deterministically: a `Remedy` block, then one more `Advance`. Notes: this slice also lands the Q2.2 reconciliation inputs (issue #12, absorbed into the seam) — `EnrollRequest` carries the fresh host's captured network facts (public IP + CIDR, gateway, DNS, and the public NIC's MAC), the adapter bakes them into a MAC-matched systemd-networkd config with an explicit gateway interface, and the node config uses clan-core's hybrid BIOS+UEFI disko layout. The two progress/embedding gate decisions are settled (checklist-only Events; the app embeds the seam) — agents must not invent progress-bar plumbing the design never asked for. ## Acceptance criteria - [ ] Given the seam contract, when the `clan` package is built, then `Deploy`, `Enroll`/`Resume`/`Enrollment` (configure→preflight→install→verify→done, forward-only, phase-bookkept), `Readiness`, `Config`, `Vars`, `Supply`, and the `HealthCheck` type all exist as specified. - [ ] Given a fleet deploy, when a scoped node fails to evaluate, then `Deploy` excludes-and-reports it (never lets the batch die) and `DeployResult` still names what reconciled, `Restarted`, and `Skipped`. - [ ] Given the fake adapter, when a seam test drives it, then it simulates blocked/resume/remedy and partial-failure flows — including a disko failure that resumes with the `install,reboot` subset only after a `Remedy` + `Advance`. - [ ] Given the founding decision (ADR 0043), when the package is built, then it produces both the control-plane build and the standalone helper binary (behind a stdio JSON interface). - [ ] Given a failure, when the seam classifies it, then it returns a typed `{Kind, Node, Summary, Detail, Remedy}` with connectivity classified before secrets, and outcomes log-derived (masked-exit proof carried in `Detail`). - [ ] Given a fresh-host takeover (Q2.2), when an `EnrollRequest` arrives, then it carries the host's network facts (public IP/CIDR, gateway, DNS, public-NIC MAC) which the adapter bakes into a MAC-matched systemd-networkd config with an explicit gateway interface and a hybrid BIOS+UEFI disko layout. ## Blocked by - #23 — needs the Go workspace + dev shell. ## Task manifest ```yaml task: bootstrap:clan-seam implements_seam: docs/seams/clan.md implements_edge: — # engineering slice; no flow edge wireframe: — # no wireframe; the seam contract IS the design interface: clan.Clan — Deploy(DeployRequest), Enroll(EnrollRequest)/Resume(snapshot) returning the Enrollment workflow (Advance/Answer/Snapshot), Readiness gate, Config/Vars/Supply hatches, and the per-service HealthCheck type; layered outcome detection + the FailureKind taxonomy with structured Remedy seam: clan seam tests (Go) against the fake clan adapter — simulates blocked/resume/remedy + partial-failure (the S13 fakes); disko-recovery path driven deterministically; both build targets (control plane + standalone helper) verified acceptance: - given: the seam contract when: the package builds then: Deploy, Enrollment (forward-only, phase-bookkept, snapshot-resumable), Readiness, Config, Vars, Supply, and HealthCheck exist as specified - given: a scoped deploy with one non-evaluating node when: Deploy runs then: the bad node is excluded-and-reported and DeployResult reports what reconciled/restarted/skipped - given: the fake adapter when: a seam test drives a disko failure then: it simulates blocked/resume/remedy and resumes with install,reboot only after a Remedy + Advance - given: ADR 0043 when: the package builds then: it produces both the control-plane build and the standalone helper (stdio JSON) - given: a fresh-host takeover EnrollRequest (Q2.2) when: the adapter builds the node config then: it bakes the captured network facts into a MAC-matched systemd-networkd config with explicit gateway interface and a hybrid BIOS+UEFI disko layout depends_on: [skeleton] out_of_scope: [the enroll agent<->control-plane boundary (enroll-seam's), theming compile (brandkit-seam's), real provisioning of catalogue services (provisioning feature), progress-bar Event plumbing (gate-decided against — checklist only)] needs_human_decision: [] ```
Author
Owner

Done — bootstrap:clan-seam shipped in commit edaaf3e.

The clan Go package (internal/clan/) is the single DDR-0010 boundary between OurCloud and clan.lol, built to the seam contract in docs/seams/clan.md, plus the fake adapter that is the other half of the slice.

Acceptance criteria — all met, each with a seam test:

  1. Surface exists — Deploy, Enroll/Resume/Enrollment (configure→preflight→install→verify→done, forward-only, phase-bookkept, snapshot-resumable), Readiness, Config, Vars, Supply, HealthCheck (clan.go; TestEnrollment_HappyPath).
  2. Exclude-and-report — a non-evaluating node is skipped, the batch lives, and DeployResult names reconciled/skipped/restarted (TestDeploy_ExcludeAndReport); Strict fails the run, a reconcile-time failure returns *DeployError while the result still names what reconciled (TestDeploy_StrictFailsWholeRun, TestDeploy_PartialFailure).
  3. Disko recovery — the fake drives a disko failure → manual Remedy block → Snapshot/Resume → one more Advance that resumes with install,reboot only (TestEnrollment_DiskoRecovery); prompt-block/Answer covered too (TestEnrollment_BlockedOnPrompt).
  4. Both build targets (ADR 0043) — the package links into the control-plane build and into the standalone helper via a stdio JSON Bridge/ServeStdio (helper clan subcommand). Verified: both binaries compile, and helper clan was driven end-to-end over stdin/stdout (TestServeStdio_RoundTrip).
  5. Failure classification — Classify returns typed {Kind, Node, Summary, Detail, Remedy} with connectivity before secrets and masked exits log-derived (FailMaskedExit, proof in Detail) (TestClassify_ConnectivityBeforeSecrets, TestClassify_MaskedExit, TestClassify_Taxonomy).
  6. Q2.2 fresh-host takeover — EnrollRequest.NetworkFacts → BuildNodeConfig bakes a MAC-matched systemd-networkd config with an explicit gateway interface and a hybrid BIOS+UEFI disko layout, guarded by NodeConfig.Validate (TestBuildNodeConfig_FreshHostTakeover, TestNodeConfig_ValidateCatchesTheSpikeAssertions, TestEnrollment_BakesNodeConfig).

Files: internal/clan/{clan,errors,secret,nodeconfig,fake,stdio,clan_test}.go; control-plane/cmd/control-plane/main.go and app/helper/cmd/helper/main.go wired to the two build targets; STATUS.md updated (header + milestone log).

Checks: 17 seam tests (stdlib testing, hand-written fake); go build ./..., go vet ./..., gofmt -l, and go test -race ./internal/clan/ all clean. Secret/Response redact in String and JSON; Events are checklist-only (no progress-bar plumbing, per the 2026-07-09 gate); wire types carry snake_case tags.

Out of scope (untouched): the real PTY-driving clan adapter, the enroll agent↔control-plane boundary (#26's), theming compile, and real catalogue provisioning — each its own slice.

Done — `bootstrap:clan-seam` shipped in commit `edaaf3e`. The `clan` Go package (`internal/clan/`) is the single DDR-0010 boundary between OurCloud and clan.lol, built to the seam contract in `docs/seams/clan.md`, plus the fake adapter that is the other half of the slice. **Acceptance criteria — all met, each with a seam test:** 1. **Surface exists** — `Deploy`, `Enroll`/`Resume`/`Enrollment` (configure→preflight→install→verify→done, forward-only, phase-bookkept, snapshot-resumable), `Readiness`, `Config`, `Vars`, `Supply`, `HealthCheck` (`clan.go`; `TestEnrollment_HappyPath`). 2. **Exclude-and-report** — a non-evaluating node is skipped, the batch lives, and `DeployResult` names reconciled/skipped/restarted (`TestDeploy_ExcludeAndReport`); `Strict` fails the run, a reconcile-time failure returns `*DeployError` while the result still names what reconciled (`TestDeploy_StrictFailsWholeRun`, `TestDeploy_PartialFailure`). 3. **Disko recovery** — the fake drives a disko failure → manual `Remedy` block → `Snapshot`/`Resume` → one more `Advance` that resumes with **install,reboot only** (`TestEnrollment_DiskoRecovery`); prompt-block/`Answer` covered too (`TestEnrollment_BlockedOnPrompt`). 4. **Both build targets (ADR 0043)** — the package links into the control-plane build and into the standalone helper via a stdio JSON `Bridge`/`ServeStdio` (`helper clan` subcommand). Verified: both binaries compile, and `helper clan` was driven end-to-end over stdin/stdout (`TestServeStdio_RoundTrip`). 5. **Failure classification** — `Classify` returns typed `{Kind, Node, Summary, Detail, Remedy}` with **connectivity before secrets** and **masked exits log-derived** (`FailMaskedExit`, proof in `Detail`) (`TestClassify_ConnectivityBeforeSecrets`, `TestClassify_MaskedExit`, `TestClassify_Taxonomy`). 6. **Q2.2 fresh-host takeover** — `EnrollRequest.NetworkFacts` → `BuildNodeConfig` bakes a MAC-matched systemd-networkd config with an explicit gateway interface and a hybrid BIOS+UEFI disko layout, guarded by `NodeConfig.Validate` (`TestBuildNodeConfig_FreshHostTakeover`, `TestNodeConfig_ValidateCatchesTheSpikeAssertions`, `TestEnrollment_BakesNodeConfig`). **Files:** `internal/clan/{clan,errors,secret,nodeconfig,fake,stdio,clan_test}.go`; `control-plane/cmd/control-plane/main.go` and `app/helper/cmd/helper/main.go` wired to the two build targets; `STATUS.md` updated (header + milestone log). **Checks:** 17 seam tests (stdlib `testing`, hand-written fake); `go build ./...`, `go vet ./...`, `gofmt -l`, and `go test -race ./internal/clan/` all clean. Secret/Response redact in `String` and JSON; Events are checklist-only (no progress-bar plumbing, per the 2026-07-09 gate); wire types carry snake_case tags. **Out of scope (untouched):** the real PTY-driving clan adapter, the enroll agent↔control-plane boundary (#26's), theming compile, and real catalogue provisioning — each its own slice.
ben closed this issue 2026-07-25 11:34:19 +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#25
No description provided.