Review: Fix cleanup-worktrees.sh repo list

review-509-2026-03-27 Review

review needs-refinement

Verdict: NEEDS_REFINEMENT

Template Completeness

  • [x] Type — Bug
  • [x] Lineage — standalone, references spec and plan docs (both verified on disk)
  • [x] Repo — forgejo_admin/claude-custom
  • [x] What Broke — clear description of stale REPO_DIRS array
  • [x] Repro Steps — step-by-step with line numbers
  • [x] Expected Behavior — lists target state
  • [x] Environment — hook file, event, counts
  • [x] Acceptance Criteria — 4 criteria, all testable
  • [x] Related — project and SOP references
All required bug template sections present. Template is complete.

Traceability

  • [x] story:pm-scope — present on board item #509
  • [x] arch:worktree — present on board item #509
  • [x] Forgejo issue — forgejo_admin/claude-custom#195, open
All three traceability legs present.

File Targets

  • [x] hooks/cleanup-worktrees.sh lines 15-25 — verified: REPO_DIRS array is exactly at those lines with 9 entries
  • [x] Remove pal-e-api — verified stale: ~/pal-e-api does not exist on disk
  • [x] Remove pal-e-sdk — verified stale: ~/pal-e-sdk does not exist on disk
  • [ ] Remove pal-e-mcp — ISSUE: ~/pal-e-mcp DOES exist on disk (Forgejo remote: forgejo_admin/pal-e-mcp). The issue claims it was renamed to pal-e-docs-mcp, but ~/pal-e-docs-mcp does NOT exist. The correct directory name is pal-e-mcp.
  • [ ] Add pal-e-docs-mcp — ISSUE: this directory does not exist. Should be pal-e-mcp (which already exists in the current array and should be kept, not removed).
  • [x] Add pal-e-docs — verified: ~/pal-e-docs exists
  • [x] Add pal-e-docs-sdk — verified: ~/pal-e-docs-sdk exists (Forgejo remote: pal-e-sdk)
  • [x] Add pal-e-deployments — verified: exists on disk
  • [x] Add westside-app — verified: exists on disk
  • [x] Add westside-contracts — verified: exists on disk
  • [x] Add mcd-tracker-api — verified: exists on disk
  • [x] Add mcd-tracker-app — verified: exists on disk
  • [x] Add minio-sdk — verified: exists on disk
  • [x] Add minio-api — verified: exists on disk
  • [ ] palworld-server — ISSUE: issue says remove as "inactive" but directory exists on disk at ~/palworld-server. Low risk (worktrees unlikely) but the claim "no longer exists" is factually wrong.

Repo Placement

OK. Fix is in claude-custom, issue is filed on claude-custom. Single-repo change.

Dependencies

Board item #508 (Post-merge worktree cleanup, also in todo) and #507 (Pre-spawn freshness hook) are sibling worktree items from the same brainstorm session. No blocking dependency — this bug fix is independent. All three share the same spec/plan lineage.

Acceptance Criteria

4 criteria, all verifiable by an agent:
  • AC1 (remove stale repos) — verifiable via array inspection, but pal-e-mcp should NOT be removed (see File Targets)
  • AC2 (add missing repos) — verifiable, but pal-e-docs-mcp should be pal-e-mcp (already present, so net effect: don't touch it)
  • AC3 (all listed directories exist on disk) — verifiable via ls -d
  • AC4 (existing hook logic unchanged) — verifiable via diff
Criteria are testable but AC1 and AC2 contain incorrect instructions that would break the hook for pal-e-mcp.

Blast Radius

REPO_DIRS is only used in hooks/cleanup-worktrees.sh. No other scripts reference it. The hook is wired via settings.json line 37. Blast radius is minimal.
Additional repos in MEMORY.md that exist on disk but are absent from both current array AND the issue's proposed additions: pal-e-mail, minio-playground, mcd-tracker-playground, tmux-custom, pal-e-docs-playground, westside-playground. The issue's "target repo count: 15" may undercount active repos. This is a minor scope gap — the agent implementing the fix should verify the canonical repo list rather than relying solely on the issue body.

Decomposition

1 file target, 4 acceptance criteria, estimated under 2 minutes agent time. No decomposition needed.

Recommendation

  • [BODY] Fix file target: remove pal-e-mcp from the "Remove stale repos" AC — ~/pal-e-mcp exists on disk and is active (Forgejo remote: forgejo_admin/pal-e-mcp).
  • [BODY] Fix file target: remove pal-e-docs-mcp from the "Add missing repos" AC — that directory does not exist. pal-e-mcp is already in the current array and should stay.
  • [BODY] Update Repro Step 3: "pal-e-mcp renamed to pal-e-docs-mcp" is incorrect — the local directory is still ~/pal-e-mcp.
  • [BODY] Clarify palworld-server disposition: directory exists on disk. Either keep it (safe) or explicitly note "inactive, remove despite directory existing."
  • [SCOPE] Consider adding additional active repos missing from both lists: pal-e-mail, minio-playground, mcd-tracker-playground, tmux-custom, pal-e-docs-playground, westside-playground. Update target count accordingly.