vm: Health folds a systemctl failure into "stopped" — the ADR 0129 seat read fabricates guest state #296
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#296
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?
Branch note:
Health/Start/Stopand the seat read live onprivate-standup-polish(ADR 0129, unmerged). Actionable once that branch lands — or fold the fix into the branch itself.internal/vm/manager.go:384-388—Healthtreats anysystemctl is-activeerror as "inactive": nil error either way, soRunning(line ~418) can never return an error andExists(line ~375) returns nil unconditionally. But a non-zero exit also happens when systemctl itself could not run (dbus down, permission denied) — the probe fault becomes a confident "stopped".internal/founding/seat.go:70-76guards onerr == nil && running, but the fabrication happens a layer below, so the guard is moot; seat.go:42 promises "Every field is a read, never a fabrication (ADR 0100)". The operator home rendersstate: "stopped"for a guest that may be running — and the new Stop/Start row acts on that fabrication.Acceptance
Healthdistinguishes "unit inactive" (a legitimate is-active non-zero exit) from "could not probe" (exec/permission/dbus failure) and propagates the latter.Filed from the 2026-08-05 fail-loud audit (three-agent pre-production sweep; findings verified against code).
Agent Brief
Category: bug
Summary:
vm.Manager.Healthfolds anysystemctl is-activeprobe failure into a confident "stopped", so a probe fault (dbus down, permission denied, binary missing) is indistinguishable from a genuinely inactive unit.Verification: Confirmed on
main, independent of the branch note in the body.Healthis live production code today, wired into the heartbeat's VM section (enroll.VMHealth) — this isn't gated on the ADR 0129 (private-standup-polish) branch landing. The body's exact line numbers have drifted (the function is shorter and lives earlier in the file now), but the described defect is exactly reproducible:Healthrunssystemctl is-active, then computesrunning := err == nil && output == "active"and returnsVMHealth{Running: false}, nilwheneverrunningis false — collapsing "confirmed inactive" and "could not probe" into the same honest-looking false with no error.One correction to the original report:
internal/founding/seat.godoes not currently guard on VM health at all — the seat model onmainonly carries operator-posturekind+community, no VM/running field. That part of the report, and its second acceptance bullet, belongs to the still-unmerged ADR 0129 arc. Scoping this brief to what's actually true onmaintoday.Current behavior:
HealthreportsRunning: falsewith anilerror both when the unit is cleanly confirmed inactive (a legitimate non-zerois-activeexit) and when the probe itself failed to run (exec error, permission denied, dbus unavailable, etc.). Callers cannot tell "the guest is stopped" from "we don't actually know."Desired behavior:
Healthdistinguishes the two cases: a clean, legitimate "inactive" read still returnsRunning: false, err: nil. A probe failure (thesystemctlinvocation itself erroring for a reason other than a clean non-active exit code) returns a non-nil error instead of a confidentRunning: false.Key interfaces:
vm.Manager.Health(ctx) (enroll.VMHealth, error)— the return contract changes from "always nil error" to "nil error only on a legitimate read (active or cleanly inactive), non-nil error when the probe itself couldn't be trusted."Acceptance criteria:
is-activenon-zero exit (unit genuinely inactive) still returnsRunning: falsewith anilerror.systemctlinvocation errors for a reason other than a clean inactive exit — exec error, permission denied, dbus unavailable) returns a non-nil error rather than a confidentRunning: false.Out of scope (belongs to the still-unmerged ADR 0129 arc, not on
main):internal/founding/seat.goor the seat model — it doesn't consume VM health today.Fixed in
c18e837(on origin/main).vm.Manager.Health(internal/vm/manager.go) folded anysystemctl is-activeerror intoVMHealth{Running: false}, nil, so a probe fault (dbus down, permission denied, systemctl missing) was indistinguishable from a genuinely inactive unit — the heartbeat carried a fabricated "stopped".Health now classifies on the
is-activeOUTPUT, not the error: a recognized systemd ActiveState word is an honest read (active/reloading→ running;inactive/failed/activating/deactivating/maintenance→ cleanly not-running) even on the clean exit-3, while unrecognized output (unknown, an error message, empty) is a probe fault that propagates a non-nil error.join.Orchestrator.Heartbeatalready returns on a Health error, so a probe fault now fails loud rather than reporting a made-up state.Red-first seam tests:
TestHealthCleanInactiveIsHonestNotRunning(recognized states over a non-zero exit still read not-running with a nil error) andTestHealthProbeFaultPropagates(dbus/permission/exec faults error, neverRunning:true).Scoped per the triage brief to Health on
main;seat.go/ Operator-home unknown-state rendering belongs to the still-unmerged ADR 0129 arc (out of scope, not onmain).go build/go vet/go test ./...green.