{"record":{"id":"4051047ffe9afbe0","repo":"zeroclaw-labs/zeroclaw","slug":"refusing-to-replace-existing-migrated-jsonl-sessio","errorCode":null,"errorMessage":"Refusing to replace existing migrated JSONL session {}","messagePattern":"Refusing to replace existing migrated JSONL session (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-infra/src/session_sqlite.rs","lineNumber":529,"sourceCode":"            let candidate_may_have_committed_receipt = staged && has_committed_import;\n            if staged {\n                if live_path.exists() {\n                    bail!(\n                        \"Refusing ambiguous JSONL migration with both {} and {}\",\n                        live_path.display(),\n                        staged_path.display()\n                    );\n                }\n            } else {\n                if staged_path.exists() {\n                    bail!(\n                        \"Refusing ambiguous JSONL migration with both {} and {}\",\n                        live_path.display(),\n                        staged_path.display()\n                    );\n                }\n                if migrated_path.exists() {\n                    bail!(\n                        \"Refusing to replace existing migrated JSONL session {}\",\n                        migrated_path.display()\n                    );\n                }\n                std::fs::rename(&live_path, &staged_path)\n                    .with_context(|| format!(\"Failed to stage JSONL session {name} for import\"))?;\n            }\n\n            let prepared_source = (|| -> Result<(String, i64)> {\n                Self::sync_staged_jsonl(&staged_path, &name)?;\n                Self::sync_parent_directory(&staged_path)?;\n                fingerprint(&staged_path, &name)\n            })();\n            let (source_hash, source_len) = match prepared_source {\n                Ok(fingerprint) => fingerprint,\n                Err(import_error) => {\n                    if candidate_may_have_committed_receipt {\n                        return Err(self.reconcile_failed_import(","sourceCodeStart":511,"sourceCodeEnd":547,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-infra/src/session_sqlite.rs#L511-L547","documentation":"Error \"Refusing to replace existing migrated JSONL session {}\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-infra/src/session_sqlite.rs:529 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete or archive the existing migrated JSONL session before re-importing."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}