Expand description
weaver migrate user-chain: copy the legacy ~/.clawft chain to the
Phase 1 user chain location (~/.weftos/chain), verified, source untouched.
Safety sequence (ADR-103 Phase 1, plan package E):
- refuse when the destination already holds something that is not this migration (identical or already-migrated is a no-op);
- refuse when a kernel holds the source
chain.lock, or when the mixed-version guard says a lock-unaware writer touched it recently; - take the source
chain.lockourselves for the whole run; - copy to a temp dir beside the destination, fsync every file;
- re-hash the source: any change since the plan aborts;
- load the copy with the kernel’s own restore path, check byte hashes, event count, head hash, integrity and signature against the source;
- write
MIGRATED_FROM.json, atomically rename into place, then write the marker beside the source.
Any failure before step 7’s rename removes the temp dir. The source chain
files are never modified, moved or deleted; the only writes in the source
directory are the transient chain.lock and the final marker.
Structs§
- File
Entry - One file in the set.
- Head
- What restoring the chain yields.
- Marker
MIGRATED_FROM.json.- Migrate
Options - Inputs. Paths are injected; the CLI resolves
$HOME. - Plan
- What a migration would copy, from the source.
Enums§
- Migrate
Error - Why a migration did not happen.
- Outcome
- Result of a run.
Functions§
- migrate_
user_ chain - Migrate. See the module docs for the sequence.