fix(install): preserve user fleet data on re-seed + refresh active units (CRITICAL) #632
Reference in New Issue
Block a user
Delete Branch "fix/631-reseed-preserves-fleet-data"
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?
fix(install): preserve user fleet data on re-seed + refresh active units (closes #631)
CRITICAL data-loss in the routine update path.
mosaic updateauto-runsinstall.shkeep-mode sync (#610). The rsync--deletehonoredPRESERVE_PATHS, butfleet/was not listed → the sync wiped~/.config/mosaic/fleet/roster.yaml(andfleet/run,fleet/agents). Any operator runningmosaic updatelost their fleet.PRIMARY fix (data-loss)
install.shPRESERVE_PATHS+=fleet/*.yaml,fleet/agents,fleet/run. The framework still seedsfleet/examples+fleet/roles+fleet/roster.schema.json(synced/refreshed); the operator's roster, custom rosters, per-agent env, and heartbeat run dir are preserved.fleet/*.yamlis preserved there too; fixed the restore to re-glob per pattern (restores only the user file, not the whole freshly-syncedfleet/dir).file-adapter.ts(TS installer): mirrored the preserve list for dual-installer parity. (syncDirectoryis copy-only — never--delete— so it never had the bug; parity + belt-and-suspenders.)SECONDARY fix (stale active units)
refreshActiveFleetUnits(): the re-seed updates~/.config/mosaic/systemd/user/but systemd runs~/.config/systemd/user/, so shipped unit fixes (e.g. #627's socket change) didn't take effect after update.mosaic updatenow copies the freshmosaic-*.service→ the active dir +daemon-reload(best-effort, only when a fleet is already installed).Verification
*.yaml+agents/+run/survive; examples refreshed; schema seeded) → 20/20 migration matrix.file-adapterkeep-mode test (roster/run/agents survive).refreshActiveFleetUnitsunit tests (refreshes when installed; no-op otherwise).🤖 Generated with Claude Code
0d310c083etob55deb4cc3