sidrefresh's picture
Add files using upload-large-folder tool
7ec48b5 verified
Raw History Blame Contribute Delete
1.51 kB
#!/bin/bash
# Run the verifier. Copied to /tests/test.sh and run from the working directory.
#
# Nothing is installed here: the task runs without network, so pytest,
# pytest-json-ctrf and Blender itself are baked into the task image.
mkdir -p /logs/verifier /logs/verifier/artifacts
# Free the box for grading: stop the agent's Blender (its last save is what
# counts — the same standard the tutorial sets) and the tutorial browser. The
# harness's own Chromium is left alone.
pkill -x blender 2>/dev/null || true
pkill -f 'tutorial-chromium' 2>/dev/null || true
sleep 2
python3 -m pytest --ctrf /logs/verifier/ctrf.json /tests/test_outputs.py -rA
# test_outputs.py writes the FRACTIONAL reward itself; a partial score is the
# whole point of the rubric. Only fall back to 0 if the verifier crashed
# before writing anything.
if [ ! -s /logs/verifier/reward.txt ]; then
echo 0 > /logs/verifier/reward.txt
fi
# Ship the agent's actual work home with the verifier output: harbor collects
# /logs/verifier, so the .blend files (for a visual pass in a local Blender)
# and the JSON dumps the rubric graded land next to reward.txt.
find /root -maxdepth 3 \( -name "*.blend" -o -name "render*.png" \) -not -path "/root/.config/*" -not -name "*_Blender_Cycles.blend" -not -path "*/Downloads/*" -exec cp -f {} /logs/verifier/artifacts/ \; 2>/dev/null || true
cp -f /tmp/t20-grade/*.json /logs/verifier/artifacts/ 2>/dev/null || true
cp -f /var/log/blender*.log /logs/verifier/artifacts/ 2>/dev/null || true