main
John Lauer Add JST GH libraries, native schematic parity and revised sensor harness study with reviewed clips 1ac01c3
"""Record a real native viewer tour of the isolated, unadopted library candidate."""
from pathlib import Path
import json,subprocess,time
root=Path(__file__).resolve().parents[1];out=root/'videos/sensor-gh-candidate';out.mkdir(exist_ok=True);hwnd=16259044

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);d=json.loads(p.stdout);(out/(label+'.json')).write_text(json.dumps(d,indent=2)+'\n');assert p.returncode==0 and d.get('success',d.get('ok',True)),d;return d
call('kicad_3d_view',{'hwnd':hwnd,'action':'view_top'},'top')
call('kicad_3d_view',{'hwnd':hwnd,'action':'fit'},'fit')
call('kicad_3d_view',{'hwnd':hwnd,'action':'rotate_x_cw','count':3},'tilt')
call('kicad_3d_view',{'hwnd':hwnd,'action':'zoom_out','count':2},'full-board-margin')
r=call('desktop_record_window_start',{'hwnd':hwnd,'fps':30,'cursor':False,'audio':False,'maxDurationMs':60000,'reason':'Requested process footage: Three-position JST GH sensor connector and scaffold-compatible corner-pin span in a native review candidate in native KiCad, not a fabrication release'},'record-start')
try:
 time.sleep(1.5)
 call('kicad_3d_view',{'hwnd':hwnd,'action':'tour','pauseMs':650,'steps':[['rotate_z_cw',4],['rotate_x_cw',1],['rotate_z_ccw',4]]},'tour')
 time.sleep(1.5)
finally:
 s=call('desktop_record_stop',{'recordingId':r['recordingId']},'record-stop')
 for i in range(5):
  if not s.get('stillRunning') and s.get('state')!='finalising':break
  time.sleep(2);s=call('desktop_record_status',{'recordingId':r['recordingId']},f'finalize-{i}')
 assert not s.get('stillRunning') and s.get('state')!='finalising',s
 call('pull_file',{'filePaths':[s.get('path',r['path'])],'saveTo':str(out)},'record-pull')
print('Native candidate take captured; video frame review pending')