Skip to content

Add fast path checks for checkpoints migrations#1108

Merged
computermode merged 1 commit intomainfrom
speedup-v2-migration
May 4, 2026
Merged

Add fast path checks for checkpoints migrations#1108
computermode merged 1 commit intomainfrom
speedup-v2-migration

Conversation

@computermode
Copy link
Copy Markdown
Contributor

@computermode computermode commented May 4, 2026

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

Speed up entire migrate --checkpoints v2 reruns by short-circuiting checkpoints that are already fully migrated and avoiding redundant v1 reads for permanently unmigratable compact transcripts.

  • Add a fast-path guard in migrateOneCheckpoint that returns errAlreadyMigrated when the v2 checkpoint already has a compact transcript and /full/<n> artifacts for every session
  • In backfillCompactTranscripts, read the v2 session metadata first and skip the v1 transcript decode when Agent == "" (compact is permanently unrecoverable for those sessions)

Note

Medium Risk
Changes checkpoint migration control-flow to short-circuit work on reruns, which could affect whether repairs/backfills run for partially migrated data. Covered by new tests, but it still touches a data-migration path.

Overview
Speeds up entire migrate --checkpoints v2 reruns by adding a fast-path in migrateOneCheckpoint that immediately skips checkpoints already fully migrated (all sessions have compact transcripts and archived /full/<n> artifacts).

Optimizes compact transcript backfill by first checking v2 session metadata and skipping v1 reads for sessions with no recorded agent type (permanently non-generatable compact transcripts). Adds focused tests for the new predicate, fast-path behavior, and the no-agent skip case.

Reviewed by Cursor Bugbot for commit 7d09b51. Configure here.

Adds fast path checks for a few cases during migration:

* avoid the whole repair branch when critical components are missing
* check if required v2 fields are already present when rerunning
  migration to skip more quickly

Entire-Checkpoint: 1e3e28c2a692
@computermode computermode requested a review from a team as a code owner May 4, 2026 17:47
Copilot AI review requested due to automatic review settings May 4, 2026 17:47
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

Speeds up entire migrate --checkpoints v2 reruns by short-circuiting checkpoints that already look fully migrated and by avoiding unnecessary v1 reads during compact-transcript backfill. This fits into the migration path for the CLI’s v1→v2 checkpoint storage.

Changes:

  • Added a fast-path in migrateOneCheckpoint to skip already-complete v2 checkpoints.
  • Added v2CheckpointFullyMigrated to detect when compact transcripts and /full/* artifacts already exist.
  • Optimized compact-transcript backfill to inspect v2 metadata first and skip v1 transcript reads for sessions with no recorded agent.

Reviewed changes

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

File Description
cmd/entire/cli/migrate.go Adds the new rerun fast-path and the metadata-first backfill shortcut.
cmd/entire/cli/migrate_test.go Adds tests for the fast-path helper and the no-agent backfill shortcut.

Comment thread cmd/entire/cli/migrate.go
Comment thread cmd/entire/cli/migrate_test.go
@computermode computermode merged commit d3ff1b9 into main May 4, 2026
14 checks passed
@computermode computermode deleted the speedup-v2-migration branch May 4, 2026 18:05
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