rehearsal-5 task 6/13: Placement deploy — device closure + gateway route, two nodes #847

Closed
opened 2026-08-25 20:14:36 +00:00 by ben · 3 comments
Owner

Part of the #183 phase-5 rehearsal arc (device-add + Nextcloud-on-device on a standing rented community).

  • Spec: docs/superpowers/specs/2026-08-25-183-phase-5-device-nextcloud-rehearsal-design.md
  • Plan: docs/superpowers/plans/2026-08-25-183-phase-5-device-nextcloud-rehearsal.md — this ticket is Task 6, carried verbatim below. The plan's Global Constraints apply to every step.

Task 6: Placement deploy — device closure + gateway route, two nodes

Files:

  • Modify: internal/provision/deploy.go (attachFilesCohost → attachFilesPlacement handling both shapes; two-node apply), deploy_test.go
  • Modify: internal/provision/takeover.go (the takeover enroll passes Target: "root@<MeshAddress>" from the fleet device)
  • Modify: STATUS.md

Interfaces:

  • Consumes: Task 3's Device.MeshAddress; Task 5's ComposeMemberModules, RenderFilesIdPClient, device-shape FilesLiveSet; AttachFrontDoor (frontdoor_attach.go:113) with LiveService{Slug: clan.FilesSlug, MeshTarget: "<mesh-ip>:80", ExemptPaths: clan.FilesExemptPaths}; the public-branch LiveSet re-supply (deploy.go:602-608).

  • Produces: a files-on-device deploy commits ONE revision containing machines/<device>/{files.nix,configuration.nix} + machines/<gateway>/{front-door.nix,files-idp.nix}, then applies device first, gateway second (two applyRevision calls, each Nodes: []clan.NodeID{n}); a device deploy with TakeoverReady runs deployTakeover whose enroll carries the mesh Target. Removal mirror: deselecting files detaches the module, rewrites the front door without the route, deploys gateway.

  • Step 1: Write the failing deploy tests — extend deploy_test.go's totara fixture (:171-180) with MeshAddress: TestDeploy_FilesOnDeviceCommitsBothMachinesDeviceFirst (fake clan records the two apply calls in order + the front-door LiveSet's mesh target), TestDeploy_DeviceRouteReSuppliesPublicKanidmBlock, TestDeployTakeover_EnrollTargetIsTheMeshAddress, TestRemoval_DetachDropsRouteAndRedeploysGateway.

  • Step 2: Run go test ./internal/provision -run 'FilesOnDevice|MeshAddress|Removal' -v → FAIL.

  • Step 3: Implement; keep the gateway co-host tests (deploy_test.go:543-703) green byte-identical.

  • Step 4: Run the package → PASS; go test ./... → PASS.

  • Step 5: Commit — git commit -m "rehearsal-5: placement deploy — device closure + gateway mesh route, device-first two-node apply (ADR 0209) (task 6 of #<ticket>)".


