# decryption_complete: false # source: /Voynich/Voynich_PORTABLE_ANONYMOUS_ROLE_BREAKTHROUGH_037_042_reproducibility.zip!/run_vertical_ # stated_sha256: f9f88a34f80d069c5d9aebc6fa28b1950e9c40128a365c14023194da414f3f7b # matches_stated_sha256: false # pdf_pages: 734-735 # 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_vertical_band_window_039.py VOYNICH RESEARCH ARCHIVE | 16 SEPTEMBER 2026 1 run_vertical_band_window_039.py Source: /Voynich/Voynich_PORTABLE_ANONYMOUS_ROLE_BREAKTHROUGH_037_042_reproducibility.zip!/run_vertical_ band_window_039.py SHA-256: f9f88a34f80d069c5d9aebc6fa28b1950e9c40128a365c14023194da414f3f7b !/usr/bin/env python3 """VERTICAL-BAND-WINDOW-039: geometry retrieves a fixed three-line record band.""" from pathlib import Path from scipy.special import comb import hashlib,json import numpy as np,pandas as pd import run_geometric_expansion_link_030 as g30 import run_fifth_record_prospective_033 as p33 import run_anonymous_record_decompression_032 as d32 ROOT=Path(__file__).resolve().parent;OUT=ROOT/'vertical_band_window_039';OUT.mkdir(exist_ok=True);K=3;RE PS=10000;SEED=20260830 def expected(n,p,k):return 1-comb(n-p,min(k,n),exact=False)/comb(n,min(k,n),exact=False) if n-p>=min(k,n) else 1.0 def evalq(q): dist=[] for c in q['cand']: _,y0,_,y1=c['box'];dist.append(abs((y0+y1)/2/837-q['qy']/837)) top=sorted(range(len(dist)),key=lambda i:dist[i])[:min(K,len(dist))];hits=[i for i in top if i in q['pos']];chosen=min(hits,key=lambda i:dist[i]) if hits else None return {'hit':bool(hits),'top':top,'chosen':chosen,'dist':dist,'expected':expected(len(dist),len(q['pos ']),K)} def main(): lb=g30.aligned_label_boxes();base=g30.aligned_prose_lines();add,_=p33.recover_unrestricted(base);coords ={**base,**add};qs={} for w in ('ZL','GC'): qs[w]={(q['folio'],q['key']):q for q in g30.build(w,lb,coords)} rows=[];paired=[];old=pd.read_csv(ROOT/'gc_segmentation_recovery_035/five_record_anonymous_ledger.csv') ;oldphys={(r.folio,int(r.zl_line),int(r.gc_line)) for r in old.itertuples()} common=sorted(set(qs['ZL'])&set(qs['GC'])) for key in common: rr={w:evalq(qs[w][key]) for w in ('ZL','GC')} for w in ('ZL','GC'):rows.append({'witness':w,'folio':key[0],'key':key[1],'candidates':len(qs[w][key][ 'cand']),'positives':len(qs[w][key]['pos']),'band_hit':int(rr[w]['hit']),'random_expected':rr[w]['expect ed'],'selected_line':qs[w][key]['cand'][rr[w]['chosen']]['line'] if rr[w]['chosen'] is not None else None}) if all(rr[w]['hit'] for w in rr): zq,gq=qs['ZL'][key],qs['GC'][key];zi,gi=rr['ZL']['chosen'],rr['GC']['chosen'];zc,gc=zq['cand'][zi],gq ['cand'][gi];zr=[x for x in zc['payloads'] if x!=key[1]];gr=[x for x in gc['payloads'] if x!=key[1]];jac=d32.multiset_jaccard(zr,gr);lcs=d32.lcs_ratio(zr,gr);new=(key[0],zc['line'],gc['line']) not in oldphys paired.append({'folio':key[0],'key':key[1],'zl_line':zc['line'],'gc_line':gc['line'],'new_physical_re cord':int(new),'zl_residual':' | '.join(zr),'gc_residual':' | '.join(gr),'jaccard':jac,'lcs':lcs,'qualif ies':int(new and jac>=.5 and lcs>=.75)}) d=pd.DataFrame(rows);p=pd.DataFrame(paired);nullrows=[];summ=[] rng=np.random.default_rng(SEED) for w in ('ZL','GC'): z=d[d.witness==w];obs=float((z.band_hit-z.random_expected).mean());ql=[qs[w][k] for k in common];null=[] for _ in range(REPS): gains=[] for q in ql: n=len(q['cand']);shift=int(rng.integers(n));pos={(i+shift)%n for i in q['pos']};dist=evalq(q)['dist'];top=sorted(range(n),key=lambda i:dist[i])[:min(K,n)];gains.append(int(bo ol(set(top)&pos))-expected(n,len(pos),K)) null.append(float(np.mean(gains))) pv=(1+sum(x>=obs for x in null))/(REPS+1);summ.append({'witness':w,'queries':len(z),'recall_at_3':floa t(z.band_hit.mean()),'random_expected':float(z.random_expected.mean()),'gain':obs,'circular_shift_p':pv} );nullrows += [{'witness':w,'replicate':i,'gain':x} for i,x in enumerate(null)] run_vertical_band_window_039.py VOYNICH RESEARCH ARCHIVE | 16 SEPTEMBER 2026 2 qnew=p[p.qualifies==1] if len(p) else p;passed=all(s['gain']>0 and s['circular_shift_p']<.05 for s in summ) and len(qnew)>=1 expanded=pd.concat([old,qnew.rename(columns={'key':'keys','jaccard':'multiset_jaccard','lcs':'ordered_l cs_ratio'})[['folio','zl_line','gc_line','keys','zl_residual','gc_residual','multiset_jaccard','ordered_ lcs_ratio']].assign(record_id=lambda x:x.folio+':'+x.zl_line.astype(str)+'/'+x.gc_line.astype(str))],ign ore_index=True) if len(qnew) else old expanded.to_csv(OUT/'expanded_band_ledger.csv',index=False);d.to_csv(OUT/'query_results.csv',index=Fals e);p.to_csv(OUT/'paired_band_records.csv',index=False);qnew.to_csv(OUT/'new_qualifying_records.csv',inde x=False);pd.DataFrame(nullrows).to_csv(OUT/'circular_shift_null.csv',index=False) summary={'test':'VERTICAL-BAND-WINDOW-039','band_size_lines':K,'results':summ,'new_qualifying_physical_ records':len(qnew),'ledger_records_after':len(expanded),'pass':passed,'boundary':'Anonymous record-band retrieval only; no plaintext or semantics.'};(OUT/'summary.json').write_text(json.dumps(summary,indent=2 )) report=['# VERTICAL-BAND-WINDOW-039','',('**PASS — BOTTLENECK BROKEN**' if passed else '**FAIL / NOT PROMOTED**'),'','Geometry first retrieves the three nearest prose lines. Only inside that frozen band may exact key recurrence select a record line.',''] for s in summ:report += [f"- {s['witness']}: recall@3 {s['recall_at_3']:.3f}; expected {s['random_expected']:.3f}; gain {s['gain']:+.3f}; p {s['circular_shift_p']:.6f}"] report += [f"- New qualifying physical records: {len(qnew)}",f"- Ledger records after: {len(expanded)}",'','## Rule audit','',('EDGE HANDOFF strengthens from point retrieval to band retrieval; six rules remain.' if passed else 'No rule change; six remain.')] (OUT/'report.md').write_text('\n'.join(report));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()} {x.name}' for x in files)+'\n');print(json.dumps(summary,indent=2)) if __name__=='__main__':main()