Add Compact Transcript Metadata Field · Entire
Summary
Following this pull request, instead of pointing metadata.json at the compact transcript.jsonl file, we actually want to update the metadata.json differently: just add a new field that says has_compact_transcript: true if it's available. Otherwise, it can be omitted.
Changes:
File:
api/checkpoint/metadata.go
AddedHasCompactTranscript boolwithjson:"has_compact_transcript,omitempty"toSessionFilePaths, and corrected theTranscriptfield comment.File:
cmd/entire/cli/checkpoint/persistent.go
InwriteSessionToSubdirectory, set the flag by checking whether the compact transcript entry actually exists in the tree.File:
tests/persistent_compact_transcript_test.go
Asserthas_compact_transcript == truefor a compactable transcript andfalsefor a non-compactable one.File:
docs/architecture/sessions-and-checkpoints.md
Updated the pointer description and the JSON example.
Verification:
Run the following to verify correctness:
go build ./...mise run lintgo test ./cmd/entire/cli/checkpoint/... ./api/checkpoint/...
Phase 0 — Gather the diff
Run git diff @{upstream}...HEAD (or other commands as necessary) to get the unified diff under review.
Phase 1 — Review
Launch 4 independent review agents via the Agent tool, passing each agent the diff and a specific angle of review:
- Reuse: Flag new code that re-implements something the codebase already has.
- Simplification: Flag unnecessary complexity the diff adds.
- Efficiency: Flag wasted work the diff introduces.
- Altitude: Confirm changes are implemented at the right depth.
Phase 2 — Apply the fixes
Wait for all four agents to complete, deduplicate findings that point at the same line or mechanism, and fix remaining issues directly.
Cleanup summary
Reviewed the diff across all four angles. The diff was already small and clean; one fix was applied. Fixed simplification regarding the previous implementation's readability and efficiency.
No findings in Reuse, Altitude.
Conclusion
The HasCompactTranscript correctly follows the lifecycle protocols established by previous session pointers. Additional improvements to documentation were made to reflect these changes.
Example metadata.json structure:
{ "cli_version": "0.5.1", "checkpoint_id": "0009b566bbbc", "sessions": [ { "metadata": "/00/09b566bbbc/0/metadata.json", "transcript": "/00/09b566bbbc/0/full.jsonl", "compact_transcript": "/00/09b566bbbc/0/transcript.jsonl", "content_hash": "/00/09b566bbbc/0/content_hash.txt" } ] }
Final Notes: Verified all relevant tests and builds succeeded with no lint issues.