Files
stack/agents/filbert/work/slice1-probes/inner.sh
T
jason.woltjeandClaude Opus 5.5 771fc3d270 docs(slice1): row 34 S0 harness probe matrix (filbert)
Pi 0.85.1 and Claude Code 2.1.289 (Agent SDK 0.3.289), 34 cases against a
scripted local model in a loopback-only network namespace. MATRIX.md has
the command, outcome, model-visible message and fail-closed column per
case, and one rely-on line per case. Evidence under evidence/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 22:25:41 -05:00

24 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Row S0: runs one probe inside the network namespace that probe.sh sets up.
# Starts the mock model on loopback, runs the harness under a wall-clock
# limit, and writes outcome.txt. Usage: inner.sh <run-dir> <limit-s> -- cmd...
set -u
run=$1 limit=$2
shift 3
here=$(dirname "$(readlink -f "$0")")
cd "$run/work" || exit 90
node "$here/mock-anthropic.mjs" 2> "$run/mock-stderr.txt" &
mock=$!
for _ in $(seq 100); do grep -q listening "$MOCK_LOG" 2>/dev/null && break; read -rt 0.05 <> <(:) || true; done
start=$(date +%s%N)
timeout -k 5 "$limit" "$@" < /dev/null > "$run/stdout.txt" 2> "$run/stderr.txt"
rc=$?
end=$(date +%s%N)
kill "$mock" 2> /dev/null
{
echo "uid=$(id -u) net=$(ip -o link | awk -F': ' '{print $2}' | tr '\n' ' ')"
echo "exit=$rc elapsed_ms=$(((end - start) / 1000000))"
if [ -e "$run/work/target.txt" ]; then echo "target=present content=$(head -c 80 "$run/work/target.txt" | tr '\n' ' ')"; else echo "target=absent"; fi
echo "gate_loaded=$(cat "$GATE_LOG" 2> /dev/null | grep -c ' loaded ') gate_calls=$(cat "$GATE_LOG" 2> /dev/null | grep -cE ' invoked | input=')"
} > "$run/outcome.txt"