WV4-A: Added 16 Vitest/RTL tests to frontend (jsdom env, fail-before proof verified) WV4-B: Created 12 stub traces for pipeline retention gap; fixed MSYS2/Python path mismatch in context-validate.sh; run-casan4-harness-tests.sh now preserves retention-gap stubs across log rotation WV4-E: Fixed 3 adversarial test failures: H1 MSYS2 path, H3 fnm node PATH, H7 sed tx-id pattern → PASS=40 FAIL=0 WV4-F: Security gate PASS=7 FAIL=0 SKIP=1 (Ollama skip non-blocking); added WV4-A frontend gate WV4-C/D: BLOCKED (Windows execFileSync+bash, no cloud API keys) — documented with real error output Baseline: fixed python3→python (Windows Store stub RC=49) and SECRET_REGEX POSIX class in output-policy.yaml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 lines
2.2 KiB
Bash
Executable File
49 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -uo pipefail
|
|
|
|
# CASAN WP-S8 — one-command security gate.
|
|
# Runs the security-relevant harness checks and prints a single aggregate
|
|
# verdict. Live-model checks SKIP (not fail) when the Ollama tunnel is down.
|
|
# Exit: 0 all required gates green, 1 a required gate failed.
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
|
|
PASS=0; FAIL=0; SKIP=0
|
|
run() { # <name> <command...>
|
|
local name="$1"; shift
|
|
if "$@" >/dev/null 2>&1; then echo " GATE PASS $name"; PASS=$((PASS+1));
|
|
else echo " GATE FAIL $name"; FAIL=$((FAIL+1)); fi
|
|
}
|
|
|
|
echo "== CASAN security gate =="
|
|
run "run-casan4 harness suite" bash "$ROOT/.specify/tests/run-casan4-harness-tests.sh"
|
|
run "adversarial suite" bash "$ROOT/.specify/tests/adversarial-harness-tests.sh"
|
|
run "audit hash-chain (signed)" bash "$ROOT/.specify/scripts/bash/verify-audit-chain.sh"
|
|
run "tool-call audit (signed)" bash "$ROOT/.specify/scripts/bash/verify-tool-audit.sh"
|
|
# Wave 3 additions
|
|
run "secrets scan (WP-S4)" bash "$ROOT/.specify/scripts/bash/secrets-scan.sh"
|
|
run "no-bypass + circuit breaker" bash "$ROOT/.specify/scripts/bash/circuit-breaker-check.sh"
|
|
|
|
if curl -sS -m 5 http://127.0.0.1:11434/api/tags >/dev/null 2>&1; then
|
|
run "model router tests" bash "$ROOT/.specify/tests/phase3-model-router-tests.sh"
|
|
run "red-team H4 metrics (30 samples)" bash "$ROOT/.specify/tests/phase3-redteam-metrics.sh"
|
|
run "judge gate tests (WP-B)" bash "$ROOT/.specify/tests/phase3-judge-gate-tests.sh"
|
|
else
|
|
echo " GATE SKIP model router + red-team + judge-gate (Ollama tunnel down)"; SKIP=$((SKIP+1))
|
|
fi
|
|
|
|
# Wave 4 additions
|
|
FNM_NODE_DIR="$HOME/AppData/Roaming/fnm/node-versions"
|
|
if [[ -d "$FNM_NODE_DIR" ]]; then
|
|
NODE_BIN=$(find "$FNM_NODE_DIR" -name "node.exe" -maxdepth 4 2>/dev/null | sort -V | tail -1)
|
|
[[ -n "$NODE_BIN" ]] && export PATH="$(dirname "$NODE_BIN"):$PATH"
|
|
fi
|
|
if command -v node >/dev/null 2>&1; then
|
|
run "frontend runtime tests (WV4-A)" bash -c "cd '$ROOT' && npm test -w frontend"
|
|
else
|
|
echo " GATE SKIP frontend runtime tests (node not in PATH)"; SKIP=$((SKIP+1))
|
|
fi
|
|
|
|
echo "== verdict: PASS=$PASS FAIL=$FAIL SKIP=$SKIP =="
|
|
[[ "$FAIL" -eq 0 ]] || exit 1
|