#!/usr/bin/env python3 """Consume both frozen targets and recompute their full analytic CRT grid.""" import hashlib import json import subprocess import sys import tempfile from pathlib import Path root = Path(__file__).resolve().parent target_csv = (root / 'target1205.csv').read_bytes() target_out = (root / 'target1205.out').read_bytes() with tempfile.TemporaryDirectory(prefix='target1205-check-') as scratch: computed = Path(scratch) / 'computed.csv' result = subprocess.run([sys.executable, str(root / 'target1205.py'), str(root / 'prereg1205.json'), str(computed)], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True, timeout=30) assert computed.read_bytes() == target_csv, 'CSV target mismatch' assert result.stdout == target_out, 'JSON target mismatch' observed = json.loads(target_out) print(json.dumps({'check': 'pass', 'rows': observed['rows'], 'target_only_points': observed['target_only_points'], 'csv_sha256': hashlib.sha256(target_csv).hexdigest(), 'out_sha256': hashlib.sha256(target_out).hexdigest()}, separators=(',', ':')))