feat(checkpoint): add compact_transcript path to metadata.json#1515
Conversation
Add a has_compact_transcript boolean to the root metadata.json sessions[] entries instead of repointing sessions[].transcript at transcript.jsonl. The transcript pointer keeps targeting full.jsonl; the flag (omitted when false) signals to external readers that a compact transcript.jsonl was written alongside it. Derived from the actual tree entry so it can't drift from what was written. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: 9c9ee0f533ff
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 278addd. Configure here.
There was a problem hiding this comment.
Pull request overview
This PR adds an explicit, backward-compatible signal in committed checkpoint metadata indicating whether a compact transcript (transcript.jsonl) was generated for a session, while keeping sessions[].transcript pointing at the raw full.jsonl used by CLI read paths.
Changes:
- Add
sessions[].has_compact_transcript(omitempty) to checkpoint summary metadata to indicate compact transcript availability. - Set the flag during checkpoint writes by detecting the presence of
transcript.jsonlin the in-memory git tree entries. - Update docs and tests to reflect/validate the new metadata shape.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/architecture/sessions-and-checkpoints.md | Updates storage/metadata documentation and JSON example to include has_compact_transcript while keeping transcript on full.jsonl. |
| cmd/entire/cli/checkpoint/persistent.go | Derives and records HasCompactTranscript on session file paths based on whether transcript.jsonl was written into the checkpoint tree. |
| cmd/entire/cli/checkpoint/persistent_compact_transcript_test.go | Extends existing compact transcript tests to assert the new has_compact_transcript behavior for compactable vs non-compactable transcripts. |
| CLAUDE.md | Updates strategy documentation to describe the new flag for external readers. |
| api/checkpoint/metadata.go | Extends the public metadata contract (SessionFilePaths) with has_compact_transcript and updates transcript field documentation accordingly. |
Replace the has_compact_transcript boolean with a compact_transcript string holding the path to transcript.jsonl, placed alongside the transcript (full.jsonl) pointer in the root metadata.json sessions[] entries. Omitted when no compact transcript was written. This mirrors the existing transcript pointer rather than signalling presence separately. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: d1553195a011
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: cc1dc940b7ca
backfillTranscript regenerates transcript.jsonl via replaceTranscript but did not rewrite the root metadata.json, so a compact transcript created during finalize (when the initial write skipped compaction) left sessions[].compact_transcript omitted. Re-derive the pointer from the tree entry after replaceTranscript and rewrite the root summary when it changed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: b0e1c7d96944

https://entire.io/gh/entireio/cli/trails/655
What
Following PR #1510, this takes a simpler approach to surfacing the compact transcript in checkpoint metadata. Instead of repointing the root
metadata.jsonsessions[].transcriptattranscript.jsonl, the pointer keeps targetingfull.jsonland a sibling path field is added:sessions[].compact_transcriptholds the path totranscript.jsonlwhen a compact transcript was generated and written into the session directory.This avoids the pointer-flip and the
compact_transcript_startoffset machinery from #1510, while giving external readers (server/UI) a direct path to the compact transcript next tofull.jsonl.How
CompactTranscript string(json:"compact_transcript,omitempty") toSessionFilePathsinapi/checkpoint/metadata.go, placed right after thetranscriptfield, and corrected theTranscriptdoc comment (it always points atfull.jsonl).writeSessionToSubdirectory(persistent.go), the path is derived directly from the tree entry: set to/<sessionPath>/transcript.jsonlonly when that entry exists. Deriving from the actual tree entry (rather than threading a separate signal) keeps the pointer from dangling, and follows the same write-once lifecycle as the existingtranscript/content_hashpointers.metadata.jsoncarries only offsets/identifiers, not afull.jsonlpath — socompact_transcriptis added in exactly the one place the full.jsonl path appears.Reviewer notes
checkpoint_transcript_start(no full-transcript-plus-offset change from feat(checkpoint): point metadata.json at full compact transcript.jsonl #1510).mise run lint(0 issues) andmise run test(6709 tests pass) verified locally.Rendered Markdown