remove-device: the VM offboard mirror never runs live — provision.GuestTeardown is an unwired seam, so a LOSES removal leaves the guest running on the host (ADR 0223 ruling 5; advances #1153) #1219
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#1219
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The failure
Drive
20260904T165415Z(--target device, vm axis), run dir/home/swarm/swarm/Matou/idss/test-results/drive-device/20260904T165415Z. 13 legs green,remove-devicered at 155.6 s (artifacts/legs.json,artifacts/verdict.json—firstRedLeg: remove-device, commit8bd61183):The gateway-side removal held: the leg got past
waitForRemovalSettledandassertFleetGatewayOnly(app/tests/e2e/journey.device.spec.ts:1152-1155) and only then threw in the VM-only guest probe (app/tests/e2e/fixtures/deviceAdd.ts:535, called atjourney.device.spec.ts:1166). This is not a removal that failed — it is a removal that reported success with the guest still up.The guest was still RUNNING, not just leftover files.
logs/device-guest-unit.logshows the wholeidss-guest.serviceunit still on the host at harvest (17:24), andlogs/device-units.txt'sss -tlnpstill lists all four of that unit'shostfwdloopback ports —127.0.0.1:35943 / 46493 / 40431 / 45947— held by pid 9812 (ld-linux-x86-64, the carried relocatable QEMU). Those are byte-for-byte the ports in the unit'sExecStart.Root cause: the seam has no production adapter
Orchestrator.RemoveDevicetears the guest down through a producer-side seam:internal/provision/provision.go:249—GuestTeardowninterface;:264—WithGuestTeardowninternal/provision/deploy.go:292—if o.guestTeardown != nil && d.Install != nil && d.Install.Mode == enroll.ModeVM { … RemoveGuest … }WithGuestTeardownis called from three places, all tests:internal/provision/deploy_test.go:1658,1703,1724. The composition'spvOpts(control-plane/cmd/control-plane/whole_composition.go:389-507) never appends it. Live,o.guestTeardownis nil, the gate atdeploy.go:292is false, and:RemoveGuestnever runs — the unit and qcow2 survive;noteGuestNotTornDown(deploy.go:337) never runs either, so the run carries noDeviceUnreachablenote. The operator sees a clean removal over a host still running the guest — the masked success ADR 0100 forbids, and exactly what ADR 0223 ruling 5 (docs/adr/0223-vm-guest-joins-the-mesh.md:104-111) calls "a failed removal, not a partial one".Landed unwired on purpose: commit
390b92b8(#1162, task 6 of #1153) — "nil for the resting composition, the seam tests". This drive is the first live exercise of that path and it caught precisely the gap.Why this is not a one-line wiring commit — there is no gateway→HOST channel at all
vm.Manager.Remove(internal/vm/manager.go:569) is local systemd+file work overvm.RealSystem()(internal/vm/system.go:19,29— bareexec.CommandContexton the local box). Every construction site owns its own guest: the device agent (agent/cmd/agent/wiring_prod.go:100), the operator app helper (app/helper/cmd/helper/wiring_prod.go:339,467,710), a smoke binary (control-plane/cmd/smoke-vm/main.go:53). Thecontrol-planebinary never builds one.The gateway's only remote-exec channel is the clan SSH adapter (
internal/clan/adapter.go:365execSSH,:100sshStream), aimed at the target captured per operation ininternal/provision/deploy.go:458-460—root@+d.MeshAddress. For a VM node that address is the guest's wt0, not the host's:internal/join/land.go:96-98states it outright ("the guest joins the mesh ITSELF. The host's own meshup is SKIPPED — the host is a supervisor, never a mesh peer"),:102reads the guest's address, and commite86e9f00moved the gateway's deploy keys into the guest (land.go:120GuestAuthorizeDeployKeys) with the reason "a box the gateway never dials in VM mode". The drive asserts that same posture and it passed (assertHostNotMeshPeer,app/tests/e2e/fixtures/deviceAdd.ts:581).So the gateway holds none of the three things a teardown needs:
enroll.RequestViewcarries onlyMeshAddress(internal/enroll/enroll.go:248-254);NetworkFacts.Addressis populated only on a full-install consent (internal/join/app.go:187);fleetstate.Deviceprojects the same guest wt0 and no host address (internal/fleetstate/projection.go:311,internal/fleetstate/fleetstate.go:137-141).e86e9f00.agent/cmd/agent/main.go:268-276→internal/join/socket.go:86), the helper↔agent contract of ADR 0053; no HTTP/TCP server exists inagent/, and the host firewall opens only 22 (nix/gateway-image/configuration.nix:70).The teardown that DOES work is device-local and pull-driven: the agent long-polls the request view and runs the teardown itself when it goes terminal (
internal/join/join.go:358,391→tearDown:411→VM.Remove:425; same shape on restart atinternal/join/resume.go:75). That loop ends atStatusApproved(join.go:388-392), so an already-enrolled device has no standing poll to piggyback on.Closing ruling 5 therefore means choosing one of: (a) put the host's door — address and credential — on the wire and into the fleet, against ADR 0223 ruling 1's mesh-invisible host; (b) make it a pull, mirroring the decline path: removal marks the node's enrol request terminal with a closure and the host agent keeps or resumes a watch past approval, so the existing
tearDownfires unchanged over the enroll poll that already exists (cheapest, fits the architecture, but changes the agent's post-approval lifecycle); or (c) amend ADR 0223 ruling 5. That is a design decision, not a wiring commit.Adjacent finding from the same commit family (no leg asserts it)
provision.GrantRevokerhas no production implementation either —RevokeGrantappears only at its declaration (internal/provision/provision.go:231) and its single call site (internal/provision/deploy.go:279);WithGrantRevokeris never called outside tests, andwhole_composition.go'spvOptsomits it. A live removal therefore does not revoke the removed device's identity grant, contrary to ADR 0210 ruling 5 andRemoveDevice's own doc-comment. The drive does not check this, so it is silently green. Worth folding into whatever ruling closes the offboard.Refusal
Rule 3 (product-behaviour surface) fired. Wiring the offboard changes what a removal deploy DOES on a member's box — it would reach into the device host and delete the operator's guest and its qcow2 — and what the community sees (the "could not be reached … not erased" note becomes a reachable surface). It needs the channel ruling above before any code. Rule 2 would fire too: a new host-door fact on the wire (or an agent-lifecycle change), an adapter, the composition wiring and red-first tests is more than 3 files.
No heal was attempted; the checkout is clean.
drive
20260904T165415Zred atremove-device:the guest is not gone from the host after the LOSES removal (the offboard mirror of the decline teardown): the unit is still loaded (is-active active); /var/lib/idss/vm/guest.qcow2 is still on disk (sevidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260904T165415Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedRuled by session under ADR 0174 — veto anytime: shape (b), landed
b0b0ba65. The offboard is a pull mirroring the decline path — the filing's own "cheapest, fits the architecture" read was right, and (a) was rejected for exactly the reason it names: a host door on the wire contradicts ruling 1's mesh-invisible host, whose deploy keys deliberately live in the guest.What landed:
enroll.Ledger.RevokeGrant(node)closes the node's request terminal withClosure{Revoked}(SelfRemovefalse in VM mode) and removes its mesh peer (ADR 0214 d.4) — idempotent on a closed request, loud on an unknown node.provision.WithGrantRevokeris now actually wired in the whole composition, unconditionally.enrolled: true; the resume watch skips it), and the standing agent's existing 30 s tick also runsjoin.GuardEnrolledOnce— poll the request by id, and on a terminal closure run the SAME directedtearDowna decline always has: guest unit + qcow2 gone, host agent stays. A poll fault is logged and retried, never a teardown on a guess (ADR 0100).WithGuestTeardownstays as a seam for a composition that genuinely holds a host door; its doc-comment no longer claims a wiring that never existed. GOTCHAS #164 records the class: aWith*option's "wired in the composition" comment is a claim to verify with a non-test grep.Pins:
TestRevokeGrant_ClosesEnrolledRequestAndRevokesMesh,TestGuard_EnrolledAnchorStandsQuiet,TestGuard_RemovalRevocationTearsDownGuest; the three anchor tests that pinned clear-at-Enrolled now pin the guard form.go test ./...green, gofmt/vet clean, the spec edit typechecks.Delivery: all agent-tree (Go) — ruling 3a's re-supply carries it; no snapshot rail involved (GOTCHAS #163). Closing — the drive re-fires and the remove-device leg is the live proof.