#!/usr/bin/env bash
# CHECK -- 2026-11-02 jobs table (ledger lane).
#
# Entry point: this is the path every caller in this tree invokes, and it is
# invoked with `bash` (the q143 sweep, tools/verify.py's doc-command leg, and a
# reader who types the path). It was a Python program with a `python3` shebang,
# so `bash CHECK-2026-11-02-jobs-table` read rc 2 on shell syntax errors before
# grading a cell. The grader moved to grade_jobs_table.py; this wrapper is the
# stable entry point and passes any argument through.
#
# Default: the item's claim -- the committed jobs.csv re-derives byte-for-byte
# from the source JSONs (root: $JOBS_SRC_ROOT, else /root) and matches
# manifest.json.
# --offline: grade the committed artifact alone (sha256, row count, fieldnames,
# required fields) and print that re-derivation was not attempted.
#
# rc 0 every leg graded and passed
# rc 1 a graded leg failed
# rc 2 could not grade (sources absent in a source mode, artifact missing)
set -u
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || exit 2
[ -f "$HERE/grade_jobs_table.py" ] || {
  echo "CANNOT GRADE: grade_jobs_table.py missing beside this entry point"; exit 2; }
exec python3 -u "$HERE/grade_jobs_table.py" "$@"
