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

28 lines
997 B
Bash

#!/usr/bin/env bash
# Sol-lane daily profile-state triage -- gate.
#
# Two legs, one command:
# 1. Re-derive the report from the live profile (build_solo_triage.py).
# 2. Re-derive the counts from the live filesystem (verify_sol_profile_triage.py)
# and assert the regenerated report matches. Exit 0 only if leg 2 passes.
#
# The exit code of this script IS the verdict (0 = correct, nonzero = wrong).
# The report is a point-in-time snapshot: the profile is a live, growing
# directory, so the gate re-derives from the current state rather than trusting
# a stale on-disk number.
set -u
cd "$(dirname "$0")" || exit 2
echo '== leg 1: build report from the live profile =='
python3 build_solo_triage.py >/dev/null || { echo 'GEN LEG FAIL'; exit 1; }
echo '== leg 2: verify report against live filesystem =='
python3 verify_sol_profile_triage.py
rc=$?
if [ "$rc" -eq 0 ]; then
echo '== GEN_AND_VERIFY GREEN =='
else
echo "== GEN_AND_VERIFY RED (verify rc=$rc) =="
fi
exit "$rc"