Skip to content

feat(dispatch): Coase dispatch policy + engineer isolation script#1

Merged
cdeust merged 1 commit into
mainfrom
audit/coase-dispatch-policy-2026-05-04
May 6, 2026
Merged

feat(dispatch): Coase dispatch policy + engineer isolation script#1
cdeust merged 1 commit into
mainfrom
audit/coase-dispatch-policy-2026-05-04

Conversation

@cdeust
Copy link
Copy Markdown
Owner

@cdeust cdeust commented May 5, 2026

Summary

  • Boundary analysis establishes one-agent-per-worktree with main-root lock as the efficient option (Option A + C lock rule); cloning per agent costs ~13 GB + 5 min at 11 agents vs. a 40-line enforcement script
  • Ships scripts/dispatch-engineer.sh: atomic worktree spawn with dirty-state assertion, pnpm install, and per-worktree pre-push isolation hook
  • Ships docs/audits/COASE_DISPATCH_POLICY_2026-05-04.md: 4-option cost matrix, orchestrator policy (do's + don'ts), dispatch contract boilerplate, and automation ownership table
  • Adds .claude/worktrees/ to .gitignore to prevent ephemeral worktrees from appearing as untracked noise in the parent root

Test plan

  • Run scripts/dispatch-engineer.sh test-agent-1 test/isolation-check against a clean main and verify it prints the worktree path, installs deps, and installs the pre-push hook
  • Introduce a dirty file in the parent root and re-run the script — verify it exits 1 with the dirty file listed
  • Verify git worktree list shows the new worktree as locked after spawn
  • Verify git worktree remove .claude/worktrees/test-agent-1 succeeds without --force after removing the test branch
  • Confirm .claude/worktrees/ no longer appears in git status --porcelain on main after the .gitignore change

🤖 Generated with Claude Code

Boundary analysis (COASE_DISPATCH_POLICY_2026-05-04) establishes that
Option A (one-agent-per-worktree) with Option C's main-root lock is the
efficient boundary: cloning per agent costs ~13 GB + 5 min at 11 agents;
policy + script enforcement costs one 40-line script and two hook checks.

Ships: docs/audits/COASE_DISPATCH_POLICY_2026-05-04.md (option matrix,
orchestrator policy, dispatch contract boilerplate, automation list),
scripts/dispatch-engineer.sh (atomic worktree spawn with precondition
assertions, pnpm install, and per-worktree pre-push isolation hook),
and .gitignore entry for .claude/worktrees/.

Co-Authored-By: Claude <noreply@anthropic.com>
@cdeust cdeust merged commit 1076a3a into main May 6, 2026
2 checks passed
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