Skip to content

(Do not merge) One-time migration script for v2 checkpoints to v1#1257

Closed
computermode wants to merge 8 commits into
mainfrom
tmp-migrate-v2-script
Closed

(Do not merge) One-time migration script for v2 checkpoints to v1#1257
computermode wants to merge 8 commits into
mainfrom
tmp-migrate-v2-script

Conversation

@computermode

@computermode computermode commented May 22, 2026

Copy link
Copy Markdown
Contributor

Example command:

To see all the checkpoints to migrate:

./scripts/migrate-v2-checkpoints-to-v1.sh \
  --repo path/to/repo \
  --since <commit sha> --list

To go through a dry run:

./scripts/migrate-v2-checkpoints-to-v1.sh \
  --repo path/to/repo \
  --since <commit sha> --dry-run

To create the commit that copies the checkpoints from v2 to v1:

./scripts/migrate-v2-checkpoints-to-v1.sh \
  --repo path/to/repo \
  --since <commit sha> --apply

To validate:
git show --stat refs/heads/entire/checkpoints/v1

To push after:
git push origin refs/heads/entire/checkpoints/v1:refs/heads/entire/checkpoints/v1


Note

Medium Risk
Adds a one-off migration script that can create and update the refs/heads/entire/checkpoints/v1 ref based on parsed commit trailers and checkpoint refs; misuse could write incorrect history or overwrite the local ref.

Overview
Introduces scripts/migrate-v2-checkpoints-to-v1.sh, a standalone tool to plan or apply migration of legacy v2 checkpoint artifacts back into the v1 checkpoint tree.

The script scans commits after a given --since (optionally constrained by --head) for Entire-Checkpoint trailers, maps those checkpoint IDs to v2 data under refs/entire/checkpoints/v2/full/* (raw transcripts + hashes), and pulls companion session/prompt metadata from refs/entire/checkpoints/v2/main when available.

It supports --list (checkpoint IDs + commit IDs), --dry-run (print every source artifact), and --apply, which builds a new v1 tree, rewrites checkpoint-level metadata.json to include discovered sessions, and writes a single migration commit updating refs/heads/entire/checkpoints/v1.

Reviewed by Cursor Bugbot for commit 1ea7f14. Configure here.

Entire-Checkpoint: c9bc625237a6
Entire-Checkpoint: e25de9aab773
Copilot AI review requested due to automatic review settings May 22, 2026 23:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a standalone, one-time Bash script to migrate legacy v2 checkpoint artifacts (raw transcripts + companion metadata) into the v1 checkpoint tree and optionally write a single migration commit updating refs/heads/entire/checkpoints/v1.

Changes:

  • Introduces scripts/migrate-v2-checkpoints-to-v1.sh with modes to list, dry-run, or apply a migration.
  • Scans git history for Entire-Checkpoint: <12-hex> trailers and maps them to v2 full/* and main ref artifacts.
  • (On --apply) rewrites checkpoint-level metadata.json to include discovered session entries and writes a migration commit.

Comment thread scripts/migrate-v2-checkpoints-to-v1.sh Outdated
Comment thread scripts/migrate-v2-checkpoints-to-v1.sh Outdated
Comment thread scripts/migrate-v2-checkpoints-to-v1.sh Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 2 potential issues.

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 1ea7f14. Configure here.

Comment thread scripts/migrate-v2-checkpoints-to-v1.sh Outdated
Comment thread scripts/migrate-v2-checkpoints-to-v1.sh Outdated
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