Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions tastytrade-mcp/evals/validate_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,30 @@ for task in */; do
export MOCK_STATE_FILE="$APP_DIR/placed_orders.jsonl"
mkdir -p "$APP_DIR" "$LOG_DIR"

bash "$task/solution/solve.sh" >/dev/null 2>&1 || true
bash "$task/tests/test.sh" >/dev/null 2>&1 || true
# Captured rather than discarded: on failure these logs are the only clue, and
# a CI run that prints just a task name means reproducing it locally to learn
# anything. Kept inside $work so they are cleaned up with it.
bash "$task/solution/solve.sh" >"$work/oracle.log" 2>&1 || true
bash "$task/tests/test.sh" >"$work/verify.log" 2>&1 || true
reward="$(cat "$LOG_DIR/reward.txt" 2>/dev/null || echo missing)"

# Negative control: an empty answer must NOT earn reward.
rm -rf "$APP_DIR"/* "$LOG_DIR"/* 2>/dev/null || true
echo '{}' > "$APP_DIR/answer.json"
bash "$task/tests/test.sh" >/dev/null 2>&1 || true
bash "$task/tests/test.sh" >"$work/negative.log" 2>&1 || true
neg="$(cat "$LOG_DIR/reward.txt" 2>/dev/null || echo missing)"

if [ "$reward" = "1" ] && [ "$neg" = "0" ]; then
echo "PASS $task"
pass=$((pass + 1))
else
echo "FAIL $task (oracle=$reward negative=$neg)"
for log in oracle verify negative; do
if [ -s "$work/$log.log" ]; then
echo " --- $log ---"
sed 's/^/ /' "$work/$log.log" | tail -15
fi
done
fail=$((fail + 1))
fi
rm -rf "$work"
Expand Down
Loading