provisioning: provision-deploy-full-install — take a full-install device over to NixOS and deploy #69

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

Parent

Feature spec: #17 (provisioning).

What to build

The real takeover path of the P4 deploy step, driven by the provision
orchestrator seam. For a full-install device still takeover-ready, deploy drives
clan.Enrollment — the install --phases NixOS takeover that device-add only
staged — over the disk, joins the clan, and then deploys services, in that order
(ADR 0059). provision reads the takeover-ready state to choose Enrollment over
clan.Deploy and to read the install-mode consent already captured in the
NodeCert; it never re-asks consent. Deploy streams to P4-S4 on the same logged
checklist the VM-mode path built.

A deploy-itself failure (config, connectivity or disk) fails safely with a plain
error and logs, and the recovery matches the mode: VM mode retries clean (delete,
recreate); a full install rolls the NixOS generation back once the new OS is on;
and a failure of the takeover itself resumes or escalates to rescue. The
escalation to rescue is named here, not implemented — the rescue tracks are P8's.

Notes: this slice consumes device-add's takeover-ready contract (network facts,
consent in the NodeCert) via the device-add:full-install-takeover-ready edge.
Supply.Seed is a hard precondition of the deploy. Flow:
docs/ux/flows/p4-provisioning.mermaid.

Acceptance criteria

  • (story 11) Given a full-install takeover-ready device, when deploy runs, then it takes the device over to NixOS, joins the clan, then deploys services — in that order.
  • (story 13) Given a deploy-itself failure (config, connectivity or disk), when it fails, then the operator gets a plain error and logs, and the recovery matches the mode: VM mode retries clean (delete, recreate); full install rolls the NixOS generation back once the new OS is on; and a failure of the takeover itself resumes or escalates to rescue.

Blocked by

  • #51 — deploy runs after review
  • #61 — extends the shared deploy path
  • #59 — consumes takeover-ready contract

Task manifest

task: provisioning:provision-deploy-full-install
implements_flow: p4-provisioning
implements_edge: S3x→S4, S4→S2 (deploy-itself failure)
wireframe: docs/ux/wireframes/p4-provisioning/p4-s4-deploy-and-health-checks.html
interface: "`provision` orchestrator seam — deploy(node) reads `takeover-ready` to choose `clan.Enrollment` (install --phases → join clan → services, in order; ADR 0059) over `clan.Deploy`, reading install-mode consent from the NodeCert without re-asking; classifies deploy-itself failure into VM clean-retry / NixOS generation-rollback / resume-or-escalate-to-rescue"
seam: "`provision` orchestrator seam tests (control plane, Go) — fake `clan.Clan` exercising the `Enrollment` hot path plus generation rollback and the takeover-failure branch, fake `Supply` (seed precondition); asserts takeover→join→services ordering, no consent re-ask, and each failure-class remedy"
acceptance:
  - given: a full-install `takeover-ready` device
    when: deploy runs
    then: it takes the device over to NixOS, joins the clan, then deploys services, in that order, reading the already-captured consent without re-asking
  - given: a deploy-itself failure (config, connectivity or disk)
    when: it fails
    then: a plain error and logs are shown and recovery matches the mode — VM clean retry (delete, recreate), full-install NixOS generation rollback once the new OS is on, or resume/escalate-to-rescue for a takeover failure
depends_on: [provision-review-impact, provision-deploy-vm-mode, device-add:full-install-takeover-ready]
out_of_scope:
  - "the rescue tracks themselves — escalation is named here, P8's to implement"
  - "story 14–17 active / partial-success health gating — provision-active-and-partial's"
  - "the actual disk-overwrite takeover on real hardware — spike #12's, not an acceptance gate here"
