AdithyaSK's picture
AdithyaSK HF Staff
MiMo-V2.6-RL Terminal as Harbor tasks
5708f7d verified
Raw History Blame
795 Bytes
#!/usr/bin/env bash
set -u
mkdir -p /logs/verifier
# tbench-anti-hack-guard:v1
export PYTHONNOUSERSITE=1
export PYTHONDONTWRITEBYTECODE=1
# Fail open when the verifier image has no python3 (node-only tests images are
# excluded from the RL set but still verifiable natively): a missing
# interpreter must not swallow the grader's own reward write.
if command -v python3 >/dev/null 2>&1 && [ -f /tests/anti_hack_guard.py ]; then
if ! python3 /tests/anti_hack_guard.py; then
# Guard already wrote reward=0; the reward file is the grading contract.
exit 0
fi
fi
python3 -m pytest --ctrf /logs/verifier/ctrf.json -q /tests/test_outputs.py
status=$?
if [ "$status" -eq 0 ]; then printf '1\n' > /logs/verifier/reward.txt; else printf '0\n' > /logs/verifier/reward.txt; fi
exit "$status"