checkpoint: centralize store construction behind Open (Phase 0) - #1451
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Centralizes checkpoint store construction behind a new checkpoint.Open(ctx, repo, OpenOptions) facade (Phase 0 of pluggable checkpoint stores), migrating production call sites away from scattered NewGitStore(repo, ResolveCommittedRefs(ctx)) creation while preserving current behavior and keeping *GitStore as the concrete backing.
Changes:
- Introduces
cmd/entire/cli/checkpoint/open.gowithOpenOptionsandStoresfacade (Primary,Temporary(),Refs(),Repository()). - Migrates strategy/CLI/dispatch paths to use
checkpoint.Open(...)and threads errors where the facade will eventually become fallible. - Updates affected tests and function signatures (notably
generateCheckpointSummary).
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/checkpoint/open.go | Adds the centralized Open seam and Stores facade for committed + temporary access. |
| cmd/entire/cli/checkpoint/committed.go | Switches in-package LookupSessionLog to construct stores via Open. |
| cmd/entire/cli/strategy/manual_commit.go | Replaces strategy-local store construction with checkpoint.Open, returns (*GitStore, error). |
| cmd/entire/cli/strategy/manual_commit_git.go | Updates SaveStep / SaveTaskStep to handle new getCheckpointStore error return. |
| cmd/entire/cli/strategy/manual_commit_condensation.go | Migrates committed checkpoint reads to Open and propagates open errors. |
| cmd/entire/cli/strategy/manual_commit_rewind.go | Migrates store construction in rewind paths (including RestoreLogsOnly) to Open. |
| cmd/entire/cli/strategy/manual_commit_hooks.go | Uses Open in post-commit/finalize paths; uses stores.Temporary() for temporary writes and stores.Refs() for mirroring. |
| cmd/entire/cli/strategy/common.go | Uses Open for ListCheckpoints committed listing. |
| cmd/entire/cli/strategy/cleanup.go | Uses Open for committed checkpoint listing during orphan detection. |
| cmd/entire/cli/strategy/manual_commit_test.go | Updates tests to handle getCheckpointStore now returning an error. |
| cmd/entire/cli/rewind.go | Uses Open and routes committed vs temporary operations via stores.Primary / stores.Temporary(). |
| cmd/entire/cli/review_context.go | Uses Open to read committed checkpoint context (best-effort on failures). |
| cmd/entire/cli/resume.go | Uses Open with blob fetcher injection and routes topology reads via stores.Refs(). |
| cmd/entire/cli/head_checkpoint_flags.go | Uses Open for committed summary read (best-effort on failures). |
| cmd/entire/cli/explain.go | Uses Open for temporary explain path and summary generation; updates generateCheckpointSummary to take *checkpoint.Stores. |
| cmd/entire/cli/explain_test.go | Updates summary-generation test to use Open/Stores facade. |
| cmd/entire/cli/dispatch/mode_local.go | Uses Open to list committed checkpoints with repo-scoped settings context. |
| cmd/entire/cli/attribution.go | Uses Open with blob fetcher injection for attribution resolver store creation. |
| cmd/entire/cli/attach.go | Adds openAttachStore helper and migrates attach code paths to Open while preserving explicit ref pinning. |
Replace the scattered NewGitStore(repo, ResolveCommittedRefs(ctx)) construction across cli, strategy, dispatch, and the in-package LookupSessionLog with a single seam: checkpoint.Open(ctx, repo, OpenOptions) (*Stores, error). This lands the final facade signature now (issue #1433 Phase 0) so call sites migrate only once: Stores.Primary holds the concrete *GitStore today and the same instance backs Temporary(); later phases narrow Primary to a pluggable committed-store interface and add independent-backend mirrors without further call-site churn. The facade exposes Temporary()/Refs()/Repository() so callers no longer reach for the concrete type, and OpenOptions carries the CLI-level BlobFetcher plus explicit Settings/Refs overrides (attach keeps its injected-settings / PrimaryAsRead topology). Pure mechanical, no behavior change. Notes: - getCheckpointStore now returns (*GitStore, error) (propagated through its callers); the old withBlobFetcher folds into OpenOptions.BlobFetcher. - generateCheckpointSummary takes the facade since it needs both the committed writer and Repository(); its mirror still resolves refs from settings (ResolveCommittedRefs) to preserve exact behavior. - Type is checkpoint.Stores (not CheckpointStores) to avoid the revive stutter; Open's always-nil error is the forward-looking facade contract. - benchutil and test files keep using NewGitStore, which Open wraps. Refs #1433 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Entire-Checkpoint: c11527631d6b
Soph
force-pushed
the
soph/pluggable-stores-phase0
branch
from
June 17, 2026 19:13
18b938d to
0747ca9
Compare
pfleidi
approved these changes
Jun 18, 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/593
Phase 0 of #1433 (pluggable checkpoint stores).
What
Replace the scattered
NewGitStore(repo, ResolveCommittedRefs(ctx))construction acrosscli,strategy,dispatch, and the in-packageLookupSessionLogwith a single seam:This lands the final facade signature now so call sites migrate only once.
Stores.Primaryholds the concrete*GitStoretoday and the same instance backsTemporary(); later phases narrowPrimaryto a pluggable committed-store interface and add independent-backend mirrors without further call-site churn. The facade exposesTemporary()/Refs()/Repository()so callers no longer reach for the concrete type, andOpenOptionscarries the CLI-levelBlobFetcherplus explicitSettings/Refsoverrides (attach keeps its injected-settings /PrimaryAsReadtopology exactly).Pure mechanical, no behavior change.
Notes / decisions
NewGitStoresites migrated; the ~131 test-file sites andbenchutilkeep usingNewGitStore, whichOpennow wraps.getCheckpointStorereturns(*GitStore, error)(propagated through its callers); the oldwithBlobFetcherfolds intoOpenOptions.BlobFetcher.generateCheckpointSummarytakes the facade since it needs both the committed writer andRepository(); its mirror still resolves refs from settings (ResolveCommittedRefs) to preserve exact behavior.checkpoint.Stores(notCheckpointStores) to avoid therevivestutter;Open's always-nil error is documented as the forward-looking facade contract.Verification
go build ./...✓ ·mise run lint→ 0 issues ·checkpoint/strategy/dispatch/clipackage tests ✓.Refs #1433
🤖 Generated with Claude Code
Note
Low Risk
Refactor-only consolidation of store construction across many files; git backend behavior is unchanged and errors are propagated consistently at new open sites.
Overview
Phase 0 introduces
checkpoint.Open(ctx, repo, OpenOptions)and aStoresfacade (Primary,Temporary(),Refs(),Repository()) so committed-ref resolution, optionalBlobFetcher, andSettings/Refsoverrides live in one place instead of repeatedNewGitStore(repo, ResolveCommittedRefs(ctx))wiring.Production call sites across attach, explain, resume, rewind, attribution, dispatch, strategy hooks, and
LookupSessionLognow open stores through this seam. Attach usesopenAttachStorewith explicitRefs(includingPrimaryAsRead()) so injected settings and read pinning stay intact. Manual commit foldswithBlobFetcherintoOpenOptionsand makesgetCheckpointStorereturn(*GitStore, error); paths that need shadow-branch I/O useStores.Temporary()rather than treating the committed store as the temp capability.Intended as a mechanical migration with no deliberate behavior change; tests largely still construct
NewGitStoredirectly where convenient.Reviewed by Cursor Bugbot for commit 18b938d. Configure here.