{"record":{"id":"5e0cc0e33d51f3af","repo":"zeroclaw-labs/zeroclaw","slug":"jsonl-session-name-does-not-match-its-committed","errorCode":null,"errorMessage":"JSONL session {name} does not match its committed import receipt","messagePattern":"JSONL session (.+?) does not match its committed import receipt","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-infra/src/session_sqlite.rs","lineNumber":604,"sourceCode":"                    ))),\n                };\n            }\n            let mut receipt_observed_or_commit_attempted = candidate_may_have_committed_receipt;\n            let import_result = (|| -> Result<()> {\n                let tx = conn\n                    .transaction_with_behavior(TransactionBehavior::Immediate)\n                    .with_context(|| {\n                        format!(\"Failed to start JSONL import transaction for {name}\")\n                    })?;\n                let receipt = Self::import_receipt(&tx, &name)?;\n\n                if let Some((receipt_key, receipt_hash, receipt_len)) = receipt {\n                    receipt_observed_or_commit_attempted = true;\n                    if receipt_key != key\n                        || receipt_hash != source_hash\n                        || receipt_len != source_len\n                    {\n                        bail!(\"JSONL session {name} does not match its committed import receipt\");\n                    }\n                    tx.commit().with_context(|| {\n                        format!(\"Failed to finish JSONL receipt check for {name}\")\n                    })?;\n                    return Ok(());\n                }\n\n                let existing_state: bool = tx\n                    .query_row(\n                        \"SELECT EXISTS(SELECT 1 FROM sessions WHERE session_key = ?1) \\\n                         OR EXISTS(SELECT 1 FROM session_metadata WHERE session_key = ?1)\",\n                        params![key],\n                        |row| row.get(0),\n                    )\n                    .with_context(|| {\n                        format!(\"Failed to inspect existing SQLite session state for {key}\")\n                    })?;\n                if existing_state {","sourceCodeStart":586,"sourceCodeEnd":622,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-infra/src/session_sqlite.rs#L586-L622","documentation":"Integrity guard inside the JSONL import transaction: a committed import receipt exists for this session name, but the file's current fingerprint does not match the (key, hash, length) recorded in the receipt. The JSONL file changed after its content was committed to SQLite, so the import aborts instead of double-importing or trusting divergent state.","triggerScenarios":"Thrown at crates/zeroclaw-infra/src/session_sqlite.rs:604 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restore the JSONL session content to match its committed import receipt, or delete both and re-import."],"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"}