checkpoint: split-store foundation (Open factory + Stores facade + reader split)#1480
Merged
Conversation
Replace the combined checkpoint Store interface with committed, temporary, and optional author capabilities. This keeps the current GitStore implementation while making the committed storage surface independent from shadow-branch operations. Entire-Checkpoint: b6e36ed89559
Expose committed and temporary checkpoint storage through separate interfaces from the Stores facade. Call sites now depend on committed readers and writers or temporary shadow-branch storage instead of the concrete GitStore. Entire-Checkpoint: bb51dce048b6
SaveStep, SaveTaskStep, and GetRewindPoints each repeated the getCheckpointStores + Temporary() pair. A getTemporaryStore accessor mirrors getCheckpointStore so each call site is a single line, with getCheckpointStores remaining the shared open-with-blob-fetcher wrapper. Entire-Checkpoint: 684fdbdfe046
Keep empty-session checkpoints distinct from missing checkpoints when reading latest session content. Also narrow resume checkpoint metadata resolution to the methods it actually uses so the split store interfaces stay precise. Entire-Checkpoint: 8e67ab6c5252
Exercise the concrete GitStore latest-session reader in the redaction failure regression test. This keeps the test checking that dropped transcripts surface ErrNoTranscript after condensation still writes checkpoint metadata. Entire-Checkpoint: 02eff406bed3
Keep attribution resolution dependent only on the committed summary and session metadata methods it uses. Add a focused test with a reader that omits unused session-content methods so the local interface stays precise. Entire-Checkpoint: 136650505f9c
Return ErrCheckpointNotFound for empty committed summaries in the split reader helper. This keeps the interface split behavior-neutral and updates the regression test to cover the pre-split contract. Entire-Checkpoint: b7a703224f22
Contributor
There was a problem hiding this comment.
Pull request overview
This PR lays the groundwork for pluggable checkpoint storage by centralizing checkpoint-store construction and splitting the previously “fat” store surface into narrower committed vs temporary (shadow-branch) reader capabilities, then migrating key callers to the new abstractions.
Changes:
- Introduces
checkpoint.Open(ctx, repo, OpenOptions)and acheckpoint.Storesfacade to centralize store wiring (refs topology + blob fetcher) and exposePrimary(committed) +Temporary()(git-only). - Splits committed/temporary reader interfaces and migrates strategy + CLI call sites away from
*checkpoint.GitStorewhere possible. - Adds/updates tests to validate the narrowed interfaces and edge-case behavior (including empty-summary not-found handling).
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/strategy/manual_commit.go | Adds getCheckpointStores helper and splits strategy access into committed vs temporary store capability. |
| cmd/entire/cli/strategy/manual_commit_test.go | Updates a condensation test to construct a store directly after getCheckpointStore now returns an interface. |
| cmd/entire/cli/strategy/manual_commit_rewind.go | Switches rewind-point discovery to use checkpoint.TemporaryStore. |
| cmd/entire/cli/strategy/manual_commit_git.go | Routes shadow-branch writes through getTemporaryStore (TemporaryStore). |
| cmd/entire/cli/strategy/manual_commit_condensation.go | Updates documentation/comments to reflect committed-store abstraction. |
| cmd/entire/cli/resume.go | Narrows resume’s dependency from *GitStore to a smaller reader interface. |
| cmd/entire/cli/resume_test.go | Adds a stub-based test proving resolveLatestCheckpoint only needs the narrowed reader surface. |
| cmd/entire/cli/explain.go | Moves author lookup behind optional checkpoint.AuthorReader and uses TemporaryStore for temporary explains. |
| cmd/entire/cli/checkpoint/store.go | Updates compile-time interface assertions to the new split interfaces. |
| cmd/entire/cli/checkpoint/open.go | Implements the Stores facade (Primary + Temporary() + resolved Refs()). |
| cmd/entire/cli/checkpoint/committed.go | Switches LookupSessionLog to committed-reader helpers instead of GitStore methods. |
| cmd/entire/cli/checkpoint/committed_reader_resolve.go | Defines new committed-store interfaces and adds reader helper utilities. |
| cmd/entire/cli/checkpoint/committed_reader_resolve_test.go | Adds coverage for the empty-summary not-found behavior in the new helpers. |
| cmd/entire/cli/checkpoint/checkpoint.go | Replaces the old combined Store interface with the git-only TemporaryStore surface. |
| cmd/entire/cli/attribution.go | Introduces a narrowed reader interface for attribution and normalizes nil summary handling. |
| cmd/entire/cli/attribution_test.go | Adds a stub-based test validating attribution’s narrower checkpoint reader dependency. |
| cmd/entire/cli/attach.go | Adjusts attach store opening to return CommittedStore capability (interface) instead of *GitStore. |
pfleidi
approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://entire.io/gh/entireio/cli/trails/622
What
Foundation slice of the pluggable checkpoint-store work (#1433). This is the durable base carved out of #1474 — the first 7 commits, unchanged, all authored by @pfleidi:
checkpoint.Open(ctx, repo, OpenOptions)factory — single construction site for the store, replacing ~15 scatteredNewGitStorecalls. Resolves the committed-ref topology and wires the on-demand blob fetcher in one place.checkpoint.Storesfacade —Primary(committed store) +Temporary()(git-only shadow-branch capability) + resolvedRefs().attachinjects its own instance viaOpenOptions{Refs: …}to preservePrimaryAsRead()pinning.*GitStore.getTemporaryStorestrategy helper, reader edge-case fixes, attribution-reader narrowing, and the empty-summary lookup fix.What this intentionally does not include
The
committed_domain.goadapter tail from #1474 (the functional-optionsWriteSession/UpdateSession/UpdateCheckpointwriter surface) is dropped here on purpose. That writer shape is being reconsidered: per the design discussion on #1433, the target is a single unqualifiedStore.Write(ctx, WriteRequest)command union rather than a bag of functional options spread across session/checkpoint writers. Landing the options surface here and then replacing it would mean reviewing the writer API twice.Stacked plan
This is PR 1 of 3, each one kind of change:
Openfactory,Storesfacade, reader split, caller migration.Store.Write(ctx, WriteRequest)union (WriteSession/BackfillTranscript/BackfillSummary/BackfillAttribution) + theSessionRef-based reader domain. Pure interface+impl redesign, no file moves.agent/session/review/TUI deps from the contract (pushTokenUsage/SkillEventinto a leaf types package) and relocate the contract togithub.com/entireio/cli/api/checkpointso the backend can import it.Supersedes #1474.
Verification
go build ./...,go vet,mise run fmt(clean),mise run lint(0 issues), and unit tests for the touched packages (checkpoint/...,cmd/entire/cli,strategy) all green.Note
Medium Risk
Touches core checkpoint read/write and manual-commit save/rewind paths across many call sites, but the change is largely interface/factory wiring with added unit tests rather than new storage semantics.
Overview
Introduces
checkpoint.Openas the single construction path for checkpoint storage, returning aStoresfacade withPrimary(CommittedStore) andTemporary()(TemporaryStore), plus resolved ref topology (attach still injectsOpenOptions.Refsfor read pinning).Replaces the monolithic
Storeinterface with narrower committed/temporary capability interfaces (CommittedStore,TemporaryStore,AuthorReader, etc.) and updates CLI/strategy call sites to depend on those types instead of*GitStore.Manual-commit shadow-branch work (
SaveStep, rewind, explain temp paths) now goes throughgetTemporaryStore; committed reads/writes stay ongetCheckpointStore. Attribution and resume narrow further via local reader interfaces and shared read helpers;LookupSessionLogroutes throughReadRawSessionLogForCheckpoint, with a fix so empty session summaries surfaceErrCheckpointNotFound.Reviewed by Cursor Bugbot for commit f39e8db. Configure here.