#!/usr/bin/env bash # Single entry point of the replication package (protocol Part IX). # ./run_all.sh exhibits + tests + paper from the committed data/ exports (laptop, ~1 min) # ./run_all.sh --with-node additionally regenerates data/ from the two DuckDB files (master node M3U96b, read-only) # ./run_all.sh --with-audit additionally runs the Stage D read-only audits (code/audit/run_all.sh, node) # Raw filings, the DuckDB files and the LLM extraction are never rebuilt here (see docs/DATA_AVAILABILITY.md). set -euo pipefail cd "$(dirname "$0")" export OMP_NUM_THREADS=${OMP_NUM_THREADS:-4} REPO=${REPO:-$HOME/UQO_RESEARCH_DB} PY=${PY:-python3} for arg in "$@"; do case "$arg" in --with-node) echo "== export_stats.py (read-only DuckDB, threads=4) -> data/" nice -n 10 "$REPO/.venv/bin/python" -I code/export_stats.py "$REPO" data/ ;; --with-audit) echo "== Stage D audits -> results/" nice -n 10 bash code/audit/run_all.sh ;; *) echo "unknown option $arg" >&2; exit 2 ;; esac done echo "== make_tables.py -> paper/tables, paper/figures, paper/tables/numbers.tex, results/inline_numbers.json" nice -n 10 "$PY" -I code/make_tables.py echo "== tests" nice -n 10 "$PY" -I -m pytest -q tests echo "== paper" ( cd paper && nice -n 10 latexmk -pdf -interaction=nonstopmode main.tex > /dev/null && grep -c '^!' main.log || true ) echo "done: paper/main.pdf"