Feature: Worktree isolation enforcement gaps -- hooks, SOP alignment, cleanup coverage #184
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/claude-custom#184
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Standalone — discovered during session reviewing worktree SOP alignment.
Related to
forgejo_admin/pal-e-platform #188(cross-repo isolation umbrella).Repo
forgejo_admin/claude-customUser Story
As a dev agent
I receive a well-scoped Forgejo issue and work in an isolated worktree
So that my changes don't pollute the main checkout or conflict with other agents
Context
Worktree workflow audit found 5 gaps between SOP documentation and actual enforcement. The highest severity gap: no hook enforces
git fetch + pullbefore agent spawn, which caused a production incident (2026-03-06, 40K+ tokens wasted on stale branch).File Targets
Files to modify (Dev agent — Ticket A):
hooks/check-agent-spawn.sh-- add freshness check (git fetch + compare HEAD to origin/main)hooks/cleanup-worktrees.shlines 17-25 -- update REPO_DIRS to cover all 17+ platform reposagents/qa.md-- addisolation: worktreeto frontmatter (reconcile with agent-spawn-requirements.json)CLAUDE.md-- add cross-reference to worktree-workflow SOPFiles to update (Dottie — Ticket B, depends on Ticket A merging):
worktree-workflow-- align with implemented freshness hooksop-claude-config-development-- add cross-reference to worktree-workflowDecomposition
This issue decomposes into 2 sequential agent dispatches:
Ticket A (Dev agent on claude-custom): Items 1-4 above. Hook code changes + config fixes. Creates a PR.
Ticket B (Dottie on pal-e-docs): Items 5-6 above. SOP updates via MCP tools. Depends on Ticket A merging first — SOPs must describe the implemented hooks, not planned hooks.
Acceptance Criteria
check-agent-spawn.shblocks spawn when local main is behind origin/maincleanup-worktrees.shcovers all repos in ~/agents/qa.mdhasisolation: worktreein frontmatterCLAUDE.mdreferences worktree-workflow SOPTest Expectations
Constraints
git fetch --dry-runorgit rev-list HEAD..origin/main --countChecklist
Related
project-pal-e-agencyforgejo_admin/pal-e-platform #188-- cross-repo isolation umbrellaforgejo_admin/claude-custom #136-- worktree auto-rebase (complementary)Review History
Closing as superseded by targeted tickets:
These three tickets address the enforcement gaps identified in this issue with specific, reviewable scope.