device-add: vm-and-state-fixes — VM lifecycle ordering, OS install-mode policy, watcher call-in state (#48/#50/#68/#40) #114
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#114
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?
Parent
Feature spec: #13 (device-add). Follow-up filed by the 2026-07-26 review sweep (code-review Standards/Spec + design-verify Design axes over
6596977..9e946b7). Three defects, all device-add, none needing new screens:Pair, but teardown infers mode fromView.Mode(set only at Pair):RevokeCodeon a still-RedeemedVM request skipsVM.Remove, orphaning the guest on the member's machine ("the device holds nothing of the community" is violated); andVM.Createruns before the spec gate, so a host failingvmHostFloorleaves a doomed guest running (internal/enroll/ledger.go:649,internal/join/app.go:150).internal/join/app_test.go:22-24); production defaultInstallModes: nilresolves to {full, vm} for every OS — a real Mac would be offered a full install.dashboard/src/lib/deviceAdd.ts:210-230stores called-in state nowhere; a watcher subscribing after the device calls in sees "Waiting…" forever, violating #40's "leaving the page loses nothing". The inline comment claims the behaviour; the code doesn't do it; no test.Acceptance criteria
View.Mode; andVM.Createruns only after the spec gate passes.Blocked by
None.
Task manifest
Done in
942ac22(onorigin/main).1. VM lifecycle ordering —
Orchestrator.Consent(internal/join/app.go) now runsPair(the spec gate, ADR 0030vmHostFloor) beforeVM.Create, so a host that fails the gate is left Redeemed with a rejection and never gets a doomed guest.Orchestrator.tearDown(internal/join/join.go) derives the teardown from the host's actual guest state via a newVMManager.Existsface, notView.Mode/Closure.SelfRemove— a revoked or declined VM-mode join removes its guest wherever it closed, and it survives a reboot (a fresh agent introspects the autostarted guest). Tests:TestConsent_SpecGateBeforeGuestCreation(gate fail → no guest),TestConsent_VMCreateFailsAfterGate,TestRevoke_InFlightTearsDown_VMMode(now drivesConsent, asserts the created guest is removed), resume-teardown models the persisted guest.2. OS→install-modes policy in production —
enroll.DefaultInstallModes(internal/enroll/ledger.go) is ADR 0030's policy (Windows/Mac VM-only, Linux both) and is now the nil-InstallModesdefault, so the agent's production wiring no longer offers a Mac a full install. The test-onlyinstallModesForhelper is removed; the seam tests exercise the real default. Production-side test:TestDefaultInstallModes_ProductionOSPolicy.3. Watcher call-in state —
FakeDeviceAddSource(dashboard/src/lib/deviceAdd.ts) stores called-in state durably, so a watcher subscribing after the device called in re-reads it instead of showing "Waiting…" forever (#40). Tests: two late/early-subscriber cases indashboard/tests/unit/deviceAdd.test.ts.Full Go suite + 416 dashboard tests green;
vue-tscclean.STATUS.mdupdated.rehearsal-e.idss.nzreds "already taken" — the single-sourcedREHEARSAL_SLUGis permanently held by the device target's LIVE standing community #1401