#!/usr/bin/env bash # CHECK — verifier for the work-queue census artifact (Extract lane: data extraction). # Exit 0 iff: (a) the TSV census is non-empty, (b) its data-row count equals the # number of ^## Q — headings in WORK-QUEUE.md, and (c) Q20, Q31, Q71 rows # are all present. set -u TSV=wizard-work/ledger/2026-10-25-workqueue-census.tsv SRC=WORK-QUEUE.md test -s "$TSV" || { echo "FAIL: TSV missing/empty" >&2; exit 1; } test "$(grep -Ec '^## Q[0-9]+ — ' "$SRC")" = "$(tail -n +2 "$TSV" | grep -c .)" \ || { echo "FAIL: row count mismatch" >&2; exit 1; } awk -F'\t' 'NR>1 && $1 ~ /^(20|31|71)$/ {c++} END{exit c<3}' "$TSV" \ || { echo "FAIL: Q20/Q31/Q71 rows missing" >&2; exit 1; } echo "PASS: census rows=$(tail -n +2 "$TSV" | grep -c .); source headings=$(grep -Ec '^## Q[0-9]+ — ' "$SRC")"