#!/usr/bin/env python3 """job1946-checks.py -- rescue ledger for return #107 (job #1946, attempt 7bc45e54...). Reads only local artefacts under work/ (the served return/review/recon note replies and the fetched Harper HTML text). stdout carries check names + the ALL_PASS line only; all timings and diagnostics go to stderr (a wall time on stdout draws a server file note, return #1023). """ import hashlib import json import math import pathlib import sys import time from fractions import Fraction as F T0 = time.time() HERE = pathlib.Path(__file__).resolve().parent # .../work/src1946 WORK = HERE.parent # .../work RUN = WORK.parent # .../run_20260918_185013_fV7w6w CHECKS = [] def chk(name, ok, note=""): CHECKS.append((name, bool(ok), note)) print(("PASS " if ok else "FAIL ") + name + ((" [" + note + "]") if note else "")) def sha(p): return hashlib.sha256(pathlib.Path(p).read_bytes()).hexdigest() def load(p): d = json.loads(pathlib.Path(p).read_text()) return d RET = load(WORK / "replies" / "return107.json") RECON_REPLY = load(WORK / "replies" / "recon.md.json") RECON = RECON_REPLY.get("raw", "") if isinstance(RECON_REPLY, dict) else str(RECON_REPLY) HARPER = (HERE / "harper.txt").read_text() REVIEW = RET["reviews"][0] NOTES = REVIEW["notes_md"] # ---------------------------------------------------------------- served record (return #107) chk("served #107 is an audit, duplicate_of #105, status rejected", RET["type"] == "audit" and RET["duplicate_of"] == "105" and RET["status"] == "rejected", "type=%s dup=%s status=%s" % (RET["type"], RET["duplicate_of"], RET["status"])) chk("served #107 patch_hash is 796c9891... (byte-identical to #105)", str(RET["patch_hash"]).startswith("796c9891"), str(RET["patch_hash"])[:16]) chk("served review #38 is trusted, verdict reject, reason class refuted", REVIEW["trusted"] is True and REVIEW["verdict"] == "reject" and REVIEW["reject_reason"] == "refuted" and REVIEW["rung"] == "refuted", "review id %s by %s" % (REVIEW["id"], REVIEW["handle"])) chk("review names Harper arXiv:2412.19644 as the nearest statement", "2412.19644" in NOTES and "JLMS 112 (2025) e70293" in NOTES) chk("review states the live gap as range + 'bars sieved sets by name'", "sieved sets" in NOTES and "range" in NOTES) chk("served #107 moves no mathematical status (step open, 0.45546 HEURISTIC)", "No mathematics moves either way" in NOTES and "0.45546 stays HEURISTIC" in NOTES) # ------------------------------------------------------- the search record (recon-0830-smooth-aps) chk("recon note fetched from the served docs (staged path, >30 kB)", len(RECON) > 30000, "len=%d" % len(RECON)) chk("recon's own verdict is statement-level: 'NONE APPLIES AS STATED' over eleven sources", "NONE APPLIES AS STATED" in RECON and "eleven sources" in RECON) chk("recon's rider records Harper 2025 arXiv:2412.19644 as the nearest (not 1208.5992)", "RIDER 2026-08-30" in RECON and "2412.19644" in RECON and "1208.5992" in RECON) chk("recon refines the needed quantifier to the lam0-WEIGHTED AVERAGE over d (BDH form)", "lam0-weighted AVERAGE over d, not uniformity" in RECON) # ------------------------------------------------------------- the changed ingredient (Harper 2025) chk("Harper 2025 body read: Corollary 1 exists in the fetched text", "Corollary 1" in HARPER) chk("Harper 2025 Corollary 1 states the range x^0.51 <= Q <= x", "x 0.51 \u2264 Q \u2264 x" in HARPER) chk("Harper 2025 Corollary 1's object is the y-smooth set itself (a sieved set)", "the y y -smooth numbers less than x x" in HARPER and "asymptotic for the y-smooth numbers" in HARPER.replace("y y -smooth", "y-smooth")) chk("Harper 2025 Theorems 1 and 2 hold for sqrt(2x) < Q <= x", HARPER.count("< Q \u2264 x") >= 2, "occurrences=%d" % HARPER.count("< Q \u2264 x")) chk("Harper 2025 Theorems 1/2 are stated for a GENERAL complex sequence (weights admissible)", "general complex sequence" in HARPER) # ----------------------------------------------------------------------- exact range arithmetic BAND_LO, BAND_HI = F(6, 5), F(2) # registered friability band u in (1.2, 2] def need(u): # modulus exponent of (*): Q = y^(4/5) = x^(4/(5u)) return F(4, 5) / u DGS_CAP = F(3, 5) # DGS Thm 1.2 modulus range x^(3/5-eps) CHK = F(51, 100) # Harper Cor 1 range x^0.51 <= Q u_dgs = F(4, 5) / DGS_CAP # smallest u with need(u) <= 3/5 u_har = F(4, 5) / CHK # largest u with need(u) >= 51/100 chk("need(u) = 4/(5u) spans [2/5, 2/3] over the registered band", need(BAND_LO) == F(2, 3) and need(BAND_HI) == F(2, 5), "need(6/5)=2/3, need(2)=2/5") chk("DGS Thm 1.2 covers u >= 4/3 exactly (need(u) <= 3/5, equality at the boundary)", u_dgs == F(4, 3) and need(F(4, 3)) == DGS_CAP, "u_dgs=%s" % u_dgs) chk("Harper Cor 1 covers u <= 80/51 exactly (need(u) >= 51/100, equality at the boundary)", u_har == F(80, 51) and need(F(80, 51)) == CHK, "u_har=%s" % u_har) chk("the two ranges OVERLAP, so the modulus clause is covered on the whole band", u_dgs < u_har and u_dgs <= BAND_HI and u_har >= BAND_LO, "4/3=%s < 80/51=%s" % (float(u_dgs), float(u_har))) chk("the earlier DGS-alone hole u in (1.2, 4/3) was 2/15 = exactly 1/6 of the band", (u_dgs - BAND_LO) / (BAND_HI - BAND_LO) == F(1, 6)) chk("Cor 1's x^0.51 range is the binding clause (51/100 > 1/2, 80/51 < 8/5)", CHK > F(1, 2) and u_har < F(8, 5), "80/51=%s < 8/5" % float(u_har)) chk("the object is DENSE over the band, so Harper's sparsity channel is unavailable", all(1 - math.log(float(u)) > 0.3 for u in (F(6, 5), F(3, 2), F(2))), "rho(2)=1-ln2=%.5f" % (1 - math.log(2))) # ------------------------------------------------------------------------ the surviving residual chk("what survives is the WEIGHT only: Cor 1 is the unweighted indicator of S(y)", "\\textbf{1}_{\\{n\\in\\mathcal{S}(y)\\}}" in HARPER and "\\Psi(x,y):=" in HARPER, "indicator blocks=%d" % HARPER.count("\\textbf{1}_{")) chk("the squarefree restriction on n is likewise absent from Cor 1's counted set", "no squarefree restriction" in RECON) # ------------------------------------------------------------------------------------- verdict npass = sum(1 for _, ok, _ in CHECKS if ok) nfail = len(CHECKS) - npass print("scanned files: return107.json %s, recon reply %s, harper.txt %s" % (sha(WORK / "replies" / "return107.json")[:12], sha(WORK / "replies" / "recon.md.json")[:12], sha(HERE / "harper.txt")[:12])) print("ALL_PASS=%s (%d pass / %d fail)" % (nfail == 0, npass, nfail)) print("harper html sha256 %s" % sha(HERE / "harper-2412.19644.html"), file=sys.stderr) print("wall %.2fs" % (time.time() - T0), file=sys.stderr) sys.exit(0 if nfail == 0 else 1)