main
John Lauer
Save native two-sided contact artwork and recorded GLB material correction; qualification remains open
57e2489
#!/usr/bin/env python3
"""Dry-run only: native check of the complete bottom text proposal."""
import json, subprocess
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1];P=ROOT/'design/silkscreen-review'
layout=json.loads((P/'bottom-layout.json').read_text());inputs=json.loads((P/'bottom-candidates.json').read_text())
assert not layout['unresolved'] and len(layout['placements'])==104
texts=[]
for group in layout['placements']:
for c in group['children']:
texts.append(dict(text=c['text'],x=c['x'],y=c['y'],height=c['size'],width=c['size'],stroke=c['stroke'],rotation=c.get('angle',0),layer='B.SilkS',mirrored=True,align='center'))
payload=dict(filePath='C:/Users/john/adom-projects/adom-custom-electronic-load/kicad/adom-custom-electronic-load.kicad_pcb',expectedRevision=inputs['nativeRevision'],create=texts,dryRun=True,save=False)
(P/'bottom-native-proposal.json').write_text(json.dumps(payload,indent=2)+'\n')
raw=subprocess.check_output(['adom-bridge','--target','AdomLapper','--ai-thread','adom-custom-load','kicad_silk_text_batch',json.dumps(payload)],text=True)
(P/'bottom-native-dryrun.json').write_text(raw);r=json.loads(raw)
print(json.dumps({k:v for k,v in r.items() if k in ('success','mutated','error','errorCode','violations','revision')},indent=2))
raise SystemExit(0 if r.get('success') else 2)