Skip to main content

migrate_v2_to_v3_install_filesystem

Function migrate_v2_to_v3_install_filesystem 

Source
pub fn migrate_v2_to_v3_install_filesystem(
    install_root: &Path,
) -> Result<FilesystemMigrationReport, Error>
Expand description

V2 → V3 install-root filesystem migration.

  1. Back up the entire legacy <install>/workspace/ tree under <install>/backup-<ts>/legacy-workspace/ (copy-not-rename so a partial failure leaves the legacy data untouched).
  2. Iterate legacy top-level entries; for each, look up the V3 destination via workspace_toplevel_v3_path (or the memory_subentry_v3_path sub-dispatch for memory/) and move it.
  3. Heal intermediate v0.8.0-pre installs by relocating agents/default/workspace/skills/ to shared/skills/.

Idempotent: on a fresh install or an already-migrated install the function is a no-op. Refuses to clobber an existing target — surfacing a WARN and leaving the legacy entry in place rather than overwriting operator data.