#!/usr/bin/env bash set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" SKILL_ROOT="$(dirname "$SCRIPT_DIR")" source "$SCRIPT_DIR/_common.sh" : "${OUTPUT_DIR:=$SKILL_ROOT/outputs}" main() { [[ -f "$OUTPUT_DIR/last_run_dir.txt" ]] || die "No last_run_dir.txt. Run 11_apply.sh first." run_dir="$(cat "$OUTPUT_DIR/last_run_dir.txt")" status="$run_dir/status_matrix.json" ok_root=false; ok_proof=false; ok_leaf=false [[ -f "$run_dir/ROOT.txt" ]] && ok_root=true [[ -f "$run_dir/PROOF.json" ]] && ok_proof=true [[ -f "$run_dir/leaf_hashes.txt" ]] && ok_leaf=true root_hex="$(grep '^root_hex=' "$run_dir/ROOT.txt" 2>/dev/null | cut -d= -f2 || true)" blockers="[]" if [[ "$ok_root" != "true" ]]; then blockers='["missing_root_txt"]' elif [[ "$ok_proof" != "true" ]]; then blockers='["missing_proof_json"]' fi cat > "$status" <