Research source · python

build-release.py

site/public/evidence/dehn-filled-quantum-trace/balanced-pairing-attack/build-release.py

43 lines. Source is displayed for inspection; it is not executed by this page.

File fingerprint

SHA-256: 522353b0b52c86f5109f85c0ea4457a71e1385ba3d1c15d38aec89ccba65c0bc

#!/usr/bin/env python3
"""Reproduce exact checks and make a deterministic research-note archive."""
from pathlib import Path
import hashlib
import json
import subprocess
import sys
import zipfile

root = Path(__file__).resolve().parent
check = subprocess.run([sys.executable, str(root/"verify-balanced-pairing.py")],
                       cwd=root, capture_output=True, text=True, check=True)
(root/"verification-output.txt").write_text(check.stdout)
result = json.loads((root/"exact-results.json").read_text())
assert all(v == "pass" for v in result["checks"].values())
assert result["seed_series_calibration"]["I_Delta_0_1"] != result["seed_series_calibration"]["I_Delta_0_minus1"]
archive_name = "balanced-pairing-attack.zip"
excluded = {archive_name, "SHA256SUMS.txt", "ARCHIVE-SHA256.txt", "archive-validation.txt"}
payload = sorted(p for p in root.iterdir() if p.is_file() and p.name not in excluded)
digest = lambda data: hashlib.sha256(data).hexdigest()
(root/"SHA256SUMS.txt").write_text("".join(f"{digest(p.read_bytes())}  {p.name}\n" for p in payload))
with zipfile.ZipFile(root/archive_name, "w", compression=zipfile.ZIP_DEFLATED, compresslevel=9) as z:
    for p in sorted(payload+[root/"SHA256SUMS.txt"]):
        info = zipfile.ZipInfo(p.name, date_time=(2026, 9, 8, 0, 0, 0))
        info.compress_type = zipfile.ZIP_DEFLATED
        info.external_attr = 0o100644 << 16
        z.writestr(info, p.read_bytes(), compress_type=zipfile.ZIP_DEFLATED, compresslevel=9)
archive_sha = digest((root/archive_name).read_bytes())
(root/"ARCHIVE-SHA256.txt").write_text(f"{archive_sha}  {archive_name}\n")
with zipfile.ZipFile(root/archive_name) as z:
    assert z.testzip() is None
    for p in payload+[root/"SHA256SUMS.txt"]:
        assert z.read(p.name) == p.read_bytes()
    count = len(z.namelist())
(root/"archive-validation.txt").write_text(
    f"PASS: {result['exact_checks']} exact algebra checks.\n"
    f"PASS: {len(payload)} payload files hashed.\n"
    f"PASS: {count} archive members match current bytes; ZIP CRC passed.\n"
    f"Archive SHA-256: {archive_sha}\n"
    "Boundary: GHHR integral normal homology and published inversion are external proof dependencies.\n"
    "No topological instances searched; no actual vacuum-vanishing theorem asserted.\n")
print(check.stdout, end="")
print((root/"archive-validation.txt").read_text(), end="")