mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-28 03:49:31 +00:00
The worktree path regex in pre-merge-check.ts used [^\s/]+ which only matched a single path segment after /tmp/spawn-worktrees/. This blocked PR merges from nested worktrees like refactor/fix/issue-N used by the automated refactoring service. Fix both the TypeScript regex ([^\s/]+ -> [^\s]+) and the inline bash grep pattern in settings.json ([a-zA-Z0-9._-]+ -> [a-zA-Z0-9._/-]+). Closes #2401 Agent: code-health Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
50 lines
1.8 KiB
JSON
50 lines
1.8 KiB
JSON
{
|
|
"env": {
|
|
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
|
|
},
|
|
"permissions": {
|
|
"defaultMode": "bypassPermissions"
|
|
},
|
|
"hooks": {
|
|
"PreToolUse": [
|
|
{
|
|
"matcher": "Write|Edit",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "bun .claude/scripts/enforce-worktree.ts"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"matcher": "Bash",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "bun .claude/scripts/pre-merge-check.ts"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"matcher": "Bash",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "bash -c 'INPUT=$(cat); CMD=$(echo \"$INPUT\" | jq -r \".tool_input.command // empty\"); echo \"$CMD\" | grep -qE \"gh pr (merge|ready)\" || exit 0; WT=$(echo \"$CMD\" | grep -oE \"/tmp/spawn-worktrees/[a-zA-Z0-9._/-]+\" | head -1); if [ -n \"$WT\" ] && [ -d \"$WT/packages/cli\" ]; then ROOT=\"$WT\"; else ROOT=$(git rev-parse --show-toplevel 2>/dev/null); fi; if [ -z \"$ROOT\" ] || [ ! -d \"$ROOT/packages/cli\" ]; then echo \"WARNING: Could not find spawn repo for pre-merge checks\" >&2; exit 0; fi; cd \"$ROOT/packages/cli\" || exit 2; echo \"Pre-merge gate: running biome check + bun test in $ROOT/packages/cli ...\" >&2; bunx @biomejs/biome check src/ 2>&1 || { echo \"BLOCKED: biome check failed — fix lint/format issues before merging\" >&2; exit 2; }; bun test 2>&1 || { echo \"BLOCKED: tests failed — fix failures before merging\" >&2; exit 2; }; echo \"Pre-merge checks passed\" >&2'"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"PostToolUse": [
|
|
{
|
|
"matcher": "Write|Edit",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "bun .claude/scripts/validate-file.ts"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|