PY_RAW ?= python3
PY := $(abspath $(shell command -v $(PY_RAW) 2>/dev/null || echo $(PY_RAW)))
RUN := env PYTHONDONTWRITEBYTECODE=1 $(PY)

review-checks: deps v30-tests v31-tests assurance-layers schemas auxiliary-analyses affected-output output-consistency figure-hashes
	@echo "V33 REVIEW CHECKS COMPLETE"

deps:
	@$(RUN) -c "import numpy, scipy, matplotlib, cryptography, jsonschema, rfc8785" || \
	  (echo "ERROR: missing dependencies — run: pip install -r requirements.txt" && exit 1)

schemas:
	$(RUN) cert/validate_schemas.py

v30-tests:
	$(RUN) tests/test_v30_protocol.py

v31-tests:
	$(RUN) tests/test_v31_protocol.py

assurance-layers:
	$(RUN) code/assurance_layer_responsibility.py

auxiliary-analyses: factorial-ci wor-baseline fixed-baseline

factorial-ci:
	$(RUN) code/derive_factorial_cis.py

wor-baseline:
	$(RUN) code/derive_wor_baseline_comparison.py

fixed-baseline:
	$(RUN) code/derive_fixed_baseline_comparison.py

affected-output:
	$(RUN) code/rebuild_v31_affected_outputs.py

output-consistency:
	$(RUN) code/check_v32_output_consistency.py

figure-hashes:
	$(RUN) code/check_figure_hashes.py

.PHONY: review-checks deps schemas v30-tests v31-tests assurance-layers \
	auxiliary-analyses factorial-ci wor-baseline fixed-baseline affected-output \
	output-consistency figure-hashes
