checkpoint: make Write(WriteRequest) the only public persistent write · Entire
checkpoint: make Write(WriteRequest) the only public persistent write
ef0c5a0→main·
Soph·3w ago·25 files·+138 added/-137 removed
The committed write operations are now internal dispatch targets of Write(ctx, WriteRequest); callers use the request union exclusively: WriteCommitted -> writeSession (Write WriteSession{...}) UpdateCommitted -> backfillTranscript (Write BackfillTranscript{...}) UpdateSummary -> backfillSummary (Write BackfillSummary{...}) UpdateCheckpointSummary -> backfillAttribution (Write BackfillAttribution{...})
Production already wrote through the union; this migrates the test callers and unexports the dispatch targets, so 'Committed' is gone from the persistent write surface and Write is the single entry point. No behavior change.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Sessions
608f3d762503View transcript
Changes
25
cmd/entire/cli
Mattach_test.go+2/-2
- Mattribution_test.go+1/-1
- benchutil
Mbench_test.go+1/-1
checkpoint
Mbackwards_compat_test.go+1/-1
- Mblob_resolver_test.go+1/-1
- Mcheckpoint.go+6/-5
- Mcheckpoint_test.go+46/-46
- Mcommitted.go+10/-10
- Mcommitted_opf_trailer_test.go+1/-1
- Mcommitted_phantom_paths_test.go+2/-2
- Mcommitted_read_store_test.go+1/-1
- Mcommitted_reader_resolve_test.go+2/-2
- Mcommitted_update_test.go+19/-19
- Mcommitted_write.go+10/-10
dispatch
Mmode_local_test.go+3/-3
Mexplain_export_test.go+2/-2
- Mexplain_test.go+17/-17
- Mhead_checkpoint_flags_test.go+1/-1
- Mresume_test.go+5/-5
- Mreview_context_test.go+1/-1
- Mstatus_test.go+1/-1
- strategy
Mclean_test.go+1/-1
- Mmanual_commit_opf_rewrite_test.go+1/-1
- Mmanual_commit_test.go+2/-2
- Mrewind_test.go+1/-1
424 unmodified lines
### Example Code
```python
# Seed the local branch with a checkpoint representing Alice's session.
alicesCheckpoint = id.MustCheckpointID("abcdef012345")
store = cpkg.NewGitStore(repo, cpkg.DefaultV1Refs())
if writeErr := store.WriteCommitted(context.Background(), cpkg.WriteOptions{
if writeErr := store.Write(context.Background(), cpkg.WriteSession{
CheckpointID: alicesCheckpoint,
SessionID: "alice-original",
Strategy: "manual-commit",
Other Important Functions
// CheckpointInfo contains summary information about a committed checkpoint.
type CheckpointInfo struct {
// CheckpointID is the stable 12-hex-char identifier
CheckpointID id.CheckpointID
}
// PrecomputeTranscriptBlobs holds blob hashes for a transcript that was
// chunked and written to the object store once, for reuse across multiple
// UpdateCommitted calls sharing the same transcript content.
func PrecomputeTranscriptBlobs(ctx context.Context, repo *git.Repository, transcript redact.RedactedBytes, agentType types.AgentType) (*PrecomputedTranscriptBlobs, error) {
raw := transcript.Bytes()
// The error handling demonstrates best practices applying to the checkpoint storage.
if err := store.UpdateCommitted(context.Background(), UpdateOptions{}) {
// Error handling logic
}
// UpdateSummary updates the summary field in the latest session's metadata.
{