needs_human_decision: []
## Parent Feature spec: #17 (provisioning). ## What to build The real takeover path of the P4 deploy step, driven by the `provision` orchestrator seam. For a full-install device still `takeover-ready`, deploy drives `clan.Enrollment` — the `install --phases` NixOS takeover that device-add only staged — over the disk, joins the clan, and *then* deploys services, in that order (ADR 0059). `provision` reads the `takeover-ready` state to choose Enrollment over `clan.Deploy` and to read the install-mode consent already captured in the NodeCert; it never re-asks consent. Deploy streams to P4-S4 on the same logged checklist the VM-mode path built. A deploy-itself failure (config, connectivity or disk) fails safely with a plain error and logs, and the recovery matches the mode: VM mode retries clean (delete, recreate); a full install rolls the NixOS generation back once the new OS is on; and a failure of the takeover *itself* resumes or escalates to rescue. The escalation to rescue is named here, not implemented — the rescue tracks are P8's. Notes: this slice consumes device-add's `takeover-ready` contract (network facts, consent in the NodeCert) via the `device-add:full-install-takeover-ready` edge. `Supply.Seed` is a hard precondition of the deploy. Flow: `docs/ux/flows/p4-provisioning.mermaid`. ## Acceptance criteria - [ ] (story 11) Given a full-install `takeover-ready` device, when deploy runs, then it takes the device over to NixOS, joins the clan, then deploys services — in that order. - [ ] (story 13) Given a deploy-itself failure (config, connectivity or disk), when it fails, then the operator gets a plain error and logs, and the recovery matches the mode: VM mode retries clean (delete, recreate); full install rolls the NixOS generation back once the new OS is on; and a failure of the takeover itself resumes or escalates to rescue. ## Blocked by - #51 — deploy runs after review - #61 — extends the shared deploy path - #59 — consumes takeover-ready contract ## Task manifest ```yaml task: provisioning:provision-deploy-full-install implements_flow: p4-provisioning implements_edge: S3x→S4, S4→S2 (deploy-itself failure) wireframe: docs/ux/wireframes/p4-provisioning/p4-s4-deploy-and-health-checks.html interface: "`provision` orchestrator seam — deploy(node) reads `takeover-ready` to choose `clan.Enrollment` (install --phases → join clan → services, in order; ADR 0059) over `clan.Deploy`, reading install-mode consent from the NodeCert without re-asking; classifies deploy-itself failure into VM clean-retry / NixOS generation-rollback / resume-or-escalate-to-rescue" seam: "`provision` orchestrator seam tests (control plane, Go) — fake `clan.Clan` exercising the `Enrollment` hot path plus generation rollback and the takeover-failure branch, fake `Supply` (seed precondition); asserts takeover→join→services ordering, no consent re-ask, and each failure-class remedy" acceptance: - given: a full-install `takeover-ready` device when: deploy runs then: it takes the device over to NixOS, joins the clan, then deploys services, in that order, reading the already-captured consent without re-asking - given: a deploy-itself failure (config, connectivity or disk) when: it fails then: a plain error and logs are shown and recovery matches the mode — VM clean retry (delete, recreate), full-install NixOS generation rollback once the new OS is on, or resume/escalate-to-rescue for a takeover failure depends_on: [provision-review-impact, provision-deploy-vm-mode, device-add:full-install-takeover-ready] out_of_scope: - "the rescue tracks themselves — escalation is named here, P8's to implement" - "story 14–17 active / partial-success health gating — provision-active-and-partial's" - "the actual disk-overwrite takeover on real hardware — spike #12's, not an acceptance gate here" needs_human_decision: [] ```
Author
Owner

Done in commit b1ccab2 on main.

What was built — the S3x → S4 edge at the ADR 0058 seam: provision.Deploy now owns both clan hot paths (ADR 0059). A full-install device still takeover-ready gets clan.Enrollment — the staged install --phases takeover over the disk, then the clan join, then services, in that order; the recording seam test proves enroll → advance → seed → clan.Deploy with services strictly last, applying the committed selection's exact revision (Supply.Seed still a hard precondition, strictly before the services apply). ErrTakeoverPath is gone — the typed refusal #61 left is now the real path.

