zeroclaw-labs/zeroclaw · error
JSONL session does not match its committed import receipt
Error message
JSONL session {name} does not match its committed import receipt What it means
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.
Solutions
- Restore the JSONL session content to match its committed import receipt, or delete both and re-import.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/zeroclaw-infra/src/session_sqlite.rs:604 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/5e0cc0e33d51f3af.
Report an issue: GitHub.
Appendix: source
Thrown at crates/zeroclaw-infra/src/session_sqlite.rs:604
))),
};
}
let mut receipt_observed_or_commit_attempted = candidate_may_have_committed_receipt;
let import_result = (|| -> Result<()> {
let tx = conn
.transaction_with_behavior(TransactionBehavior::Immediate)
.with_context(|| {
format!("Failed to start JSONL import transaction for {name}")
})?;
let receipt = Self::import_receipt(&tx, &name)?;
if let Some((receipt_key, receipt_hash, receipt_len)) = receipt {
receipt_observed_or_commit_attempted = true;
if receipt_key != key
|| receipt_hash != source_hash
|| receipt_len != source_len
{
bail!("JSONL session {name} does not match its committed import receipt");
}
tx.commit().with_context(|| {
format!("Failed to finish JSONL receipt check for {name}")
})?;
return Ok(());
}
let existing_state: bool = tx
.query_row(
"SELECT EXISTS(SELECT 1 FROM sessions WHERE session_key = ?1) \
OR EXISTS(SELECT 1 FROM session_metadata WHERE session_key = ?1)",
params![key],
|row| row.get(0),
)
.with_context(|| {
format!("Failed to inspect existing SQLite session state for {key}")
})?;
if existing_state {View on GitHub (pinned to 88bb9c8533)