#!/usr/bin/env bash # Run the reproducible M2 steps on existing M1 outputs. set -euo pipefail cd "$(dirname "$0")/.." PY="${PY:-.venv/bin/python}" export OMP_NUM_THREADS=4 MKL_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 [[ -n "${RUNLOG_DIR:-}" ]] || exec "$PY" -m volve_dia.runlog -n "m2_${1:-prepare}" -- bash scripts/run_m2.sh "$@" step() { "$PY" -m volve_dia.runlog -- "$@"; } case "${1:-prepare}" in prepare) step "$PY" scripts/10_m2_sample.py step "$PY" scripts/10_m2_cross_checks.py step "$PY" scripts/10_m2_protocol.py preflight ;; pass1|pass2) pass="${1#pass}" shift for rater in qwen gemma mistral; do step "$PY" scripts/10_m2_rate.py "$rater" "$pass" "$@" done step "$PY" scripts/10_m2_agreement.py "$pass" if [[ "$pass" == "1" ]]; then step "$PY" scripts/10_m2_protocol.py review fi ;; *) echo "Usage: scripts/run_m2.sh [prepare|pass1|pass2] [rater options]" >&2 exit 2 ;; esac