rehearsal-7 Task 2: The payload grows the device VM slot; /get serves it; agent install stages it #1158

Closed
opened 2026-09-02 19:04:41 +00:00 by ben · 2 comments
Owner

Task 2 of 9 — phase-7 VM-mode device rehearsal. Plan (READ ITS Global Constraints + Plan-time inventory first): docs/superpowers/plans/2026-09-02-183-phase-7-vm-device-rehearsal.md. Spec: docs/superpowers/specs/2026-08-29-183-phase-7-vm-device-rehearsal-design.md (RULED). Drive issue: #1153. Say "task 2 of #1153" in commits — NEVER "closes".

Task 2: The payload grows the device VM slot; /get serves it; agent install stages it

Files: Modify scripts/assemble-payload.sh (new vm-guest slot: per-arch
QEMU dist + nixos-guest.qcow2), internal/fleetwire/supply.go
(PayloadVMGuest staging, optional-by-design like the installer-base slot but
FAIL-LOUD at consume time), internal/controlapi/install_doorway.go (/get
gains the VM artefact route), agent install path (stage the VM payload beside
the binary when the host is Linux), internal/vm/resolve.go (resolve from the
staged slot). Tests: supply staging, doorway route, resolve.

Interfaces: Produces PayloadVMGuest; consumes nothing. Task 8's
agent-install leg asserts its contract (QEMU + image present post-install).

  • Step 1: Slot in assemble-payload.sh + supply.go; a payload without the slot seeds the rest and RECORDS the absence (installer-base pattern) — but a VM-mode Create against an absent slot fails naming the slot (ADR 0100), never falls back to a bare binary.
  • Step 2: /get route + install staging; size/duration of the slot logged at seed time (arc-start fixed-cost rule).
  • Step 3: Offline tests; smoke-guest-image.sh consumes the staged slot where /dev/kvm exists.
> Task 2 of 9 — phase-7 VM-mode device rehearsal. Plan (READ ITS **Global Constraints** + **Plan-time inventory** first): `docs/superpowers/plans/2026-09-02-183-phase-7-vm-device-rehearsal.md`. Spec: `docs/superpowers/specs/2026-08-29-183-phase-7-vm-device-rehearsal-design.md` (RULED). Drive issue: #1153. Say "task 2 of #1153" in commits — NEVER "closes". ### Task 2: The payload grows the device VM slot; `/get` serves it; agent install stages it **Files:** Modify `scripts/assemble-payload.sh` (new `vm-guest` slot: per-arch QEMU dist + `nixos-guest.qcow2`), `internal/fleetwire/supply.go` (`PayloadVMGuest` staging, optional-by-design like the installer-base slot but FAIL-LOUD at consume time), `internal/controlapi/install_doorway.go` (`/get` gains the VM artefact route), agent install path (stage the VM payload beside the binary when the host is Linux), `internal/vm/resolve.go` (resolve from the staged slot). Tests: supply staging, doorway route, resolve. **Interfaces:** Produces `PayloadVMGuest`; consumes nothing. Task 8's `agent-install` leg asserts its contract (QEMU + image present post-install). - [ ] Step 1: Slot in assemble-payload.sh + supply.go; a payload without the slot seeds the rest and RECORDS the absence (installer-base pattern) — but a VM-mode `Create` against an absent slot fails naming the slot (ADR 0100), never falls back to a bare binary. - [ ] Step 2: `/get` route + install staging; size/duration of the slot logged at seed time (arc-start fixed-cost rule). - [ ] Step 3: Offline tests; `smoke-guest-image.sh` consumes the staged slot where `/dev/kvm` exists.

swarm-claim host=matou-dev-server-01 run=16640
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=16640 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1158 — status success

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

