Skip to content

Make worktree prune preview-first and capacity warnings actionable - #1291

Open
chubes4 wants to merge 1 commit into
mainfrom
fix/749-789-preview-prune
Open

Make worktree prune preview-first and capacity warnings actionable#1291
chubes4 wants to merge 1 commit into
mainfrom
fix/749-789-preview-prune

Conversation

@chubes4

@chubes4 chubes4 commented Aug 29, 2026

Copy link
Copy Markdown
Member

Summary

High-volume workspace list still 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 prune was 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 prune now defaults to a bounded dry-run of stale Git registrations (--limit=25, --until-budget=30s, --after-repo continuation). --yes applies. Live checkouts are never deleted.
  • CLI/ability prune skips the full inventory refresh on preview and bounded apply.
  • Worktree-count capacity advisories lead with workspace worktree prune --dry-run and inventory prune-missing --dry-run instead of only hygiene JSON.

Does not apply cleanup or delete worktrees.

Trackers

Verification

  • Focused: 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.php
  • Required suite: php bin/dmc-test — 148/150 passed. tests/worktree-add-lifecycle.php also fails on current origin/main (pre-existing). tests/workspace-command-startup-bounds.php passed in isolation and flaked once under the full suite.

Remaining gaps

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.

Bounded dry-run is now the default for stale Git registrations, and
worktree-count advisories point at that preview instead of hygiene JSON.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant