Make worktree prune preview-first and capacity warnings actionable - #1291
Open
chubes4 wants to merge 1 commit into
Open
Make worktree prune preview-first and capacity warnings actionable#1291chubes4 wants to merge 1 commit into
chubes4 wants to merge 1 commit into
Conversation
Bounded dry-run is now the default for stale Git registrations, and worktree-count advisories point at that preview instead of hygiene JSON.
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
High-volume
workspace liststill defaults to a 50-row page plus a compact capacity warning that only pointed at hygiene JSON, while raw Git already showed many prunable dead registrations.workspace worktree prunewas immediately destructive, unbounded, and refreshed the full inventory.This keeps inventory/cleanup bounded and fast, and makes the worktree-count warning preview-first:
workspace worktree prunenow defaults to a bounded dry-run of stale Git registrations (--limit=25,--until-budget=30s,--after-repocontinuation).--yesapplies. Live checkouts are never deleted.workspace worktree prune --dry-runandinventory prune-missing --dry-runinstead of only hygiene JSON.Does not apply cleanup or delete worktrees.
Trackers
Verification
php bin/dmc-test tests/worktree-prune-preview.php tests/worktree-prune-linked-primary.php tests/workspace-capacity-advisory.php tests/worktree-command-help-snapshots.php tests/workspace-list-cli-format-contract.php tests/workspace-show-cli-format-contract.php tests/workspace-compact-output.php tests/worktree-emergency-cleanup-lock-reactivation.php tests/workspace-command-startup-bounds.phpphp bin/dmc-test— 148/150 passed.tests/worktree-add-lifecycle.phpalso fails on currentorigin/main(pre-existing).tests/workspace-command-startup-bounds.phppassed in isolation and flaked once under the full suite.Remaining gaps
workspace listis still a 50-row page with cursor ceremony;--summaryremains opt-in (workspace list should be bounded and summary-first on high-cardinality workspaces #1034 closed the bounded-page slice).missing_pathinventory rows still need the separateinventory prune-missingpreview/apply path.AI assistance
OpenAI gpt-5.6-sol via OpenCode general coding subagent inspected #749/#789, matching PRs, live inventory/hygiene, and raw Git prune candidates; implemented preview-first bounded prune and actionable capacity warnings; added deterministic tests; ran focused and repository tests; and opened this PR. Chris Huber owns direction and merge.