fix(claude): foxhunt audit router — plans path + REPO_ROOT consistency
Two Important review findings: 1. docs/superpowers/plans/*.md missing from sp-critical-reviewer routing table — sp-critical-reviewer would never self-suggest on plan files (its primary use case). 2. STATE_FILE and REPO_ROOT diverged when CLAUDE_PROJECT_DIR was unset (one used "." relative, the other "$(pwd)" absolute). Compute REPO_ROOT first and derive STATE_FILE from it; remove the duplicate later assignment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,8 @@
|
||||
|
||||
set -u # not -e; we want to exit 0 even on errors
|
||||
|
||||
STATE_FILE="${CLAUDE_PROJECT_DIR:-.}/.claude/.foxhunt-audit-state"
|
||||
REPO_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
|
||||
STATE_FILE="$REPO_ROOT/.claude/.foxhunt-audit-state"
|
||||
mkdir -p "$(dirname "$STATE_FILE")" 2>/dev/null || exit 0
|
||||
touch "$STATE_FILE" 2>/dev/null || exit 0
|
||||
|
||||
@@ -28,7 +29,6 @@ PATH_FOUND="$(printf '%s' "$INPUT" | grep -oE '"file_path"[[:space:]]*:[[:space:
|
||||
[ -z "$PATH_FOUND" ] && exit 0
|
||||
|
||||
# Make path repo-relative if absolute
|
||||
REPO_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
|
||||
case "$PATH_FOUND" in
|
||||
"$REPO_ROOT"/*) REL="${PATH_FOUND#$REPO_ROOT/}" ;;
|
||||
/*) REL="$PATH_FOUND" ;;
|
||||
@@ -51,7 +51,7 @@ case "$REL" in
|
||||
crates/ml-*/*.rs|crates/ml-*/**/*.rs) SUGGEST+=("isv-discipline-auditor") ;;
|
||||
esac
|
||||
case "$REL" in
|
||||
docs/superpowers/specs/*.md|docs/plans/*.md)
|
||||
docs/superpowers/specs/*.md|docs/superpowers/plans/*.md|docs/plans/*.md)
|
||||
SUGGEST+=("sp-critical-reviewer") ;;
|
||||
esac
|
||||
case "$REL" in
|
||||
|
||||
Reference in New Issue
Block a user