#!/bin/bash # N12 - environment lock of the master node's venv (uv-managed, no pip): requirements.lock, .python-version, environment.md set -u OUT="$HOME/firc0001_review/results/env"; mkdir -p "$OUT" VENV="$HOME/UQO_RESEARCH_DB/.venv" cd "$HOME/UQO_RESEARCH_DB" || exit 1 uv pip freeze --python "$VENV/bin/python" > "$OUT/requirements.lock" 2> "$OUT/uv_freeze.err" "$VENV/bin/python" -c 'import sys; print(".".join(map(str, sys.version_info[:3])))' > "$OUT/.python-version" { echo "# Environment of the master node (M3U96b) used for the SPID extraction and for every Stage D audit" echo echo "Generated $(date -Iseconds) by code/audit/a12_env_lock.sh (read-only)." echo echo '```' echo "hostname: $(hostname)" sw_vers 2>/dev/null echo "hw.model: $(sysctl -n hw.model)"; echo "machdep.cpu.brand_string: $(sysctl -n machdep.cpu.brand_string 2>/dev/null)" echo "hw.ncpu: $(sysctl -n hw.ncpu) hw.memsize: $(( $(sysctl -n hw.memsize) / 1024 / 1024 / 1024 )) GB" echo "python: $($VENV/bin/python -V 2>&1) ($(cat $VENV/pyvenv.cfg | tr '\n' ';'))" echo "uv: $(uv --version 2>/dev/null)" echo "duckdb (python): $($VENV/bin/python -c 'import duckdb; print(duckdb.__version__)')" echo "pyarrow: $($VENV/bin/python -c 'import pyarrow; print(pyarrow.__version__)') numpy: $($VENV/bin/python -c 'import numpy; print(numpy.__version__)') pandas: $($VENV/bin/python -c 'import pandas; print(pandas.__version__)') matplotlib: $($VENV/bin/python -c 'import matplotlib; print(matplotlib.__version__)') httpx: $($VENV/bin/python -c 'import httpx; print(httpx.__version__)')" echo "packages in venv: $(wc -l < $OUT/requirements.lock)" echo "git HEAD of ~/UQO_RESEARCH_DB: $(git rev-parse --short HEAD) (paper cites 2324b58)" echo "DuckDB files: $(ls -l $HOME/UQO_RESEARCH_DB/project-db/data/db/spid.duckdb | awk '{print $5, $6, $7, $8}') | $(ls -l $HOME/UQO_RESEARCH_DB/data/duckdb/edgar_research.duckdb | awk '{print $5, $6, $7, $8}')" echo "laptop exhibits: python3 -I code/make_tables.py (matplotlib pinned in requirements-exhibits.txt by L6)" echo '```' echo echo "Audit settings: \`nice -n 10\`, \`OMP_NUM_THREADS=4\`, DuckDB \`SET threads=4\`, \`SET memory_limit='24GB'\`, \`read_only=True\`, seed 20261105." echo "Expected runtimes on this node (Stage D, measured): a01 12 s · a02 217 s · a03 2 s · a04 32 s · a05 see results/focus/manifest.json · a06 < 10 s · a07 see manifest · a08 see manifest · a09 < 10 s · a10 < 10 s." } > "$OUT/environment.md" cat "$OUT/environment.md"; head -3 "$OUT/requirements.lock"; cat "$OUT/uv_freeze.err"