Phase 1: mirror committed checkpoints to v1 custom ref (opt-in, local-only)#1300
Conversation
Phase 1 of the v1.1 rollout: when strategy_options.checkpoints_version is "1.1", advance a local-only v1 custom ref (refs/entire/checkpoints/v1.1) to the v1 metadata branch's commit after each committed checkpoint write (condensation + finalization). v1 stays the source of truth; nothing reads the custom ref and it is never pushed or fetched in this phase. Implemented as a small post-write ref-sync helper rather than the plan's MirroringCommittedStore wrapper, avoiding GitStore and WriteCommitted/UpdateCommitted signature changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: 73f0dc5db2be
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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
Reviewed by Cursor Bugbot for commit 8007d39. Configure here.
There was a problem hiding this comment.
Pull request overview
Phase 1 of a staged v1.1 checkpoints rollout. When strategy_options.checkpoints_version is "1.1" (or JSON number 1.1), committed checkpoint metadata written to the existing v1 branch is additionally mirrored locally to a new custom ref refs/entire/checkpoints/v1.1. v1 remains authoritative; the new ref is never read, fetched, or pushed in this PR. Mirror failures are logged only and never affect the underlying v1 write.
Changes:
- Add
paths.MetadataRefName = "refs/entire/checkpoints/v1.1"and amirrorMetadataToV1CustomRefhelper invoked afterWriteCommittedinCondenseSessionand once after thefinalizeAllTurnCheckpointsupdate loop. - Recognize
"1.1"/1.1as a validcheckpoints_versionmapping to v1 data format (avoids the "unsupported version" warning) and addMirrorsToV1CustomRefgate on both package andEntireSettings. - Add unit, integration, and pre-push tests covering enabled/disabled mirroring, advancing/missing-ref cases, and the invariant that the custom ref is never pushed.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/paths/paths.go | Adds MetadataRefName constant for the v1.1 custom ref. |
| cmd/entire/cli/settings/settings.go | Recognizes 1.1/"1.1" as v1 format and adds MirrorsToV1CustomRef gate (package + receiver). |
| cmd/entire/cli/settings/settings_test.go | Tests MirrorsToV1CustomRef value matrix and that 1.1 is a recognized version. |
| cmd/entire/cli/strategy/v1_custom_ref_mirror.go | New helper that points the custom ref at the v1 branch tip when opted in; logs mirror failures. |
| cmd/entire/cli/strategy/v1_custom_ref_mirror_test.go | Unit + integration tests for mirror behavior, real condense/finalize paths, and pre-push exclusion. |
| cmd/entire/cli/strategy/manual_commit_condensation.go | Invokes mirror helper after the v1 committed write. |
| cmd/entire/cli/strategy/manual_commit_hooks.go | Invokes mirror helper once after finalizeAllTurnCheckpoints update loop. |
Only the string checkpoints_version "1.1" enables mirroring; the numeric form 1.1 now falls back to v1 and logs as unsupported, matching the plan's string-only intent. Simplifies isV1CustomRefValue to a single type assertion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: a0e27638ea22
pfleidi
left a comment
There was a problem hiding this comment.
Left two minor comments. Otherwise, it looks good 👍
Mirror the v1 custom ref via SafelyAdvanceLocalRef instead of a raw SetReference, matching the established ancestry-safe advancement rule for metadata refs under refs/entire/ (addresses PR review). For the local single-writer mirror this is always a fast-forward; the helper also handles the missing/equal/diverged cases. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: e79036c379c9
updateCombinedAttributionForCheckpoint runs in the post-commit hook and issues a committed write (UpdateCheckpointSummary) that advances v1 after per-session condensation has already mirrored. Mirror the v1 custom ref there too so it tracks v1 across the full post-commit flow. explain (--generate UpdateSummary) and attach remain unmirrored and are tracked as a follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Entire-Checkpoint: d5f194d3e477
|
Verified that checkpoints are mirrored in a test repo. Tested with a new session and then an advancement of the session and noticed both refs advanced. |

Summary
Phase 1 of the v1.1 checkpoints rollout. Adds opt-in, local-only mirroring of committed checkpoint metadata to a new v1 custom ref
refs/entire/checkpoints/v1.1, gated onstrategy_options.checkpoints_version: "1.1"(string only).refs/heads/entire/checkpoints/v1) remains the source of truth.What changed
pathsnew constMetadataRefName = "refs/entire/checkpoints/v1.1". Lives underrefs/entire/so it stays invisible togit branch -a/ GitHub's branch UI and is not pulled by a defaultgit clone.settingsthe stringcheckpoints_version: "1.1"is now a recognized value mapping to data-format major version 1 (so it no longer trips the "unsupported version, falling back" warning). New gateMirrorsToV1CustomRef. Only the string"1.1"opts in; the numeric form1.1falls back to v1 and logs as unsupported.strategynewmirrorMetadataToV1CustomRef(ctx, repo)helper that, when opted in, advances the custom ref to the v1 branch's current commit usingSafelyAdvanceLocalRef(the established ancestry-safe advancement forrefs/entire/metadata refs). Wired into all post-commit-hook committed writes: condensation, finalize, and combined-attribution (UpdateCheckpointSummary). A mirror failure is logged, never propagated, so it can't affect the v1 write that preceded it.CondenseSessionand finalize (PostCommit+HandleTurnEnd) paths and assert the custom ref equals v1's actual checkpoint commit; and a pre-push test proving the custom ref is never pushed while the v1 branch is.Divergences from the handoff plan (
plan.md) and whyFollows the plan's scope and intent but not its mechanism (a
MirroringCommittedStorewrapper on a reworkedGitStore):MirroringCommittedStore, noGitStorerework, no signature change (plan §GitStore, §Write Return Values, §MirroringCommittedStore). Replaced by a post-write ref-sync helper — same outcome, much smaller blast radius, zero churn to the working v1 write path.vercel.jsoninit (plan §Seed Behavior). N/A under mirroring: the custom ref only ever points at v1's existing commit; it is never independently initialized.(Earlier divergences now closed: the opt-in is string-only per the plan; and the custom ref now advances ancestry-safely via
SafelyAdvanceLocalRefrather than a rawSetReference.)Known limitation — comprehensive mirroring deferred (follow-up)
Mirroring covers the post-commit-hook write paths (condensation, finalize, combined-attribution). Two non-hook paths also advance the v1 ref and do not mirror yet:
UpdateSummary(explain --generate)attach(WriteCommitted)After either of those, the custom ref lags v1 until the next hook write re-syncs it. Benign for phase 1 (nothing reads the custom ref), but must be addressed before reads flip in phase 2. Deferred per PR review.
Note for the follow-up: every committed write — including
explain's, which goes throughNewCommittedReader/DualCheckpointReaderrather than a raw*GitStore— ultimately funnels throughGitStore's four committed-write methods. So a single mirror point insideGitStore(gated + cached) is the clean way to cover all paths and any future writer, rather than wiring each construction site.Out of scope (per plan)
Reads (
list/explain/rewindstay v1-only for reading), push/fetch/reconcile/cleanup/doctor for the custom ref, and any new CLI surface — all untouched.Testing
mise run lintclean (0 issues).🤖 Generated with Claude Code