Extract checkpoint write helpers into treeWriter (no behavior change)

main

Commit

Soph2mo ago

Refactor toward the per-checkpoint git-ref store (#1471): isolate the repo-only "build one checkpoint's subtree" machinery from the git-branch store so a second backend can share it instead of duplicating it.

  • The repo-only entry/subtree builders (writeStandardCheckpointEntries, writeTaskCheckpointEntries, writeSessionToSubdirectory, writeCheckpointSummary, findSessionIndex, reaggregateFromEntries, replaceTranscript, replaceSkillEvents, writeTranscript/writeCompactTranscript, copyMetadataDir, readSummaryFromBlob, readMetadataFromBlob, buildCommitMessage) move from *GitStore to a new *treeWriter; GitStore embeds *treeWriter so call sites resolve via promotion.
  • GitStore's four write methods route through shared appliers anchored at the checkpoint-dir root; the git-branch store keeps splicing the result under <shard>/<id>/ into the v1 tree, so the committed v1 tree is byte-identical. writeCheckpointSummary now takes the checkpoint-version to stamp.

Behavior-preserving: the git-branch checkpoint, strategy, and integration suites are unchanged. Nothing constructs a second backend yet.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 99d650653e0c

Checkpoints

Build Checkpoints Store Based on Design

Claude Code
View session
Checkpoint 1