fix(install): preserve user fleet data on re-seed + refresh active units (closes#631)
CRITICAL data-loss in the routine update path.mosaic update auto-runs install.sh keep-mode sync (#610). The rsync --delete honored PRESERVE_PATHS, but fleet/ was not listed → the sync wiped ~/.config/mosaic/fleet/roster.yaml (and fleet/run, fleet/agents). Any operator running mosaic update lost 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.
Made the cp (no-rsync) fallback glob-aware so fleet/*.yaml is preserved there too; fixed the restore to re-glob per pattern (restores only the user file, not the whole freshly-synced fleet/ dir).
file-adapter.ts (TS installer): mirrored the preserve list for dual-installer parity. (syncDirectory is 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 update now copies the fresh mosaic-*.service → the active dir + daemon-reload (best-effort, only when a fleet is already installed).
## fix(install): preserve user fleet data on re-seed + refresh active units (closes #631)
**CRITICAL data-loss in the routine update path.** `mosaic update` auto-runs `install.sh` keep-mode sync (#610). The rsync `--delete` honored `PRESERVE_PATHS`, but **`fleet/` was not listed** → the sync **wiped `~/.config/mosaic/fleet/roster.yaml`** (and `fleet/run`, `fleet/agents`). Any operator running `mosaic update` lost their fleet.
### PRIMARY fix (data-loss)
- **`install.sh` `PRESERVE_PATHS` += `fleet/*.yaml`, `fleet/agents`, `fleet/run`.** The framework still **seeds** `fleet/examples` + `fleet/roles` + `fleet/roster.schema.json` (synced/refreshed); the operator's roster, custom rosters, per-agent env, and heartbeat run dir are **preserved**.
- Made the **cp (no-rsync) fallback glob-aware** so `fleet/*.yaml` is preserved there too; fixed the restore to re-glob per pattern (restores only the user file, **not** the whole freshly-synced `fleet/` dir).
- **`file-adapter.ts`** (TS installer): mirrored the preserve list for **dual-installer parity**. (`syncDirectory` is 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 update` now copies the fresh `mosaic-*.service` → the active dir + `daemon-reload` (best-effort, only when a fleet is already installed).
### Verification
- **bash F6 fixture** (roster + custom `*.yaml` + `agents/` + `run/` survive; examples refreshed; schema seeded) → **20/20** migration matrix.
- TS `file-adapter` keep-mode test (roster/run/agents survive).
- 2 `refreshActiveFleetUnits` unit tests (refreshes when installed; no-op otherwise).
- tsc/eslint/prettier/**sanitize** clean. Cheap under #619.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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