ReadCommitted() navigates to the specific sharded path (e.g., a3/b2c4d5e6f7/) on entire/sessions
Only reads full.jsonl from that checkpoint's directory
Each checkpoint has its own isolated transcript stored at its sharded path.
2. Branch Filtering
Working correctly with sophisticated filtering:
Shows ALL checkpoints in history (up to limit)
User
and are we sure that the full.jsonl is the cut-down agent transcript?
Assistant
Good question - let me verify what actually gets written to full.jsonl during checkpoint creation.
Assistant
So full.jsonl contains the entire session transcript up to that checkpoint, not a delta. Each checkpoint stores the complete accumulated transcript from session start.
Concrete example - if a user makes 10 prompts:
Checkpoint
Contents of full.jsonl
1
Prompt 1
2
Prompts 1-2
5
Prompts 1-5 (NOT just 4-5)
10
Prompts 1-10
Now regarding your follow-up question about transcript_identifier_at_start and transcript_lines_at_start - those fields exist precisely to enable computing the delta! Let me find how they're used.
Assistant
Now let me check if these fields are actually used to slice the transcript, or just stored for informational purposes.
Assistant
Let me search where these fields are actually read (not written):
Assistant
Now I can give you the complete answer.
The TranscriptIdentifierAtStart and TranscriptLinesAtStart fields are stored but NOT used.
Looking at explain.go:
Lines 263-268 - generateCheckpointSummary() passes result.Transcript directly to the summariser:
go
if len(result.Transcript) == 0 {
return fmt.Errorf("checkpoint %s has no transcript to summarise", checkpointID)
}
condensed, err := summarise.BuildCondensedTranscriptFromBytes(result.Transcript)
No slicing - The metadata fields are available in and , but they're never read in the explain command.
User
for explain, the prompts we show should be scoped to that checkpoint. The same goes for the summary (for now).
Assistant
I'll implement scoping for prompts and summaries to the checkpoint's portion of the transcript. Let me first understand how the transcript is structured and where slicing should happen.
Assistant
Let me check how prompts are stored and if they're already scoped:
Assistant
Now I have a clear picture. The issue is:
prompt.txt stores ALL prompts from the session (not scoped)
full.jsonl stores the full cumulative transcript
TranscriptLinesAtStart is stored but never used
The fix: When displaying prompts or generating summaries, slice the transcript using TranscriptLinesAtStart and extract prompts only from that portion.
Let me implement this with TDD.
Assistant
I'll implement the transcript scoping for entire explain using TDD.
Understanding the Problem
TranscriptLinesAtStart tracks the line count when a checkpoint started
Currently, explain shows ALL prompts and summarizes the FULL transcript
Need to slice to only show content from line TranscriptLinesAtStart onwards
Let me start with a failing test for the transcript slicing helper.
Assistant
Now I'll write a failing test for the SliceFromLine function:
Assistant
Now let me run the test to verify it fails:
Assistant
Test fails as expected (function doesn't exist). Now let me implement the minimal code to pass:
Assistant
All tests pass. Now let me run all transcript tests to make sure I didn't break anything:
Assistant
All tests pass. Now I need to use this function in the explain command. Let me look at how to integrate it:
Assistant
I need to:
Use SliceFromLine to scope the transcript in generateCheckpointSummary
Use it in formatCheckpointOutput for prompts display
But first, I need to also add a helper to extract prompts from the sliced transcript. Looking at the code, result.Prompts is already populated from prompt.txt, but that contains ALL prompts. I need to re-extract from the sliced transcript.
Let me check how prompts are extracted:
Assistant
The cleanest approach is to add a helper in the transcript package that extracts prompts from transcript bytes. Let me check what the transcript package already has.
Actually, looking at the code flow:
result.Transcript contains the full JSONL bytes
result.Metadata.TranscriptLinesAtStart tells us where to slice
I need to slice the transcript, then extract prompts from it
Let me add a function to extract prompts from transcript bytes in the transcript package, then use it in explain.go.
Actually, let me check the summarise package - it already has BuildCondensedTranscriptFromBytes which parses the transcript. Maybe I can use that and filter for user entries.
Looking at the code:
Assistant
The file is very long. Let me add a test for the scoped transcript behavior at the end:
Assistant
Now let me add a test for the scoped transcript behavior:
Assistant
Now let me run these tests to verify they fail (functions don't exist yet):
Assistant
Tests fail as expected. Now let me implement the helper functions and modify formatCheckpointOutput:
Assistant
Now let me add the helper functions before formatCheckpointOutput:
Assistant
Now let me modify formatCheckpointOutput to use scoped prompts. First, let me read the current implementation:
Assistant
Now I need to modify the function to use scoped prompts. The key insight is:
Use TranscriptLinesAtStart from metadata to scope the transcript
Extract prompts from the scoped transcript instead of using result.Prompts
Assistant
Now I also need to update generateCheckpointSummary to use the scoped transcript. Let me read that function:
Assistant
Now let me run the tests to see if they pass:
Assistant
All new tests pass. Now let me run the full test suite for the affected packages to make sure I didn't break anything:
Assistant
I see a FAIL at the end. Let me check for specific failures:
Assistant
There's a failing test. Let me see what's wrong:
Assistant
The test is failing because it's checking that prompts appear, but now we extract prompts from the scoped transcript (which is empty when there's no transcript in the test data). Let me look at the test:
Assistant
The test doesn't provide a Transcript field, so when we scope it, we get nothing and there are no prompts to extract. I need to update this test to include a transcript that matches the prompts. Let me fix it:
Assistant
Now let me run the test again:
Assistant
Now let me run all tests to make sure everything passes:
Assistant
All tests pass. Now let me run the full test suite and lint:
Assistant
All tests pass and linting is clean. Let me provide a summary of the changes:
Summary
I've implemented transcript scoping for entire explain to ensure that prompts and summaries are scoped to only the checkpoint-specific content, not the entire session transcript.
Changes Made
1. cmd/entire/cli/transcript/parse.go
Added SliceFromLine(content []byte, startLine int) []byte - slices a JSONL transcript to skip the first N lines, returning only content from onwards
User
/compact
compact
let's do a review
User
let's review the code we've created for this branch
Assistant
I'll read the relevant files to review the changes made on this branch.
Assistant
Let me also read the test files.
Assistant
Let me run the tests to ensure everything passes.
Assistant
On main/master:
On feature branches: Shows ONLY checkpoints unique to that branch (filters out commits reachable from main)
The implementation precomputes a hash set of commits reachable from main for O(1) lookup, then skips any commits already in that set. Also includes temporary checkpoints from shadow branches whose base commit is reachable from current HEAD.
3. --generate Summary Scope
Only summarizes the related checkpoint's transcript.
In generateCheckpointSummary():
Takes result.Transcript from ReadCommitted() (checkpoint-specific)
Passes ONLY that transcript to summarise.BuildCondensedTranscriptFromBytes()
Generates summary from the condensed checkpoint transcript
No cross-checkpoint or whole-session merging happens.
Summary: All three behaviors are scoped to the individual checkpoint, not the whole session. Branch filtering is also working as designed. Is there a specific behavior you expected to be different, or a bug you're investigating?
result.Metadata.TranscriptLinesAtStart
result.Metadata.TranscriptIdentifierAtStart
Summary
Question
Answer
What is full.jsonl?
The entire session transcript up to that checkpoint (cumulative)
What do the *AtStart fields do?
Nothing currently - they're stored but never consumed
What should they do?
Allow slicing the transcript to get only the delta since the previous checkpoint
Example with 10 prompts:
Checkpoint 5's full.jsonl = prompts 1-5
transcript_lines_at_start: 44 = the transcript had 44 lines when checkpoint 5 started
Currently:explain -c 5 returns all of prompts 1-5 and --generate summarizes all 5
Intended?: Should return/summarize only lines 45+ (the delta)
This looks like scaffolding for a feature that was never completed. Do you want to implement the transcript slicing, or is the current cumulative behavior intentional?
summarise.BuildCondensedTranscriptFromBytes(content) returns []Entry with User, Assistant, and Tool entries
I can filter for EntryTypeUser to get prompts
So the approach is:
Slice the transcript using transcript.SliceFromLine
Pass sliced transcript to summarise.BuildCondensedTranscriptFromBytes
Filter for user entries to get prompts
Let me implement this in explain.go. First, let me write a test for the explain functionality.
The cleanest approach is to:
Slice the transcript with transcript.SliceFromLine
Use summarise.BuildCondensedTranscriptFromBytes to parse it
Filter for user entries to extract prompts
Let me write a test for the scoping behavior in explain, then implement the fix:
startLine
2. cmd/entire/cli/explain.go
Added import for transcript package
Added scopeTranscriptForCheckpoint(fullTranscript []byte, linesAtStart int) - wrapper that uses transcript.SliceFromLine
Added extractPromptsFromTranscript(transcriptBytes []byte) []string - extracts user prompts from transcript bytes using the summarise package
Modified formatCheckpointOutput() to:
Scope the transcript using TranscriptLinesAtStart from metadata
Extract prompts from the scoped transcript instead of using result.Prompts
Display only checkpoint-specific prompts in verbose output
Modified generateCheckpointSummary() to:
Scope the transcript before generating the AI summary
Summarize only the checkpoint-specific portion
3. Tests Added
TestSliceFromLine_* tests in transcript/parse_test.go
TestScopeTranscriptForCheckpoint_* tests in explain_test.go
TestExtractPromptsFromScopedTranscript in explain_test.go
TestFormatCheckpointOutput_UsesScopedPrompts in explain_test.go
How It Works
The TranscriptLinesAtStart field in checkpoint metadata tracks the line count when a checkpoint started. Now:
For entire explain -c {checkpoint}: Prompts shown are extracted from only the checkpoint's portion of the transcript (lines from TranscriptLinesAtStart onwards)
For --generate: The AI summary is generated from only the checkpoint's transcript portion, not the full session
This ensures that when viewing a checkpoint, you see only what happened during that checkpoint, not everything that happened since the session started.
All tests pass. Here's my review of the code created for this branch:
Code Review: Checkpoint-Scoped Transcript Feature
Summary
The branch implements scoping of transcripts for entire explain -c {checkpoint}, ensuring prompts and summaries show only content relevant to the specific checkpoint rather than the entire session.
Changes Overview
File
Lines Added
Purpose
transcript/parse.go
+35
SliceFromLine() function to slice transcripts
transcript/parse_test.go
+90
Comprehensive tests for the new function
explain.go
+67
Scoping helpers and integration
explain_test.go
+122
Tests for scoping behavior
Code Quality Assessment
✅ Strengths
Clean separation of concerns - SliceFromLine() is a pure utility function in the transcript package, making it reusable and testable in isolation.
Proper TDD approach - Tests exist for:
Zero start line returns all content
Skipping N lines
Handling more lines than exist (returns nil)
Empty content handling
Files without trailing newlines
Defensive coding - The SliceFromLine function handles edge cases well:
Good documentation - Function comments explain the purpose and behavior clearly:
go
// SliceFromLine returns the content starting from line number `startLine` (0-indexed).
// This is used to extract only the checkpoint-specific portion of a cumulative transcript.
Integration is minimally invasive - The changes to formatCheckpointOutput and generateCheckpointSummary use the new scoping helpers without disrupting existing functionality.
The implementation is solid. The code correctly uses the existing TranscriptLinesAtStart metadata field to scope transcripts, addressing the requirement that entire explain -c {checkpoint} shows only content relevant to that checkpoint.
The changes are well-tested, minimally invasive, and follow the existing patterns in the codebase.