from research import *
import fitz
s=begin(1405,'Bind the printable technical companion','Did the full formulas and both phase tables render successfully?',{},['deliverables/490d_Technical_Companion_C1431.md','evidence/render_readers_v2.py'])
p=ROOT/'deliverables/490d_Technical_Companion_C1431_Print.pdf';doc=fitz.open(p)
r={'path':str(p.relative_to(ROOT)),'sha256':hashlib.sha256(p.read_bytes()).hexdigest(),'bytes':p.stat().st_size,'pages':len(doc),'source_sha256':hashlib.sha256((ROOT/'deliverables/490d_Technical_Companion_C1431.md').read_bytes()).hexdigest(),'warnings':(ROOT/'prep/render/technical_print_pandoc.log').read_text()}
a=artifact('model/technical_print_binding.json',json.dumps(r,indent=2)+'\n')
finish(s,{'technical_pdf':r,'binding':a},'The technical reader rendered without warnings and is bound to the final reviewed Markdown. Visual inspection will check the formulas and dense state table.','Inspect the technical equations and phase tables.',{'pdf':p.read_bytes().startswith(b'%PDF'),'no_warnings':r['warnings']=='','all_phases':'2438.5' in ''.join(page.get_text() for page in doc)})
