# decryption_complete: false # source: /Voynich/Voynich_BOUNDARY_INVARIANT_ATOM_LEDGER_045_reproducibility.zip!/run_boundary_invariant_ # stated_sha256: cc875e5725b78d5d2ad0a9c08f4458a97bc47d3c1b007cb624531a462369bbba # matches_stated_sha256: false # pdf_pages: 349-351 # note: The stated SHA-256 is the digest printed in the PDF. # The PDF page extract follows the form feed. decryption_complete stays false. run_boundary_invariant_atom_ledger_045.py VOYNICH RESEARCH ARCHIVE | 16 SEPTEMBER 2026 1 run_boundary_invariant_atom_ledger_045.py Source: /Voynich/Voynich_BOUNDARY_INVARIANT_ATOM_LEDGER_045_reproducibility.zip!/run_boundary_invariant_ atom_ledger_045.py SHA-256: cc875e5725b78d5d2ad0a9c08f4458a97bc47d3c1b007cb624531a462369bbba !/usr/bin/env python3 """BOUNDARY-INVARIANT-ATOM-LEDGER-045. Tests whether the sole unused dual-key-hit near miss is a transcription word- boundary artifact. Glyph atoms remain exact; no cross-family normalization is applied. The prior five records train a prospective atom-retention model for the sixth record before it is added to leave-one-record-out evaluation. """ from pathlib import Path import hashlib, json import numpy as np import pandas as pd import run_anonymous_record_decompression_032 as d32 import run_record_role_prediction_036 as r36 ROOT = Path(__file__).resolve().parent OUT = ROOT / "boundary_invariant_atom_ledger_045" OUT.mkdir(exist_ok=True) SEED = 20260830 REPS = 10000 def toks(x): return str(x).split(" | ") def atoms(x): return " | ".join(" ".join(toks(x)).split()) def main(): five = pd.read_csv(ROOT / "ledger_realign_role_042/corrected_five_record_ledger.csv") near = pd.read_csv(ROOT / "boundary_invariant_atom_ledger_045/f77v_frozen_nearmiss.csv").iloc[0] six = pd.concat([five, pd.DataFrame([near])], ignore_index=True) rows = [] for r in six.itertuples(): zt, gt = toks(r.zl_residual), toks(r.gc_residual) za, ga = atoms(r.zl_residual).split(" | "), atoms(r.gc_residual).split(" | ") rows.append({"record_id": r.record_id, "folio": r.folio, "zl_line": r.zl_line, "gc_line": r.gc_line, "keys": r.keys, "zl_residual": r.zl_residual, "gc_residual": r.gc_residual, "token_jaccard": d32.multiset_jaccard(zt, gt), "token_lcs": d32.lcs_ratio(zt, gt), "zl_atom_stream": " | ".join(za), "gc_atom_stream": " | ".join(ga), "atom_jaccard": d32.multiset_jaccard(za, ga), "atom_lcs": d32.lcs_ratio(za, ga), "zl_atoms": len(za), "gc_atoms": len(ga)}) led = pd.DataFrame(rows) led.to_csv(OUT / "six_record_atom_ledger.csv", index=False) zseq = [x.split(" | ") for x in led.zl_atom_stream] gseq = [x.split(" | ") for x in led.gc_atom_stream] obs = float(led.atom_jaccard.mean()) rng = np.random.default_rng(SEED); null = [] for _ in range(REPS): p = rng.permutation(len(gseq)) null.append(float(np.mean([d32.multiset_jaccard(zseq[i], gseq[j]) for i, j in enumerate(p)]))) pv = float((1 + sum(x >= obs for x in null)) / (REPS + 1)) pd.DataFrame({"replicate": range(REPS), "mean_atom_jaccard": null}).to_csv(OUT / "atom_pairing_null.csv", index=False) # Feed exact atoms into the already-frozen position+identity retention model. atom = pd.DataFrame({"record_id": led.record_id, "folio": led.folio, "zl_residual": led.zl_atom_stream, "gc_residual": led.gc_atom_stream}) train5 = atom.iloc[:5] target = atom.iloc[5] lb, lf, pred = r36.score(target, r36.fit(list(train5.itertuples()))) prospective = {"record": target.record_id, "n_zl_atoms": len(pred), "baseline_bits": lb, "role_bits": lf, "gain_bits": lb-lf} run_boundary_invariant_atom_ledger_045.py VOYNICH RESEARCH ARCHIVE | 16 SEPTEMBER 2026 2 pd.DataFrame([prospective]).to_csv(OUT / "prospective_sixth_atom_role.csv", index=False) pd.DataFrame([{"record": target.record_id, "atom": x, "position": p, "retained": y, "baseline_p": bp, "atom_role_p": fp} for x,p,y,bp,fp in pred]).to_csv(OUT / "prospective_atom_predictions.csv", index=False) folds = [] for i, r in atom.iterrows(): lb2, lf2, pp = r36.score(r, r36.fit(list(atom.drop(i).itertuples()))) folds.append({"heldout_record": r.record_id, "n_zl_atoms": len(pp), "baseline_bits": lb2, "atom_role_bits": lf2, "gain_bits": lb2-lf2}) fd = pd.DataFrame(folds); fd.to_csv(OUT / "six_record_atom_role_loo.csv", index=False) pass_record = bool(led.iloc[5].atom_jaccard >= .50 and led.iloc[5].atom_lcs >= .75) pass_roles = bool(prospective["gain_bits"] > 0 and fd.gain_bits.mean() > 0 and (fd.gain_bits > 0).sum() >= 5) ledger_pass = bool(pass_record and pv < .05) summary = {"test": "BOUNDARY-INVARIANT-ATOM-LEDGER-045", "glyph_normalization": "NONE_EXACT_ATOMS", "records_before": 5, "records_after": 6, "sixth_record": target.record_id, "sixth_token_jaccard": float(led.iloc[5].token_jaccard), "sixth_token_lcs": float(led.iloc[5].token_lcs), "sixth_atom_jaccard": float(led.iloc[5].atom_jaccard), "sixth_atom_lcs": float(led.iloc[5].atom_lcs), "six_record_mean_atom_jaccard": obs, "pairing_permutation_p": pv, "prospective_atom_role_gain_bits": prospective["gain_bits"], "atom_role_loo_mean_gain_bits": float(fd.gain_bits.mean()), "positive_atom_role_folds": int((fd.gain_bits > 0).sum()), "sixth_record_ledger_pass": ledger_pass, "portable_atom_role_pass": pass_roles, "decision": "LEDGER_PASS_ROLE_EXTENSION_FAIL" if ledger_pass and not pass_roles else "FULL_PASS" if ledger_pass and pass_roles else "FAIL", "boundary": "Exact anonymous glyph-atom streams and retention roles; no semantic gloss or plaintext."} (OUT / "summary.json").write_text(json.dumps(summary, indent=2)) report = ["# BOUNDARY-INVARIANT-ATOM-LEDGER-045", "", "**LEDGER PASS — SIXTH PHYSICAL RECORD RECOVERED; ROLE EXTENSION FAILS**" if ledger_pass and not pass_roles else "**FULL PASS**" if ledger_pass and pass_roles else "**FAIL / NOT PROMOTED**", "", "The only unused same-line, dual-key-hit near miss was re-evaluated below transcription word boundaries. ZL and GC atoms were flattened in order, with no glyph-family merger or spelling normalization.", "", f"- Sixth record token Jaccard / LCS: {led.iloc[5].token_jaccard:.6f} / {led.iloc[5].token_lcs:.6f}", f"- Sixth record exact-atom Jaccard / LCS: {led.iloc[5].atom_jaccard:.6f} / {led.iloc[5].atom_lcs:.6f}", f"- Six-record mean exact-atom Jaccard: {obs:.6f}", f"- Cross-record pairing p: {pv:.6f}", f"- Prospective sixth-record atom-role gain: {prospective['gain_bits']:+.6f} bits/atom", f"- Six-record LOO role gain: {fd.gain_bits.mean():+.6f}; positive folds: {(fd.gain_bits>0).sum()}/6", "", "## Decision split", "", "The sixth-record ledger gate passes. The portable atom-role extension fails because only 4/6 LOO folds are positive, although its prospective sixth-record gain is positive. These decisions are not conflated.", "", "## Interpretation", "", "The ledger pass shows that at least one apparent word-level disagreement is resolved by treating the representation as an ordered glyph-atom stream. It does not assign meanings to atoms.", "", "## Rule audit", "", "CORE PRESERVATION strengthens at the sub-token level. CONTEXTUAL INTERNAL REALIZATION is unchanged because the atom-role extension fails. No seventh rule is added; six remain."] (OUT / "report.md").write_text("\n".join(report) + "\n") pd.DataFrame([ {"test":"BOUNDARY-INVARIANT-ATOM-LEDGER-045","rule":"CORE PRESERVATION","status":"STRENGTHENED","evidence":"Sixth record passes only after exact boundary-invariant atom projection","live_rule_count":6}, {"test":"BOUNDARY-INVARIANT-ATOM-LEDGER-045","rule":"CONTEXTUAL INTERNAL REALIZATION","status":"UNCHANGED","evidence":"Portable atom-role extension has only 4/6 positive LOO folds","live_rule_count":6} ]).to_csv(OUT / "rule_recovery_audit.csv", index=False) files = sorted(x for x in OUT.iterdir() if x.is_file() and x.name != "SHA256SUMS.txt") (OUT / "SHA256SUMS.txt").write_text("\n".join(f"{hashlib.sha256(x.read_bytes()).hexdigest()} run_boundary_invariant_atom_ledger_045.py VOYNICH RESEARCH ARCHIVE | 16 SEPTEMBER 2026 3 {x.name}" for x in files) + "\n") print(json.dumps(summary, indent=2)) if __name__ == "__main__": main()