Instead of checkpointsv2only: true, we want checkpointsversion: 2. The logic that checks…
- User
Instead of
checkpoints_v2_only: true, we wantcheckpoints_version: 2. The logic that checks forcheckpoints_v2_onlyas a boolean will have to be adapted to handle a version number. 2 will be the first one (it will behave in the code currently the same way ascheckpoints_v2_only: truedoes) Assistant· claude-opus-4-7
Now let me look at the test fixtures and the strategy code to understand how the setting is being used.
Assistant· claude-opus-4-7
Now I have a full picture. The changes:
- JSON key
checkpoints_v2_only(bool) →checkpoints_version(int, starting at 2) - Adapt
IsCheckpointsV2OnlyEnabledto returnCheckpointsVersion() == 2 - Update comments, hint messages, and tests
Go function/method names stay the same since they still semantically describe "v2-only mode". Let me make the changes.
- JSON key
Assistant· claude-opus-4-7
Now update the tests:
Assistant· claude-opus-4-7
Now update the
TestIsPushV2RefsEnabled_RequiresBothFlagstest:Assistant· claude-opus-4-7
Now update the strategy tests:
Assistant· claude-opus-4-7
Now let me verify there are no remaining
checkpoints_v2_onlyreferences anywhere in the code:Assistant· claude-opus-4-7
Only one reference remains in a doc comment describing legacy behavior — that's appropriate context. Let me verify tests pass and check the code:
Assistant· claude-opus-4-7
Let me run all unit tests to make sure nothing else broke:
Assistant· claude-opus-4-7
Let me also run integration tests since I touched them:
- User
[Request interrupted by user for tool use]
- User
Remove all references to checkpoints_v2_only in the code including the comments and tests. The
"checkpoints_version": 2option is the only one valid now moving forward Assistant· claude-opus-4-7
Let me check the other tests to understand whether "V2Only" refers to the setting or to the concept of checkpoints living only in v2:
Assistant· claude-opus-4-7
Good — the other
V2Onlytests refer to "checkpoint only exists in v2" (not the setting), so those are fine to leave. My renaming scope is just the setting-related identifiers.Plan: drop both forms of
IsCheckpointsV2OnlyEnabled, promoteCheckpointsVersion()as the sole API, and rename the internal helpers/tests tied to the old setting.Let me start with
settings.go:Assistant· claude-opus-4-7
Now update the callers in the strategy package and attach.go:
Assistant· claude-opus-4-7
Good —
v2is only used where expected. Now updatemanual_commit_hooks.go:Assistant· claude-opus-4-7
Now
checkpoint_remote.go:Assistant· claude-opus-4-7
Now
push_common.go:Assistant· claude-opus-4-7
Now update
push_common_test.go— rename the tests and helpers that refer to the old setting concept:Assistant· claude-opus-4-7
Now remove the redundant
IsCheckpointsV2OnlyEnabledtests insettings_test.go(they're replaced byTestCheckpointsVersion):Assistant· claude-opus-4-7
Now delete the
TestIsCheckpointsV2OnlyEnabled_*tests —TestCheckpointsVersioncovers the same ground:Assistant· claude-opus-4-7
Now update the
"v2 only supersedes both"subtest name and integration-test names/comments that reference the old setting:Assistant· claude-opus-4-7
Now the integration tests —
TestV2Only_SkipsV1WriteandTestV2Push_V2OnlySkipsV1Branch:Assistant· claude-opus-4-7
Verify everything compiles and there are no lingering references:
Assistant· claude-opus-4-7
Lint is clean. Let me run the unit tests:
Assistant· claude-opus-4-7
Final sanity check — any lingering
checkpoints_v2_onlyorV2Onlyreferences tied to the old setting:Assistant· claude-opus-4-7
Let me also run the specific settings and strategy tests to confirm everything passes end-to-end:
Assistant· claude-opus-4-7
All references to
checkpoints_v2_onlyhave been purged from the code, comments, and tests. Summary of the changes:Settings API (
cmd/entire/cli/settings/settings.go):- Removed both forms of
IsCheckpointsV2OnlyEnabled. CheckpointsVersion()(method + package func) is now the sole API — returns the configured version as an int,0if unset.IsCheckpointsV2EnabledandIsPushV2RefsEnablednow branch onCheckpointsVersion() == 2.
- Removed both forms of
- User
For
CheckpointsVersion, for now, the default should be 1 instead of 0 Assistant· claude-opus-4-7
Now update the
TestCheckpointsVersionexpectations:Assistant· claude-opus-4-7
CheckpointsVersion()now defaults to 1 when the setting is unset or invalid. The== 2checks at call sites still work correctly — v1 is the default "has v1 metadata branch" mode. All tests and lint pass.