checkpoint: trim compact_transcript comments and test verbosity · Entire

checkpoint: trim compact_transcript comments and test verbosity

Sessions

cc1dc940b7caView transcript

Changes

3

383 unmodified lines

// (rewind/resume/explain) resolve by filename.
Transcript string `json:"transcript,omitempty"`
// CompactTranscript points at the compact transcript.jsonl when one was
// generated and written into this session's directory alongside full.jsonl.
// Omitted for non-compactable, empty, or oversized transcripts and for
// checkpoints written by older CLI versions.
CompactTranscript string `json:"compact_transcript,omitempty"`
ContentHash       string `json:"content_hash,omitempty"`
Prompt            string `json:"prompt"`

Mapi/checkpoint/metadata.go+2/-3

403 unmodified lines

// Write transcript. The Transcript pointer targets full.jsonl, which CLI
// rewind/resume/explain read by filename. The compact transcript.jsonl is
// also written into the tree (so it is pushed) and pointed at by
// CompactTranscript below for external readers.
// Write transcript. Transcript points at full.jsonl (CLI
// rewind/resume/explain read it by filename); the compact transcript.jsonl,
// when written, is also pushed and pointed at by CompactTranscript.
wroteTranscript, err := s.writeTranscript(ctx, opts, sessionPath, entries)
if err != nil {
    return filePaths, err
}

if wroteTranscript {
    filePaths.Transcript = "/" + sessionPath + paths.TranscriptFileName
    filePaths.ContentHash = "/" + sessionPath + paths.ContentHashFileName
    // Point at the compact transcript.jsonl when writeTranscript wrote one
    // into the tree (best-effort; skipped for non-compactable, empty, or
    // oversized transcripts). Derived from the actual tree entry so the
    // pointer can never dangle.
    if _, ok := entries[sessionPath+paths.CompactTranscriptFileName]; ok {
        filePaths.CompactTranscript = "/" + sessionPath + paths.CompactTranscriptFileName
    }
}

Mcmd/entire/cli/checkpoint/persistent.go+5/-8

79 unmodified lines

t.Error("compact transcript missing assistant content")

// Root metadata.json still points at full.jsonl via transcript; the compact
// transcript is written into the tree (and pushed) and pointed at by
// compact_transcript.
// Root metadata.json: transcript points at full.jsonl, compact_transcript
// at transcript.jsonl.
summary := readSummaryFromBranch(t, repo, cpID)
if len(summary.Sessions) != 1 {
    t.Fatalf("session count = %d, want 1", len(summary.Sessions))
}

Mcmd/entire/cli/checkpoint/persistent_compact_transcript_test.go+2/-3