#!/usr/bin/env bash # lib/tests/guardrails-scan.test.sh — floor of the /guardrails scanner. # The clean fixture must scan with zero FAIL and zero WARN. Each mutant breaks # one rule on a copy of it and must raise that rule at the expected severity # (positive control). Exit codes, JSON, domain filter, symlinks and secret # redaction are checked too. # shellcheck disable=SC2016 set -u ROOT="$(cd "$(dirname "$0")/../.." && pwd)" SCAN="$ROOT/skills/guardrails/scripts/scan.py" GOOD="$ROOT/lib/tests/fixtures/guardrails-good" WORK="$(mktemp -d)"; trap 'rm -rf "$WORK"' EXIT PASS=0; FAIL=0; LAST_OUT=""; LAST_RC=0 check() { # check