Evidence-First Claude Session MiningLesson 3/8
Evidence boundary

Determinism and Honest Failure

The same tree produces the same bytes; a broken boundary produces an error, not a partial story.

U1 LIVE: PROVENSYNTHETIC EXAMPLE · /demo-claude/
Two shuffled traversals produce one identical sorted result while faults stop outputenumeration Aother · primarysubagent · primaryenumeration Bprimary · subagentprimary · otheridentical sorted JSONfault → no partial value
Two shuffled traversals produce one identical sorted result while faults stop output.
You will be able to
  • Name every source of ordering that must be stabilized.
  • Separate a valid empty result from a filesystem fault.
  • Explain why partial output would be dishonest.
1

Core model

A useful inventory is comparable over time. That requires sorted traversal, stable aggregation, explicit timestamps from filesystem metadata, and no clock or random value in the result. When metadata or directory reads fail, the operation and path are named and the command exits unsuccessfully.

Mental model: Think of a calibrated scale: the same sealed crate must yield the same reading. If the scale loses power, it displays an error instead of yesterday's weight.

The implementation sorts injected `readDir` results before recursion and sorts final relative paths again. It returns `Result<T, Error>` for missing roots, non-directories, `lstat` faults, and `readDir` faults. Two JSON runs over an unchanged tree can therefore be byte-identical.

2

Boundary table

QuestionObserved boundaryOwnerVerdict
Injected directory orderSort before walkingStable pathsDETERMINISTIC
Unchanged mtimesUse filesystem valueStable rangeDETERMINISTIC
Read faultReturn Result.errNo partial inventoryFAIL CLOSED
Primary local sourcepackages/sessions/src/claude-inventory.test.ts
const first = await inventoryClaudeProject(root, shuffledFsA);
const second = await inventoryClaudeProject(root, shuffledFsB);
expect(JSON.stringify(first)).toBe(JSON.stringify(second));
Stable comparator: Explicit text ordering independent of filesystem enumeration.Stable comparator
Explicit text ordering independent of filesystem enumeration.
Result: Success or a named error, never an ambiguous partial value.Result
Success or a named error, never an ambiguous partial value.
Filesystem mtime: File metadata, not transcript chronology.Filesystem mtime
File metadata, not transcript chronology.
Byte-identical: Serialized output matches exactly for unchanged state.Byte-identical
Serialized output matches exactly for unchanged state.
3

Synthetic lab

Choose an observed state and inspect the honest result.

4

Retrieval and feedback

Predict before revealing

A nested `readDir` fails after three entries were collected. What may be returned?

Only an error. Returning three entries would disguise an incomplete archive as truth.

Retrieval cards

Retrieval cardsStable comparatorActivate to flip
Stable comparatorExplicit text ordering independent of filesystem enumeration.
Retrieval cardsResultActivate to flip
ResultSuccess or a named error, never an ambiguous partial value.
Retrieval cardsFilesystem mtimeActivate to flip
Filesystem mtimeFile metadata, not transcript chronology.
Retrieval cardsByte-identicalActivate to flip
Byte-identicalSerialized output matches exactly for unchanged state.

Check your model

Which time range may U1 claim?

U1 never opens records, so it cannot infer transcript chronology.
5

Evidence ledger

Contract · PROVENSCOPE + source
Implementation · PROVENfocused code + tests
Compiled boundary · PROVENU1 receipt recorded
Independent probe · PROVENU1 counts/bytes match

Authority: docs/fable-session-mining/LOOP-LOG.md. Tests never upgrade a missing live receipt.