#!/usr/bin/env python3 """Run the four finite checks: python anc/run_checks.py. Requires Python 3, NumPy, and SciPy. Tested versions are recorded in anc/verification.json. Writes results/ beside main.tex. Fixed seeds make numerical outputs reproducible; completion times and platform vary. These checks do not replace the proofs or quantify all admissible attacks. """ from __future__ import annotations import datetime import json import platform import subprocess import sys from pathlib import Path import numpy as np import scipy ROOT = Path(__file__).resolve().parents[1] NAMES = ("communication", "interchange", "protocol", "recovery") def main(): (ROOT / "results").mkdir(exist_ok=True) for name in NAMES: subprocess.run([sys.executable, str(ROOT / "anc" / f"verify_{name}.py")], check=True, cwd=ROOT) report = { "completed_utc": datetime.datetime.now(datetime.timezone.utc).isoformat(), "environment": {"python": platform.python_version(), "numpy": np.__version__, "scipy": scipy.__version__, "platform": platform.platform()}, "command": "python anc/run_checks.py", "manuscript_build": "pdflatex main; bibtex main; pdflatex main; pdflatex main", "all_completed": True, "scope": "Finite fixed-seed consistency checks only; not formal proof verification or full-device simulation.", "results": {name: json.loads((ROOT / "results" / f"{name}.json").read_text()) for name in NAMES}} (ROOT / "results" / "verification.json").write_text( json.dumps(report, indent=2) + "\n", encoding="utf-8") print("All four checks completed; results/verification.json written.") if __name__ == "__main__": main()