{"record":{"id":"9077bbf27f0ed484","repo":"zeroclaw-labs/zeroclaw","slug":"refusing-incompatible-migrated-jsonl-session","errorCode":null,"errorMessage":"Refusing incompatible migrated JSONL session {}","messagePattern":"Refusing incompatible migrated JSONL session (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-infra/src/session_sqlite.rs","lineNumber":737,"sourceCode":"                    &sessions_dir,\n                    &mut mutation_guard,\n                )\n                .context(\"Failed to deactivate JSONL after committed SQLite import\")?;\n                drop(conn);\n                return Err(sync_error).with_context(|| {\n                    format!(\"JSONL import for {name} committed before sync mode restore failed\")\n                });\n            }\n            crate::session_store::mark_session_directory_migrated(\n                &sessions_dir,\n                &mut mutation_guard,\n            )\n            .context(\"Failed to deactivate JSONL after committed SQLite import\")?;\n            drop(conn);\n\n            if migrated_path.exists() {\n                if Self::source_fingerprint(&migrated_path, &name)? != expected {\n                    bail!(\n                        \"Refusing incompatible migrated JSONL session {}\",\n                        migrated_path.display()\n                    );\n                }\n                Self::sync_parent_directory(&migrated_path)?;\n                std::fs::remove_file(&staged_path)\n                    .with_context(|| format!(\"Failed to finish staged JSONL handoff for {name}\"))?;\n                Self::sync_parent_directory(&staged_path)?;\n            } else {\n                archive(&staged_path, &migrated_path, &expected)\n                    .with_context(|| format!(\"Failed to archive imported JSONL session {name}\"))?;\n            }\n            if live_path.exists() {\n                bail!(\n                    \"JSONL session {} reappeared during migration\",\n                    live_path.display()\n                );\n            }","sourceCodeStart":719,"sourceCodeEnd":755,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-infra/src/session_sqlite.rs#L719-L755","documentation":"Safety refusal during post-commit cleanup of a JSONL migration: the .migrated archive for a session exists but its fingerprint does not match the expected one recorded at commit time. The archive cannot be proven to be the file that was just imported, so the handoff that would remove the staged copy refuses to proceed.","triggerScenarios":"Thrown at crates/zeroclaw-infra/src/session_sqlite.rs:737 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the migrated JSONL session's metadata for incompatibility; fix or remove it before migration."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","contentChangedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}