Skip to content
This repository was archived by the owner on Sep 2, 2026. It is now read-only.

Bound and preview worktree registration pruning - #1289

Merged
chubes4 merged 1 commit into
mainfrom
fix/749-high-volume-stats
Aug 29, 2026
Merged

Bound and preview worktree registration pruning#1289
chubes4 merged 1 commit into
mainfrom
fix/749-high-volume-stats

Conversation

@chubes4

@chubes4 chubes4 commented Aug 29, 2026

Copy link
Copy Markdown
Member

Summary

  • add a real workspace worktree prune --dry-run path with structured JSON evidence
  • bound local primary scanning to a shared 30-second budget and five-second Git/lock probes
  • keep worktree prune scoped to Git registration metadata, removing its hidden unbounded inventory repair and path-present checkout deletion behavior
  • make worktree-count capacity warnings directly actionable with bounded, non-applying checkout cleanup and stale-registration previews
  • report skipped/partial probes instead of presenting incomplete scans as clean

Root 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)
  • PHP syntax checks for all changed production PHP files
  • composer validate --no-check-publish
  • git diff --check
  • full bin/dmc-test exercised 149 tests; the changed startup-bounds test was updated and passes focused. Remaining unrelated gaps: workspace-lock-sqlite-contention.php is timing-flaky (passed and failed isolated runs), and worktree-add-lifecycle.php reproducibly 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.

@chubes4
chubes4 merged commit 78b249f into main Aug 29, 2026
11 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant