Files
troupe-standup/wizard-work/sol/CHECK-sol-profile-triage-2026-11-02
T

44 lines
1.7 KiB
Bash

#!/usr/bin/env bash
# CHECK -- sol: sol-profile top-level entries triage (2026-11-02).
# Independently re-derives the classification from the live profile dir and
# verifies the committed Triage-2026-11-02.json re-derives it. Exit 0 iff every
# check passes (the exit code IS the verdict).
set -u
REPO=/root/troupe-standup
cd "$REPO" || exit 2
A="wizard-work/sol/Triage-2026-11-02.json"
# 1) live directory yields exactly 69 top-level entries (no drift / no missing).
LIVE=$(find /root/.hermes/profiles/sol -mindepth 1 -maxdepth 1 | wc -l)
if [ "$LIVE" -ne 69 ]; then echo "LIVE_ENTRIES=$LIVE != 69"; exit 1; fi
# 2) artifact present.
[ -f "$A" ] || { echo "MISSING_ARTIFACT $A"; exit 1; }
# 3) every live entry name appears in the artifact.
NMISS=0
while IFS= read -r n; do
if ! grep -q "\"name\": \"$n\"" "$A"; then echo "MISSING $n"; NMISS=1; fi
done < <(find /root/.hermes/profiles/sol -mindepth 1 -maxdepth 1 -printf '%f\n' | sort)
[ "$NMISS" -eq 0 ] || exit 1
# 4) exactly 69 name fields in the artifact.
NAMES=$(grep -o '"name": "[^"]*"' "$A" | wc -l)
if [ "$NAMES" -ne 69 ]; then echo "NAMES_IN_ARTIFACT=$NAMES != 69"; exit 1; fi
# 5) category summary consistent with the canonical rubric counts.
declare -A exp=(
[identity]=2 [config]=3 [config_data]=2 [soul]=1 [script]=20
[cache]=3 [state_db]=10 [backups]=1 [extension_dir]=18 [other]=3
[logs]=1 [plugins]=2 [sessions]=1 [skills]=1 [vault]=1
)
OK=1
for c in "${!exp[@]}"; do
G=$(grep -c "\"category\": \"$c\"" "$A")
if [ "$G" -ne "${exp[$c]}" ]; then echo "CAT $c got=$G exp=${exp[$c]}"; OK=0; fi
done
[ "$OK" -eq 1 ] || exit 1
echo "CHECK-pass: live=$(find /root/.hermes/profiles/sol -mindepth 1 -maxdepth 1 | wc -l)/artifact=69 categories=15"
exit 0