main
John Lauer Add insulated sensor library and reconcile off-board harness and staged labels 10fc208
"""Native CLI still renders for candidate review, not a live-view/video substitute."""
from pathlib import Path
import subprocess,json,sys
R=Path(__file__).resolve().parents[1];O=R/'checkpoints/library-label-review';remote='C:/Users/john/adom-projects/adom-custom-electronic-load/review/library-label-render'
def call(v,a,label):
 p=subprocess.run(['adom-bridge','--target','AdomLapper','--ai-thread','adom-custom-load',v,json.dumps(a)],capture_output=True,text=True);j=json.loads(p.stdout);(O/(label+'.json')).write_text(json.dumps(j,indent=2));assert p.returncode==0 and j.get('success',True) and not j.get('error') and j.get('exitCode',0)==0,str(j)[:1000];return j
call('send_files',{'filePaths':[str(O/'library-label-candidate.kicad_pcb')],'dest':remote+'/','reason':'Render isolated cumulative candidate without changing live editor'},'render-send-board')
call('send_files',{'filePaths':[str(p)for p in (O/'3d').glob('*.step')],'dest':remote+'/3d/','reason':'Include exact selected STEP models for native still review'},'render-send-models')
cli=call('kicad_status',{},'render-native-status')['install']['kicadCli']
for name,extra in [('top',[]),('bottom',['--side','bottom']),('oblique',['--rotate','325,0,25'])]:
 if len(sys.argv)>1 and name not in sys.argv[1:]:continue
 out=remote+'/native-'+name+'.png'
 call('shell_execute',{'command':'"'+cli+'"','args':['pcb','render','--width','3600','--height','3200','--quality','high','--output',out,*extra,remote+'/library-label-candidate.kicad_pcb'],'timeoutSeconds':120,'reason':'Native renderer still-image inspection of cumulative38-footprint candidate; copper fill not accepted from these stills; live viewport remains unqualified'},'render-'+name)
 call('pull_file',{'filePaths':[out],'saveTo':str(O)},'render-pull-'+name)
 print(name,flush=True)