Global Constraints (from the plan)

  • Nothing fabricated (ADR 0100): every landed fact is read from the box; a
    failure is a named error, never a masked success. No sandbox-green claim (#377).
  • The wipe consent is given at the machine (ADR 0024) and shown-not-re-asked
    at P4-S3x; the takeover runs at provisioning's first deploy, never at join.
  • One placement deploy = device closure + gateway route in one config-repo
    commit, then two single-node clan.Deploy calls, device first (ruling: a
    route to a dead service is the honest failure, a service with no route is
    invisible).
  • Standing community: home test-results/standing-rented/; staleness gate =
    oc_bootstrap_staleness pattern over agent/ go.mod go.sum internal/; the
    reaper stays honest — renewal, not exemption (idss-rental-hold is for
    humans, the executor never sets it).
  • Do not destabilize live drives: #720 (rented confirm loop, elitebook) and
    #721/#722 (workstation) keep running; the prefix extraction (Task 10) is
    behavior-preserving and #720 must stay green across it. Never touch the
    executors' env files from a ticket.
  • Tracker gotcha: labels via POST/DELETE /issues/<n>/labels, never in an
    issue PATCH. "closes #NNN" in commit messages auto-closes — say "task N of
    #NNN" instead.
  • ADR numbers: 0207/0208/0209 assumed — re-check git ls-tree origin/main docs/adr/
    at mint (IDIP + observability swarm lanes are minting concurrently).
  • STATUS.md updated in the same commit as any project-state change;
    git pull --rebase immediately before a STATUS commit (shared checkout).
  • Go: gofmt, go vet ./..., go test ./... green; TS: pnpm -r typecheck +
    unit suites green, pre-land.
Part of the **#183 phase-5 rehearsal arc** (device-add + Nextcloud-on-device on a standing rented community). - Spec: `docs/superpowers/specs/2026-08-25-183-phase-5-device-nextcloud-rehearsal-design.md` - Plan: `docs/superpowers/plans/2026-08-25-183-phase-5-device-nextcloud-rehearsal.md` — this ticket is **Task 6**, carried verbatim below. The plan's Global Constraints apply to every step. --- ### Task 6: Placement deploy — device closure + gateway route, two nodes **Files:** - Modify: `internal/provision/deploy.go` (`attachFilesCohost` → `attachFilesPlacement` handling both shapes; two-node apply), `deploy_test.go` - Modify: `internal/provision/takeover.go` (the takeover enroll passes `Target: "root@<MeshAddress>"` from the fleet device) - Modify: `STATUS.md` **Interfaces:** - Consumes: Task 3's `Device.MeshAddress`; Task 5's `ComposeMemberModules`, `RenderFilesIdPClient`, device-shape `FilesLiveSet`; `AttachFrontDoor` (`frontdoor_attach.go:113`) with `LiveService{Slug: clan.FilesSlug, MeshTarget: "<mesh-ip>:80", ExemptPaths: clan.FilesExemptPaths}`; the public-branch LiveSet re-supply (`deploy.go:602-608`). - Produces: a files-on-device deploy commits ONE revision containing `machines/<device>/{files.nix,configuration.nix}` + `machines/<gateway>/{front-door.nix,files-idp.nix}`, then applies device first, gateway second (two `applyRevision` calls, each `Nodes: []clan.NodeID{n}`); a device deploy with `TakeoverReady` runs `deployTakeover` whose enroll carries the mesh Target. Removal mirror: deselecting files detaches the module, rewrites the front door without the route, deploys gateway. - [ ] **Step 1: Write the failing deploy tests** — extend `deploy_test.go`'s totara fixture (`:171-180`) with `MeshAddress`: `TestDeploy_FilesOnDeviceCommitsBothMachinesDeviceFirst` (fake clan records the two apply calls in order + the front-door LiveSet's mesh target), `TestDeploy_DeviceRouteReSuppliesPublicKanidmBlock`, `TestDeployTakeover_EnrollTargetIsTheMeshAddress`, `TestRemoval_DetachDropsRouteAndRedeploysGateway`. - [ ] **Step 2: Run** `go test ./internal/provision -run 'FilesOnDevice|MeshAddress|Removal' -v` → FAIL. - [ ] **Step 3: Implement**; keep the gateway co-host tests (`deploy_test.go:543-703`) green byte-identical. - [ ] **Step 4: Run** the package → PASS; `go test ./...` → PASS. - [ ] **Step 5: Commit** — `git commit -m "rehearsal-5: placement deploy — device closure + gateway mesh route, device-first two-node apply (ADR 0209) (task 6 of #<ticket>)"`. --- ## Global Constraints (from the plan) - **Nothing fabricated (ADR 0100):** every landed fact is read from the box; a failure is a named error, never a masked success. No sandbox-green claim (#377). - **The wipe consent is given at the machine (ADR 0024)** and shown-not-re-asked at P4-S3x; the takeover runs at provisioning's first deploy, never at join. - **One placement deploy = device closure + gateway route** in one config-repo commit, then two single-node `clan.Deploy` calls, device first (ruling: a route to a dead service is the honest failure, a service with no route is invisible). - **Standing community:** home `test-results/standing-rented/`; staleness gate = `oc_bootstrap_staleness` pattern over `agent/ go.mod go.sum internal/`; the reaper stays honest — renewal, not exemption (`idss-rental-hold` is for humans, the executor never sets it). - **Do not destabilize live drives:** #720 (rented confirm loop, elitebook) and #721/#722 (workstation) keep running; the prefix extraction (Task 10) is behavior-preserving and #720 must stay green across it. Never touch the executors' env files from a ticket. - **Tracker gotcha:** labels via `POST/DELETE /issues/<n>/labels`, never in an issue PATCH. "closes #NNN" in commit messages auto-closes — say "task N of #NNN" instead. - **ADR numbers:** 0207/0208/0209 assumed — re-check `git ls-tree origin/main docs/adr/` at mint (IDIP + observability swarm lanes are minting concurrently). - **STATUS.md** updated in the same commit as any project-state change; `git pull --rebase` immediately before a STATUS commit (shared checkout). - Go: `gofmt`, `go vet ./...`, `go test ./...` green; TS: `pnpm -r typecheck` + unit suites green, pre-land.

ADR numbers ruled at mint — read 0207 → 0208, 0208 → 0209, 0209 → 0210

Task 1 (#842) has landed the phase-5 design tier. This ticket's body carries the
plan's assumed ADR numbers; they shifted by one at mint, exactly as the
Global Constraints line in your body told you to re-check.

assumed ruled ADR
0207 0208 the standing rehearsal community — staleness-gated re-found
0208 0209 device-add's landing goes live — mesh fact, fleet admission, /get
0209 0210 files on a member device — composition, OIDC split, mesh route

Why: docs/adr/0207-design-keri-stack-version-pins.md (#771, the concurrent
IDIP lane) had taken 0207 on origin/main before this arc minted.

Use the ruled numbers in your commit messages and code comments. The plan
(docs/superpowers/plans/2026-08-25-183-phase-5-device-nextcloud-rehearsal.md)
is updated and records the mapping; commit 70a3bce6.

Ruled by agent under ADR 0174 — veto anytime.

## ADR numbers ruled at mint — read 0207 → 0208, 0208 → 0209, 0209 → 0210 Task 1 (#842) has landed the phase-5 design tier. This ticket's body carries the plan's **assumed** ADR numbers; they shifted by one at mint, exactly as the Global Constraints line in your body told you to re-check. | assumed | **ruled** | ADR | |---|---|---| | 0207 | **0208** | the standing rehearsal community — staleness-gated re-found | | 0208 | **0209** | device-add's landing goes live — mesh fact, fleet admission, `/get` | | 0209 | **0210** | files on a member device — composition, OIDC split, mesh route | Why: `docs/adr/0207-design-keri-stack-version-pins.md` (#771, the concurrent IDIP lane) had taken 0207 on `origin/main` before this arc minted. Use the **ruled** numbers in your commit messages and code comments. The plan (`docs/superpowers/plans/2026-08-25-183-phase-5-device-nextcloud-rehearsal.md`) is updated and records the mapping; commit `70a3bce6`. Ruled by agent under ADR 0174 — veto anytime.

swarm-claim host=elitebook-distributed-server-03 run=10103
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=10103 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #847 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 847,
  "status": "success",
  "commits": [
    "a7f9f7275acc14e4541dedc662a1cfc0309bcf46"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/resting_composition.go",
    "internal/clan/clan.go",
    "internal/clan/files_attach.go",
    "internal/clan/files_idp_gateway.go",
    "internal/clan/gateway_attach.go",
    "internal/clan/testing/fake.go",
    "internal/provision/deploy.go",
    "internal/provision/deploy_test.go",
    "internal/provision/takeover.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/provision -run 'FilesOnDevice|MeshAddress|Removal|DeviceRoute' -v",
      "exit_code": 0
    },
    {
      "command": "go test ./... (via nix develop .#go-ci push gate)",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/... ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "gofmt -l internal/ control-plane/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Step 1: failing deploy tests written (FilesOnDevice/DeviceRoute/EnrollTarget/Removal)": "internal/provision/deploy_test.go: TestDeploy_FilesOnDeviceCommitsBothMachinesDeviceFirst, TestDeploy_DeviceRouteReSuppliesPublicKanidmBlock, TestDeployTakeover_EnrollTargetIsTheMeshAddress, TestRemoval_DetachDropsRouteAndRedeploysGateway",
    "Step 3: implemented; gateway co-host tests green byte-identical": "attachFilesCohost->attachFilesPlacement in deploy.go keeps the coHosted branch unchanged; deploy_test.go:543-703 co-host tests unchanged and pass",
    "Step 4: package + go test ./... PASS": "push gate ran nix develop .#go-ci (build/vet/lint/test ./...) to completion; exit 0",
    "One commit = device closure + gateway route, then device-first two-node apply": "placementApplyNodes returns [device, gateway]; TestDeploy_FilesOnDeviceCommitsBothMachinesDeviceFirst asserts deployReqs[0]=totara, deployReqs[1]=karaka on the one committed revision",
    "front-door LiveSet mesh target": "attachMemberFilesPlacement sets MeshTarget=<MeshAddress>:80; test asserts fd.Services[0].MeshTarget == 100.83.1.22:80",
    "takeover enroll Target = root@<MeshAddress>": "takeover.go sets req.Target=root@<d.MeshAddress>; TestDeployTakeover_EnrollTargetIsTheMeshAddress asserts root@100.83.1.22",
    "removal mirror: detach module, rewrite front door w/o route, deploy gateway": "detachMemberFilesPlacement in deploy.go; TestRemoval_DetachDropsRouteAndRedeploysGateway asserts empty front-door services + [totara, karaka] apply",
    "device-route re-supplies public kanidm block (whole-rewrite honesty)": "memberFrontDoorLiveSet reproduces GateURL + KanidmLoopback; TestDeploy_DeviceRouteReSuppliesPublicKanidmBlock"
  },
  "summary": "Wired task 5's renders into the member-device files placement deploy: one commit (device closure + gateway files-idp + mesh route), device-first two-node apply, takeover-over-mesh target, and the removal mirror.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #847 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 847, "status": "success", "commits": [ "a7f9f7275acc14e4541dedc662a1cfc0309bcf46" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/resting_composition.go", "internal/clan/clan.go", "internal/clan/files_attach.go", "internal/clan/files_idp_gateway.go", "internal/clan/gateway_attach.go", "internal/clan/testing/fake.go", "internal/provision/deploy.go", "internal/provision/deploy_test.go", "internal/provision/takeover.go" ], "tests": [ { "command": "go test ./internal/provision -run 'FilesOnDevice|MeshAddress|Removal|DeviceRoute' -v", "exit_code": 0 }, { "command": "go test ./... (via nix develop .#go-ci push gate)", "exit_code": 0 }, { "command": "go vet ./internal/... ./control-plane/...", "exit_code": 0 }, { "command": "gofmt -l internal/ control-plane/", "exit_code": 0 } ], "criteria": { "Step 1: failing deploy tests written (FilesOnDevice/DeviceRoute/EnrollTarget/Removal)": "internal/provision/deploy_test.go: TestDeploy_FilesOnDeviceCommitsBothMachinesDeviceFirst, TestDeploy_DeviceRouteReSuppliesPublicKanidmBlock, TestDeployTakeover_EnrollTargetIsTheMeshAddress, TestRemoval_DetachDropsRouteAndRedeploysGateway", "Step 3: implemented; gateway co-host tests green byte-identical": "attachFilesCohost->attachFilesPlacement in deploy.go keeps the coHosted branch unchanged; deploy_test.go:543-703 co-host tests unchanged and pass", "Step 4: package + go test ./... PASS": "push gate ran nix develop .#go-ci (build/vet/lint/test ./...) to completion; exit 0", "One commit = device closure + gateway route, then device-first two-node apply": "placementApplyNodes returns [device, gateway]; TestDeploy_FilesOnDeviceCommitsBothMachinesDeviceFirst asserts deployReqs[0]=totara, deployReqs[1]=karaka on the one committed revision", "front-door LiveSet mesh target": "attachMemberFilesPlacement sets MeshTarget=<MeshAddress>:80; test asserts fd.Services[0].MeshTarget == 100.83.1.22:80", "takeover enroll Target = root@<MeshAddress>": "takeover.go sets req.Target=root@<d.MeshAddress>; TestDeployTakeover_EnrollTargetIsTheMeshAddress asserts root@100.83.1.22", "removal mirror: detach module, rewrite front door w/o route, deploy gateway": "detachMemberFilesPlacement in deploy.go; TestRemoval_DetachDropsRouteAndRedeploysGateway asserts empty front-door services + [totara, karaka] apply", "device-route re-supplies public kanidm block (whole-rewrite honesty)": "memberFrontDoorLiveSet reproduces GateURL + KanidmLoopback; TestDeploy_DeviceRouteReSuppliesPublicKanidmBlock" }, "summary": "Wired task 5's renders into the member-device files placement deploy: one commit (device closure + gateway files-idp + mesh route), device-first two-node apply, takeover-over-mesh target, and the removal mirror.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#847
No description provided.