Add checkpoint format compatibility checks - #1507
Conversation
Parse committed checkpoint version strings and reject unsupported formats before decoding checkpoint data. Wire the check into explain, export, resume, and rewind read paths so user-driven commands fail clearly when a checkpoint requires a newer CLI. Entire-Checkpoint: 77f1d4ade515
There was a problem hiding this comment.
Pull request overview
This PR introduces an explicit read-compatibility gate for checkpoints via a new checkpointpolicy package, ensuring user-facing read commands (explain/export/resume/rewind) fail early and clearly when encountering newer checkpoint formats that the current CLI cannot decode.
Changes:
- Added
cmd/entire/cli/checkpointpolicyto parsefamily-vNcheckpoint format identifiers and enforce a read-allowlist (currentlybranch-v1). - Wired compatibility checks into checkpoint read paths (including manual-commit logs-only rewind restore, interactive rewind transcript restore, resume selection, explain, and export).
- Added targeted tests to cover unsupported versions (e.g.,
refs-v1) and multi-checkpoint resume selection behavior.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/strategy/manual_commit_rewind.go | Validates checkpoint_version before restoring logs-only rewind transcripts from committed checkpoints. |
| cmd/entire/cli/rewind.go | Ensures checkpoint version compatibility before decoding committed session transcript content; propagates unsupported-version errors. |
| cmd/entire/cli/resume.go | Enforces version compatibility in resume metadata reads; adjusts latest-checkpoint resolution to skip unsupported candidates. |
| cmd/entire/cli/resume_test.go | Adds coverage for skipping unsupported checkpoints and returning unsupported-version errors when no readable checkpoints exist. |
| cmd/entire/cli/explain.go | Validates checkpoint version immediately after reading the checkpoint summary during explain loading. |
| cmd/entire/cli/explain_test.go | Adds a regression test asserting explain rejects unsupported checkpoint versions. |
| cmd/entire/cli/explain_export.go | Adds compatibility checks for export JSON and transcript streaming paths. |
| cmd/entire/cli/explain_export_test.go | Adds helper to rewrite committed checkpoint summary version and tests that export paths reject unsupported versions. |
| cmd/entire/cli/checkpointpolicy/version.go | Implements EnsureCanReadVersion and a typed unsupported-version error plus helper predicate. |
| cmd/entire/cli/checkpointpolicy/format.go | Implements family-vN parsing and the read-allowlist decision (CanRead). |
| cmd/entire/cli/checkpointpolicy/format_test.go | Unit tests for format parsing and read support behavior. |
| cmd/entire/cli/checkpoint_policy_read_test.go | Ensures resume’s metadata-read helper rejects unsupported checkpoint versions early. |
Preserve unsupported checkpoint-version errors while checking remote metadata during resume. This keeps remote-only checkpoints consistent with local reads: if the checkpoint exists but uses a format this CLI cannot decode, resume returns the explicit compatibility error instead of falling through to a generic missing-metadata message. Entire-Checkpoint: fb873cd67d32
Return unsupported checkpoint-version errors instead of skipping them when selecting from multiple checkpoint IDs. This nudges users to upgrade instead of resuming from a potentially older readable checkpoint. Entire-Checkpoint: 67f0307b2665
Say that multi-checkpoint resume selects the latest readable checkpoint. This avoids implying every skipped checkpoint was older when metadata for some checkpoint IDs may be unavailable. Entire-Checkpoint: ac4b21ebff86
|
Bugbot run |
Return checkpoint metadata read errors while resolving squash-merge checkpoint trailers instead of selecting another readable checkpoint. Update integration and canary expectations to describe selecting the latest checkpoint only after all listed checkpoints were read successfully. Entire-Checkpoint: 8fb17d9e05cc
Preserve the checkpointpolicy error text at command boundaries without adding noisy wrapper prefixes. Also clarify the multi-checkpoint resume log when no metadata can be resolved. Entire-Checkpoint: 95d54474361d
|
Bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit efc3ca2. Configure here.
# Conflicts: # cmd/entire/cli/resume.go # cmd/entire/cli/rewind.go
| return fmt.Errorf("checkpoint %s has invalid checkpoint_version %q: %w", checkpointID, version, err) | ||
| } | ||
| if !CanRead(format) { | ||
| return &unsupportedVersionError{ |
There was a problem hiding this comment.
Maybe use value-based error instead?
| return &unsupportedVersionError{ | |
| return unsupportedVersionError{ |
| var unsupported *unsupportedVersionError | ||
| return errors.As(err, &unsupported) |
There was a problem hiding this comment.
Doing from memory, so maybe the syntax is slighlty off, but we are better off using error.Is in this case:
| var unsupported *unsupportedVersionError | |
| return errors.As(err, &unsupported) | |
| return errors.Is(err, unsupportedVersionError) |
| return nil, fmt.Errorf("failed to read checkpoint: %w", err) | ||
| } | ||
| if err := checkpointpolicy.EnsureCanReadVersion(point.CheckpointID.String(), summary.CheckpointVersion); err != nil { | ||
| return nil, fmt.Errorf("%w", err) |
There was a problem hiding this comment.
| return nil, fmt.Errorf("%w", err) | |
| return nil, err |
| return nil, nil, fmt.Errorf("failed to read checkpoint: %w", err) | ||
| } | ||
| if err := checkpointpolicy.EnsureCanReadVersion(cpID.String(), summary.CheckpointVersion); err != nil { | ||
| return nil, nil, fmt.Errorf("%w", err) |
There was a problem hiding this comment.
| return nil, nil, fmt.Errorf("%w", err) | |
| return nil, nil, err |
| return fmt.Errorf("failed to read checkpoint: %w", err) | ||
| } | ||
| if err := checkpointpolicy.EnsureCanReadVersion(cpID.String(), summary.CheckpointVersion); err != nil { | ||
| return fmt.Errorf("%w", err) |
There was a problem hiding this comment.
| return fmt.Errorf("%w", err) | |
| return err |
| return fmt.Errorf("failed to read checkpoint: %w", err) | ||
| } | ||
| if err := checkpointpolicy.EnsureCanReadVersion(cpID.String(), summary.CheckpointVersion); err != nil { | ||
| return fmt.Errorf("%w", err) |
There was a problem hiding this comment.
| return fmt.Errorf("%w", err) | |
| return err |
| return nil, fmt.Errorf("read checkpoint: %w", err) | ||
| } | ||
| if err := checkpointpolicy.EnsureCanReadVersion(checkpointID.String(), summary.CheckpointVersion); err != nil { | ||
| return nil, fmt.Errorf("%w", err) |
There was a problem hiding this comment.
| return nil, fmt.Errorf("%w", err) | |
| return nil, err |
| return "", fmt.Errorf("failed to read checkpoint: %w", err) | ||
| } | ||
| if err := checkpointpolicy.EnsureCanReadVersion(cpID.String(), summary.CheckpointVersion); err != nil { | ||
| return "", fmt.Errorf("%w", err) |
There was a problem hiding this comment.
| return "", fmt.Errorf("%w", err) | |
| return "", err |
Review feedback on the dead-code sweep: two deletions took the only tests of live logic with them. - factoryaidroid: the six subagent-aggregation tests only exercised the dead path-based twins, but the logic lives on in CalculateTotalTokenUsageFromBytes/ExtractAllModifiedFilesFromBytes — the production path via lifecycle.go, and Droid isn't in the CI canary. Retarget them at the FromBytes entry points: per-checkpoint offset math, the APICallCount>0 subagent gate, cross-agent file dedup, and missing-transcript tolerance are asserted again. - explain: the three default-view tests only drove the deleted runExplainDefault wrappers, leaving runExplainBranchWithFilter — the real branch soph/deslop checkpoints 114 ● f06be81196bf "<task-notification>\n<task-id>b53nll3s4</task-id>\n<tool-us..." 07-02 18:12 (ca82a6a) cli: drop types and test helper orphaned by the dead-code sweep ● 7307caae423f "<task-notification>\n<task-id>b53nll3s4</task-id>\n<tool-us..." 07-02 18:12 (350f6ff) cli subpackages: delete dead code and its dedicated tests ● 7c22eaba7124 "<task-notification>\n<task-id>b53nll3s4</task-id>\n<tool-us..." 07-02 18:12 (13b0ab1) cli: dedupe tmp-state cleanup and rewind preview warnings ● 8a9c75ea075f "<task-notification>\n<task-id>b53nll3s4</task-id>\n<tool-us..." 07-02 18:12 (a2c89a2) cli: delete dead root-package code and its dedicated tests ● ab0d1ee8ae62 e2e: share the run-capture/deadline-wrap block across age... 07-02 18:12 (c7443f4) e2e: share the run-capture/deadline-wrap block across agent runners ● 5eec000c7982 agent/geminicli: drop trailing blank line left by parser ... 07-02 18:12 (3ea3351) agent/geminicli: drop trailing blank line left by parser fold ● e64c28c66fb4 strategy, trailers, clusterdiscovery: delete dead code an... 07-02 18:12 (10892ce) strategy, trailers, clusterdiscovery: delete dead code and its tests ● 351ee2316125 cli: standardize on printJSON for indented JSON output 07-02 18:12 (7f9b918) cli: standardize on printJSON for indented JSON output ● 5c2527f62f77 cli: share the stop-sessions confirmation prompt 07-02 18:12 (62ea674) cli: share the stop-sessions confirmation prompt ● 76f119a87828 cli: dedupe agent display-name and hook-agent-option buil... 07-02 18:12 (a0ab634) cli: dedupe agent display-name and hook-agent-option building in setup ● 65cfea8234e1 agent/vogon: reuse one parser for the sessionInfoRaw hooks 07-02 18:12 (ff99145) agent/vogon: reuse one parser for the sessionInfoRaw hooks ● 4bfedc11ca7f review: dedupe config filtering and picker multiselect co... 07-02 18:12 (02a59b9) review: dedupe config filtering and picker multiselect construction ● 11253d4586b3 agent: dedupe transcript scanning in opencode and copilot... 07-02 18:12 (3aada34) agent: dedupe transcript scanning in opencode and copilot-cli ● 7b73bd925300 "/goal simplify this repo, make sure to de-slop it continu..." 07-02 18:11 (1b1e8b5) agent: collapse capability As* helpers onto two generic gates ● cafa646983ad [imported] "can you review #1462" 07-01 13:59 (cafa646) can you review #1462 ● 5bc51efe5634 [imported] "could we also add \"PR #1237\" or \"T #123\" (for trail) so m..." 07-01 13:39 (5bc51ef) could we also add "PR #1237" or "T #123" (for trail) so m... ● 1686873c82fe [imported] "test" 07-01 13:33 (1686873) test ● 424e70130be4 [imported] "can you review again, did it change?" 07-01 13:19 (424e701) can you review again, did it change? ● 88b96bfc1a5c [imported] "check" 07-01 13:18 (88b96bf) check ● 67b0ce56bd73 [imported] "one" 07-01 13:18 (67b0ce5) one ● 39348f4dc708 [imported] "can you post it as finding to the trail?" 07-01 13:11 (39348f4) can you post it as finding to the trail? ● 37c58b1285cc [imported] "so it worked a few times, but now it doesn't..." 07-01 13:07 (37c58b1) so it worked a few times, but now it doesn't... ● 738da64b0dfb [imported] "can you review #1573" 07-01 13:02 (738da64) can you review #1573 ● 42a4208d02fc [imported] "just testing if it updates now if I really type something" 07-01 12:15 (42a4208) just testing if it updates now if I really type something ● 3be2e037f80a [imported] "yes, revert" 07-01 10:46 (3be2e03) yes, revert ● 3b397151d6f6 [imported] "can you look at this comment: https://github.com/anthropi..." 07-01 10:38 (3b39715) can you look at this comment: https://github.com/anthropi... ● 4555162959cd [imported] "I think it worked when I left the focus for the window an..." 07-01 10:37 (4555162) I think it worked when I left the focus for the window an... ● 76eb3d2b9d98 [imported] "ok" 07-01 10:34 (76eb3d2) ok ● 2124a6f6a229 [imported] "test" 07-01 10:34 (2124a6f) test ● 4330123cdcf9 [imported] "it does not work :(" 06-30 16:20 (4330123) it does not work :( ● 4d9c7190f539 [imported] "ok, restarted, let's try again" 06-30 16:19 (4d9c719) ok, restarted, let's try again ● aaabdc00513b [imported] "I changed it, is this auto picked up or needs a restart?" 06-30 16:18 (aaabdc0) I changed it, is this auto picked up or needs a restart? ● 06862b0f6354 [imported] "Help me fix the issues reported by /doctor below.\n\nFor ea..." 06-30 16:16 (06862b0) Help me fix the issues reported by /doctor below. For ea... ● 8e56c6a6b74f [imported] "I put the line into the settings.json since I briefly saw..." 06-30 16:11 (8e56c6a) I put the line into the settings.json since I briefly saw... ● 5f4910a121d0 [imported] "no" 06-30 16:07 (5f4910a) no ● 4a0d45bf06c5 [imported] "it does not, but maybe I have not title set to \"\"" 06-30 16:05 (4a0d45b) it does not, but maybe I have not title set to "" ● a03587b3282a [imported] "works now, test" 06-30 16:04 (a03587b) works now, test ● 17e892e14dd0 [imported] "⏺ Ran 2 stop hooks\n ⎿ \u00a0Stop hook error: Failed with non-..." 06-30 16:00 (17e892e) ⏺ Ran 2 stop hooks ⎿ Stop hook error: Failed with non-... ● 9299dcc26c8e [imported] "hello" 06-30 15:59 (9299dcc) hello ● 3d591b1340c3 [imported] "Help me fix the issues reported by /doctor below.\n\nFor ea..." 06-30 15:58 (3d591b1) Help me fix the issues reported by /doctor below. For ea... ● 32197462b83a [imported] "yeah let's try wiring the stop hook in my settings.json, ..." 06-30 15:55 (3219746) yeah let's try wiring the stop hook in my settings.json, ... ● 08301e76c817 [imported] "but it would not work with claude being in the window and..." 06-30 15:52 (08301e7) but it would not work with claude being in the window and... ● 80b129a53f56 [imported] "I'd like to show when the last \"change\" in a ghostty tab ..." 06-30 15:49 (80b129a) I'd like to show when the last "change" in a ghostty tab ... ● 9454bdd3f330 [imported] "this has no a conflict with the base branch" 06-30 15:01 (9454bdd) this has no a conflict with the base branch ● 0652f4abbdbb [imported] "can you look at the pr comments, and also if the correspo..." 06-30 14:29 (0652f4a) can you look at the pr comments, and also if the correspo... ● f842b0ae13c4 [imported] "yes, do that" 06-30 14:07 (f842b0a) yes, do that ● aff3a8f7636f [imported] "did we open a PR yet?" 06-30 14:06 (aff3a8f) did we open a PR yet? ● 642544e41c50 [imported] "- cmd/entire/cli/paths/paths.go:32 still says transcript...." 06-30 12:28 (642544e) - cmd/entire/cli/paths/paths.go:32 still says transcript.... ● 03570057e87a [imported] "- P2 cmd/entire/cli/transcript/compact/compact.go:158: Fu..." 06-30 11:42 (0357005) - P2 cmd/entire/cli/transcript/compact/compact.go:158: Fu... ● d0b9faddc75d [imported] "<task-notification>\n<task-id>a0b8ca16f3d36a411</task-id>\n..." 06-30 11:15 (d0b9fad) <task-notification> <task-id>a0b8ca16f3d36a411</task-id> ... ● 9b2eb8b87c47 [imported] "<task-notification>\n<task-id>a78ca6485d1be4ff7</task-id>\n..." 06-30 11:14 (9b2eb8b) <task-notification> <task-id>a78ca6485d1be4ff7</task-id> ... ● 9c84afa51639 [imported] "<task-notification>\n<task-id>a457acc7c9d47e06e</task-id>\n..." 06-30 11:14 (9c84afa) <task-notification> <task-id>a457acc7c9d47e06e</task-id> ... ● 76b715ce095f [imported] "`/simplify → 4 cleanup agents in parallel → apply the fix..." 06-30 11:12 (76b715c) `/simplify → 4 cleanup agents in parallel → apply the fix... ● 4877690ab239 [imported] "how could 2 even work, we don't write the checkpoints at ..." 06-30 09:23 (4877690) how could 2 even work, we don't write the checkpoints at ... ● 2bc7d831d62e [imported] "can we start working on this?" 06-30 09:09 (2bc7d83) can we start working on this? ● d2b6c31a4e9b [imported] "Yeah but the issue is as soon as a checkpoint / commit in..." 06-30 08:57 (d2b6c31) Yeah but the issue is as soon as a checkpoint / commit in... ● def9943b30f0 [imported] "if we would want to store the transcript.jsonl as full we..." 06-30 08:46 (def9943) if we would want to store the transcript.jsonl as full we... ● 058751630ccb [imported] "<task-notification>\n<task-id>a676a8185d76c1abe</task-id>\n..." 06-30 08:42 (0587516) <task-notification> <task-id>a676a8185d76c1abe</task-id> ... ● 66311ee49b8c [imported] "can you give me a summary how we store session logs right..." 06-30 08:40 (66311ee) can you give me a summary how we store session logs right... ● e698e190b41c [imported] "can you also post the findings on 1472" 06-29 16:23 (e698e19) can you also post the findings on 1472 ● acd45beca109 [imported] "can you post those as findings on the trail using the cli..." 06-29 15:34 (acd45be) can you post those as findings on the trail using the cli... ● 4ffd98acbcbe [imported] "can you review #1313" 06-29 15:25 (4ffd98a) can you review #1313 ● e16e3aaaac83 [imported] "can you review #1472" 06-29 13:34 (e16e3aa) can you review #1472 ● 1b18c7ec130e [imported] "can you review again, I rebased" 06-29 13:12 (1b18c7e) can you review again, I rebased ● 9ad2a22d8dfc [imported] "can you review #1549 ..." 06-29 12:22 (9ad2a22) can you review #1549 ... ● 06efd7549b2f [imported] "I also not sure I like the design choice of just \"public\"..." 06-29 11:52 (06efd75) I also not sure I like the design choice of just "public"... ● a090f0dc130b [imported] "can you review #1531 ..." 06-29 11:26 (a090f0d) can you review #1531 ... ● 9a01b7c38400 [imported] "ok, now update the other place for the brew docs :)" 06-29 10:08 (9a01b7c) ok, now update the other place for the brew docs :) ● c7139bb53c2b [imported] "can you first review 1529 again" 06-29 10:03 (c7139bb) can you first review 1529 again ● 6a72ca55142f [imported] "back to 1534: can you check there are not other places wh..." 06-29 09:59 (6a72ca5) back to 1534: can you check there are not other places wh... ● 9d5af71d1933 [imported] "can you now review #1529" 06-29 09:50 (9d5af71) can you now review #1529 ● 474fa98bdd8d [imported] "can you look at #1534..." 06-29 09:45 (474fa98) can you look at #1534... ● 4f8c1a05c7b7 [imported] "can you post the findings to the trail" 06-26 10:51 (4f8c1a0) can you post the findings to the trail ● a30148800f79 [imported] "<task-notification>\n<task-id>acb9f26eddbbec259</task-id>\n..." 06-26 09:49 (a301488) <task-notification> <task-id>acb9f26eddbbec259</task-id> ... ● 52143da192be [imported] "<task-notification>\n<task-id>a8ef47f97666c7ec7</task-id>\n..." 06-26 09:47 (52143da) <task-notification> <task-id>a8ef47f97666c7ec7</task-id> ... ● cb6566b53cf4 [imported] "<task-notification>\n<task-id>ab560e36ee1d3b4fe</task-id>\n..." 06-26 09:46 (cb6566b) <task-notification> <task-id>ab560e36ee1d3b4fe</task-id> ... ● 0b6374e0727b [imported] "can you now review https://entire.io/gh/entireio/cli/trai..." 06-26 09:34 (0b6374e) can you now review https://entire.io/gh/entireio/cli/trai... ● 3780222c8dca [imported] "can you post the two findings on the corespoding trail?" 06-26 09:33 (3780222) can you post the two findings on the corespoding trail? ● 17a5bc98ead8 [imported] "<task-notification>\n<task-id>ab980f2b645d399d7</task-id>\n..." 06-26 09:05 (17a5bc9) <task-notification> <task-id>ab980f2b645d399d7</task-id> ... ● e3746a86fc59 [imported] "can you review https://entire.io/gh/entireio/cli/trails/6..." 06-26 08:55 (e3746a8) can you review https://entire.io/gh/entireio/cli/trails/6... ● da9f546ca0b2 [imported] "can you review #1511 ..." 06-26 07:15 (da9f546) can you review #1511 ... ● d7db80fe900d [imported] "How can we figure out the checkpoint version before talki..." 06-25 17:45 (d7db80f) How can we figure out the checkpoint version before talki... ● 60a30c517d1d [imported] "can you check #1507 i..." 06-25 17:28 (60a30c5) can you check #1507 i... ● 4de09c8dbe06 [imported] "are you sure the other code isn't generated too?" 06-25 13:46 (4de09c8) are you sure the other code isn't generated too? ● a7f2ccdfdae6 [imported] "<task-notification>\n<task-id>a5eabac878feb054a</task-id>\n..." 06-25 12:47 (a7f2ccd) <task-notification> <task-id>a5eabac878feb054a</task-id> ... ● ae405e941044 [imported] "<task-notification>\n<task-id>a81ae07c29c11807f</task-id>\n..." 06-25 12:46 (ae405e9) <task-notification> <task-id>a81ae07c29c11807f</task-id> ... ● 074a9669b87b [imported] "can you review #1518 ..." 06-25 12:41 (074a966) can you review #1518 ... ● aac680e5d19a [imported] "can you review https://entire.io/gh/entireio/cli/trails/661" 06-25 11:35 (aac680e) can you review https://entire.io/gh/entireio/cli/trails/661 ● d7f57fda979d [imported] "can you review https://entire.io/gh/entireio/cli/trails/652/" 06-25 10:29 (d7f57fd) can you review https://entire.io/gh/entireio/cli/trails/652/ ● a0dc8c4fe795 [imported] "can you review #1499 ..." 06-25 10:05 (a0dc8c4) can you review #1499 ... ● 4991964f4c59 [imported] "Add debug" 06-25 09:13 (4991964) Add debug ● 3889f0ebbc6a [imported] "Ok. Sounds good. The only thing I‘m now still wondering: ..." 06-25 09:11 (3889f0e) Ok. Sounds good. The only thing I‘m now still wondering: ... ● 908a3544dda7 [imported] "can you explain to me when resume will now directly launc..." 06-25 06:45 (908a354) can you explain to me when resume will now directly launc... ● b257152616fa [imported] "can you check again, there were some new commits" 06-25 06:29 (b257152) can you check again, there were some new commits ● d1772ae84a2c [imported] "The issue is: we are writing the placeholders - but they ..." 06-25 06:26 (d1772ae) The issue is: we are writing the placeholders - but they ... ● 5fd4acd71e1f [imported] "Hmm. It has none merged. The prior try failed because no ..." 06-24 16:19 (5fd4acd) Hmm. It has none merged. The prior try failed because no ... ● f2b9c1baea12 [imported] "Hmm. It has none merged. The prior try failed because no ..." 06-24 14:53 (f2b9c1b) Hmm. It has none merged. The prior try failed because no ... ● 15cbecef4326 [imported] "Question: but the skipping sounds as if no new prompts we..." 06-24 14:50 (15cbece) Question: but the skipping sounds as if no new prompts we... ● a5355b1b65c9 [imported] "[Request interrupted by user for tool use]" 06-24 14:50 (a5355b1) [Request interrupted by user for tool use] ● b99b7a61ff82 [imported] "Question: but the skipping sounds as if no new prompts we..." 06-24 14:33 (b99b7a6) Question: but the skipping sounds as if no new prompts we... ● 9e3847afcfc2 [imported] "can you take a look at this, I did run it in ../git-sync:..." 06-24 14:16 (9e3847a) can you take a look at this, I did run it in ../git-sync:... ● caabf544820c [imported] "<task-notification>\n<task-id>a3074a8a47b891551</task-id>\n..." 06-24 14:03 (caabf54) <task-notification> <task-id>a3074a8a47b891551</task-id> ... ● 6c110eac3ed6 [imported] "<task-notification>\n<task-id>a13dc9fa412edcc6e</task-id>\n..." 06-24 14:03 (6c110ea) <task-notification> <task-id>a13dc9fa412edcc6e</task-id> ... ● 75f953bc7f73 [imported] "<task-notification>\n<task-id>ad20ef831ab9e65ac</task-id>\n..." 06-24 14:02 (75f953b) <task-notification> <task-id>ad20ef831ab9e65ac</task-id> ... ● 6a06d3d60b75 [imported] "<task-notification>\n<task-id>ab0dd083f555810c5</task-id>\n..." 06-24 14:02 (6a06d3d) <task-notification> <task-id>ab0dd083f555810c5</task-id> ... ● 9919dc6061ec [imported] "`/simplify → 4 cleanup agents in parallel → apply the fix..." 06-24 13:58 (9919dc6) `/simplify → 4 cleanup agents in parallel → apply the fix... ● 87e140dbb789 [imported] "<task-notification>\n<task-id>a574469aa1c7a2156</task-id>\n..." 06-24 13:47 (87e140d) <task-notification> <task-id>a574469aa1c7a2156</task-id> ... ● d88c60c7e9d5 [imported] "<task-notification>\n<task-id>abcc3502034cdc607</task-id>\n..." 06-24 13:43 (d88c60c) <task-notification> <task-id>abcc3502034cdc607</task-id> ... ● 3513316e30da [imported] "hmm, they are embedded with the long prompts we have on m..." 06-24 13:38 (3513316) hmm, they are embedded with the long prompts we have on m... ● d60960deb068 [imported] "can you review #1511 ..." 06-24 13:33 (d60960d) can you review #1511 ... ● d30159d49f5f [imported] "can you add both as findings to the trail" 06-24 13:22 (d30159d) can you add both as findings to the trail ● 9c5d56031982 [imported] "<task-notification>\n<task-id>ab0220103d4f0fce1</task-id>\n..." 06-24 13:20 (9c5d560) <task-notification> <task-id>ab0220103d4f0fce1</task-id> ... ● 97e388529f33 [imported] "can you also look at https://entire.io/gh/entireio/cli/tr..." 06-24 13:15 (97e3885) can you also look at https://entire.io/gh/entireio/cli/tr... ● 61404c98152c [imported] "ok, I think we need to change the onboarding idea a bit. ..." 06-24 13:04 (61404c9) ok, I think we need to change the onboarding idea a bit. ... path — unasserted. Retarget them (branch view, zero-checkpoint hint, detached-HEAD labeling) with the wrapper's implied no-filter arguments, sharing one setup helper instead of the original copy-pasted scaffolding. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Entire-Checkpoint: 93a786da9959
https://entire.io/gh/entireio/cli/trails/649
Why
Checkpoints can now carry an explicit
checkpoint_version. Older CLIs need a narrow compatibility gate before they decode checkpoint data, otherwise user-driven read commands may try to interpret a format they do not support or fall back to unrelated remote-recovery behavior.What changed
Adds a small checkpoint compatibility package that parses checkpoint format identifiers and reports unsupported read versions. Explain, export, resume, and rewind read paths now validate the stored
checkpoint_versionimmediately after loading the checkpoint summary and before decoding session content or transcripts.branch-v1remains the only read-supported checkpoint format in this PR. Legacy checkpoints with no stored version continue to normalize tobranch-v1through the existing checkpoint summary normalization. Newer known formats such asrefs-v1produce a clear unsupported-version error.Unknown format families are intentionally treated as invalid rather than unsupported. That keeps the
Familymodel constrained to families this CLI actually knows about. The trade-off is that a future CLI using a brand-new family will produce an invalid-version error in this older CLI until that family is added here, instead of the nicer unsupported-version error used for known but unreadable formats. We are accepting that trade-off to keep the first compatibility gate simple and explicit.Usage examples
Supported legacy and
branch-v1checkpoints continue to work:When a checkpoint stores a newer known version such as
refs-v1, user-driven read commands fail with a clear error like:For squash-merge commits with multiple checkpoint trailers,
entire session resume <branch>now fails if any listed checkpoint cannot be read, including unsupported checkpoint versions. If all listed checkpoints are readable, resume chooses the checkpoint with the newestCreatedAttimestamp and prints that it is resuming from the latest checkpoint.Resume behavior details
Unsupported-version errors now propagate from all resume read paths instead of being treated as missing metadata:
checkRemoteMetadataresolveLatestCheckpointThis keeps the behavior conservative: a newer or unreadable checkpoint nudges the user to upgrade or fetch the missing metadata rather than silently resuming from a different checkpoint that happened to be readable.
Decisions made during development
This PR only handles per-checkpoint read compatibility. It intentionally does not add the repository policy ref, policy command, hook warnings, or policy enforcement; those are split into follow-up PRs to keep this review focused.
The read check lives at each command boundary after
CheckpointSummaryis loaded instead of inside low-level checkpoint storage. That keeps storage capable of preserving newer metadata for future clients while user-driven commands stop before decoding unsupported content.The parser recognizes only known format families. Known unreadable formats become unsupported-version errors; unknown families remain invalid-version errors by design.
Technical tradeoffs
Failing multi-checkpoint resume on the first unreadable checkpoint is stricter than attempting to pick the newest readable checkpoint. The tradeoff is intentional: the confusing case should be rare, and a clear error is easier to reason about than resuming from a checkpoint that may not represent the newest session state.
Treating unknown families as invalid is also intentional. It gives up a slightly nicer forward-compatibility error for brand-new families in exchange for keeping the typed family model narrow and avoiding acceptance of arbitrary typo families as syntactically valid policy input.
The PR does not verify checkpoint commit signatures. Signature verification is related to trusting policy/config changes, but it is outside the scope of this read-compatibility split.
Reviewer notes
This is PR 1 of the checkpoint policy split. Follow-up stacked PRs will add the hidden
entire policy checkpointcommand and repository policy storage/enforcement.Note
Medium Risk
Touches core user flows (resume, rewind, explain/export) with stricter multi-checkpoint and remote-fallback behavior; mistakes could block legitimate resumes or mis-handle version strings, but changes are read-path only with broad test coverage.
Overview
Adds a
checkpointpolicypackage that parsesfamily-vNcheckpoint formats and allows reads only forbranch-v1(empty version still normalizes to branch-v1). Known but unreadable versions such asrefs-v1return a typed unsupported-version error viaEnsureCanReadVersionandIsUnsupportedVersion.Explain, export (JSON and transcript streaming), resume, rewind, and manual-commit rewind now call that check right after loading
CheckpointSummaryand before session content or transcripts are decoded. Unsupported versions fail with an explicit message instead of being treated as missing metadata or falling through to remote recovery.Resume behavior is stricter for squash merges with multiple checkpoint trailers:
resolveLatestCheckpointfails on the first unreadable checkpoint (including unsupported version) rather than skipping bad IDs and picking the newest readable one; user messaging refers to resuming from the latest checkpoint. Remote metadata fallback surfaces unsupported-version errors when that is what was found on the remote tree.Tests cover policy parsing, rejection paths across explain/export/resume, and e2e resume output expectations.
Reviewed by Cursor Bugbot for commit efc3ca2. Configure here.