Checkpoints v2: Fix issue where migrations didn't check archived v2 transcripts#1080
Merged
computermode merged 3 commits intomainfrom Apr 29, 2026
Merged
Checkpoints v2: Fix issue where migrations didn't check archived v2 transcripts#1080computermode merged 3 commits intomainfrom
computermode merged 3 commits intomainfrom
Conversation
Migration repair and committed checkpoint updates only looked in v2/full/current when deciding whether a checkpoint session had raw transcript artifacts. If a previous migration had already rotated those artifacts into v2/full/000000000000N, a rerun treated them as missing and copied the old checkpoint back into current. That repopulated current with archived data, so later ordinary writes crossed the generation threshold and kept rotating new full refs. Teach V2GitStore to find full-session artifacts in current and archived generations, preferring complete transcript/hash pairs. Existing full artifacts are updated in the ref where they already live; only brand-new artifacts fall back to current, where the normal rotation helper can decide whether to archive. Update migration repair to use the same generation-aware check so rerunning v1-to-v2 migration does not rehydrate archived full artifacts into current. Add regressions for archived-generation updates and migration reruns that should skip repair when archived raw artifacts are already present. Entire-Checkpoint: beb44564441f
The pre-push migration hint checks the v1 branch for checkpoint IDs that are absent from v2. Failed or partial v1 writes can leave shard entries without a readable checkpoint summary; ListCommitted can still surface those IDs, but the migration command cannot migrate them because there is no summary to read. That made the hook keep telling users to run entire migrate --checkpoints v2 even after all actionable v1 checkpoints had already been migrated. In the bundle that showed up as a repeated push-time hint next to normal v2 ref pushes. Before reporting an unmigrated v1 checkpoint, read the v1 summary and ignore malformed entries that are missing or unreadable. This keeps the hint aligned with the set of checkpoints migration can actually process. Add coverage for a malformed v1-only entry so it does not resurrect the warning. Entire-Checkpoint: 71256d04318b
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a post-migration v2 checkpointing issue where repos with enough checkpoints to trigger rotation would repeatedly create new /full/<generation> rotations on subsequent pushes by ensuring “finalization” updates and repair checks don’t unnecessarily rehydrate data into /full/current.
Changes:
- Update v2 full-transcript finalization to write to the existing
/full/*ref where the session’s artifacts live (current or archived), and rotate only when writing to/full/current. - Adjust migration “repair” logic to treat archived
/full/*artifacts as satisfying required full artifacts (avoids copying them back into/full/current). - Add/adjust tests covering malformed v1 checkpoints, migration reruns with archived artifacts, and updating archived generations.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/strategy/push_common.go | Suppresses v2 migration hint when “missing” v1 entries are malformed (no readable summary). |
| cmd/entire/cli/strategy/push_common_test.go | Adds a malformed v1 checkpoint helper + test to validate hint suppression behavior. |
| cmd/entire/cli/migrate.go | Uses v2 store’s /full/* artifact check during repair (instead of /full/current only). |
| cmd/entire/cli/migrate_test.go | Updates migration test expectations and adds a helper to assert /full/current stays unrehydrated. |
| cmd/entire/cli/checkpoint/v2_committed.go | Adds /full/* artifact discovery and updates full transcript finalization to target archived refs when appropriate; refactors rotation check. |
| cmd/entire/cli/checkpoint/v2_generation_test.go | Adds coverage ensuring UpdateCommitted updates archived generations without repopulating /full/current. |
Entire-Checkpoint: 53c2ce4a82af
Soph
approved these changes
Apr 29, 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/267
Fixes a bug where the migration repair path checked only
v2/full/currentto decide whether a migrated checkpoint still had its raw transcript. If that transcript had already been rotated into an archived ref likev2/full/0000000000001, rerunning the migration treated it as missing and copied old historical data back intocurrent. That made current exceed the rotation threshold, so each later checkpoint/push kept creating more bogus archived generations.Pre-fix:
Post-fix:
Note
Medium Risk
Touches git-ref selection and rotation behavior for v2 checkpoint transcripts plus migration repair heuristics; mistakes could write transcripts to the wrong generation or skip needed repairs, affecting checkpoint integrity.
Overview
Fixes v2 checkpoint finalization/repair logic to avoid rewriting
/full/currentwhen the raw transcript already lives in an archived/full/*generation (preventing repeated rotations and “rehydrating” old checkpoints back into current).Adds
/full/*artifact discovery (HasFullSessionArtifacts) and updatesUpdateCommitted/migration repair to use it, including writing finalized transcripts back to the archived generation where they belong and factoring rotation checks intorotateCurrentIfNeeded(only triggered when/full/currentis updated). Push migration hinting is also tightened to ignore malformed v1 checkpoint entries so the CLI doesn’t suggest migration when only broken v1 data is present; tests are updated/added to cover these cases.Reviewed by Cursor Bugbot for commit 53e6b10. Configure here.