Contract consumption (story 11) — device-add's #59 takeover-ready contract is read, never re-collected: the probe's network facts ride the EnrollRequest (new fleetstate.Install.Network), and the NodeCert's install-mode consent is attributed on the run ("Full install consented at the machine by Hine, Wed 22 Jul — read from the NodeCert, never re-asked here.") — ADR 0024, no consent verb exists on the path.

Failure recovery (story 13) — every deploy-itself failure lands a classified DeployFailure (step, clan-taxonomy kind, plain error, the step's own log — ADR 0027) with its mode-matched recovery: VM mode → clean retry (delete, recreate); full install once the new OS is on → NixOS generation rollback, actually driven at the seam (clan.Rollback scope generation, ADR 0017); a stopped takeover → resume (durable snapshot on the orchestrator; the next deploy runs clan.Resume and the fake proves only [install reboot] re-run — destructive disk work never re-runs); a dead takeover → escalate to rescue, named only (the rescue tracks are P8's, per out_of_scope).

UI (P4-S4 wireframe) — DeployScreen grows the five-row takeover checklist, the consent line (data-field="consent"), and the failure box (plain error + the failed step's Open/Download log + recovery, data-status = recovery mode) with the S4 → S2 back-to-select route and Resume for a stopped takeover, wired through SetupSurface.

Evidence — internal/provision/takeover.go + takeover_test.go (5 seam tests) and the VM clean-retry test in deploy_test.go; dashboard/tests/unit/provisionDeployFullInstall.test.ts (6 tests). Full Go suite + vet green; dashboard vitest (266 tests), vue-tsc, eslint green. STATUS.md updated in the same commit.

Done in commit b1ccab2 on main. **What was built** — the S3x → S4 edge at the ADR 0058 seam: `provision.Deploy` now owns both clan hot paths (ADR 0059). A full-install device still `takeover-ready` gets `clan.Enrollment` — the staged `install --phases` takeover over the disk, then the clan join, then services, in that order; the recording seam test proves enroll → advance → seed → `clan.Deploy` with services strictly last, applying the committed selection's exact revision (`Supply.Seed` still a hard precondition, strictly before the services apply). `ErrTakeoverPath` is gone — the typed refusal #61 left is now the real path. **Contract consumption (story 11)** — device-add's #59 takeover-ready contract is read, never re-collected: the probe's network facts ride the `EnrollRequest` (new `fleetstate.Install.Network`), and the NodeCert's install-mode consent is attributed on the run ("Full install consented at the machine by Hine, Wed 22 Jul — read from the NodeCert, never re-asked here.") — ADR 0024, no consent verb exists on the path. **Failure recovery (story 13)** — every deploy-itself failure lands a classified `DeployFailure` (step, clan-taxonomy kind, plain error, the step's own log — ADR 0027) with its mode-matched recovery: VM mode → clean retry (delete, recreate); full install once the new OS is on → NixOS generation rollback, actually driven at the seam (`clan.Rollback` scope `generation`, ADR 0017); a stopped takeover → resume (durable snapshot on the orchestrator; the next deploy runs `clan.Resume` and the fake proves only `[install reboot]` re-run — destructive disk work never re-runs); a dead takeover → escalate to rescue, **named only** (the rescue tracks are P8's, per out_of_scope). **UI (P4-S4 wireframe)** — `DeployScreen` grows the five-row takeover checklist, the consent line (`data-field="consent"`), and the failure box (plain error + the failed step's Open/Download log + recovery, `data-status` = recovery mode) with the S4 → S2 back-to-select route and Resume for a stopped takeover, wired through `SetupSurface`. **Evidence** — `internal/provision/takeover.go` + `takeover_test.go` (5 seam tests) and the VM clean-retry test in `deploy_test.go`; `dashboard/tests/unit/provisionDeployFullInstall.test.ts` (6 tests). Full Go suite + vet green; dashboard vitest (266 tests), vue-tsc, eslint green. STATUS.md updated in the same commit.
ben closed this issue 2026-07-25 17:57:06 +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#69
No description provided.