Files
troupe-standup/wizard-work/sol/verify.sh
T

25 lines
772 B
Bash
Executable File

#!/usr/bin/env bash
# Verify the triage classifier artifact end-to-end.
set -u
cd "$(dirname "$0")" || exit 1
# 1) regenerate the artifact
python3 classify.py --input demands.json --output actual.csv --pretty
test $? -eq 0 || { echo "FAIL: classification run"; exit 1; }
# 2) JSON summary assertion (no -c one-liner)
python3 - <<'PY'
import json
d = json.load(open("actual.json"))
want = {"total": 8, "by_category": {"decision": 2, "info": 2, "action": 3, "done": 1}}
if d.get("summary") != want:
raise SystemExit("summary mismatch: %r" % (d.get("summary"),))
PY
test $? -eq 0 || { echo "FAIL: summary assertion"; exit 1; }
# 3) CSV diff against known-good output
diff -u expected.csv actual.csv
test $? -eq 0 || { echo "FAIL: CSV diff"; exit 1; }
echo "CHECK OK"