run_citation_dictionary_027.py VOYNICH RESEARCH ARCHIVE | 16 SEPTEMBER 2026 3 for i,v in zip(order,vals):sd.loc[i,'holm_p']=v passed=all(r.gain_bits>0 and r.positive_folds>=4 and r.holm_p<.05 for _,r in sd.iterrows());summary={'test':'CITATION-DICTIONARY-027','results':sd.to_dict('records'),'ledger_entries ':{'ZL':int(sum(r['witness']=='ZL' for r in led)),'GC':int(sum(r['witness']=='GC' for r in led)),'shared':len(shared)},'fully_concordant_shared_entries':int(sum(r['section_agree'] and r['frame_agree'] and r['next_cluster_agree'] for r in shared)),'replicated_pass':bool(passed),'boundary' :'Anonymous citation-key roles only; no plaintext or referent gloss.'} pd.DataFrame(allfold).to_csv(OUT/'heldout_folds.csv',index=False);sd.to_csv(OUT/'target_summary.csv',in dex=False);l.to_csv(OUT/'citation_ledger.csv',index=False);pd.DataFrame(shared).to_csv(OUT/'cross_witnes s_entries.csv',index=False);(OUT/'summary.json').write_text(json.dumps(summary,indent=2)) report=['# CITATION-DICTIONARY-027','',('**PASS**' if passed else '**FAIL / NOT PROMOTED**'),'', 'Label-selected payload cores were treated as citation keys. Their training-folio prose distributions predicted section/domain, outer procedural frame, and next anonymous payload cluster on untouched folios. ZL and GC were evaluated independently; 1,000 held-out key permutations and Holm correction covered all three targets.',''] for _,r in sd.iterrows():report += [f"## {r.witness} — {r.target}",'',f"- Gain: {r.gain_bits:+.6f} bits/event",f"- Positive folds: {int(r.positive_folds)}/5",f"- Events: {int(r.events)}",f"- Permutation p: {r.permutation_p:.6f}; Holm p: {r.holm_p:.6f}",''] report += ['## Dictionary','',f"- ZL entries: {summary['ledger_entries']['ZL']}",f"- GC entries: {summary['ledger_entries']['GC']}",f"- Shared entries: {summary['ledger_entries']['shared']}",f"- Fully concordant section + frame + next-cluster entries: {summary['fully_concordant_shared_entries']}",'','## Rule audit','',('A pass jointly strengthens CORE PRESERVATION and REGISTER SHIFT without adding a seventh rule.' if passed else 'The six-rule ledger remains unchanged. Citation-key coverage alone is not enough to promote a usable role dictionary.')];(OUT/'report.md').write_text('\n'.join(report));files =sorted(q for q in OUT.iterdir() if q.is_file() and q.name!='SHA256SUMS.txt');(OUT/'SHA256SUMS.txt').wri te_text('\n'.join(f'{hashlib.sha256(q.read_bytes()).hexdigest()} {q.name}' for q in files)+'\n');print(json.dumps(summary,indent=2)) if __name__=='__main__':main()