#!/usr/bin/env bash set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" INSTR_DIR="$REPO_ROOT/tests/strix/Z" # Generate instruction files python3 "$REPO_ROOT/tests/strix/generate_strix_tests.py" if [[ -z "${LLM_API_KEY:-}" || -z "${STRIX_LLM:-}" ]]; then echo "Warning: STRIX_LLM or LLM_API_KEY not set. Set them before running Strix (or configure local model)." echo "Runner will still generate instruction files; to execute scans set the env vars and run again." fi failed=0 for md in "$INSTR_DIR"/*.md; do echo "---- Running Strix for $md ----" if [[ -z "${LLM_API_KEY:-}" ]]; then echo "Skipping execution: LLM_API_KEY not set" continue fi # non-interactive, focused instruction strix -n --target "$REPO_ROOT" --instruction-file "$md" --scan-mode quick || failed=1 done if [[ $failed -ne 0 ]]; then echo "Some Strix runs failed or found issues (exit code non-zero). Check output above." >&2 exit $failed fi echo "All Strix runs completed."