main
John Lauer Add JST GH libraries, native schematic parity and revised sensor harness study with reviewed clips 1ac01c3
from pathlib import Path
import subprocess,json
R=Path(__file__).resolve().parents[1];O=R/'checkpoints/sensor-gh-review-v8';remote='C:/Users/john/adom-projects/adom-custom-electronic-load/review/sensor-gh-candidate'
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
s=call('kicad_routing_state',{'filePath':remote+'/sensor-gh-candidate.kicad_pcb'},'live-binding-before-export');print('Live candidate revision',s['revision'])
cli=call('kicad_status',{},'export-native-status')['install']['kicadCli']
call('shell_execute',{'command':'"'+cli+'"','args':['pcb','export','step','--subst-models','--output',remote+'/sensor-gh-candidate.step',remote+'/sensor-gh-candidate.kicad_pcb'],'timeoutSeconds':120,'reason':'Export isolated JST GH board candidate with native model bindings for assembly fit review'},'native-step-export')
call('pull_file',{'filePaths':[remote+'/sensor-gh-candidate.step'],'saveTo':str(O)},'native-step-pull')