Fix cleanup-worktrees.sh stale repo list #195

Closed
opened 2026-03-28 04:39:10 +00:00 by forgejo_admin · 2 comments
Contributor

Type

Bug

Lineage

Standalone — discovered during worktree lifecycle enforcement brainstorm (2026-03-28).
Spec: pal-e-platform/docs/superpowers/specs/2026-03-28-worktree-lifecycle-enforcement-design.md
Plan: pal-e-platform/docs/superpowers/plans/2026-03-28-worktree-lifecycle-enforcement.md — Task 3

Repo

forgejo_admin/claude-custom

What Broke

REPO_DIRS in hooks/cleanup-worktrees.sh (lines 15-25) lists 2 stale repo names that no longer exist on disk (pal-e-api, pal-e-sdk) and is missing 13 active repos. Stale worktrees in those repos are never cleaned up by the SessionStart hook.

Repro Steps

  1. Open hooks/cleanup-worktrees.sh
  2. Observe REPO_DIRS array on lines 15-25 (9 entries)
  3. Note: pal-e-api does not exist on disk (MISSING)
  4. Note: pal-e-sdk does not exist on disk (MISSING)
  5. Note: pal-e-mcp DOES exist on disk — keep it (NOT renamed)
  6. Note: palworld-server DOES exist on disk — keep it
  7. Note: 13 active repos are missing from the array entirely

Expected Behavior

REPO_DIRS should list all 22 active repos. Stale worktrees in any repo should be caught by the SessionStart cleanup.

Environment

  • Hook file: hooks/cleanup-worktrees.sh
  • Runs on: SessionStart event
  • Current repo count: 9 (2 stale, 13 missing)
  • Target repo count: 22

Acceptance Criteria

  • Remove repos that don't exist on disk: pal-e-api, pal-e-sdk
  • Keep all existing repos that ARE on disk: pal-e-platform, pal-e-mcp, pal-e-app, pal-e-services, claude-custom, basketball-api, palworld-server
  • Add missing repos (all verified on disk): pal-e-docs, pal-e-docs-sdk, pal-e-deployments, westside-app, westside-contracts, mcd-tracker-api, mcd-tracker-app, minio-sdk, minio-api, pal-e-mail, minio-playground, mcd-tracker-playground, tmux-custom, pal-e-docs-playground, westside-playground
  • Final array has exactly 22 entries
  • Existing hook logic unchanged (only REPO_DIRS array changes)
  • project-pal-e-agency — agent infrastructure project
  • worktree-workflow — SOP this supports
  • Review: review-509-2026-03-27 — identified 5 errors in original scope
### Type Bug ### Lineage Standalone — discovered during worktree lifecycle enforcement brainstorm (2026-03-28). Spec: `pal-e-platform/docs/superpowers/specs/2026-03-28-worktree-lifecycle-enforcement-design.md` Plan: `pal-e-platform/docs/superpowers/plans/2026-03-28-worktree-lifecycle-enforcement.md` — Task 3 ### Repo `forgejo_admin/claude-custom` ### What Broke `REPO_DIRS` in `hooks/cleanup-worktrees.sh` (lines 15-25) lists 2 stale repo names that no longer exist on disk (`pal-e-api`, `pal-e-sdk`) and is missing 13 active repos. Stale worktrees in those repos are never cleaned up by the SessionStart hook. ### Repro Steps 1. Open `hooks/cleanup-worktrees.sh` 2. Observe `REPO_DIRS` array on lines 15-25 (9 entries) 3. Note: `pal-e-api` does not exist on disk (MISSING) 4. Note: `pal-e-sdk` does not exist on disk (MISSING) 5. Note: `pal-e-mcp` DOES exist on disk — keep it (NOT renamed) 6. Note: `palworld-server` DOES exist on disk — keep it 7. Note: 13 active repos are missing from the array entirely ### Expected Behavior `REPO_DIRS` should list all 22 active repos. Stale worktrees in any repo should be caught by the SessionStart cleanup. ### Environment - Hook file: `hooks/cleanup-worktrees.sh` - Runs on: SessionStart event - Current repo count: 9 (2 stale, 13 missing) - Target repo count: 22 ### Acceptance Criteria - [ ] Remove repos that don't exist on disk: `pal-e-api`, `pal-e-sdk` - [ ] Keep all existing repos that ARE on disk: `pal-e-platform`, `pal-e-mcp`, `pal-e-app`, `pal-e-services`, `claude-custom`, `basketball-api`, `palworld-server` - [ ] Add missing repos (all verified on disk): `pal-e-docs`, `pal-e-docs-sdk`, `pal-e-deployments`, `westside-app`, `westside-contracts`, `mcd-tracker-api`, `mcd-tracker-app`, `minio-sdk`, `minio-api`, `pal-e-mail`, `minio-playground`, `mcd-tracker-playground`, `tmux-custom`, `pal-e-docs-playground`, `westside-playground` - [ ] Final array has exactly 22 entries - [ ] Existing hook logic unchanged (only REPO_DIRS array changes) ### Related - `project-pal-e-agency` — agent infrastructure project - `worktree-workflow` — SOP this supports - Review: `review-509-2026-03-27` — identified 5 errors in original scope
Author
Contributor

