diff --git a/skills/strix-ci-setup/SKILL.md b/skills/strix-ci-setup/SKILL.md index 416c1c665..97859d653 100644 --- a/skills/strix-ci-setup/SKILL.md +++ b/skills/strix-ci-setup/SKILL.md @@ -85,7 +85,12 @@ if [ -z "$BASE_BRANCH" ]; then BASE_BRANCH="${BASE_BRANCH#origin/}" fi DIFF_BASE="origin/${BASE_BRANCH:-main}" -git rev-parse --verify --quiet "$DIFF_BASE" >/dev/null || DIFF_BASE="HEAD~1" +# Fail loudly rather than silently narrowing scope (e.g. to HEAD~1, which on a +# multi-commit branch would scan only the last commit and let earlier ones pass). +if ! git rev-parse --verify --quiet "$DIFF_BASE" >/dev/null; then + echo "Cannot resolve diff base '$DIFF_BASE'. Fetch the base branch (git fetch origin ) or set --diff-base explicitly." >&2 + exit 1 +fi strix -n -t ./ --scan-mode quick --scope-mode diff --diff-base "$DIFF_BASE" --max-budget 10 ``` diff --git a/skills/strix-fix-findings/SKILL.md b/skills/strix-fix-findings/SKILL.md index fd00fad32..bb28acb6a 100644 --- a/skills/strix-fix-findings/SKILL.md +++ b/skills/strix-fix-findings/SKILL.md @@ -49,7 +49,10 @@ if [ -z "$DIFF_BASE" ]; then git rev-parse --verify --quiet "$b" >/dev/null && DIFF_BASE="$b" && break done fi -DIFF_BASE="${DIFF_BASE:-HEAD~1}" +# No silent fallback: a guess like HEAD~1 would cover only the last commit of a +# multi-commit fix branch. If no base resolves, ask the user for the base branch +# (or use the focused --instruction verification below, which needs no diff base). +[ -n "$DIFF_BASE" ] || { echo "Set DIFF_BASE to the branch your fix will merge into." >&2; exit 1; } strix -n -t ./ --scan-mode quick --scope-mode diff --diff-base "$DIFF_BASE" --max-budget 5 # Or re-test with the original finding as focus (no diff base needed)