Files
superpowers/evals/bin/tool-before
Jesse Vincent 3c046f579e Lift drill into evals/ at 013fcb8b7dbefd6d3fa4653493e5d2ec8e7f985b
rsync of obra/drill@013fcb8b7d into superpowers/evals/, excluding
.git/, .venv/, results/, .env/, __pycache__/, *.egg-info/,
.private-journal/.

The drill repo is unaffected by this commit; archival is a separate
manual step after this PR merges.

Source SHA recorded at evals/.drill-source-sha for divergence
detection.
2026-05-06 12:15:46 -07:00

29 lines
832 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
command -v jq >/dev/null || { echo "jq required"; exit 127; }
TOOL_A="$1"
TOOL_B="$2"
FILE="tool_calls.jsonl"
IDX_A=$(jq -s 'to_entries | map(select(.value.tool == "'"$TOOL_A"'")) | first // empty | .key' "$FILE" 2>/dev/null)
IDX_B=$(jq -s 'to_entries | map(select(.value.tool == "'"$TOOL_B"'")) | first // empty | .key' "$FILE" 2>/dev/null)
if [ -z "$IDX_A" ] || [ "$IDX_A" = "null" ]; then
echo "FAIL: $TOOL_A never called"
exit 1
fi
if [ -z "$IDX_B" ] || [ "$IDX_B" = "null" ]; then
echo "FAIL: $TOOL_B never called"
exit 1
fi
if [ "$IDX_A" -lt "$IDX_B" ]; then
echo "PASS: $TOOL_A (line $((IDX_A + 1))) before $TOOL_B (line $((IDX_B + 1)))"
exit 0
else
echo "FAIL: $TOOL_A at line $((IDX_A + 1)) occurred after $TOOL_B at line $((IDX_B + 1))"
exit 1
fi