Overlap, Hashes, Journals, and Mutation
A plan is trustworthy only if every byte is attributable to one stable source snapshot.
- Separate byte integrity, file identity, and archive membership.
- Explain journal precedence and skipped windows.
- Reject mixed snapshots without partial output.
Core model
Hashes prove which bytes were measured; identity checks prove those bytes came from the same file; final enumeration proves archive membership did not change. Journals receive hashes and structural counts, but no transcript window plan. These are distinct integrity decisions, not one generic safety flag.
Mental model: A tamper-evident evidence bag needs a seal number, custody signatures, and an item list. A checksum alone cannot prove someone did not swap the entire bag.
U2 compares path `lstat`, handle `fstat` identity before/after streaming, and the path identity again after close, then repeats the inventory. Device, inode, size, mtimeNs, and ctimeNs detect replacement or mutation. SHA-256 covers files and each full window. Basename `journal.jsonl` takes classification precedence and yields `status: skipped, reason: journal`.
Boundary table
| Question | Observed boundary | Owner | Verdict |
|---|---|---|---|
| SHA-256 | Exact bytes | Digest mismatch | Cross-check content identity |
| Handle identity | Opened file object | dev/inode/time/size change | Reject source mutation |
| Final inventory | Archive membership | Entry added/removed/changed | Reject changed archive |
| journal.jsonl | Journal basename | No transcript windows | Hash and count only |
Primary local source
packages/sessions/src/claude-manifest.tsbeforePath === openedHandle openedHandle === afterHandle afterHandle === afterPath finalInventory === initialInventory // Otherwise: fail closed, no mixed manifest.
Synthetic lab
Choose a change during scanning. What is the honest outcome?
Retrieval and feedback
The file is atomically replaced by another file of the same size. Is size alone enough?
Retrieval cards
Check your model
What happens to `subagents/journal.jsonl` in U2?
Evidence ledger
Authority: docs/fable-session-mining/LOOP-LOG.md. Tests never upgrade a missing live receipt.