From 8517776be58f980acb6b040f9a856c94d1293ded Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Sun, 10 May 2026 20:50:44 +0200 Subject: [PATCH] =?UTF-8?q?fix(claude):=20foxhunt=20audit=20router=20?= =?UTF-8?q?=E2=80=94=20plans=20path=20+=20REPO=5FROOT=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .claude/helpers/foxhunt-audit-router.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.claude/helpers/foxhunt-audit-router.sh b/.claude/helpers/foxhunt-audit-router.sh index 8ce848878..d709c88bb 100755 --- a/.claude/helpers/foxhunt-audit-router.sh +++ b/.claude/helpers/foxhunt-audit-router.sh @@ -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