main
John Lauer Save native two-sided contact artwork and recorded GLB material correction; qualification remains open 57e2489
#!/usr/bin/env python3
"""Native desktop DRC of the isolated candidate, with its real project context."""
import json,subprocess
from pathlib import Path
R=Path(__file__).resolve().parents[1];P=R/'design/silkscreen-review';host='C:/Users/john/adom-projects/adom-custom-electronic-load/kicad'
def call(verb,payload):
 r=json.loads(subprocess.check_output(['adom-bridge','--target','AdomLapper','--ai-thread','adom-custom-load',verb,json.dumps(payload)],text=True));(P/('bottom-'+verb+'.json')).write_text(json.dumps(r,indent=2)+'\n');assert r.get('success',r.get('ok')) and r.get('exitCode',0)==0,r;return r
call('send_files',dict(filePaths=[str(R/'kicad'/('bottom-artwork-candidate'+x)) for x in ['.kicad_pcb','.kicad_pro','.kicad_dru']],dest=host,reason='Check isolated bottom artwork with the real project rules; preserve the live board'))
cli='C:/Users/john/AppData/Local/Programs/KiCad/10.0/bin/kicad-cli.exe'
r=call('shell_execute',dict(command=f'"{cli}" pcb drc --format json --output "{host}/bottom-artwork-candidate-drc.json" "{host}/bottom-artwork-candidate.kicad_pcb"',timeoutSeconds=120,reason='Native project-aware DRC for the complete bottom text and graphics candidate'));print(r['stdout'])
call('pull_file',dict(filePaths=[host+'/bottom-artwork-candidate-drc.json'],saveTo=str(P)))
r=json.loads((P/'bottom-artwork-candidate-drc.json').read_text());print('violations',len(r['violations']),'opens',len(r['unconnected_items']));assert not r['violations'] and not r['unconnected_items']