#!/usr/bin/env python3 """Apply job #3032's revision to the served research/IMPORT-MAP.md, minimal and anchored. Seven anchors, each required to match the served bytes exactly once; the script refuses at the first mismatch and writes nothing. Every edit is a correction the findings name, in the cell the finding names: E1 row 2, the PRIOR-ART sentence -- findings #32/#752 (MRS Table 3.2 p.75 gives the B = 1 capacity 0 bits; the walk language is a zero-loop extension, sofic and not of finite type), folded with the note #353 filed as import-map755.patch and #171 asked to fold into one phrase (binary B-charge graph at MRS §1.5.4 Fig. 1.14 p.16 / §2.3 p.47; the ternary zero-loop rule named as AMI at Cioffi ch.3 §3.8.4.1 p.588). E2 row 4, source column -- finding #759 (the 1990 Statistical Science restatement gets its locator beside the 1989 Ann. Probab. entry). E3 row 24, source column -- finding #198 (the page number is qualified: the author preliminary version, printed book not checked). E4 row 24, status cell -- finding #198 ("review pending" becomes the review record: review 319, 2026-09-24, trusted, accept at verified). E5 §1 calibration, thinning row -- findings #179/#180 (the SOURCE-SCOPE note of #377, which the v8 integration dropped, is restored with the tag corrected to (job968, return 377), the spaces restored and the full stop after "LANDED, coupling closed"). E6 §2 preamble -- findings #766/#769 (a count clause for rows 24 and 25, so the count paragraph no longer reads as if they did not exist). E7 §2 live map, after row 24 -- findings #766/#769 (#1321's Bonferroni row is inserted as row 25 and renumbered; the v1-based revised file 62a2fcce is NOT installed). python apply-revision.py --base --out [--diff ] Exit 0 on a clean apply, 1 on refusal. """ import argparse import difflib import hashlib import sys BASE_SHA = "fa3df844ab0588fe380a3e2d4cb6e6a6a7efc3b1183e0d039c671c117e8acaab" ROW25 = ( "| 25 | Bonferroni-type inequalities, and the sharpened sieve inequalities | Grable, " "*Hypergraphs and sharpened sieve inequalities*, **Discrete Math.** (1994) 75-82, " "Zbl 0809.05074, MSC 05C65/60C05 **[INSPECTED-ABSTRACT]**; behind it Galambos-Simonelli, " "*Bonferroni-type inequalities with applications*, Springer 1996, whose prime-number " "applications are **UNOPENED** | `F(s)^-` of [global-factor-signs.md](global-factor-signs.md) " "section 3 and the pair-trigger majorant (10); equivalently the truncated Mobius transform " "of a divisor-ramp profile | the rung of that section's refutation, read as a discovery when " "its identity is classical | EXACT-IDENTITY (the identity) + STRONG-ANALOGY (Grable) | CLEAN " "| PUBLISHED-ANCHOR + WALL-ADDRESS | 2 h | **FILED 2026-09-19, return #1320 (job #2551).** " "The identity under the ten-prime cell is the classical Bonferroni truncation error, " "`sum_{j -84`; `k=19, J=6 -> -8568`). The " "finite-difference identity of `F(s)` is ALREADY assigned to Granville-Koukoulopoulos-Maynard " "section 1.2 (1.6)-(1.7) by global-smooth-majorant.md section 7, so sections 1-2 of the note " "carry no new algebra; the PHENOMENON has a published threshold, GKM's " "`A = (1/2k)C(2k,k) - 1` (\"which is not the intention when designing sieve weights\"), cited " "in six corpus files and never for that threshold. Next step is a SOURCE READ, not an " "experiment: Galambos-Simonelli's prime-number chapter and Grable's full text. No novelty or " "absence claim; searched in three named conventions on three calibrated channels, return " "#1320. |" ) EDITS = [ ( "E1 row 2 -- the MRS attribution, corrected and folded (#32/#752/#171, #353's note)", "PRIOR-ART 2026-08-19: the strict-soficity and the capacity are REPRODUCTIONS of printed " "results — the language is the B = 1 charge constraint / alternate-mark-inversion, " "Marcus–Roth–Siegel §2.3 p. 47 and §3.2 p. 75 — what stays banked is the 3/p → 2/p rate " "correction, the weight-(1,1,2) multiplicity, and the wall address", "PRIOR-ART 2026-08-19 (corrected 2026-09-25, findings #32/#752; review 235): what is " "printed on those pages is the BINARY B-charge graph — Marcus–Roth–Siegel §1.5.4 " "Fig. 1.14 p. 16 and §2.3 p. 47 — whose B = 1 capacity is 0 bits (their Table 3.2 " "p. 75), while the corpus's walk language is a zero-loop extension of it (all-ones " "adjacency matrix, capacity ln 2, sofic and not of finite type) — what stays banked is " "the 3/p → 2/p rate correction, the weight-(1,1,2) multiplicity, and the wall address; " "**PRIOR-ART 2026-09-14, #161 / review #75 (folded into the sentence above 2026-09-25, " "findings #170/#171):** the ternary zero-loop rule is alternate mark inversion (nonzero " "signs alternate, zero letters do not change state), directly stated in John M. Cioffi, " "*Digital Communication*, author-hosted chapter 3, §3.8.4.1 printed p.588 after " "Eq.(3.512), https://cioffi-group.stanford.edu/doc/book/chap3.pdf (online edition " "retrieved 2026-09-14; publication year not established), and the MRS pages named above " "are the binary graph, so the ternary zero-loop specialization is not presented as a " "verbatim graph on those pages; Holt arXiv:2502.20470v3 §3 Lemma 2 p.5 owns the " "same-image span criterion underlying g ≡ 0, ±2 (mod p). These source matches cover the " "local criterion and language, not #161's finite table, cyclic conventions, or an " "uncapped growing-sieve L bound. Existing graph ownership, rate corrections and reviewer " "#75's fixed-tile tail remain credited to their original sources", ), ( "E2 row 4 -- the 1990 restatement gets its locator (#759)", "Arratia–Goldstein–Gordon, *Ann. Probab.* 17 (1989) 9–25 **[SOURCED-BIB]**; " "Barbour–Holst–Janson, OUP 1992 **[SOURCED-BIB]**", "Arratia–Goldstein–Gordon, *Ann. Probab.* 17 (1989) 9–25 **[SOURCED-BIB]**, and the same " "authors' *Poisson Approximation and the Chen–Stein Method*, *Statist. Sci.* **5** (1990) " "403–434, p. 405 (the `b₂ − b₁ = E(W²) − E(Z²)` identity; `b₁`, `b₂`, `b₃` read verbatim " "there, `history/staging/import-stein.md` §1) **[SOURCED, verbatim]**; " "Barbour–Holst–Janson, OUP 1992 **[SOURCED-BIB]**", ), ( "E3 row 24 -- the page number is qualified (#198)", "AMS GSM 203 (2019), Exercise 26.2, p. 286, [author preliminary PDF]", "AMS GSM 203 (2019), Exercise 26.2, p. 286 of the author preliminary version (printed " "book not checked), [author preliminary PDF]", ), ( "E4 row 24 -- the review record replaces 'review pending' (#198)", "**SOURCE MATCH 2026-09-17; review pending.**", "**SOURCE MATCH 2026-09-17; review 319 (2026-09-24), trusted, accept at rung verified.**", ), ( "E5 §1 calibration -- the #377 SOURCE-SCOPE note the v8 integration dropped (#179/#180)", "**LANDED, coupling closed** |", "**LANDED, coupling closed.** **SOURCE-SCOPE 2026-09-14 (job968, return 377):** " "independent-renewal thinning formula sourced in E. Sandhya, JKSA 7(1) (1991) 1–7, " "[arXiv:1409.5948v1](https://arxiv.org/pdf/1409.5948v1) §3 pp. 3–4. This owns the " "renewal null; it does not state the deterministic two-class maximal-run tail " "inequality. Copy/closure and local tuple-occupancy ingredients are sourced separately " "in Holt–Rudd arXiv:1408.6002v1 §6.1 pp. 23–26 and Holt arXiv:2502.20470v3 §3 p. 5. " "Closures and finite claims retain their existing scope. |", ), ( "E6 §2 preamble -- a count clause for rows 24 and 25 (#766/#769)", "still unwritten. The\ncost column is the price set BEFORE each run", "still unwritten. Row 24 is the 2026-09-17 divisor-weighted maximal " "Bombieri–Vinogradov source match (return #910) and is outside the original-row counts " "on the same ground. Row 25 is the 2026-09-19 Bonferroni-type prior-art audit (return " "#1320) and is likewise outside the original-row counts. The\ncost column is the price " "set BEFORE each run", ), ( "E7 §2 live map -- #1321's row inserted as row 25 (#766/#769)", "unchanged. |\n\n**Counts", "unchanged. |\n" + ROW25 + "\n\n**Counts", ), ] def main() -> int: ap = argparse.ArgumentParser() ap.add_argument("--base", required=True) ap.add_argument("--out", required=True) ap.add_argument("--diff") a = ap.parse_args() sys.stdout.reconfigure(newline="\n", encoding="utf-8", errors="replace") with open(a.base, encoding="utf-8", newline="") as fh: text = fh.read() sha = hashlib.sha256(text.encode("utf-8")).hexdigest() if sha != BASE_SHA: print("REFUSED: base sha is %s, not the served %s" % (sha, BASE_SHA)) return 1 for name, old, new in EDITS: n = text.count(old) if n != 1: print("REFUSED: anchor %d times for %s" % (n, name)) return 1 text = text.replace(old, new, 1) with open(a.out, "w", encoding="utf-8", newline="") as fh: fh.write(text) if a.diff: with open(a.base, encoding="utf-8", newline="") as fh: base_lines = fh.read().splitlines(keepends=True) with open(a.diff, "w", encoding="utf-8", newline="") as fh: fh.writelines(difflib.unified_diff( base_lines, text.splitlines(keepends=True), fromfile="research/IMPORT-MAP.md (served, sha256 %s...)" % BASE_SHA[:12], tofile="research/IMPORT-MAP.md (revised)")) print("ok: %d edits applied" % len(EDITS)) print("out sha256 %s" % hashlib.sha256(text.encode("utf-8")).hexdigest()) print("out bytes %d" % len(text.encode("utf-8"))) return 0 if __name__ == "__main__": sys.exit(main())