Checkpoints v2: Use checkpoint creation time for migration generation calc + lower default generation retention#1088
Conversation
Preserve the original checkpoint created_at when migrating v1 checkpoints into v2 so migration time does not reset retention age. Derive archived generation timestamp ranges from v2 main metadata, with raw transcript timestamps as a fallback, and have cleanup recompute checkpoint ages before trusting generation.json. Add coverage for migration timestamp preservation, archive rotation timestamps, transcript fallback, and cleanup retention eligibility. Entire-Checkpoint: bc5c01c6ca8a
Change the full transcript generation retention fallback from 60 days to the intended 14-day window. Update settings tests so unset, nil, and zero retention values resolve to 14 days while explicit custom values are preserved. Entire-Checkpoint: 9bafba8019e7
There was a problem hiding this comment.
Pull request overview
This PR updates checkpoints v2 retention and rotation logic so generation age is derived from checkpoint metadata (created_at) rather than migration/commit time, preventing retention windows from being reset during v1→v2 migration or ref repair. It also lowers the default archived full-transcript generation retention window.
Changes:
- Preserve original checkpoint
created_atduring v1→v2 migration and committed metadata writes. - Compute archived generation timestamps from checkpoint metadata (with raw transcript timestamp fallback) and use this computation during cleanup eligibility checks.
- Reduce the default
full_transcript_generation_retention_daysfrom 60 to 14 and update/add tests accordingly.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/strategy/cleanup.go | Uses computed checkpoint timestamps for v2 generation cleanup eligibility, falling back to generation.json when needed. |
| cmd/entire/cli/settings/settings.go | Lowers the default archived full-transcript generation retention to 14 days. |
| cmd/entire/cli/settings/settings_test.go | Updates default-retention expectations from 60 to 14 days. |
| cmd/entire/cli/migrate.go | Preserves v1 checkpoint CreatedAt when writing v2 checkpoints during migration. |
| cmd/entire/cli/migrate_test.go | Adds a test asserting migration preserves checkpoint CreatedAt. |
| cmd/entire/cli/clean_test.go | Adds test coverage ensuring retention eligibility uses checkpoint timestamps. |
| cmd/entire/cli/checkpoint/v2_generation.go | Adds timestamp computation from checkpoint metadata/raw transcript and uses it during rotation. |
| cmd/entire/cli/checkpoint/v2_generation_test.go | Adds tests for timestamp sourcing from metadata and raw transcript fallback. |
| cmd/entire/cli/checkpoint/v2_committed.go | Writes committed metadata CreatedAt from provided options (preserving migration timestamps). |
| cmd/entire/cli/checkpoint/committed.go | Adds a helper to consistently derive CreatedAt (option value or current time). |
| cmd/entire/cli/checkpoint/checkpoint.go | Introduces WriteCommittedOptions.CreatedAt to carry original checkpoint creation time. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 22a87cd. Configure here.
Have clean --all discover archived v2 full generations from the checkpoint remote, fetch remote-only or stale refs into temporary refs for timestamp inspection, and keep dry-run side-effect free. Delete eligible archived v2 generation refs from both the local repository and the checkpoint remote using force-with-lease against the observed OID. Add coverage for dry-running and force-deleting remote-only archived generations. Entire-Checkpoint: 4e837ebcdfb0
Mark unreadable checkpoint trees as incomplete during v2 generation timestamp computation so callers fall back to generation.json instead of using partial derived ranges. Add regression coverage for a mixed readable/unreadable generation tree. Entire-Checkpoint: 74c42986449d

https://entire.io/gh/entireio/cli/trails/273
clean --allto account for remote generation refs as well (based on the retention setting)Note
Medium Risk
Changes retention eligibility for v2 archived transcript generations by switching timestamp sources and reducing the default retention window, which could cause earlier-than-expected cleanup of stored transcripts if timestamp derivation is wrong or metadata is missing.
Overview
V2 checkpoint retention now uses the checkpoint’s original creation time instead of git commit time.
WriteCommittedOptionsaddsCreatedAt, migration passes v1created_atthrough, and both v1/v2 committed writers persistcreated_atvia a shared helper.Generation rotation and cleanup were updated to compute archived generation timestamp ranges by walking checkpoints: prefer v2
/mainmetadata.jsoncreated_at, fall back to parsingtimestampfields from raw transcript events, and only fall back to existinggeneration.json/commit history when needed.The default
full_transcript_generation_retention_dayswas lowered from 60 → 14, with tests added/updated to cover created-at preservation, timestamp computation fallbacks, and cleanup eligibility.Reviewed by Cursor Bugbot for commit 22a87cd. Configure here.