envelope
{
  "issue": 1158,
  "status": "success",
  "commits": [
    "b5cd1c41e26be1b2b07373fdb5a9a86734e0b386"
  ],
  "changed_files": [
    "STATUS.md",
    "agent/cmd/agent/wiring_prod.go",
    "control-plane/cmd/control-plane/compose.go",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/resting_composition.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "internal/controlapi/install_doorway.go",
    "internal/controlapi/install_doorway_test.go",
    "internal/fleetwire/supply.go",
    "internal/fleetwire/supply_test.go",
    "internal/install/guestcache.go",
    "internal/install/guestpayload.go",
    "internal/install/guestpayload_test.go",
    "internal/join/cli.go",
    "internal/join/install_guest_test.go",
    "internal/vm/resolve.go",
    "internal/vm/resolve_test.go",
    "scripts/assemble-payload.sh",
    "scripts/smoke-guest-image.sh"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go build -tags dev ./agent/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/vm/... ./internal/fleetwire/... ./internal/install/... ./internal/controlapi/... ./internal/join/... ./agent/cmd/agent/...",
      "exit_code": 0
    },
    {
      "command": "bash -n scripts/assemble-payload.sh && bash -n scripts/smoke-guest-image.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Step 1: vm-guest slot in assemble-payload.sh + supply.go; a payload without the slot seeds the rest and RECORDS the absence (installer-base pattern); a VM-mode Create against an absent slot fails naming the slot (ADR 0100), never a bare binary": "assemble-payload.sh builds vm-guest.tar (offline-verified: staged when QEMU present, PENDING otherwise); PayloadVMGuest + seedGuestPayload in internal/fleetwire/supply.go seed it optional-by-design (TestSupplySeed_SeedsVMGuestBundle / _SkipsVMGuestWhenPayloadLacksIt logs the absence); internal/vm/resolve.go stagedGuestSlot() resolves from the slot, an absent slot leaves an empty base image so missingPayload fails loud (TestResolveConfig_AbsentStagedSlotLeavesBareNames / _StagedDeviceSlotResolvesTheGuest / _PayloadDirWinsOverStagedSlot)",
    "Step 2: /get route + install staging; size/duration of the slot logged at seed time (arc-start fixed-cost rule)": "controlapi WithInstallOneLinerGuest + serveGuestPayload adds GET /get?artifact=vm-guest (TestInstallDoorway_VMGuestRoute* — 200 tar / 503 unseeded / 404 guestless / 400 archless), wired in main.go over install.GuestCacheSource; install.GuestPayload (join.GuestStager) stages beside the binary on Linux (TestGuestPayload_* + TestInstallAgent_StagesVMGuestWhenWired); seed logs bytes= + dur= (TestSupplySeed_VMGuestBundleLogsSizeAndDuration)",
    "Step 3: Offline tests; smoke-guest-image.sh consumes the staged slot where /dev/kvm exists": "Offline seam tests across vm/fleetwire/install/controlapi/join all green in go test ./...; smoke-guest-image.sh gains IDSS_VM_GUEST_SLOT to untar+boot the staged bundle (driver-gated, bash -n OK)"
  },
  "summary": "The served payload grows a device vm-guest slot: assemble-payload.sh builds it, supply seeds it into the gateway cache, /get serves it, and the agent install stages it beside the binary where vm.resolve resolves the guest from.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1158 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1158, "status": "success", "commits": [ "b5cd1c41e26be1b2b07373fdb5a9a86734e0b386" ], "changed_files": [ "STATUS.md", "agent/cmd/agent/wiring_prod.go", "control-plane/cmd/control-plane/compose.go", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/resting_composition.go", "control-plane/cmd/control-plane/whole_composition.go", "internal/controlapi/install_doorway.go", "internal/controlapi/install_doorway_test.go", "internal/fleetwire/supply.go", "internal/fleetwire/supply_test.go", "internal/install/guestcache.go", "internal/install/guestpayload.go", "internal/install/guestpayload_test.go", "internal/join/cli.go", "internal/join/install_guest_test.go", "internal/vm/resolve.go", "internal/vm/resolve_test.go", "scripts/assemble-payload.sh", "scripts/smoke-guest-image.sh" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go build -tags dev ./agent/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/vm/... ./internal/fleetwire/... ./internal/install/... ./internal/controlapi/... ./internal/join/... ./agent/cmd/agent/...", "exit_code": 0 }, { "command": "bash -n scripts/assemble-payload.sh && bash -n scripts/smoke-guest-image.sh", "exit_code": 0 } ], "criteria": { "Step 1: vm-guest slot in assemble-payload.sh + supply.go; a payload without the slot seeds the rest and RECORDS the absence (installer-base pattern); a VM-mode Create against an absent slot fails naming the slot (ADR 0100), never a bare binary": "assemble-payload.sh builds vm-guest.tar (offline-verified: staged when QEMU present, PENDING otherwise); PayloadVMGuest + seedGuestPayload in internal/fleetwire/supply.go seed it optional-by-design (TestSupplySeed_SeedsVMGuestBundle / _SkipsVMGuestWhenPayloadLacksIt logs the absence); internal/vm/resolve.go stagedGuestSlot() resolves from the slot, an absent slot leaves an empty base image so missingPayload fails loud (TestResolveConfig_AbsentStagedSlotLeavesBareNames / _StagedDeviceSlotResolvesTheGuest / _PayloadDirWinsOverStagedSlot)", "Step 2: /get route + install staging; size/duration of the slot logged at seed time (arc-start fixed-cost rule)": "controlapi WithInstallOneLinerGuest + serveGuestPayload adds GET /get?artifact=vm-guest (TestInstallDoorway_VMGuestRoute* — 200 tar / 503 unseeded / 404 guestless / 400 archless), wired in main.go over install.GuestCacheSource; install.GuestPayload (join.GuestStager) stages beside the binary on Linux (TestGuestPayload_* + TestInstallAgent_StagesVMGuestWhenWired); seed logs bytes= + dur= (TestSupplySeed_VMGuestBundleLogsSizeAndDuration)", "Step 3: Offline tests; smoke-guest-image.sh consumes the staged slot where /dev/kvm exists": "Offline seam tests across vm/fleetwire/install/controlapi/join all green in go test ./...; smoke-guest-image.sh gains IDSS_VM_GUEST_SLOT to untar+boot the staged bundle (driver-gated, bash -n OK)" }, "summary": "The served payload grows a device vm-guest slot: assemble-payload.sh builds it, supply seeds it into the gateway cache, /get serves it, and the agent install stages it beside the binary where vm.resolve resolves the guest from.", "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#1158
No description provided.