#!/bin/bash
# CHECK — volt lane: the Q65 verifier-coverage gate. Fast: no verifier runs.
#
# What this grades: the LEDGER against the tree at HEAD. Every committed
# wizard-work/**/verify_*.py must be named by the census
# (q63_unwired_baseline.tsv) or by the runner ledger (q65_runner_baseline.tsv),
# and every ledger row's verdict must agree with the rc beside it. Re-executing
# the verifiers is `q65_runner.py --emit` (minutes, 76 files) and is not this.
#
#   rc 0  the ledger is complete and self-consistent
#   rc 1  a fault it graded: an unclassed verifier, a missing row, a bad pairing
#   rc 2  it could not grade at all (no ledger, unreadable tree)
set -u
cd /root/troupe-standup || exit 2

python3 wizard-work/volt/q65_runner.py --selftest || exit 1
python3 wizard-work/volt/q65_runner.py --check    || exit 1
python3 wizard-work/volt/q63_verify_scan.py --repo . >/dev/null || exit 1

echo "CHECK PASS: census covers every committed verifier; runner ledger grades clean."
exit 0
