Hand container health to the daemon: a Healthcheck at create, and the boot inference deleted #184
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lz/agent-nexus#184
Loading…
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?
Split out of #177 after a roadmap pass on 2026-09-21. It is the largest single deletion in that spec, it does not need the fleet store, and it ships while the browser still drives the poll — which leaves #177 to be about ownership rather than about health.
Why it is separable, and why it is now a deletion
docs/superpowers/specs/2026-09-17-fleet-status-layer-design.mdsays the healthcheck "does not delete the boot machinery". That is entirely a legacy-container argument:Healthcheckis fixed at container create,docker updatecannot add one, and nothing forces a recreate — sosettleBootingPhase,lastBootMarker,BOOT_GRACE_MSand the tmuxexecProbeall survive for workspaces created before it ships, and the spec has to carry a residual prober for the set that cannot report.Nexus carries no backwards compatibility and updates from a clean state. So make the healthcheck universal instead of keeping two paths, and the residual class — the one the spec flags as "looks like everything working until an old workspace goes quiet" — stops being expressible rather than having to be computed.
Shape
Healthcheckin the create config inprovisionWorker:CMD-SHELL tmux has-session -t nexus, withInterval,StartPeriodandRetriesstated explicitly (see the latency trap below).startWorkerrecreates a container whose inspected config carries noHealthcheck. The namedworkspace_volumesurvives —remove({ v: true })reaps anonymous volumes only (fact #22) — andHostConfig.Mountsrebuilds from the frozenworkers.mounts_json, which is the snapshot that exists for exactly this.checkWorkerHealthreadsinspect().State.Health.Statusinstead of exec-probing tmux.bootingends onhealthy.settleBootingPhase,lastBootMarker,BOOT_GRACE_MS, the tmux probe, and the log-marker boot inference that feeds them.WorkerHealthDTOfieldscontainerState,tmuxRunning,recentLogs— zero.sveltereaders (positive control:degradedhits six components). After the store they also reachGET /api/workers, which is inTOKEN_ROUTESand is projected bymcp/projection.ts, making it an API-visible removal instead of an internal one.execProbe, which the degraded-marker read still needs.What fails silently if got wrong
Healthcheckagainst an empty create config passes equally well for a form that clobbers operator mounts. Assert against a config that already holds one, followingcapabilities.test.ts.startfires before the entrypoint's first line./run/nexus/degradedis written atworker/entrypoint.sh:84andtmux new-sessionis line 255 of 256. Nothing may be inferred fromstart; the degraded read stays on the poll in this slice and moves tohealth_status: healthyin #177.Intervaldefaults to 30s, sobootingcould clear up to 30s later than the 10s poll clears it today. State the interval and the start period, and say what the boot latency becomes.resolveSpawnMountsre-validates saved rows for a reason; the recreate path must go through the same builder rather than reconstructingHostConfigby hand.Done when
A workspace created after this reports health from the daemon, nothing execs
tmux has-sessionto decide workspace health, the four boot-inference helpers are gone, and no container in the fleet lacks aHealthcheckafter onestartWorker.Sequencing
Independent of #178 and #179. Lands before #177, which then consumes
health_statusevents from a fleet where every container emits them.