Skip to content

Checkpoints v2 push speedup: simplify v2 migration hint check#1209

Merged
computermode merged 1 commit into
mainfrom
fix-v2-migration-hint
May 14, 2026
Merged

Checkpoints v2 push speedup: simplify v2 migration hint check#1209
computermode merged 1 commit into
mainfrom
fix-v2-migration-hint

Conversation

@computermode
Copy link
Copy Markdown
Contributor

@computermode computermode commented May 14, 2026

https://entire.io/gh/entireio/cli/trails/375

Summary

This PR improves the performance of the pre-push hook for v2-enabled repos with 100+ checkpoints down from ~60s (!) to 20s. Tested with the entiredb repo. Observed push times went down from close to a minute to about 20 seconds (still unacceptable but much better while the refs fixes are being addressed). Double-checked and ensured checkpoints were pushed up correctly.

  • Replace the v1 <> v2 missing checkpoints check for the migration hint message with a single "does v2 /main exist?" ref probe. The hint now only fires when migration was never run; partial migrations are no longer flagged (a little drift is acceptable post-migration since we fall back to v1 in the UI when we display transcripts for now anyway).
  • Drops the per-push cost of listing the full v1 and v2 committed-checkpoint sets just to decide whether to print one line

Extracted from #1208 — the rotation/blob-fetch perf fixes from that PR are left in place there.

Test plan

  • mise run fmt && mise run lint clean
  • go test ./cmd/entire/cli/strategy/ -run TestPrintCheckpointsV2MigrationHint passes
  • Manual: pre-push on a v2-enabled repo no longer prints the hint once v2/main exists, even with v1 checkpoints that were never mirrored

🤖 Generated with Claude Code


Note

Low Risk
Low risk: changes are limited to advisory stderr hint logic during pushes and corresponding tests, with no impact on checkpoint data writes or syncing behavior.

Overview
printCheckpointsV2MigrationHint now decides whether to warn solely by probing for refs/entire/checkpoints/v2/main (via v2MainRefExists) when checkpoints_version: 2 is committed, rather than listing and cross-checking v1/v2 checkpoint inventories.

Tests were updated accordingly by removing v1-mirroring fixtures and deleting the hasUnmigratedV1Checkpoints test suite, and by asserting the hint is suppressed once v2 /main exists and printed otherwise.

Reviewed by Cursor Bugbot for commit f7a4cb4. Configure here.

Replace the v1↔v2 cross-check in the migration hint with a single
"does v2 /main exist?" ref probe. The hint now only fires when
migration was never run; partial migrations are no longer flagged
(drift is acceptable post-migration since we still fall back to v1
in the UI when displaying transcripts).

This also drops the per-push cost of listing the full v1 and v2
committed-checkpoint sets just to decide whether to print one line.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 4538743510a7
Copilot AI review requested due to automatic review settings May 14, 2026 01:31
@computermode computermode requested a review from a team as a code owner May 14, 2026 01:31
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 f7a4cb4. Configure here.

Comment thread cmd/entire/cli/strategy/push_common.go
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies when the CLI prints the “checkpoints v2 migration” hint during push-related flows by replacing the previous v1↔v2 inventory comparison with a single probe for the v2 /main ref (refs/entire/checkpoints/v2/main). This reduces per-push overhead and changes the hint to only trigger when the v2 /main ref is absent.

Changes:

  • Replace the v1 vs v2 checkpoint set cross-check with a v2 /main ref existence probe.
  • Update the user-facing hint text to reflect the new condition (missing v2 /main ref).
  • Simplify and update unit tests to match the new hinting behavior; remove tests for the old inventory-based helper.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
cmd/entire/cli/strategy/push_common.go Switch hint gating logic to a v2 /main ref existence probe and update messaging.
cmd/entire/cli/strategy/push_common_test.go Update tests to validate the new ref-probe-based hint behavior; remove old helper coverage.

Comment thread cmd/entire/cli/strategy/push_common.go
@computermode computermode enabled auto-merge May 14, 2026 02:30
@computermode computermode changed the title Simplify v2 migration hint to a /main ref probe Checkpoints v2 push speedup: simplify v2 migration hint check May 14, 2026
@computermode computermode merged commit 346f62b into main May 14, 2026
14 checks passed
@computermode computermode deleted the fix-v2-migration-hint branch May 14, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants