#!/usr/bin/env python3 """Assemble the return parts for job #1446: research.json and hashes.json. Same shape as the builders of jobs #1385-#1402, deliberately: long markdown fields are read from disk verbatim, the declared file list and its sha map are produced in one pass so they cannot drift, a declared file that is missing is an error rather than an omission, and the server's 4000-character limits on `evidence_md` and `prior_art_md` are enforced here rather than discovered as an HTTP 400. """ import hashlib import json import pathlib import sys HERE = pathlib.Path(__file__).parent R = HERE.parent.parent # the run directory FILES = [ "work/job1446/report.md", "work/job1446/recipe.md", "work/job1446/research.json", "work/job1446/research.jsonl", "work/job1446/transcript.jsonl", "work/job1446/evidence.md", "work/job1446/evidence-inline.md", "work/job1446/prior-art.md", "work/job1446/checks.json", "work/job1446/lstar.py", "work/job1446/exch.py", "work/job1446/detrend.py", "work/job1446/verdict.py", "work/job1446/guardreal.py", "work/job1446/framework_checks.py", "work/job1446/build_return.py", "work/job1446/out/lstar.json", "work/job1446/out/exch.json", "work/job1446/out/detrend.json", "work/job1446/out/verdict.json", "work/job1446/out/guardreal.json", "work/job1446/out/guard-selftest.json", "work/job1446/out/guard-report-16384.json", "work/job1446/out/guard-report-65536.json", "work/job1446/out/guard-report-262144.json", ] def main(): evidence = (HERE / "evidence-inline.md").read_text(encoding="utf-8") prior = (HERE / "prior-art.md").read_text(encoding="utf-8") if len(evidence) > 4000: print("inline evidence is %d chars, over the server's 4000 limit" % len(evidence)) return 3 if len(prior) > 4000: print("prior_art_md is %d chars, over the server's 4000 limit" % len(prior)) return 3 research = { "route_id": 31, "outcome": "result", "evidence_md": evidence, "prior_art_md": prior, "headline": ( "Route 31 rev 5's registered question is answered negatively and its premise is shown to " "fail: L*(x) tracks neither the mean smooth-class size (353/928/2658 against L* = 148/146/" "49) nor 1/(residual energy share), and |J|/L* runs 55/224/2651, so there is no single " "scale to normalise by -- and at a FIXED L the whole curve grows with x (largest cell R = " "2.259/2.096/6.832), so no L*(x) can collapse it. The large-L positive regime itself is " "not an arrangement property at all: on the one-signed classes the residual is exactly " "s_C*(|c| - class mean) (max error 0.0), the class key is (s_U(n), s_U(n-2)) so the " "cofactor n/s_U(n) is proportional to n inside a class, and one linear fit per class in n " "carries 68/80/83 percent of the residual energy and removes the rise (excess removed " "74/103/102 percent of it), with the segment profile flattening 11.33 -> 2.00 and the " "within-class chunk ratio W(m) collapsing from m^0.92 to ~1. The exact split " "R*L*mean(f^2) = D_L + X_L (verified to 2.6e-13) shows the rise lives in the sign-free " "D_L, which the class-sign permutation null has as its mean; combined with #1438's " "identically-zero sign-only residual this says the statistic carries no sign information " "beyond the class-sign map. Established at 2^16 and 2^18, NOT at 2^14 (74.3 percent " "removed, guard declines to refuse)."), "next_step": { "question": ( "The drift is a systematic dependence of |c| on the cofactor m = n/s_U(n), which the " "class key discards. Does renormalising by (class x stratum of the cofactor's own " "rough part) instead of by the class alone return R_L to 1 at large L, with the " "within-class drift share below 0.25, while every small-L reading is unchanged?"), "method": ( "No new producer run: the fields already exist. Rebuild the same three scales, " "partition each class further by a stratum of the cofactor's own rough part (m = 1; m " "prime; m a product of two primes above U; m carrying a prime power above U; m " "composite otherwise), recompute the same 39-cell grid, the D/X split, W(m) and the " "segment profile, and put each scale through the shared guard/1 before reading " "anything. Cost is two further passes of the same size, about 0.02 CPU-h."), "success": ( "guard/1 returns NOT_REJECTED with a large-L R_L within noise of 1 and the drift share " "under 0.25 at all three scales, and the small-L cells are unchanged to within their " "own null sd -- the repair is a nuisance model and nothing else moves."), "failure": ( "guard/1 still REJECTs, or the largest-cell D_share stays above 2, or the small-L " "readings move: the cofactor stratification is not the right nuisance, and the honest " "outcome is that this statistic cannot be read at large L on this partition at any of " "the three scales."), "budget_hours": 1, }, "cites": [ "return #654 / job #1438 (the instrument and the route's success clause this job flags)", "return #648 (the R_L^cls surface this statistic extends) and #646 (the class-sign collapse and the S-null)", "return #636 (the accepted producer, pin read from the instrument's own PRODUCER_SHA)", "Mandelbrot-Wallis 1969 (R/S introduced); Rea-Reale-Brown-Oxley arXiv:0901.0762 (the trend artefact in R/S, snippet-level)", "Mundlak 1978; Bell-Fairbrother-Jones, Quality & Quantity 52 (2018) (group-mean centering, snippet-level)", "Matomaki-Radziwill, Ann. of Math. 183 (2016); Matomaki-Radziwill-Tao 2015 (nearest published neighbours; no source located that computes this object)", "shared tool guard/1 (driftguard.py sha256 2ce388c5..., new this assignment, selftest 5/5)", ], "depends_on": [654, 648, 646, 636], } (HERE / "research.json").write_text(json.dumps(research, indent=1, ensure_ascii=False), encoding="utf-8", newline="\n") # the same payload as one JSONL record, so the publication scrubber can read it (HERE / "research.jsonl").write_text(json.dumps(research, ensure_ascii=False) + "\n", encoding="utf-8", newline="\n") hashes = {} for rel in FILES: p = R / rel if not p.exists(): print("missing declared file: %s" % rel) return 2 hashes[rel] = hashlib.sha256(p.read_bytes()).hexdigest() (HERE / "hashes.json").write_text(json.dumps(hashes, indent=1, sort_keys=True), encoding="utf-8", newline="\n") print(json.dumps({"wrote": ["work/job1446/research.json", "work/job1446/hashes.json"], "evidence_chars": len(evidence), "prior_art_chars": len(prior), "files": len(FILES), "outcome": research["outcome"]}, indent=1)) return 0 if __name__ == "__main__": sys.exit(main())