mirror of
https://github.com/obra/superpowers.git
synced 2026-05-11 11:39:04 +08:00
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.
This commit is contained in:
committed by
Drew Ritter
parent
2e46e9590d
commit
3b412a3836
28
evals/bin/tool-before
Executable file
28
evals/bin/tool-before
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user