Scope Review: NEEDS_REFINEMENT

Review note: review-509-2026-03-27

The issue has correct template structure and full traceability, but contains incorrect file targets that would break the hook if followed literally.

Critical fixes needed:

  • pal-e-mcp should NOT be removed from REPO_DIRS — ~/pal-e-mcp exists on disk (Forgejo remote: forgejo_admin/pal-e-mcp). The claim it was "renamed to pal-e-docs-mcp" is wrong.
  • pal-e-docs-mcp should NOT be added — that directory does not exist. pal-e-mcp is already in the array and should stay.
  • Repro Step 3 ("pal-e-mcp renamed to pal-e-docs-mcp") is factually incorrect.
  • palworld-server directory exists on disk despite being called "inactive" — clarify disposition.

Scope gap:

  • 6+ additional active repos on disk are missing from both current array and proposed additions: pal-e-mail, minio-playground, mcd-tracker-playground, tmux-custom, pal-e-docs-playground, westside-playground. Target count of 15 may be an undercount.
## Scope Review: NEEDS_REFINEMENT Review note: `review-509-2026-03-27` The issue has correct template structure and full traceability, but contains **incorrect file targets** that would break the hook if followed literally. **Critical fixes needed:** - `pal-e-mcp` should NOT be removed from REPO_DIRS — `~/pal-e-mcp` exists on disk (Forgejo remote: `forgejo_admin/pal-e-mcp`). The claim it was "renamed to pal-e-docs-mcp" is wrong. - `pal-e-docs-mcp` should NOT be added — that directory does not exist. `pal-e-mcp` is already in the array and should stay. - Repro Step 3 ("pal-e-mcp renamed to pal-e-docs-mcp") is factually incorrect. - `palworld-server` directory exists on disk despite being called "inactive" — clarify disposition. **Scope gap:** - 6+ additional active repos on disk are missing from both current array and proposed additions: `pal-e-mail`, `minio-playground`, `mcd-tracker-playground`, `tmux-custom`, `pal-e-docs-playground`, `westside-playground`. Target count of 15 may be an undercount.
Author
Contributor

Scope Review: READY

Review note: review-509-2026-03-27-v2
All 5 errors from v1 review have been corrected. All 22 repos independently verified on disk. Ticket is ready for execution.

  • (cosmetic, non-blocking) "What Broke" says "missing 13 active repos" but AC lists 15 additions. AC is authoritative — prose count is stale.
## Scope Review: READY Review note: `review-509-2026-03-27-v2` All 5 errors from v1 review have been corrected. All 22 repos independently verified on disk. Ticket is ready for execution. - (cosmetic, non-blocking) "What Broke" says "missing 13 active repos" but AC lists 15 additions. AC is authoritative — prose count is stale.
forgejo_admin 2026-03-28 05:00:05 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/claude-custom#195
No description provided.