def run(load,check): hits=load('C301_DATA.json')['all_matches'];reg=load('C286_DATA.json')['target_register'];pairs=[] keys=['tradition','gear','rail','Cainan','Terah60','full430'] for upper in hits: if upper['cumulative']['role']!='Shem':continue u=upper['regular']; lower_role={'Noah birth':'Flood start','Shem birth':'Shem death'}.get(u['role']) if lower_role is None:continue for lower in hits: l=lower['regular']; cu=upper['cumulative'];cl=lower['cumulative'] if cl['role']=='Flood' and all(cu[k]==cl[k] for k in ['profile','index']) and l['role']==lower_role and all(u.get(k)==l.get(k) for k in keys): pairs.append({'profile':cu['profile'],'index':cu['index'],'upper':upper,'lower':lower,'cumulative_width':cu['BC']-cl['BC'],'regular_width':u['center']-l['center'],'gap_difference':lower['gap']-upper['gap']}) coverage=[] for j in range(8): row=[p for p in pairs if p['profile']=='LXX_OFF' and p['index']==j] required=(5890-j-2832,5290-j-2832) coverage.append({'index':j,'required_regular_upper':required[0],'required_regular_lower':required[1],'complete_segments':row,'upper_point_hits':[h for h in hits if h['cumulative']['profile']=='LXX_OFF' and h['cumulative']['role']=='Shem' and h['cumulative']['index']==j],'lower_point_hits':[h for h in hits if h['cumulative']['profile']=='LXX_OFF' and h['cumulative']['role']=='Flood' and h['cumulative']['index']==j]}) used=[] for p in pairs:used.extend([p['upper'],p['lower']]) orphans=[h for h in hits if h not in used] check('twelve labeled complete segments',len(pairs)==12) check('eight coordinate segments',len({(p['upper']['regular']['center'],p['lower']['regular']['center']) for p in pairs})==8) check('all three differences600',all(p['cumulative_width']==p['regular_width']==p['gap_difference']==600 for p in pairs)) check('complete segment families4MT5SP3LXX',[sum(p['upper']['regular']['tradition']==t for p in pairs) for t in ['MT','SP','LXX']]==[4,5,3]) check('LXX seven indices missing1',[c['index'] for c in coverage if c['complete_segments']]==[0,2,3,4,5,6,7]) check('gap lower exists upper absent',coverage[1]['required_regular_upper']==3057 and coverage[1]['required_regular_lower']==2457 and not coverage[1]['upper_point_hits'] and len(coverage[1]['lower_point_hits'])==1) check('four unpaired Flood-close labels',len(orphans)==4 and all(h['regular']['role']=='Flood close' for h in orphans)) check('no upper3057 anywhere in held register',not [t for t in reg if t['center']==3057 and t['role'] in ['Noah birth','Shem birth']]) check('same phase600 identity',all((p['upper']['regular']['center']+e)-(p['lower']['regular']['center']+e)==600 for p in pairs for e in [-0.25,0.25])) return {'complete_segments':pairs,'labeled_segments':len(pairs),'coordinate_segments':len({(p['upper']['regular']['center'],p['lower']['regular']['center']) for p in pairs}),'LXX_OFF_annual_coverage':coverage,'unpaired_point_matches':orphans,'all_required_source_bindings_retained':True,'new_Gears_or_rails':False}