fix(fleet): boot-survival symmetry — disable-on-remove + add-enable + init-R5 (#611)
Codex symmetry-gap finding. Three fixes completing add/remove boot-survival symmetry: 1. disable-on-remove (BUG, TDD): fleet remove stopped + deleted roster/env/ heartbeat but never disabled the systemd unit, so a removed-but-enabled mosaic-agent@NAME.service could resurrect on reboot pointing at deleted config. Add buildSystemdDisableCommand + disable in remove (best-effort, gated on !--keep-files). 2. add-enable: fleet add now enables the new agent's unit for boot-survival (best-effort, independent of --start). 3. init-R5 guarantee: fleet init --write now fails hard when a non-minimal profile lacks exactly one orchestrator (was a soft warning); the sanctioned no-orchestrator 'minimal' preset is still allowed. Verified: 4 new tests (disable builder; remove-invokes-disable; add-invokes- enable; init general → exactly 1 orchestrator) + 147 existing fleet tests green (151 total); tsc/eslint/prettier clean. Refs #611 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EsgTQzV5YUGk1JtCLP4B83
This commit is contained in:
20
docs/scratchpads/fleet-polish-bundle.md
Normal file
20
docs/scratchpads/fleet-polish-bundle.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Fleet-polish bundle — boot-survival symmetry (#611)
|
||||
|
||||
- **Issue:** #611 · **Branch:** `feat/fleet-polish-bundle` · From the Lead's Codex symmetry-gap finding.
|
||||
|
||||
## Three fixes
|
||||
|
||||
1. **disable-on-remove (BUG, TDD).** `fleet remove` stopped + deleted roster/env/heartbeat but never
|
||||
`systemctl --user disable mosaic-agent@NAME.service` → a removed-but-enabled unit could resurrect on
|
||||
reboot pointing at deleted config. Fix: `buildSystemdDisableCommand` + disable in `remove`
|
||||
(best-effort, gated on !--keep-files).
|
||||
2. **add-enable.** `fleet add` now enables the new agent's unit for boot-survival (best-effort,
|
||||
independent of --start) — symmetry with disable-on-remove.
|
||||
3. **init-R5 guarantee.** `fleet init --write` now FAILS HARD when a non-minimal profile doesn't yield
|
||||
exactly one orchestrator (was a soft warning). `minimal` (sanctioned no-orchestrator) still allowed.
|
||||
|
||||
## Verification
|
||||
|
||||
- 4 new tests (disable builder; remove-invokes-disable; add-invokes-enable; init general → exactly 1
|
||||
orchestrator) + 147 existing fleet tests green (151 total). tsc/eslint/prettier clean.
|
||||
- TDD on the disable bug per contract.
|
||||
Reference in New Issue
Block a user