rehearsal-7 Task 6: Removal mirrors the teardown — RemoveDevice removes the guest #1162

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

Task 6 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 6 of #1153" in commits — NEVER "closes".

Task 6: Removal mirrors the teardown — RemoveDevice removes the guest

Files: Modify the removal path: for a VM node, after the offboard the HOST
agent tears the guest down (vm.Manager.Remove — unit gone, qcow2 deleted);
the reachable-removal walk (ADR 0210 r5, #1114 Shape A) applies to the HOST:
an unreachable host still removes from fleet + gateway with the honest note.
Removal LOSES row derives from placement as landed in #1134 — verify it names
Files for a guest placement. Tests: fake VMManager records Remove; unreachable
host branch.

Interfaces: Consumes Tasks 4/5. Produces the guest-absent post-state
Task 8's remove-device leg asserts over host SSH.

  • Step 1: Guest teardown on removal + honest note branch.
  • Step 2: Tests incl. the failure path (Remove fails → removal still completes gateway-side, red is named, never masked — ADR 0100).
> Task 6 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 6 of #1153" in commits — NEVER "closes". ### Task 6: Removal mirrors the teardown — RemoveDevice removes the guest **Files:** Modify the removal path: for a VM node, after the offboard the HOST agent tears the guest down (`vm.Manager.Remove` — unit gone, qcow2 deleted); the reachable-removal walk (ADR 0210 r5, #1114 Shape A) applies to the HOST: an unreachable host still removes from fleet + gateway with the honest note. Removal LOSES row derives from placement as landed in #1134 — verify it names Files for a guest placement. Tests: fake VMManager records Remove; unreachable host branch. **Interfaces:** Consumes Tasks 4/5. Produces the guest-absent post-state Task 8's `remove-device` leg asserts over host SSH. - [ ] Step 1: Guest teardown on removal + honest note branch. - [ ] Step 2: Tests incl. the failure path (Remove fails → removal still completes gateway-side, red is named, never masked — ADR 0100).

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

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

close-report for #1162 — status success

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

envelope
{
  "issue": 1162,
  "status": "success",
  "commits": [
    "390b92b8"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/provision/deploy.go",
    "internal/provision/deploy_test.go",
    "internal/provision/provision.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/provision/",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/provision/",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Step 1: Guest teardown on removal + honest note branch": "internal/provision/deploy.go — RemoveDevice calls o.guestTeardown.RemoveGuest for a VM-mode node (d.Install.Mode==ModeVM) after the offboard (RemoveNode + grant revoke); GuestTeardown seam + WithGuestTeardown in provision.go; unreachable-host honest note via noteGuestNotTornDown (reachable-removal walk #1114 Shape A applied to the HOST, ADR 0210 r5)",
    "Step 2: Tests incl. the failure path (Remove fails -> removal still completes gateway-side, red is named, never masked, ADR 0100)": "internal/provision/deploy_test.go — TestRemoveDevice_VMGuestTearsDownTheGuestOnTheHost (fake VMManager records Remove; LOSES row names Files for a guest placement, #1134), TestRemoveDevice_FullInstallNeverTearsDownAGuest, TestRemoveDevice_GuestTeardownFailsStillOffboardsWithHonestNote (RemoveGuest fails -> node removed + grant revoked + honest DeviceUnreachable note, no run.Failure); red-before-green verified by neutering the call"
  },
  "summary": "RemoveDevice on a VM-mode node tears the guest down on its host (ADR 0223 ruling 5), with the reachable-removal walk applied to the host and the honest not-erased note.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1162 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1162, "status": "success", "commits": [ "390b92b8" ], "changed_files": [ "STATUS.md", "internal/provision/deploy.go", "internal/provision/deploy_test.go", "internal/provision/provision.go" ], "tests": [ { "command": "go test ./internal/provision/", "exit_code": 0 }, { "command": "go vet ./internal/provision/", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 } ], "criteria": { "Step 1: Guest teardown on removal + honest note branch": "internal/provision/deploy.go — RemoveDevice calls o.guestTeardown.RemoveGuest for a VM-mode node (d.Install.Mode==ModeVM) after the offboard (RemoveNode + grant revoke); GuestTeardown seam + WithGuestTeardown in provision.go; unreachable-host honest note via noteGuestNotTornDown (reachable-removal walk #1114 Shape A applied to the HOST, ADR 0210 r5)", "Step 2: Tests incl. the failure path (Remove fails -> removal still completes gateway-side, red is named, never masked, ADR 0100)": "internal/provision/deploy_test.go — TestRemoveDevice_VMGuestTearsDownTheGuestOnTheHost (fake VMManager records Remove; LOSES row names Files for a guest placement, #1134), TestRemoveDevice_FullInstallNeverTearsDownAGuest, TestRemoveDevice_GuestTeardownFailsStillOffboardsWithHonestNote (RemoveGuest fails -> node removed + grant revoked + honest DeviceUnreachable note, no run.Failure); red-before-green verified by neutering the call" }, "summary": "RemoveDevice on a VM-mode node tears the guest down on its host (ADR 0223 ruling 5), with the reachable-removal walk applied to the host and the honest not-erased note.", "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#1162
No description provided.