grader: isolated Python (-I -S), no PATH tools (#120 review #5); check.py: import and PATH cheats (part 2)
Browse filesFiles changed (50)
- tasks/agg-p01-n01/tests/test.sh+19-9
- tasks/agg-p01-n02/tests/test.sh+19-9
- tasks/agg-p01-n04/tests/test.sh+19-9
- tasks/agg-p01-n08/tests/test.sh+19-9
- tasks/agg-p01-n16/tests/test.sh+19-9
- tasks/agg-p02-n01/tests/test.sh+19-9
- tasks/agg-p02-n02/tests/test.sh+19-9
- tasks/agg-p02-n04/tests/test.sh+19-9
- tasks/agg-p02-n08/tests/test.sh+19-9
- tasks/agg-p02-n16/tests/test.sh+19-9
- tasks/agg-p03-n01/tests/test.sh+19-9
- tasks/agg-p03-n02/tests/test.sh+19-9
- tasks/agg-p03-n04/tests/test.sh+19-9
- tasks/agg-p03-n08/tests/test.sh+19-9
- tasks/agg-p03-n16/tests/test.sh+19-9
- tasks/agg-p04-n01/tests/test.sh+19-9
- tasks/agg-p04-n02/tests/test.sh+19-9
- tasks/agg-p04-n04/tests/test.sh+19-9
- tasks/agg-p04-n08/tests/test.sh+19-9
- tasks/agg-p04-n16/tests/test.sh+19-9
- tasks/agg-p05-n01/tests/test.sh+19-9
- tasks/agg-p05-n02/tests/test.sh+19-9
- tasks/agg-p05-n04/tests/test.sh+19-9
- tasks/agg-p05-n08/tests/test.sh+19-9
- tasks/agg-p05-n16/tests/test.sh+19-9
- tasks/agg-p06-n01/tests/test.sh+19-9
- tasks/agg-p06-n02/tests/test.sh+19-9
- tasks/agg-p06-n04/tests/test.sh+19-9
- tasks/agg-p06-n08/tests/test.sh+19-9
- tasks/agg-p06-n16/tests/test.sh+19-9
- tasks/agg-p07-n01/tests/test.sh+19-9
- tasks/agg-p07-n02/tests/test.sh+19-9
- tasks/agg-p07-n04/tests/test.sh+19-9
- tasks/agg-p07-n08/tests/test.sh+19-9
- tasks/agg-p07-n16/tests/test.sh+19-9
- tasks/agg-p08-n01/tests/test.sh+19-9
- tasks/agg-p08-n02/tests/test.sh+19-9
- tasks/agg-p08-n04/tests/test.sh+19-9
- tasks/agg-p08-n08/tests/test.sh+19-9
- tasks/agg-p08-n16/tests/test.sh+19-9
- tasks/agg-p09-n01/tests/test.sh+19-9
- tasks/agg-p09-n02/tests/test.sh+19-9
- tasks/agg-p09-n04/tests/test.sh+19-9
- tasks/agg-p09-n08/tests/test.sh+19-9
- tasks/agg-p09-n16/tests/test.sh+19-9
- tasks/agg-p10-n01/tests/test.sh+19-9
- tasks/agg-p10-n02/tests/test.sh+19-9
- tasks/agg-p10-n04/tests/test.sh+19-9
- tasks/agg-p10-n08/tests/test.sh+19-9
- tasks/agg-p10-n16/tests/test.sh+19-9
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
6 unmodified lines78910111213141516171819202139 unmodified lines6162636465666 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results. ANSWER,# EXPECTED and VERIFIER_DIR override the paths (no links in them), to test the grader locally.answer=${ANSWER:-/app/answer.json}expected=${EXPECTED:-$(dirname "$0")/expected.json}verifier=${VERIFIER_DIR:-/logs/verifier}mkdir -p "$verifier"rm -f "$verifier/reward.txt" "$verifier/reward.json" "$verifier/answer.json"echo 0 > "$verifier/reward.txt"ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]valid = Falsetry:data = read_own(os.environ["ANSWER"])6 unmodified lines78910111213141516171819202122232439 unmodified lines646566676869707172737475766 unmodified lines# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat39 unmodified linesverifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a linktry:os.unlink(os.path.join(verifier, name))except FileNotFoundError:passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry:data = read_own(os.environ["ANSWER"])
tasks/agg-p01-n01/tests/test.sh+19-9
tasks/agg-p01-n02/tests/test.sh+19-9
tasks/agg-p01-n04/tests/test.sh+19-9
tasks/agg-p01-n08/tests/test.sh+19-9
tasks/agg-p01-n16/tests/test.sh+19-9
tasks/agg-p02-n01/tests/test.sh+19-9
tasks/agg-p02-n02/tests/test.sh+19-9
tasks/agg-p02-n04/tests/test.sh+19-9
tasks/agg-p02-n08/tests/test.sh+19-9
tasks/agg-p02-n16/tests/test.sh+19-9
tasks/agg-p03-n01/tests/test.sh+19-9
tasks/agg-p03-n02/tests/test.sh+19-9
tasks/agg-p03-n04/tests/test.sh+19-9
tasks/agg-p03-n08/tests/test.sh+19-9
tasks/agg-p03-n16/tests/test.sh+19-9
tasks/agg-p04-n01/tests/test.sh+19-9
tasks/agg-p04-n02/tests/test.sh+19-9
tasks/agg-p04-n04/tests/test.sh+19-9
tasks/agg-p04-n08/tests/test.sh+19-9
tasks/agg-p04-n16/tests/test.sh+19-9
tasks/agg-p05-n01/tests/test.sh+19-9
tasks/agg-p05-n02/tests/test.sh+19-9
tasks/agg-p05-n04/tests/test.sh+19-9
tasks/agg-p05-n08/tests/test.sh+19-9
tasks/agg-p05-n16/tests/test.sh+19-9
tasks/agg-p06-n01/tests/test.sh+19-9
tasks/agg-p06-n02/tests/test.sh+19-9
tasks/agg-p06-n04/tests/test.sh+19-9
tasks/agg-p06-n08/tests/test.sh+19-9
tasks/agg-p06-n16/tests/test.sh+19-9
tasks/agg-p07-n01/tests/test.sh+19-9
tasks/agg-p07-n02/tests/test.sh+19-9
tasks/agg-p07-n04/tests/test.sh+19-9
tasks/agg-p07-n08/tests/test.sh+19-9
tasks/agg-p07-n16/tests/test.sh+19-9
tasks/agg-p08-n01/tests/test.sh+19-9
tasks/agg-p08-n02/tests/test.sh+19-9
tasks/agg-p08-n04/tests/test.sh+19-9
tasks/agg-p08-n08/tests/test.sh+19-9
tasks/agg-p08-n16/tests/test.sh+19-9
tasks/agg-p09-n01/tests/test.sh+19-9
tasks/agg-p09-n02/tests/test.sh+19-9
tasks/agg-p09-n04/tests/test.sh+19-9
tasks/agg-p09-n08/tests/test.sh+19-9
tasks/agg-p09-n16/tests/test.sh+19-9
tasks/agg-p10-n01/tests/test.sh+19-9
tasks/agg-p10-n02/tests/test.sh+19-9
tasks/agg-p10-n04/tests/test.sh+19-9
tasks/agg-p10-n08/tests/test.sh+19-9
tasks/agg-p10-n16/tests/test.sh+19-9