Research source · python
build-release.py
site/public/evidence/dehn-filled-quantum-trace/longitude-difference-attack/build-release.py
45 lines. Source is displayed for inspection; it is not executed by this page.
File fingerprint
SHA-256: 889d3b1894db36c96ed206f2b68a2122c75c7b0a30e589c3518f48ea953499b3
#!/usr/bin/env python3
"""Reproduce verification and deterministically package the release."""
from pathlib import Path
import hashlib
import json
import subprocess
import sys
import zipfile
root = Path(__file__).resolve().parent
verification = subprocess.run([sys.executable,str(root/"verify-longitude-difference.py")],
cwd=root,capture_output=True,text=True,check=True)
(root/"verification-output.txt").write_text(verification.stdout)
results = json.loads((root/"exact-results.json").read_text())
assert results["all_orders_certificate"]["residual_monomials"] == 0
assert results["series_sanity_check"]["unit_coefficients"] == results["series_sanity_check"]["longitude_coefficients"]
archive_name = "longitude-difference-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)
sha = lambda data: hashlib.sha256(data).hexdigest()
(root/"SHA256SUMS.txt").write_text("".join(f"{sha(p.read_bytes())} {p.name}\n" for p in payload))
with zipfile.ZipFile(root/archive_name,"w",compression=zipfile.ZIP_DEFLATED,compresslevel=9) as archive:
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
archive.writestr(info,p.read_bytes(),compress_type=zipfile.ZIP_DEFLATED,compresslevel=9)
archive_hash = sha((root/archive_name).read_bytes())
(root/"ARCHIVE-SHA256.txt").write_text(f"{archive_hash} {archive_name}\n")
with zipfile.ZipFile(root/archive_name) as archive:
assert archive.testzip() is None
for p in payload+[root/"SHA256SUMS.txt"]:
assert archive.read(p.name) == p.read_bytes()
count = len(archive.namelist())
(root/"archive-validation.txt").write_text(
f"PASS: {results['exact_checks']} exact checks.\n"
"PASS: all-orders certificate residual is zero.\n"
"PASS: independent certified series agreement through A-degree 16.\n"
f"PASS: {len(payload)} payload files hashed.\n"
f"PASS: {count} archive members match current bytes; ZIP CRC test passed.\n"
f"Archive SHA-256: {archive_hash}\n"
"Scope: supporting ATTACK; no actual triangulation counterexample.\n")
print(verification.stdout,end="")
print((root/"archive-validation.txt").read_text(),end="")