Migrations

Use the migration framework for all layout changes. It validates source and destination, writes a deterministic plan and fingerprints, copies first, activates last, and records a journal:

memoryledger migrate status
memoryledger --json migrate plan storage-layout --adopt-project-uuid --output .ledger/migrations/storage-layout.json
memoryledger --json migrate apply storage-layout --plan-file .ledger/migrations/storage-layout.json --adopt-project-uuid
memoryledger --json migrate recover storage-layout --journal <path> --policy auto
memoryledger --json migrate cleanup storage-layout --dry-run
memoryledger --json migrate cleanup storage-layout --yes

For storage-v2 and linked-docs-dir, apply the exact reviewed plan file. Storage-v2
creates mandatory legacy backups automatically; canonical `migrate apply` has no
`--backup` option.

Supported migration names include storage-layout, storage-v2, and linked-docs-dir. Plans are read-only until apply. Ownership, source/destination fingerprints, and activation ordering protect against ambiguous or conflicting layouts. Recovery uses the journal after an incomplete operation; cleanup requires confirmation after successful activation. Manual copying is forbidden because it bypasses these checks and can create split-brain storage.