#!/bin/sh # q65_gate.sh -- Q65's done-means in one command, and the repo-root resolution # Q65's own addendum asks for. # # Two claims, both graded: # 1. the LEDGER covers the census and grades clean -- that is `CHECK`, which # runs the runner's 22-cell selftest, `--check --class gate-run,undeclared` # (population coverage, verdict/rc pairing, blob binding) and the Q63 scan; # 2. NO ROW IS A TIMEOUT. A TIMEOUT row carries no rc, and Q65's done-when is # "each of the five carries an rc or a refusal". A ledger that keeps a # TIMEOUT row is a ledger with an ungraded verifier, so this gate is red on # one -- which is the only reason the check is worth running. # # The root is resolved from $0 rather than written down: a gate that `cd`s to an # absolute host path grades THAT tree from whatever checkout invokes it, which is # Q62's class and was measured in this very lane (reply 93 defect 1). # # rc 0 census complete, ledger clean, zero TIMEOUT rows # rc 1 a fault it graded (a CHECK fault, or a TIMEOUT row) # rc 2 it could not grade: no git root above $0, or no ledger set -u ROOT="$(git -C "$(dirname "$0")" rev-parse --show-toplevel 2>/dev/null)" || exit 2 [ -n "$ROOT" ] || exit 2 LEDGER="$ROOT/wizard-work/volt/q65_runner_baseline.tsv" [ -f "$LEDGER" ] || { echo "q65_gate: no ledger at $LEDGER" >&2; exit 2; } bash "$ROOT/wizard-work/volt/CHECK" || exit 1 n="$(awk -F'\t' '!/^#/ && NF >= 3 && $3 == "TIMEOUT"' "$LEDGER" | wc -l | tr -d ' ')" if [ "$n" != "0" ]; then echo "q65_gate: $n TIMEOUT row(s) -- a row with no rc is not a grade" >&2 awk -F'\t' '!/^#/ && NF >= 3 && $3 == "TIMEOUT" {print " " $2 " (" $6 ")"}' "$LEDGER" >&2 exit 1 fi echo "q65_gate PASS: census complete, ledger clean, 0 TIMEOUT row(s)." exit 0