"""Independent enumeration input for S229 (stdout suitable for fcaps_229_relax.cpp)."""
import hashlib,sys,json
from pathlib import Path
def load(e):
    pinned=json.loads((e/'three_tests_plan.json').read_text())
    fn=e/'liber-primus__transcription--master.txt';assert hashlib.sha256(fn.read_bytes()).hexdigest()==pinned['source_sha256']
    # Use the notebook's page parser and canonical rune order, but locate section and runes here.
    sys.path.insert(0,str(e));from lp_core import lp,R
    src='%'.join(lp[:56]);section=src.split('$')[8];x=[R.index(c) for c in section if c in R]
    assert len(x)==3316 and x.count(0)==131 and R[0]=='ᚠ'
    return x
if __name__=='__main__':
    x=load(Path(sys.argv[1]).resolve() if len(sys.argv)>1 else Path(__file__).resolve().parent)
    print(29,len(x),*x)
