main
John Lauer
Board34 R10 nominal cooling and probe-clearance verification; refreshed prototype assets and native export checks
5460526
"""Native Board34 export with explicit retrieval; review package, no order or release."""
from pathlib import Path
import json,subprocess,sys
R=Path(__file__).resolve().parents[1];O=R/'manufacturing-review/board34';host='C:/Users/john/adom-projects/adom-custom-electronic-load/review/board34-export'
def call(v,a,name):
r=subprocess.run(['adom-bridge',v,json.dumps(a),'--target','AdomLapper','--ai-thread','adom-custom-load'],capture_output=True,text=True)
j=json.loads(r.stdout);(O/(name+'.json')).write_text(json.dumps(j,indent=2)+'\n')
assert r.returncode==0 and j.get('success',j.get('ok',j.get('status')=='ok')) and not j.get('error') and j.get('exitCode',0)==0,str(j)[:1200]
return j
O.mkdir(parents=True, exist_ok=True)
if '--retrieve-existing' not in sys.argv:
call('send_files',{'filePaths':[str(R/'aiflow/run'/('board-34.'+ext))for ext in ['kicad_pcb','kicad_pro','kicad_dru']],'dest':host+'/','reason':'Exact Board34 inputs for final design export review'},'input-transfer')
call('kicad_export_gerber',{'filePath':host+'/board-34.kicad_pcb','outputDir':host+'/exports'},'native-gerber-export')
cli=call('kicad_status',{},'native-status')['install']['kicadCli']
call('shell_execute',{'command':'"'+cli+'"','args':['pcb','export','drill','--format','excellon','--excellon-units','mm','--excellon-separate-th','--generate-report','-o',host+'/drill/',host+'/board-34.kicad_pcb'],'timeoutSeconds':120,'reason':'Export plated and non-plated drills from exact Board34 for design review'},'native-drill-export')
for sub,local in [('exports','gerbers'),('drill','drill')]:
j=call('desktop_list_files',{'path':host+'/'+sub},'host-'+sub+'-files')
inner=json.loads(j['output']) if isinstance(j.get('output'),str) else j
d=inner.get('data',inner)
paths=[x['path'] for x in d['files'] if x.get('size',0)>0]
call('pull_file',{'filePaths':paths,'saveTo':str(O/local)},local+'-files-pull')
print('Retrieved',len(paths),local,'files; validation pending')