#!/usr/bin/env python3 """Build the submission spec for job #4434 (route 117 step check). Writes .solveathome/private/runs//spec_job4434.json with every hashed artefact and the verification plan. Paths in the spec are relative to the workspace root (the spec's own directory is used by submit_return.py for relative file paths, so absolute local paths never enter the payload). """ import hashlib import json import os RUN = "launch-1rqz5jwid5234jrtdjvdo0it" JOB_ID = 4434 ATTEMPT = "50dd1e8bfea4cfbabd2745742bbaa564" OUTDIR = "outputs/job4434" SPEC = os.path.join(".solveathome/private/runs", RUN, "spec_job4434.json") FILES = [ ("REPORT.md", "REPORT.md"), ("stepcheck_population.py", "stepcheck_population.py"), ("dgate_reindex.py", "dgate_reindex.py"), ("stepcheck_facts.json", "stepcheck_facts.json"), ("dgate30.json", "dgate30.json"), ("dgate_saving.json", "dgate_saving.json"), ("verify_route117_stepcheck.py", "verify_route117_stepcheck.py"), ("test_verify_route117_stepcheck.py", "test_verify_route117_stepcheck.py"), ("fetch_served.py", "fetch_served.py"), ("build_spec.py", "build_spec.py"), ("f1833_dbound2612.json", "served/f1833_dbound2612.json"), ("f1812_sweep2775b.json", "served/f1812_sweep2775b.json"), ] ROLE = {"verify_route117_stepcheck.py": "checker", "f1833_dbound2612.json": "input", "f1812_sweep2775b.json": "input", "test_verify_route117_stepcheck.py": "dependency", "stepcheck_population.py": "dependency", "dgate_reindex.py": "dependency", "fetch_served.py": "dependency", "build_spec.py": "dependency", "stepcheck_facts.json": "target", "dgate30.json": "target", "dgate_saving.json": "target"} TARGETS = ["stepcheck_facts.json", "dgate30.json", "dgate_saving.json"] EVIDENCE = """\ Route 117's step (set by #1812) asks for a measurement at P=30, |R| in {5,6,7}, M <= 3e9 on the rows where #1267's floor permits a drop of 2. This pass ran no K*: it re-enumerated the step's own predicates and re-read the served records. (1) THE |R|=7 CELL IS EMPTY. The cheapest 6-prime-plus-base product is 30*7*11*13*17*19*23*29 = 6,469,693,230 > 3e9, so the step's |R|=7 half admits no row (exact). The rest of the population: 13,890 R-sets at |R|=5 and 1,059 at |R|=6, of which 12,854 are new over #1812's M <= 3e8. The enumerator reproduces #1812's own count of 9,965 R-sets at M <= 3e8 and contains all 8,381 R-sets of its served sweep2775b.json (0 outside). (2) #1833 (route 100, proven, recorded AFTER #1812) SUPPLIES THE MISSING THEOREM. drop <= D(P,p,L) = max_phi min_s #{i : o_i + s = 0 or -2 mod p} for every R with K*(P,R) = L, and D <= floor(2L/p). At P=30 a drop of 3 needs D(30,p,A) >= 3, first reached at A = 14, 19, 21, 27, 33 for p = 7, 11, 13, 17, 19: the step's own named first floor-3 rows (p=11, A=17,18; p=13, A=20) have D=2, so its failure clause cannot fire there. A drop of 2 needs D(30,p,A) >= 2, first reached at A = 11, 12, 14, 18, 22, 39 for p = 7, 11, 13, 17, 19, 23 -- strictly sharper than the step's p <= A, and free (A is the sweep's first pass). (3) THE GATE REMOVES 62% OF THE STEP'S TARGET POPULATION. On #1812's 14,008 served rows the step's filter p <= A keeps 2,028; D(30,p,A) >= 2 keeps 807 (39.8%). All 694 p=7 rows are removed (a p=7 row needs A >= 11, not A >= 7), plus 193 of 814 at p=11 and 334 of 520 at p=13. D >= 3 keeps 0 rows, reproducing #1812's forced statement. The removed rows cannot drop by 2 at all, by a theorem. (4) PRICE. sum_M = 1.85e13 (A pass) + sum_Mp = 1.55e16 (B pass) = 10,320 CPU-h at #1384's measured 4.17e8 slots/s; like-for-like against #1812's own recorded run (983 s wall, 6 threads, 2.07e13 slots) the full population is 1,229 CPU-h = 750x #1812's whole addendum, so the step's 2 CPU-h reaches about 0.16% of it. (5) WHY NOT 'known'. The measured quantity -- a second B = A-2 row beyond M = 3e8 -- is not on the record: #1812 measured only M <= 3e8 (min rise -1, 40 drops all of size 1, no row with floor(2A/p) >= 3), and its six A >= 17 rows are |R|=6 with p in {23,29,31,37} and floor(2A/p)=1, because under M <= 3e8 a 6-prime R is forced to the smallest primes. #1895 (route 147, recorded after #1812) explicitly leaves the A >= 17 ground to route 117; #1832 leaves the floor >= 3 question to routes 100/117/127. So the step is not answered (no 'known'), nor shippable as written (its |R|=7 cell is empty, its named failure branch is dead, 62% of its target population is provably pointless): the old step is replaced by the same measurement restricted to what is still live. """ PRIOR_ART = """\ Search 2026-09-27, this pass, for the changed question (a phase-refined bound on the drop of a two-class killing run when a prime joins the base, sparse killer set R). Two queries: (1) "phase refinement Jacobsthal bound adding prime to modulus two residue classes drop bound"; (2) "arXiv 1611.03310 Jacobsthal function two classes base extension bound"; plus "twin prime covering run K*(Pp,R) - K*(P,R) base change bound 2026". Returns were the known one-class Jacobsthal line (arXiv:1611.03310; Hagedorn's tables; Costello-Watts; OEIS A048670/A144311) and unrelated 2026 preprints on other twin-prime constructions; nothing bounds K*(Pp,R) - K*(P,R) for a sparse R, and nothing has the phase-refined translate bound D(P,p,L). This reuses the route's own search record (route 117 rev 3 and #1812/#1833 prior_art_md: MathOverflow 70307, Erdos 1962, OEIS wiki, Tucker's Atlas of Maximal Gaps, Zenodo 22919682) rather than repeating the broad survey. Access gaps: the Tucker PDF and the 2026 Zenodo items were not read in full. Empty external result is a statement about the search, not evidence of novelty. The decisive project record is #1833 (proven D(P,p,L)); #1267 (proven floor), #1804, #1812, #1365, #1367, #1384, #1895. """ NEXT_STEP = { "question": ("At P=30 with M = 30*prod(R) in (3e8, 3e9], |R| in {5,6}, on the rows where " "#1833's proven phase bound still permits a drop of 2 (D(30,p,A) >= 2), does a " "second B = A-2 row appear -- in particular at p=7 with A >= 11, p=11 with " "A >= 12 or p=13 with A >= 14, the first A at which #1833 leaves a drop of 2 " "possible, and at p=7 with A >= 14, p=11 with A >= 19 or p=13 with A >= 21, the " "first A at which a drop of 3 is permitted at all?"), "method": ("Reuse the served kstar.c of #1812 unchanged with sweep2775b.py's custody gates " "(the five published values 9, 8, 10, 12, 10 and #1384's 62 served values). New " "pre-registered driver, price first: P=30, R from primes 7..97 coprime to 30, " "|R| in {5,6} (the |R|=7 cell is empty under this cap: min M = " "30*7*11*13*17*19*23*29 = 6,469,693,230 > 3e9), M = 30*prod(R) in (3e8, 3e9] " "only -- the M <= 3e8 rows are #1812's and #1367's and are not rerun. Compute A " "per R-set (cost M), then keep a row only when D(30,p,A) >= 2, #1833's proven " "necessary condition for a drop of 2; on #1812's served rows that gate removes " "1,221 of the 2,028 rows the old filter p <= A kept (all 694 p=7 rows with " "A <= 10, the p=11 rows with A <= 11, the p=13 rows with A <= 13, the p=19 rows " "with A <= 21 and the p=23 rows with A <= 38). Then run B (cost Mp) on the kept " "rows in ascending Mp, reporting the exact Mp reached. Cross-check every drop of " "2 with #1804's kfork.c. The population is not a budget: the A pass alone is " "1.85e13 slots and the full B pass 1.55e16, about 750x #1812's whole addendum, so " "state the scope reached exactly and extrapolate nothing beyond it."), "success": ("No rise <= -2 on any kept row run: the single-exception form extends to the " "largest A reached, and the p=7, p=11, p=13 cells above drop by at most 1. Or " "an exact list of new rise = -2 rows with (R, p, A, B, D(30,p,A)) certified by " "both instruments."), "failure": ("Any rise <= -3 on a kept row (a size-dependent deficit: the lower leg then " "needs a term growing with floor(2A/p), and #1833's D is not the sharp " "constant), or a rise = -2 row disagreeing between kstar.c and kfork.c."), "compute": {"ram_gb": 2, "disk_gb": 1, "cpu_hours": 0}, "budget_hours": 2, "required_tools": ["python3", "cc"], "required_sources": ["return-1267", "return-1804", "return-1812", "return-1833"], } def sha(path): return hashlib.sha256(open(path, "rb").read()).hexdigest() def main(): files, hashes, manifest = [], {}, [] for name, rel in FILES: p = os.path.join(OUTDIR, rel) files.append({"name": name, "path": os.path.abspath(p)}) hashes[name] = sha(p) manifest.append({"path": name, "sha256": hashes[name], "role": ROLE.get(name, "input")}) checker = hashes["verify_route117_stepcheck.py"] inputs = [hashes[n] for n in ("f1833_dbound2612.json", "f1812_sweep2775b.json")] plan = { "schema_version": 1, "tools": ["python3"], "manifest": manifest, "targets": TARGETS, "claim": ("Route 117's step from #1812 has an empty |R|=7 cell under its own cap, and " "#1833's proven phase bound removes 1,221 of the 2,028 rows the step's own " "filter keeps in the population #1812 already measured, including every row " "in which a rise of -3 or worse is possible; the step's measured quantity (a " "second B = A-2 row beyond M = 3e8) is not on the record."), "scope": ("P=30; R from primes 7..97 coprime to 30; |R| in {3,4,5,6} for the served " "validation and {5,6,7} for the step's cap; M = 30*prod(R) <= 3e8 (#1812's " "cap) and <= 3e9 (the step's cap); p prime <= 97, p not in R; the D gate of " "#1833 over L <= 60."), "assumptions": ("The served f1812_sweep2775b.json and f1833_dbound2612.json are the " "returns' own bytes; #1833's D(P,p,L) theorem is used as stated and is " "not reproved here; the price is an estimate at #1384's measured rate."), "checker": checker, "inputs": inputs, "environment": ("python3 3.13 stdlib only, no network. f1833_dbound2612.json = return " "#1833's served dbound2612.json; f1812_sweep2775b.json = return #1812's " "served sweep2775b.json."), "command": "python3 verify_route117_stepcheck.py --dir .", "expected": "58 checks, 0 FAIL, then the line ALL CHECKS PASS, exit code 0.", "supports": ("Passing re-derives, from the served inputs alone, the step's population " "counts, the emptiness of its |R|=7 cell, #1833's D table for P=30 against " "an independent exact evaluation, the 2,028/807/0 row counts, the price and " "the like-for-like ratio, and #1812's served summary fields. It does not " "establish any K* value, any bound on A - B, or anything beyond the caps."), "coverage": "decisive", "coverage_md": ("Every shape of #1833's table at P=30 with floor(2L/p) >= 1 is read; the " "re-index is cross-checked against an independent exact evaluation on 224 " "(p, L) shapes for p in {7,11,13,17,19,23,29}, L <= 40. Every one of " "#1812's 14,008 served rows is used for the gate counts. All 14,949 " "R-sets of the step's cap are enumerated. No sampling, no seed."), "comparison": ("Exact integer equality everywhere except the price: cpu_hours compared to " "10320.126 with tolerance 5e-3 and the like-for-like ratio to 750.2 with " "tolerance 0.05, both justified as float round-off of an exact slot count " "and a recorded wall clock."), "availability": {"status": "complete", "details": "Checker and both served inputs are in the manifest.", "required_sources": [], "network": False}, "cost": {"minutes": 1, "judgment_minutes": 15, "cpu_hours": 0.02, "ram_gb": 2, "disk_gb": 1}, } spec = { "job_id": JOB_ID, "attempt_id": ATTEMPT, "type": "explore", "route_id": 117, "report_md": open(os.path.join(OUTDIR, "REPORT.md"), encoding="utf-8").read(), "author_rung": "verified", "cpu_hours": 0.15, "files": files, "hashes": hashes, "research": { "route_id": 117, "outcome": "progress", "evidence_md": EVIDENCE, "prior_art_md": PRIOR_ART, "next_step": NEXT_STEP, # obstacle is only for blocked/inconclusive; the server rejects null "depends_on": [1267, 1365, 1367, 1384, 1804, 1812, 1833, 1895], }, "cites": {"messages": [], "returns": [1267, 1365, 1367, 1384, 1804, 1812, 1833, 1895], "files": [], "handles": []}, "recipe_md": ("python3 stepcheck_population.py # writes stepcheck_facts.json\n" "python3 dgate_reindex.py # writes dgate30.json, dgate_saving.json\n" "python3 verify_route117_stepcheck.py # 58 checks, ALL CHECKS PASS, exit 0\n" "python3 test_verify_route117_stepcheck.py # 10 tests: clean passes, 9 negative controls detected\n" "The checker is self-contained (stdlib only). Inputs are the served returns " "#1812 sweep2775b.json and #1833 dbound2612.json, shipped with the package and " "fetched by fetch_served.py from /files/."), "transcript_approved": True, "verification_plan": plan, } # length caps from the research protocol caps = {"evidence_md": 4000, "prior_art_md": 4000} for k, cap in caps.items(): assert len(spec["research"][k]) <= cap, (k, len(spec["research"][k])) ns = spec["research"]["next_step"] for k, cap in (("question", 1000), ("method", 4000), ("success", 2000), ("failure", 2000)): assert len(ns[k]) <= cap, (k, len(ns[k])) os.makedirs(os.path.dirname(SPEC), exist_ok=True) with open(SPEC, "w", encoding="utf-8") as fh: json.dump(spec, fh, indent=1, ensure_ascii=False) print("spec ->", SPEC) print("lengths: evidence %d, prior_art %d, method %d, question %d" % (len(EVIDENCE), len(PRIOR_ART), len(ns["method"]), len(ns["question"]))) print("files:", [f["name"] for f in files]) # leak check: no absolute local path or credential literal in any PUBLISHED field published = {"report_md": spec["report_md"], "research": spec["research"], "recipe_md": spec["recipe_md"], "verification_plan": spec["verification_plan"], "cites": spec["cites"], "hashes": spec["hashes"]} blob = json.dumps(published) for bad in ("C:\\", "C:/", "/Users/", "/home/", "AppData", "sah_Az", ".solveathome"): assert bad not in blob, ("absolute path/credential in published payload: %s" % bad) print("scrub check: no absolute path or credential literal in the published fields") if __name__ == "__main__": main()