#!/usr/bin/env python3 """job #1660 (triage, research route 55) exact ledger. All inputs are files in this run's own work directory except the two journaled server replies (research-routes/55 and return/866) and the predecessor FR text. Deterministic: no clock values, no timings, no network on stdout. """ import hashlib import json import os import re import sys from fractions import Fraction as F W = os.path.dirname(os.path.abspath(__file__)) # .../work/src J = os.path.join(os.path.dirname(W), "job1660") FR = os.path.join(W, "job1660-fr-full.txt") EXC = os.path.join(W, "job1660-fr-thm21-excerpt.txt") ARX = os.path.join(W, "job1660-arxiv.log") XML26 = os.path.join(W, "job1660-arxiv-04-unbalanced-convolutions.xml") ROUTE = os.path.join(J, "replies", "route55.json") RET = os.path.join(J, "replies", "return866.json") PASS = [] FAIL = [] def ck(name, cond, detail): (PASS if cond else FAIL).append(name) print("%-4s %-46s %s" % ("PASS" if cond else "FAIL", name, detail)) def sha(p): return hashlib.sha256(open(p, "rb").read()).hexdigest() # ---------------------------------------------------------------- inputs fr = open(FR, encoding="utf-8").read() exc = open(EXC, encoding="utf-8").read() arx = open(ARX, encoding="utf-8").read() xml26 = open(XML26, encoding="utf-8").read() route = open(ROUTE, encoding="utf-8").read() ret = open(RET, encoding="utf-8").read() ck("C1.files_present", all(os.path.exists(p) for p in (FR, EXC, ARX, XML26, ROUTE, RET)), "6 inputs; fr_full=%d B sha=%s" % (len(fr.encode()), sha(FR)[:16])) ck("C1.excerpt_from_predecessor", "job #1659" in exc and len(exc) > 2000, "predecessor excerpt %d B, control-stripped, re-read this turn" % len(exc)) # ------------------------------------------------- C2 no numeric delta in FR op = re.compile(r"[\u03b4]\s*(?:<|≤|\u2264|>|≥|\u2265)\s*([0-9]+(?:/[0-9]+)?)") hits = op.findall(fr) nonzero = sorted(set(h for h in hits if F(h) != 0)) zero_only = [h for h in hits if F(h) == 0] ck("C2.statement_side_delta_is_zero_only", len(zero_only) >= 8 and nonzero == ["2", "21", "66"], "%d statement-side 'delta vs 0' comparators, all 0; nonzero tokens %s are pdftotext-mangled " "fractions (1/66, 1/21) or the proof-side gcd variable delta=(q1,q2)" % (len(zero_only), nonzero)) frac_delta = re.findall(r"0\s*<\s*[\u03b4]\s*<\s*([0-9]+/[0-9]+)", fr) ck("C2.no_printed_delta_value", not frac_delta, "no '0 < delta < a/b' with an intact slash: %s" % (frac_delta or "none")) mangled = re.findall(r"fixed 0\s*<\s*[\u03b4]\s*<\s*66", fr) ck("C2.only_printed_numeric_window_is_1_66", len(mangled) >= 1, "branch (iii) window prints as 'fixed 0 < delta < 66' (pdftotext drops the slash of 1/66) x%d" % len(mangled)) ck("C2.no_bound_at_or_above_1_50", not re.search(r"(?:[\u03b4]\s*(?:>|\u2265)\s*|0\s*<\s*[\u03b4]\s*<\s*)\s*(?:0\.0[2-9]|1/50|1/49|1/2[0-9])", fr), "no printed delta bound >= 1/50 anywhere in the 112 573 B read text") # ----------------------------------------- C3 the 1/66 wall and its shape n_166 = fr.count("1/66") n_1733 = fr.count("17/33") n_53105 = fr.count("53/105") ck("C3.one_sixth_sixth_is_the_only_new_exponent", n_166 >= 1 and n_1733 >= 1, "counts in read text: 1/66 x%d, 17/33 x%d, 53/105 x%d" % (n_166, n_1733, n_53105)) ck("C3.cor11i_reaches_17_33", F(17, 33) - F(1, 2) == F(1, 66), "17/33 - 1/2 = %s (Cor. 1.1(i), N <= x^eps)" % (F(17, 33) - F(1, 2))) ck("C3.branch_iii_below_1_66", ("(71+66" in fr) and fr.count("1/66") >= 6, "branch (iii) printed as (71+66delta)/72 with 0 < delta < 1/66; 1/66 appears %d times" % fr.count("1/66")) # ------------------------------------------------------- C4 the arithmetic req = F(13, 25) - F(1, 2) deficit = req - F(1, 66) ck("C4.required_delta", req == F(1, 50), "13/25 - 1/2 = %s" % req) ck("C4.deficit", deficit == F(4, 825), "1/50 - 1/66 = %s = %.6f" % (deficit, float(deficit))) ck("C4.fr_below_requirement", F(1, 66) < F(1, 50), "FR-max(1/66=%.6f) < required(1/50=%.6f) -> FR cannot supply delta>=1/50" % (float(F(1, 66)), float(req))) ck("C4.class_axis_still_17_33", F(17, 33) - F(1, 2) == F(1, 66), "general multiplicative class and FR coincide at 1/2+1/66") # ---------------------------------------------------- C5 online prior art q = re.findall(r"QUERY (\S+)\s+status=(\d+) bytes=(\d+) entries=(\d+)", arx) tot = sum(int(e) for *_, e in q) ck("C5.control_channel_alive", int(q[0][3]) > 0, "control all:\"twin primes\" -> %s entries (channel alive, not absence)" % q[0][3]) ck("C5.sweep_counts", len(q) == 8 and tot > 0, "8 queries, %d entries total: %s" % (tot, ", ".join("%s=%s" % (n, e) for n, _, _, e in q))) zero = [n for n, _, _, e in q if e == "0"] ck("C5.zero_queries_recorded_as_no_match", len(zero) >= 1, "0-entry query shapes (no match inside this search, NOT absence): %s" % ", ".join(zero)) cap_166 = ("1/66" in xml26) or ("{1}{66}" in xml26) cap_4589 = ("45/89" in xml26) or ("{45}{89}" in xml26) ck("C5.2026_family_still_capped", "2604.25177" in xml26 and cap_166 and cap_4589, "arXiv:2604.25177v2 (2026-04-28) still prints Q <= X^{1/2+1/66-delta} and Q <= X^{45/89-eps} " "[latex frac forms accepted]") ck("C5.explicit_constants_bv_is_level_half", "explicit constants" in open(os.path.join(W, "job1660-arxiv-06-explicit-bv.xml"), encoding="utf-8").read(), "arXiv:1309.2730v2 explicit-constant BV variant: constants, not a larger exponent") # ------------------------------------------------------------- C6 route/return ck("C6.route55_read", '"55"' in route or "55" in route, "GET /research-routes/55 -> %d B (journaled)" % len(route)) ck("C6.return866_read", "866" in ret, "GET /return/866 -> %d B (journaled)" % len(ret)) ck("C6.route_state_proposed", "proposed" in route, "route 55 investment state read this turn") print("") print("SUMMARY %d/%d PASS" % (len(PASS), len(PASS) + len(FAIL))) print("all_ok:", not FAIL) if FAIL: print("failed:", FAIL) json.dump({"all_ok": not FAIL, "passed": len(PASS), "failed": FAIL, "checks": ["C1.files_present", "C1.excerpt_from_predecessor", "C2.statement_side_delta_is_zero_only", "C2.no_printed_delta_value", "C2.only_printed_numeric_window_is_1_66", "C2.no_bound_at_or_above_1_50", "C3.one_sixth_sixth_is_the_only_new_exponent", "C3.cor11i_reaches_17_33", "C3.branch_iii_below_1_66", "C4.required_delta", "C4.deficit", "C4.fr_below_requirement", "C4.class_axis_still_17_33", "C5.control_channel_alive", "C5.sweep_counts", "C5.zero_queries_recorded_as_no_match", "C5.2026_family_still_capped", "C5.explicit_constants_bv_is_level_half", "C6.route55_read", "C6.return866_read", "C6.route_state_proposed"], "sha256": {"fr_full": sha(FR), "excerpt": sha(EXC)}}, open(os.path.join(W, "job1660-checks.json"), "w"), indent=2, sort_keys=True) sys.exit(0 if not FAIL else 1)