Skip to content

Checkpoints v2: write compact transcript file + metadata#828

Merged
computermode merged 22 commits intomainfrom
write-transcript-main-ref
Apr 2, 2026
Merged

Checkpoints v2: write compact transcript file + metadata#828
computermode merged 22 commits intomainfrom
write-transcript-main-ref

Conversation

@computermode
Copy link
Copy Markdown
Contributor

@computermode computermode commented Apr 1, 2026

Writes the transcript.jsonl file to refs/entire/checkpoints/v2/main when the v2 checkpoints setting is enabled.

Tested locally:

➜  test-repo git:(test-v2-checkpoints) ✗ git show-ref refs/entire/checkpoints/v2/main
d4cea66ced1e346fa584113e982d16fc7c1a50d8 refs/entire/checkpoints/v2/main
➜  test-repo git:(test-v2-checkpoints) ✗ git show refs/entire/checkpoints/v2/main:3c/ed2b94d513/0/transcript.jsonl

{"v":1,"agent":"claude-code","cli_version":"v0.5.2-dev-717d7810c","type":"user","ts":"2026-04-01T20:52:39.072Z","content":[{"id":"c5e73887-be32-4c29-9461-ead695f305da","text":"update v2 to add \"testing again\""}]}
{"v":1,"agent":"claude-code","cli_version":"v0.5.2-dev-717d7810c","type":"assistant","ts":"2026-04-01T20:52:43.270Z","id":"msg_01BXKpfEoL22fQmiskWPSjbe","input_tokens":3,"output_tokens":123,"content":[{"id":"toolu_01USUsrAM8y5vt4i3z9qVhAj","input":{"pattern":"v2|test v2","output_mode":"files_with_matches"},"name":"Grep","result":{"output":"Found 2 files\ntest-v2.md\n.entire/settings.json","status":"success","matchCount":2},"type":"tool_use"}]}
{"v":1,"agent":"claude-code","cli_version":"v0.5.2-dev-717d7810c","type":"assistant","ts":"2026-04-01T20:52:47.454Z","id":"msg_0185d7DbCwbZYnYnVrMaWsXU","input_tokens":1,"output_tokens":75,"content":[{"id":"toolu_01J1do5pvCSyd327EtebzwkC","input":{"file_path":"/Users/ninawork/entire/test-repos/test-repo/test-v2.md"},"name":"Read","result":{"output":"1\ttesting v2\n2\t","status":"success","file":{"filePath":"/Users/ninawork/entire/test-repos/test-repo/test-v2.md","numLines":2}},"type":"tool_use"}]}
{"v":1,"agent":"claude-code","cli_version":"v0.5.2-dev-717d7810c","type":"assistant","ts":"2026-04-01T20:52:50.594Z","id":"msg_01J2S6HmZXNVFpcgYKzZJrKX","input_tokens":1,"output_tokens":120,"content":[{"id":"toolu_01AWD7CRQH1EACsSy91T8Swy","input":{"replace_all":false,"file_path":"/Users/ninawork/entire/test-repos/test-repo/test-v2.md","old_string":"testing v2","new_string":"testing v2\ntesting again"},"name":"Edit","result":{"output":"The file /Users/ninawork/entire/test-repos/test-repo/test-v2.md has been updated successfully.","status":"success","file":{"filePath":"/Users/ninawork/entire/test-repos/test-repo/test-v2.md"}},"type":"tool_use"}]}
{"v":1,"agent":"claude-code","cli_version":"v0.5.2-dev-717d7810c","type":"assistant","ts":"2026-04-01T20:52:54.560Z","id":"msg_015Nd5ycH2fJCAjQLJiaG9iL","input_tokens":1,"output_tokens":23,"content":[{"text":"Done. Added \"testing again\" on a new line in `test-v2.md`.","type":"text"}]}
➜  test-repo git:(test-v2-checkpoints) ✗ git ls-tree -r refs/entire/checkpoints/v2/main

100644 blob 6560fea9b1fd7f2b6a0c7114f2b7150a4b14f221	3c/ed2b94d513/0/metadata.json
100644 blob 5f52afef5f351f5f47a3ae1c9d96a099de5d6cba	3c/ed2b94d513/0/prompt.txt
100644 blob eb88d390b34ee8f7de5ce494f2e88dc322aa2f29	3c/ed2b94d513/0/transcript.jsonl
100644 blob 14587f39e987cb315b26e8ecd475d16186d826be	3c/ed2b94d513/0/transcript_hash.txt
100644 blob da48506b27531e8fe67eb24f426f1042fd277481	3c/ed2b94d513/1/metadata.json
100644 blob 54bd80c02ecc778a79652855ec2c26e5f1341cc5	3c/ed2b94d513/1/prompt.txt
100644 blob f9f36ff2d2a78f79ad154268f626d67d8ce0645d	3c/ed2b94d513/1/transcript.jsonl
100644 blob a3c68608f5db097698aef90cbd53562ad53074f0	3c/ed2b94d513/1/transcript_hash.txt
100644 blob 93f1890701bab01ed41554ae068ec07999563877	3c/ed2b94d513/metadata.json

