# decryption_complete: false # source: /Voynich/Voynich_FIFTH_RECORD_ATTACK_033_034_reproducibility.zip!/run_fifth_record_prospective_0 # stated_sha256: db0bd93aa841f51717612fb61f84b8db76d3dacf9b88485e62d198ff421f1763 # matches_stated_sha256: false # pdf_pages: 447-448 # 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_fifth_record_prospective_033.py VOYNICH RESEARCH ARCHIVE | 16 SEPTEMBER 2026 1 run_fifth_record_prospective_033.py Source: /Voynich/Voynich_FIFTH_RECORD_ATTACK_033_034_reproducibility.zip!/run_fifth_record_prospective_0 33.py SHA-256: db0bd93aa841f51717612fb61f84b8db76d3dacf9b88485e62d198ff421f1763 !/usr/bin/env python3 """FIFTH-RECORD-PROSPECTIVE-033: recover omitted coordinate lines without ordinal constraint.""" from pathlib import Path from collections import defaultdict,Counter from difflib import SequenceMatcher import hashlib,json import numpy as np,pandas as pd import run_geometric_expansion_link_030 as g30 import run_anonymous_record_decompression_032 as d32 ROOT=Path(__file__).resolve().parent;OUT=ROOT/'fifth_record_prospective_033';OUT.mkdir(exist_ok=True) MIN_RATIO=.55;MIN_MARGIN=.10 def recover_unrestricted(existing): txt=g30.eva_prose_lines();added={};audit=[] for p in g30.BOXDIR.glob('*.js'): fol=p.stem if fol not in txt:continue vis=g30.box_lines(p);lines=txt[fol];M=np.zeros((len(lines),len(vis))) for i,(ln,t) in enumerate(lines): for j,v in enumerate(vis):M[i,j]=SequenceMatcher(a=[g30.collapse(x['word']) for x in v],b=[g30.collapse(x) for x in t],autojunk=False).ratio() for i,(ln,t) in enumerate(lines): if (fol,ln) in existing or not len(vis):continue j=int(M[i].argmax());best=float(M[i,j]);second=float(np.partition(M[i],-2)[-2]) if len(vis)>1 else 0 mutual=int(M[:,j].argmax())==i accepted=best>=MIN_RATIO and best-second>=MIN_MARGIN and mutual audit.append({'folio':fol,'line':ln,'visual_line_index':j,'ratio':best,'margin':best-second,'mutual_b est':int(mutual),'accepted':int(accepted)}) if accepted: v=vis[j];added[(fol,ln)]=(min(b['x'] for b in v),min(b['y'] for b in v),max(b['x']+b['w'] for b in v),max(b['y']+b['h'] for b in v)) return added,pd.DataFrame(audit) def selected(q): scores=[] for c in q['cand']: _,y0,_,y1=c['box'];scores.append(-abs((y0+y1)/2/837-q['qy']/837)) j=int(np.argmax(scores));c=q['cand'][j] return {'folio':q['folio'],'key':q['key'],'line':c['line'],'hit':j in q['pos'],'full':list(c['payloads']),'residual':[x for x in c['payloads'] if x!=q['key']],'vertical_distance':-scores[j]} def main(): lb=g30.aligned_label_boxes();base=g30.aligned_prose_lines();added,audit=recover_unrestricted(base);coor ds={**base,**added} old={w:{(q['folio'],q['key']) for q in g30.build(w,lb,base)} for w in ('ZL','GC')};new={};rows=[] for w in ('ZL','GC'): qs=[q for q in g30.build(w,lb,coords) if (q['folio'],q['key']) not in old[w]];new[w]={} for q in qs: r=selected(q);r['witness']=w;rows.append(r);new[w][(r['folio'],r['key'])]=r common=sorted(set(new['ZL'])&set(new['GC']));pairs=[] for k in common: z,g=new['ZL'][k],new['GC'][k];jac=d32.multiset_jaccard(z['residual'],g['residual']);lcs=d32.lcs_ratio( z['residual'],g['residual']) pairs.append({'folio':k[0],'key':k[1],'zl_line':z['line'],'gc_line':g['line'],'zl_hit':int(z['hit']),' gc_hit':int(g['hit']),'both_hit':int(z['hit'] and g['hit']),'zl_residual':' | '.join(z['residual']),'gc_residual':' | '.join(g['residual']),'multiset_jaccard':jac,'ordered_lcs_ratio' :lcs}) p=pd.DataFrame(pairs);qual=p[(p.both_hit==1)&(p.multiset_jaccard>=.50)&(p.ordered_lcs_ratio>=.75)] if len(p) else p passed=len(qual)>=1 run_fifth_record_prospective_033.py VOYNICH RESEARCH ARCHIVE | 16 SEPTEMBER 2026 2 audit.to_csv(OUT/'unrestricted_alignment_audit.csv',index=False);pd.DataFrame(rows).assign(full=lambda d:d.full.map(lambda x:' | '.join(x)),residual=lambda d:d.residual.map(lambda x:' | '.join(x))).to_csv(OUT/'new_query_retrievals.csv',index=False);p.to_csv(OUT/'prospective_cross_witness_r ecords.csv',index=False);qual.to_csv(OUT/'qualifying_fifth_records.csv',index=False) summary={'test':'FIFTH-RECORD-PROSPECTIVE-033','frozen_alignment_gate':{'minimum_sequence_ratio':MIN_RA TIO,'minimum_best_second_margin':MIN_MARGIN,'mutual_best_required':True},'new_aligned_prose_lines':len(a dded),'new_queries':{'ZL':len(new['ZL']),'GC':len(new['GC'])},'paired_new_queries':len(p),'qualifying_ne w_physical_records':len(qual),'prospective_pass':passed,'boundary':'Coordinate recovery and anonymous record agreement only; no plaintext or semantic gloss.'};(OUT/'summary.json').write_text(json.dumps(summ ary,indent=2)) report=['# FIFTH-RECORD-PROSPECTIVE-033','',('**PASS — FIFTH PHYSICAL RECORD RECOVERED**' if passed else '**FAIL — NO FIFTH RECORD**'),'','The old ±4 visual-line restriction was removed prospectively. New line boxes require sequence ratio ≥0.55, best-versus-second margin ≥0.10, and mutual best matching. The vertical-band decoder and cross-witness record gates were unchanged.','',f"- Newly aligned prose lines: {len(added)}",f"- New ZL / GC queries: {len(new['ZL'])} / {len(new['GC'])}",f"- Paired new queries: {len(p)}",f"- Qualifying new physical records: {len(qual)}",''] if len(p): cols=list(p.columns);table=['| '+' | '.join(cols)+' |','| '+' | '.join(['---']*len(cols))+' |'] table += ['| '+' | '.join(str(r[c]).replace('|','/') for c in cols)+' |' for _,r in p.iterrows()] report += ['## Paired outcomes','',*table,''] report += ['## Boundary','','A pass promotes the five-record anonymous ledger, not a plaintext translation.','', '## Rule audit','',('CORE PRESERVATION, EDGE HANDOFF, and REGISTER SHIFT are strengthened; the rule count remains six.' if passed else 'No rule change; six remain.')] (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').write_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()