Repository navigation
fix: repair stale checkpoints and flag worktree setup gaps - #2408
Draft
MuskanPaliwal wants to merge 3 commits into
Draft
MuskanPaliwal wants to merge 3 commits into
MuskanPaliwal wants to merge 3 commits into
Conversation
Entire-Checkpoint: 01M2FNRCE1AMZZVN8C15DVKP6S
Contributor
Author
|
Hi @karthik-rameshkumar , i have created a draft pr for the follow ups in your pr #2404 . would love your feedback on the direction. thanks :)) |
Entire-Checkpoint: 01M2SP2J7Z3PW4XVMHV24HDTMG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is stacked on #2404. It should target
krk/doctor-shrink-checkpoint-metadatawhile that PR is open, then be retargeted tomainafter #2404 lands.Problem
#2404 prevents new oversized
prompt_attributionsmetadata and adds an explicit doctor repair. Two cases remain.A stale clone can still contain the original oversized history plus newer local checkpoints after another clone repairs the remote. Its next push may reject the repaired history as unrelated or replay the old commits and reintroduce the oversized blobs.
Commit hashes cannot identify the shared boundary reliably because rewriting metadata and signing commits both change commit IDs. OPF also runs before ordinary push recovery, so cleanup must happen before its divergence check.
Fresh Claude Code linked worktrees have a separate setup problem. Shared Git hooks may exist even though Entire hook dispatch is inactive because the worktree has no Entire settings. Claude user or local settings may cover the current worktree, but
.entire/settings.jsonand.claude/settings.jsonare the portable project files needed by new worktrees and separate clones.Checkpoint push repair
For the git-branch v1 backend, pre-push now scans reachable
metadata.jsonhistory before OPF.When it finds oversized metadata, it:
checkpoint_remoteURL.This path does not force-push.
The shared boundary is identified by tree content rather than commit hash. If the histories have an exact hash merge base, a content match older than that merge base is rejected. This prevents an unrepaired remote from being mistaken for a repaired one.
Replay also checks the resulting tree before creating a commit. If the change is already present at the remote tip, it skips the commit so repeated pushes do not duplicate checkpoints.
The implementation covers the cases that differ from ordinary push recovery:
Shallow history has an explicit boundary. If the shallow boundary is clean, the rewriter preserves it and repairs bloat introduced afterward. If that boundary contains oversized metadata, pre-push stops and asks the user to fetch the missing checkpoint history.
Automatic cleanup applies only to
entire/checkpoints/v1. Per-checkpoint Git refs keep their current push behavior.Worktree setup warnings
entire status,entire status --detailed,entire status --json, andentire doctornow use the same linked-worktree diagnostic.The warning appears only when a non-prunable sibling worktree proves that the project has both enabled project-level Entire settings and shared Claude project hooks.
It stays silent for ordinary repositories, disabled setups, malformed or unreadable configuration, worktree-list failures, and correctly configured worktrees.
The message distinguishes between two states:
JSON keeps the existing
"error": "not set up"value and adds an optionalworktree_setupobject. Doctor reports shared Git hooks as installed but inactive when Entire settings are absent instead of reporting them as healthy.Reading a sibling's settings does not replace the current worktree's process-wide vouched symlink policy.
Performance
A clean v1 push adds one local Git history scan and no extra fetch. A local benchmark over a synthetic 500-commit checkpoint history measured about 137 ms per scan across 10 iterations. The scan has a 10-second timeout.
Verification
Passed locally:
mise run checkgo test ./cmd/entire/cli/strategy -count=1go test ./cmd/entire/cli/settings ./cmd/entire/cli/agent/claudecode -count=1go test ./cmd/entire/cli -count=1git diff --checkNo real-agent E2E tests were run.