feat(checkpoint): point metadata.json at full compact transcript.jsonl

Commit

computermode3mo ago

The root metadata.json sessions[].transcript pointer now prefers the compact transcript.jsonl over the raw full.jsonl. The pointer is derived from the actual tree entries so it can never dangle: when the best-effort compact transcript is skipped (compaction failure, empty/oversized output, older checkpoints) it falls back to full.jsonl. UpdateCommitted (deferred finalization) re-derives the pointer too. CLI read paths resolve transcripts by filename and ignore the pointer; it is consumed by external readers.

The compact transcript now mirrors full.jsonl: it is stored in full (never trimmed) instead of pre-sliced per checkpoint. Each checkpoint's start within it is recorded as a new compacted-line offset, compact_transcript_start, in the session metadata. This is distinct from checkpoint_transcript_start (which indexes the raw full.jsonl) because compaction merges/drops lines, so the raw offset cannot index the compacted file. The offset is computed at write time by subtracting the checkpoint's own compacted line count from the full compact's.

Consumers (entire.io server) must slice transcript.jsonl numerically by compact_transcript_start and must not re-apply checkpoint_transcript_start slicing; that server change is a prerequisite before downstream reads switch to the new pointer.

Entire-Checkpoint: 61d5c3e264d3

Checkpoints

Investigate Metadata to Transcript Pointer Impact

Claude CodeOpus 4.8
View session
Checkpoint 1

Merge Main and Resolve Transcript Conflicts

Claude CodeFable 5
View session
Checkpoint 1