Note

Medium Risk
Changes v2 checkpoint persistence semantics by adding new artifacts (transcript.jsonl + hash) to the permanent /main ref and updating stop-time finalization to rewrite them, which could affect consumers that read v2 metadata paths or expect transcripts only under /full/current. Logic is guarded by the v2 setting and includes redaction/skip-on-error behavior, but it touches core checkpoint storage/update flows.

Overview
Adds support for writing a compact, redacted transcript artifact to v2 checkpoints: transcript.jsonl plus transcript_hash.txt are now stored on refs/entire/checkpoints/v2/main alongside metadata/prompts, while raw full.jsonl remains on refs/entire/checkpoints/v2/full/current.

Extends checkpoint write/update options with CompactTranscript, updates v2 /main write + UpdateCommitted to create/replace these blobs and keep root metadata.json session paths in sync (with transcript/content_hash now optional). Manual-commit condensation and stop-time finalization now generate the compact format (with secret redaction) when v2 is enabled, and tests/integration assertions are updated to validate the new files and redaction behavior.

Written by Cursor Bugbot for commit caf0f33. Configure here.

computermode and others added 9 commits April 1, 2026 09:51
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 62d2f1146e6b
…lePaths

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 1069dd0fb5b4
Add three tests covering compact transcript write behavior:
- WriteCommittedMain writes transcript.jsonl and transcript_hash.txt
- WriteCommittedMain gracefully skips when CompactTranscript is nil
- UpdateCommitted writes compact transcript on update path

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: aacaa6dbe559
Add writeCompactTranscriptHash helper and integrate compact transcript
writing into both writeMainSessionToSubdirectory and updateCommittedMain.
When CompactTranscript bytes are provided, transcript.jsonl and
transcript_hash.txt are written alongside metadata.json and prompt.txt
on the /main ref. When nil, these files are simply not written.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 5ea183e58cf7
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: c7d57cdafde9
… finalization

Entire-Checkpoint: 3660294efee6
…nscript support

Entire-Checkpoint: dd0331b980df
@computermode computermode requested a review from a team as a code owner April 1, 2026 21:02
Copilot AI review requested due to automatic review settings April 1, 2026 21:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for writing a compact transcript.jsonl (Entire Transcript Format) and its hash to the v2 checkpoints /main ref during dual-write, so /main can carry lightweight transcript data while /full/current continues to store the raw transcript.

Changes:

  • Generate and attach a compact transcript during condensation and stop-time finalization when v2 checkpoints are enabled.
  • Persist transcript.jsonl + transcript_hash.txt to v2 /main, and expose their paths in SessionFilePaths.
  • Extend unit/integration tests to validate the compact transcript artifacts on v2 refs.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
cmd/entire/cli/strategy/manual_commit_hooks.go Generates compact transcript during stop-time finalization for v2 /main.
cmd/entire/cli/strategy/manual_commit_condensation.go Adds compact transcript generation helper and wires it into condensation writes.
cmd/entire/cli/paths/paths.go Introduces constants for compact transcript filename + hash filename.
cmd/entire/cli/integration_test/v2_dual_write_test.go Verifies compact transcript + hash exist on v2 /main in integration flows.
cmd/entire/cli/checkpoint/v2_store_test.go Adds unit tests for writing/updating compact transcript and hash on v2 /main.
cmd/entire/cli/checkpoint/v2_committed.go Implements writing compact transcript + hash on /main and updates related comments.
cmd/entire/cli/checkpoint/checkpoint.go Extends checkpoint option structs and SessionFilePaths to include compact transcript paths.

Comment thread cmd/entire/cli/strategy/manual_commit_hooks.go Outdated
Comment thread cmd/entire/cli/strategy/manual_commit_condensation.go
Comment thread cmd/entire/cli/checkpoint/v2_committed.go
Comment thread cmd/entire/cli/checkpoint/checkpoint.go
Comment thread cmd/entire/cli/strategy/manual_commit_condensation.go Outdated
Comment thread cmd/entire/cli/checkpoint/checkpoint.go Outdated
@computermode
Copy link
Copy Markdown
Contributor Author

bugbot review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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

Comment thread cmd/entire/cli/strategy/manual_commit_hooks.go
pfleidi
pfleidi previously approved these changes Apr 1, 2026
Entire-Checkpoint: bb38bf58960b
pfleidi
pfleidi previously approved these changes Apr 1, 2026
@computermode computermode merged commit 40a849b into main Apr 2, 2026
3 checks passed
@computermode computermode deleted the write-transcript-main-ref branch April 2, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants