0.3.0-alpha.2 Session and Recovery Migration
Scope
This source candidate adds RunResult.operation and persists the operation snapshot in pause and finish RunState records. The final CLI run_result emitted by --json-events also includes operation. Existing fields and exit codes remain available.
Session migration
A schema-v3 file stored directly at session.dir/<id>.jsonl migrates on first open:
- validate the file and session id;
- create a byte-preserving
<id>.jsonl.v3.backup; - atomically publish and reopen the versioned target;
- publish the stable public link last.
Migration supports messages, model/thinking/tool-set changes, compactions, branch summaries, custom data, labels, names, and main-lane moves. An entry that cannot be represented losslessly returns session_migration_unsupported while preserving the public source.
Rollback
- Stop every process using the Session.
- Preserve the versioned target and RunState as audit evidence.
- Verify the
.v3.backupagainst the expected digest. - Restore the legacy filename from the backup and return to
0.2.0-rc.1.
Never remove .open.lock or a RunState .lock while its writer is alive. Keep the run paused when an external effect cannot be confirmed, and ask the business owner to verify it.