#!/usr/bin/env bash # verify_queue_triage_check.sh — re-derive the work-queue status census from the # committed tree and grade the sol-lane queue-status reconciliation report against # it. Exit 0 = the report matches the tree; nonzero = wrong. set -u REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" cd "$REPO" || { echo "CHECK_FAIL: cannot cd to $REPO"; exit 1; } EXPECTED_OPEN_IDS="Q37 Q53 Q64 Q57 Q58 Q60 Q62 Q66 Q67 Q69" EXPECTED_OPENING=28 EXPECTED_CLOSED=18 EXPECTED_OPEN=10 # 1) The claim-check tool must run clean on the committed tree. OUT="$(python3 tools/queue_claim_check.py --census 2>&1)" || { echo "CHECK_FAIL: census exited non-zero"; echo "$OUT" | tail -5; exit 1; } # 2) Headline census line must carry the three figures. HEADLINE="$(printf '%s\n' "$OUT" | grep -F '28 opening records; 18 closed; 10 open.' | head -1)" if [ -z "$HEADLINE" ]; then echo "CHECK_FAIL: headline line missing"; printf '%s\n' "$OUT" | sed -n '1,6p'; exit 1; fi # 3) Open set: extract the Q ids from the "open set:" line and sort both sides. ACTUAL_OPEN_LIST="$(printf '%s\n' "$OUT" | sed -n 's/^open set: //p' \ | tr ',' '\n' | sed 's/^ *//;s/ *$//' | sed 's/:.*//' | grep -v '^$' | sort)" EXPECTED_OPEN_LIST="$(printf '%s\n' $EXPECTED_OPEN_IDS | sort)" if [ "$ACTUAL_OPEN_LIST" != "$EXPECTED_OPEN_LIST" ]; then echo "CHECK_FAIL: open set mismatch" echo " expected: $EXPECTED_OPEN_IDS" echo " actual: $ACTUAL_OPEN_LIST" exit 1 fi echo "CHECK_PASS: census(28/18/10) open-set=($ACTUAL_OPEN_LIST)" exit 0