This repository was archived by the owner on Sep 2, 2026. It is now read-only.
Bound and preview worktree registration pruning - #1289
Merged
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
workspace worktree prune --dry-runpath with structured JSON evidenceworktree prunescoped to Git registration metadata, removing its hidden unbounded inventory repair and path-present checkout deletion behaviorRoot cause
High-volume workspace inventory is intentionally paginated, but the worktree-count advisory did not point to a focused preview. The apparent metadata cleanup command immediately mutated state, traversed the full inventory, and could recursively remove a path-present stale-marker checkout. That made it unsuitable as safe warning remediation and coupled cheap Git registration pruning to expensive, destructive inventory repair.
Safety
No cleanup was applied and no actual worktree was deleted while developing or verifying this change. Git dry-run and capacity warning actions are preview-first. Actual checkout cleanup remains in the existing bounded cleanup plan/apply paths.
Verification
bin/dmc-test tests/worktree-prune-linked-primary.php tests/worktree-command-help-snapshots.php tests/worktree-command-routing.php tests/workspace-capacity-advisory.php tests/workspace-command-startup-bounds.php tests/worktree-disk-budget.php tests/workspace-capacity-envelope.php tests/workspace-hygiene-bounded-du.php tests/worktree-inventory-prune-missing.php tests/workspace-safe-cleanup-orchestrator.php tests/cleanup-remaining-work-summary.php(11 passed)composer validate --no-check-publishgit diff --checkbin/dmc-testexercised 149 tests; the changed startup-bounds test was updated and passes focused. Remaining unrelated gaps:workspace-lock-sqlite-contention.phpis timing-flaky (passed and failed isolated runs), andworktree-add-lifecycle.phpreproducibly fails its remote stale-plan fixture on current main-derived code.Refs #749
Refs #789
AI disclosure
OpenAI gpt-5.6-sol via OpenCode general coding subagent was used for issue/PR scope research and code review; implementation and verification were performed in OpenCode.