#!/usr/bin/env bash # lib/tests/guardrails-probe.test.sh — floor of the /guardrails live probe. # A throwaway http.server on 127.0.0.1 serves scripted responses; the probe # runs against it and each verdict is asserted. Nothing leaves the machine. # The probe sends read-only methods; this suite proves the OPEN/CLOSED logic, # the --authorized gate, the same-host redirect guard and the request budget. set -u ROOT="$(cd "$(dirname "$0")/../.." && pwd)" PROBE="$ROOT/skills/guardrails/scripts/probe.py" WORK="$(mktemp -d)" PASS=0; FAIL=0; SRV="" cleanup() { [ -n "$SRV" ] && kill "$SRV" 2>/dev/null; rm -rf "$WORK"; } trap cleanup EXIT check() { # check