Skip to content

feat: recover from CC Switch configs and track asset snapshots - #6

Merged
StarsailsClover merged 1 commit into
mainfrom
v26.0-Alpha.6
Oct 5, 2026
Merged

StarsailsClover merged 1 commit into
mainfrom
v26.0-Alpha.6

Conversation

@StarsailsClover

Copy link
Copy Markdown
Owner

Summary

Three expansions for the recovery/protection lifecycle:

  1. ccswitch recover — when both the store baseline and Codex's own backups are gone, scan the Codex provider configs stored in CC Switch, pick the one protecting the most user-owned paths (current provider wins ties), merge it with overlay_wins, and take a pre-recover backup. Dry-run by default; --provider selects by id or name.
  2. Asset coverage — backup records the snapshot in state.json; status prints it; doctor warns when no snapshot exists or the newest is older than 30 days.
  3. Launcher survival — the immediate Startup helper is now created through the WMI service (Invoke-CimMethod Win32_Process Create) via a hidden VBS launcher, so it is not a member of the installer's job object. The previous cmd /C start + DETACHED_PROCESS helper was reaped when the installing session ended, leaving the machine unprotected until the next logon.

Verified

  • 37 tests passing (18 core unit + 13 workflow + 3 CLI + 3 autostart); clippy -D warnings and fmt --check clean.
  • Synthetic CC Switch database test proves selection, dry-run, provider-name selection, and merge behavior.
  • Snapshot state assertions added to the asset backup/restore test.
  • Machine verification (WMI loop survival across sessions + first hardlink snapshot) is performed after deployment of this branch.

Adds a third recovery source (CC Switch's stored provider configs), reports asset-snapshot coverage in status/doctor, and launches the Startup loop through the WMI service so the immediate helper survives the installer session.

- ccswitch recover [--provider NAME] [--db FILE] [--apply]: pick the stored config with the most protected paths, merge with overlay_wins, pre-recover backup
- state.json records the last asset snapshot; status prints it; doctor warns when missing or older than 30 days
- hidden VBS launcher created via Invoke-CimMethod Win32_Process Create (escapes the caller job object)
- regression tests for CC Switch recovery, snapshot state, and the WMI launcher
@StarsailsClover
StarsailsClover merged commit a84c3af into main Oct 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant