Evidence

prepare selection constraints.py

Download source fileOpen in research workspace
from pathlib import Path
import json, hashlib, re

ROOT=Path(__file__).resolve().parents[2]
OUT=Path(__file__).resolve().parent
source=ROOT/'project_sources/38-File_18.Chronological_Data_Tables-20260919-141048-.md'
text=source.read_text(); lines=text.splitlines()

def section(heading,end_heading):
    start=lines.index(heading); end=lines.index(end_heading,start+1)
    return start,end

def tables_between(start,end):
    result=[];i=start
    while i<end:
        if lines[i].startswith('|') and i+1<end and re.fullmatch(r'[|\-: ]+',lines[i+1]):
            header=[x.strip() for x in lines[i].strip('|').split('|')]; begin=i;i+=2;rows=[]
            while i<end and lines[i].startswith('|'):
                raw=lines[i];cells=[x.strip().replace('`','').replace('**','') for x in raw.strip('|').split('|')]
                rows.append({'line':i+1,'cells':cells,'literal':raw});i+=1
            result.append({'start_line':begin+1,'end_line':i,'header':header,'rows':rows})
        else:i+=1
    return result

regions={
 'MT_baseline':section('#### 2.1.3 MT Minimum-Regular table','### 2.2 Post-Flood to Patriarchs: MT Minimum-Regular'),
 'SP_birth_and_bindings':section('### 3.1 Creation to Flood: SP Normal / G2','#### 3.1.1 Methodological note: BJ / Jubilees corroboration'),
 'SP_cap':section('#### 3.1.3 SP Flood cap and patriarchal deaths','#### 3.1.4 Ordinary Flood Gears, fixed Arphaxad, and the SP midpoint'),
 'LXX_baseline':section('### 4.1 Creation to Flood: LXX Regular-Minimum','### 4.2 Post-Flood to Patriarchs: LXX Regular-Minimum'),
 'SP_state':section('## 3. SP Regular Baseline','### 3.1 Creation to Flood: SP Normal / G2')}
tables={k:tables_between(*v) for k,v in regions.items()}
names=['Adam','Seth','Enosh','Kenan','Mahalalel','Jared','Enoch','Methuselah','Lamech']
def find_person(table,name):
    return next(r for r in table['rows'] if r['cells'][0]==name or r['cells'][0].startswith(name+' /'))
numeric=[]
for name in names:
    m=find_person(tables['MT_baseline'][0],name);s=find_person(tables['SP_birth_and_bindings'][0],name);l=find_person(tables['LXX_baseline'][0],name)
    first=lambda x:int(re.match(r'\d+',x).group())
    numeric.append({'name':name,'MT_L':first(m['cells'][3]),'main_LXX_L':first(l['cells'][3]),'SP_L':first(s['cells'][3]),'SP_birth':int(s['cells'][1]),'SP_death':int(s['cells'][2]),'SP_b_literal':s['cells'][4],'SP_b_nominal':first(s['cells'][4]),'SP_b_effective':52 if name=='Lamech' else first(s['cells'][4]),'lifespan_output_convention':'inclusive Flood-start cap count' if name in ['Jared','Methuselah','Lamech'] else 'ordinary completed-year subtraction','source_lines':{'MT':m['line'],'LXX':l['line'],'SP':s['line']}})
packet={'status':'frozen preparation packet; not numbered research','source_path':str(source),'source_sha256':hashlib.sha256(source.read_bytes()).hexdigest(),'tables':tables,'source_excerpts':{k:{'start_line':a+1,'end_line':b,'text':'\n'.join(lines[a:b])} for k,(a,b) in regions.items()},'ordered_nine_rows':numeric,'held_state':{'tradition':'SP','gear':'G2 fixed','frame':'native Sojourn215; Terah+60 OFF; secondCainan OFF','Noah_primary_birth':3493,'Flood_start':2893,'Flood_close':2892,'Noah_primary_to_Flood_start':600,'inclusive_count_adjustment':1,'allowed_whole_frame_comparison':215},'guards':['Noah outside nine-row cap domain','no upstream Gear transport','no ancestral−1 companion rail','count tags retained: six ordinary, three inclusive','MT and mainLXX baseline comparison does not establish historical direction','mainLXX182/753;777 is not substituted into LXX','no second decimal inversion or new statistical tally','no source edits']}
target=OUT/'selection_constraints_inputs.json';target.write_text(json.dumps(packet,ensure_ascii=False,indent=2)+'\n')
print(json.dumps({'path':str(target),'sha256':hashlib.sha256(target.read_bytes()).hexdigest(),'literal_tables':sum(len(v) for v in tables.values()),'literal_rows':sum(len(t['rows']) for v in tables.values() for t in v),'nine_rows':numeric},ensure_ascii=False,indent=2))

Linked sources and evidence

Edition and provenance

prepare_selection_constraints.py

SHA-256 1517072f1e20fab1f3e5494c9576c790fcd1d714cf50641e4ecfd95dfd1cc0c8

C480–C1634/Research_Cycles/C0932_C1131/prep/prepare_selection_constraints.py