rehearsal-5 task 3/13: Fleet admission — mesh fact, AddNode on land, live TakeoverReady/Consent #844

Closed
opened 2026-08-25 20:14:30 +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 3, carried verbatim below. The plan's Global Constraints apply to every step.

Files:

  • Modify: internal/enroll/enroll.go (ConfirmEnrolled gains the mesh address; ledger stores it), internal/enroll/ledger.go, ledger_test.go
  • Modify: internal/enrollwire/ (device transport carries mesh_address on the confirm verb), its tests
  • Create: internal/enroll/admission.go + admission_test.go (the land-side fleet admission)
  • Modify: internal/fleetstate/projection.go + projection_test.go (Install facts + mesh address projected)
  • Modify: internal/fleetstate/fleetstate.go (Device.MeshAddress string; Install.TakeoverReady/Consent fed from the ledger)
  • Modify: control-plane/cmd/control-plane/whole_composition.go (wire the admission; configRepoInventory reads the mesh address + derives Datasets from placement — files → Dataset{Name: "Files & documents", Service: "files", Homes: [<node>]})
  • Modify: dashboard/src/lib/pending.ts (setUpRoute uses the grant's node id node-<requestID>, not the raw request id), dashboard/tests/unit/ sibling test
  • Modify: STATUS.md

Interfaces:

  • Consumes: Task 2's ConfirmEnrolled(…, MeshAddress); clan.Config().AddNode (founding's existing call is the signature source — internal/founding/deploy.go), enroll.Ledger consent record (written at the terminal WIPE consent).

  • Produces: fleetstate.Device{ID: "node-<requestID>", MeshAddress, Resources: <probe>, Install: &Install{Mode: ModeFull, TakeoverReady: true, Consent: &Consent{By, At}}} visible in GET /api/v1/fleet the moment the agent lands; GET /provision/devices/node-<requestID>/assessment stops 404ing; provision.ReviewImpact renders ERASES live (it already reads Install.Consent — impact.go:164-166); LOSES speaks from the derived dataset. The fleet row's action reads set-up-node-<requestID> (role empty ⇒ un-provisioned).

  • Step 1: Write failing ledger/admission tests — TestConfirmEnrolled_StoresMeshAddress, TestAdmission_LandedDevicePlacedWithProbeResourcesAndInstallFacts, TestAdmission_IdempotentOnRepeatConfirm.

  • Step 2: Run go test ./internal/enroll -run 'Confirm|Admission' -v → FAIL; implement; → PASS.

  • Step 3: Write failing projection tests — TestProjection_EnrolledDeviceCarriesTakeoverReadyAndConsent, TestProjection_MeshAddressProjected, TestPlacement_FilesHomeDerivesDataset.

  • Step 4: Run → FAIL; implement projection + whole_composition.go derivation; → PASS.

  • Step 5: Fix setUpRoute (failing dashboard unit test first: the intent id equals the fleet DeviceID); pnpm --filter dashboard test → PASS.

  • Step 6: Run go build ./... && go vet ./... && go test ./... && pnpm -r typecheck → PASS.

  • Step 7: Commit — git commit -m "rehearsal-5: a landed device enters the fleet — mesh fact, AddNode admission, live ERASES/LOSES facts (ADR 0208) (task 3 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 3**, carried verbatim below. The plan's Global Constraints apply to every step. --- ### Task 3: Fleet admission — mesh fact, AddNode on land, live TakeoverReady/Consent **Files:** - Modify: `internal/enroll/enroll.go` (`ConfirmEnrolled` gains the mesh address; ledger stores it), `internal/enroll/ledger.go`, `ledger_test.go` - Modify: `internal/enrollwire/` (device transport carries `mesh_address` on the confirm verb), its tests - Create: `internal/enroll/admission.go` + `admission_test.go` (the land-side fleet admission) - Modify: `internal/fleetstate/projection.go` + `projection_test.go` (Install facts + mesh address projected) - Modify: `internal/fleetstate/fleetstate.go` (`Device.MeshAddress string`; `Install.TakeoverReady`/`Consent` fed from the ledger) - Modify: `control-plane/cmd/control-plane/whole_composition.go` (wire the admission; `configRepoInventory` reads the mesh address + derives `Datasets` from placement — files → `Dataset{Name: "Files & documents", Service: "files", Homes: [<node>]}`) - Modify: `dashboard/src/lib/pending.ts` (`setUpRoute` uses the grant's node id `node-<requestID>`, not the raw request id), `dashboard/tests/unit/` sibling test - Modify: `STATUS.md` **Interfaces:** - Consumes: Task 2's `ConfirmEnrolled(…, MeshAddress)`; `clan.Config().AddNode` (founding's existing call is the signature source — `internal/founding/deploy.go`), `enroll.Ledger` consent record (written at the terminal WIPE consent). - Produces: `fleetstate.Device{ID: "node-<requestID>", MeshAddress, Resources: <probe>, Install: &Install{Mode: ModeFull, TakeoverReady: true, Consent: &Consent{By, At}}}` visible in `GET /api/v1/fleet` the moment the agent lands; `GET /provision/devices/node-<requestID>/assessment` stops 404ing; `provision.ReviewImpact` renders ERASES live (it already reads `Install.Consent` — `impact.go:164-166`); LOSES speaks from the derived dataset. The fleet row's action reads `set-up-node-<requestID>` (role empty ⇒ un-provisioned). - [ ] **Step 1: Write failing ledger/admission tests** — `TestConfirmEnrolled_StoresMeshAddress`, `TestAdmission_LandedDevicePlacedWithProbeResourcesAndInstallFacts`, `TestAdmission_IdempotentOnRepeatConfirm`. - [ ] **Step 2: Run** `go test ./internal/enroll -run 'Confirm|Admission' -v` → FAIL; **implement**; → PASS. - [ ] **Step 3: Write failing projection tests** — `TestProjection_EnrolledDeviceCarriesTakeoverReadyAndConsent`, `TestProjection_MeshAddressProjected`, `TestPlacement_FilesHomeDerivesDataset`. - [ ] **Step 4: Run** → FAIL; **implement** projection + `whole_composition.go` derivation; → PASS. - [ ] **Step 5: Fix `setUpRoute`** (failing dashboard unit test first: the intent id equals the fleet DeviceID); `pnpm --filter dashboard test` → PASS. - [ ] **Step 6: Run** `go build ./... && go vet ./... && go test ./... && pnpm -r typecheck` → PASS. - [ ] **Step 7: Commit** — `git commit -m "rehearsal-5: a landed device enters the fleet — mesh fact, AddNode admission, live ERASES/LOSES facts (ADR 0208) (task 3 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 #844 — status success

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

envelope
{
  "issue": 844,
  "status": "success",
  "commits": [
    "df74b03c38b1adc3eb1675bf840b586cf47e621b"
  ],
  "changed_files": [
    "app/helper/cmd/helper/enrollpersist.go",
    "app/helper/cmd/helper/enrollpersist_test.go",
    "control-plane/cmd/control-plane/aggregation_integration_test.go",
    "control-plane/cmd/control-plane/resting_composition.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "control-plane/cmd/smoke-stores/main.go",
    "dashboard/src/lib/pending.ts",
    "dashboard/tests/unit/pendingDevices.test.ts",
    "internal/enroll/admission.go",
    "internal/enroll/admission_test.go",
    "internal/enroll/enroll.go",
    "internal/enroll/enroll_test.go",
    "internal/enroll/ledger.go",
    "internal/enrollwire/client.go",
    "internal/enrollwire/fleet_reporting_integration_test.go",
    "internal/enrollwire/server.go",
    "internal/enrollwire/taxonomy_test.go",
    "internal/fleetstate/fleetstate.go",
    "internal/fleetstate/projection.go",
    "internal/fleetstate/projection_test.go",
    "internal/founding/seed.go",
    "internal/founding/standup.go",
    "internal/join/join_test.go",
    "internal/join/land.go",
    "internal/join/testing/fakes.go",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "go test ./internal/enroll -run 'Confirm|Admission'",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/fleetstate ./internal/enroll",
      "exit_code": 0
    },
    {
      "command": "go build ./... && go vet ./...",
      "exit_code": 0
    },
    {
      "command": "go test ./... (pre-push pinned go-ci gate)",
      "exit_code": 0
    },
    {
      "command": "CI=true pnpm --filter dashboard test",
      "exit_code": 0
    },
    {
      "command": "cd dashboard && npx vue-tsc --noEmit -p tsconfig.json",
      "exit_code": 0
    }
  ],
  "criteria": {
    "ConfirmEnrolled carries the device wt0 mesh address, stored on the ledger (ADR 0209 §3)": "internal/enroll/enroll.go (ControlPlane.ConfirmEnrolled gains meshAddr; RequestView.MeshAddress), internal/enroll/ledger.go; TestConfirmEnrolled_StoresMeshAddress",
    "enrollwire device transport carries mesh_address on the confirm verb": "internal/enrollwire/client.go + server.go (confirmBody{mesh_address}); enrollwire tests green",
    "Land-side fleet admission places node-<requestID> un-provisioned on landing (AddNode, empty role), idempotent": "internal/enroll/admission.go (Admitter/FleetPlacer) + ledger OnEnrolled hook; whole_composition.go clanFleetPlacer over real clan.Config; TestAdmission_LandedDevicePlacedWithProbeResourcesAndInstallFacts, TestAdmission_IdempotentOnRepeatConfirm",
    "Projection feeds Install.TakeoverReady/Consent from the ledger and projects Device.MeshAddress": "internal/fleetstate/fleetstate.go (Device.MeshAddress), internal/fleetstate/projection.go (TakeoverReady true only while un-provisioned; Consent from ledger); TestProjection_EnrolledDeviceCarriesTakeoverReadyAndConsent, TestProjection_TakeoverClearsOnceProvisioned, TestProjection_MeshAddressProjected",
    "configRepoInventory derives Datasets from placement (files -> Files & documents dataset)": "internal/fleetstate/projection.go DatasetsFromPlacement; control-plane/cmd/control-plane/whole_composition.go configRepoInventory wires it; TestPlacement_FilesHomeDerivesDataset",
    "Device visible in GET /api/v1/fleet the moment it lands; P4 assess stops 404ing; ERASES renders live": "admission places node at landing so the projection surfaces it with probe resources + Install.Consent (impact.go:164-166 reads Install.Consent); projection + admission tests",
    "dashboard setUpRoute uses the fleet node id set-up-node-<requestID>": "dashboard/src/lib/pending.ts setUpRoute; dashboard/tests/unit/pendingDevices.test.ts expects set-up-node-req-0001",
    "Full gate green: go build/vet/test ./... , dashboard vitest, vue-tsc": "pre-push go-ci gate passed on push; CI=true pnpm --filter dashboard test 1214 passed; vue-tsc noEmit exit 0"
  },
  "summary": "A landed device now enters the fleet: ConfirmEnrolled carries the wt0 mesh fact, the ledger admits node-<requestID> via AddNode on landing, and the projection surfaces live TakeoverReady/Consent/MeshAddress + derived datasets (ADR 0209).",
  "reason": "",
  "blockers": []
}
**close-report** for #844 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 844, "status": "success", "commits": [ "df74b03c38b1adc3eb1675bf840b586cf47e621b" ], "changed_files": [ "app/helper/cmd/helper/enrollpersist.go", "app/helper/cmd/helper/enrollpersist_test.go", "control-plane/cmd/control-plane/aggregation_integration_test.go", "control-plane/cmd/control-plane/resting_composition.go", "control-plane/cmd/control-plane/whole_composition.go", "control-plane/cmd/smoke-stores/main.go", "dashboard/src/lib/pending.ts", "dashboard/tests/unit/pendingDevices.test.ts", "internal/enroll/admission.go", "internal/enroll/admission_test.go", "internal/enroll/enroll.go", "internal/enroll/enroll_test.go", "internal/enroll/ledger.go", "internal/enrollwire/client.go", "internal/enrollwire/fleet_reporting_integration_test.go", "internal/enrollwire/server.go", "internal/enrollwire/taxonomy_test.go", "internal/fleetstate/fleetstate.go", "internal/fleetstate/projection.go", "internal/fleetstate/projection_test.go", "internal/founding/seed.go", "internal/founding/standup.go", "internal/join/join_test.go", "internal/join/land.go", "internal/join/testing/fakes.go", "STATUS.md" ], "tests": [ { "command": "go test ./internal/enroll -run 'Confirm|Admission'", "exit_code": 0 }, { "command": "go test ./internal/fleetstate ./internal/enroll", "exit_code": 0 }, { "command": "go build ./... && go vet ./...", "exit_code": 0 }, { "command": "go test ./... (pre-push pinned go-ci gate)", "exit_code": 0 }, { "command": "CI=true pnpm --filter dashboard test", "exit_code": 0 }, { "command": "cd dashboard && npx vue-tsc --noEmit -p tsconfig.json", "exit_code": 0 } ], "criteria": { "ConfirmEnrolled carries the device wt0 mesh address, stored on the ledger (ADR 0209 §3)": "internal/enroll/enroll.go (ControlPlane.ConfirmEnrolled gains meshAddr; RequestView.MeshAddress), internal/enroll/ledger.go; TestConfirmEnrolled_StoresMeshAddress", "enrollwire device transport carries mesh_address on the confirm verb": "internal/enrollwire/client.go + server.go (confirmBody{mesh_address}); enrollwire tests green", "Land-side fleet admission places node-<requestID> un-provisioned on landing (AddNode, empty role), idempotent": "internal/enroll/admission.go (Admitter/FleetPlacer) + ledger OnEnrolled hook; whole_composition.go clanFleetPlacer over real clan.Config; TestAdmission_LandedDevicePlacedWithProbeResourcesAndInstallFacts, TestAdmission_IdempotentOnRepeatConfirm", "Projection feeds Install.TakeoverReady/Consent from the ledger and projects Device.MeshAddress": "internal/fleetstate/fleetstate.go (Device.MeshAddress), internal/fleetstate/projection.go (TakeoverReady true only while un-provisioned; Consent from ledger); TestProjection_EnrolledDeviceCarriesTakeoverReadyAndConsent, TestProjection_TakeoverClearsOnceProvisioned, TestProjection_MeshAddressProjected", "configRepoInventory derives Datasets from placement (files -> Files & documents dataset)": "internal/fleetstate/projection.go DatasetsFromPlacement; control-plane/cmd/control-plane/whole_composition.go configRepoInventory wires it; TestPlacement_FilesHomeDerivesDataset", "Device visible in GET /api/v1/fleet the moment it lands; P4 assess stops 404ing; ERASES renders live": "admission places node at landing so the projection surfaces it with probe resources + Install.Consent (impact.go:164-166 reads Install.Consent); projection + admission tests", "dashboard setUpRoute uses the fleet node id set-up-node-<requestID>": "dashboard/src/lib/pending.ts setUpRoute; dashboard/tests/unit/pendingDevices.test.ts expects set-up-node-req-0001", "Full gate green: go build/vet/test ./... , dashboard vitest, vue-tsc": "pre-push go-ci gate passed on push; CI=true pnpm --filter dashboard test 1214 passed; vue-tsc noEmit exit 0" }, "summary": "A landed device now enters the fleet: ConfirmEnrolled carries the wt0 mesh fact, the ledger admits node-<requestID> via AddNode on landing, and the projection surfaces live TakeoverReady/Consent/MeshAddress + derived datasets (ADR 0209).", "reason": "", "blockers": [] } ``` </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#844
No description provided.