snippet.py: check_tools() imports hermes_tools and requires callable(getattr(...)); --require is the negative-control hook; HERMES_HOME/HERMES_PROFILE/--home/--profile resolve every path; rc 0/1/2. verify_hermes_setup.sh: HERE from $0, sibling snippet.py graded, --home/--root/--profile, VERDICT line, rc 0/1/2. New test_env_verifiers.py (14 black-box cells, stub hermes_tools on PYTHONPATH, synthetic trees) and CHECK-env-verifiers. Pre-repair blobs: 9 cells red for snippet.py, 6 for the shell script.
35 lines
1.3 KiB
Bash
Executable File
35 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# CHECK-env-verifiers: grade the lane's two environment verifiers.
|
|
#
|
|
# Q109. The lane's own CHECK grades artifacts under an absolute /root path and
|
|
# runs none of the lane's test_*.py (that blindness is a separate item), so this
|
|
# file gives these two verifiers a gate of their own. The cell
|
|
# (test_env_verifiers.py) invokes both verifiers as subprocesses with stub
|
|
# modules on PYTHONPATH and synthetic Hermes trees, so it grades the tree it
|
|
# sits in -- the paths are resolved from the cell's own location.
|
|
#
|
|
# Exit codes follow the repo's tools/ contract:
|
|
# 0 = both verifiers measure what they claim
|
|
# 1 = a verifier regression (a cell failed)
|
|
# 2 = could not grade (no python3, or the cell does not import/collect)
|
|
set -e
|
|
set -o pipefail
|
|
cd "$(dirname "$(readlink -f "$0")")"
|
|
|
|
if ! command -v python3 >/dev/null 2>&1; then
|
|
echo "CHECK: python3 not on PATH -- cannot grade." >&2
|
|
exit 2
|
|
fi
|
|
|
|
set +e
|
|
python3 -m unittest -q test_env_verifiers >/tmp/.q109-check.out 2>&1
|
|
rc=$?
|
|
set -e
|
|
tail -3 /tmp/.q109-check.out
|
|
|
|
case $rc in
|
|
0) echo "CHECK: both environment verifiers measure what they claim."; exit 0 ;;
|
|
1) echo "CHECK: verifier contract broken -- a cell failed." >&2; exit 1 ;;
|
|
*) echo "CHECK: unittest exited $rc -- collection error, could not grade." >&2; exit 2 ;;
|
|
esac
|