Repository navigation
fix(maintenance): stop the shared git dir keeping dead stores alive - #4120
Merged
Merged
Conversation
Orphan-store classification counted the repository's git common directory as a liveness root. A linked worktree shares that directory with the primary checkout, so the store of a deleted worktree stayed Live for as long as the repository existed and was never collected. Liveness now comes from the registered checkout roots only: the canonical and display roots and every path alias, which includes each enrolled checkout. The git-common-dir alias is skipped because it names the shared git directory, not a checkout. A registry-backed test plans a deleted worktree's store for collection while its git dir lives.
|
ScriptedAlchemy
enabled auto-merge
October 16, 2026 09:43
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 2 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
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.
Summary
Step 3 of the storage redesign (
docs/plans/storage/README.mdin #4118), first growth source from #4099.Orphan-store classification counted the repository's git common directory as a liveness root. A linked worktree shares that directory with the primary checkout, so the store of a deleted worktree stayed Live for as long as the repository existed and was never collected; the test that pinned this (
live_git_common_dir_keeps_a_linked_worktree_store_live) encoded the leak. Liveness now comes from the registered checkout roots only: the canonical and display roots and every path alias, which includes each enrolled checkout. Thegit-common-dir:alias is skipped because it names the shared git directory, not a checkout. A store with any live enrolled checkout stays Live (live_registered_alias_keeps_the_store_out_of_every_collectable_bucketstill holds), and the durable-memory guard and retention window are unchanged.Test plan
bazel test --config=clippy //crates/tracedecay-maintenance:unit_test(107 passed).sweep_plans_a_deleted_worktrees_store_while_its_repository_livesseeds a registry project whose checkout is gone and whose recorded git dir exists, and asserts the sweep plans its store for collection. Feeding the git dir back into the liveness roots makes it fail (left[], right["store_worktree"]).rustfmt_check_2024for the touched crate//crates/tracedecay:daemon_suite,:mcp_suite,:session_suite,:unit_testin CIRefs #4099