#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
ART="$ROOT_DIR/engine/artifacts"
AUD="$ROOT_DIR/engine/audit"
IDX="$ROOT_DIR/engine/contracts/witness_atlas_index.json"

python3 "$AUD/audit_wsc.py" "$ART/WSC-G-AWT-0001.json"
python3 "$AUD/audit_wsc.py" "$ART/WSC-E-LDW-0001.json"
python3 "$AUD/audit_wsc.py" "$ART/WSC-C-CMT-0001.json"
python3 "$AUD/audit_wsc.py" "$ART/WSC-M-MXC-0001.json"

python3 "$AUD/audit_wob.py" "$ART/WOB-G-0002.json"
python3 "$AUD/audit_wob.py" "$ART/WOB-E-0001.json"

python3 "$AUD/audit_cc.py" "$ART/CC-RNF-0001.json"
python3 "$AUD/audit_cc.py" "$ART/CC-NDB-MXC-0001.json"

python3 "$AUD/audit_atlas.py" "$IDX" "$ART"

echo "PASS: validated core artifacts, convergence certificates, and atlas index"
