main
John Lauer Revalidate Board32 libraries and preserve reviewed scaffold interface contract 8af5c3b
"""Publish this bounded review checkpoint after a fresh source-head comparison."""
from pathlib import Path
import json,subprocess,re
R=Path(__file__).resolve().parents[1];repo='adom/adom-custom-electronic-load';base='d5bcc5e5582755f97b98245f01340c3feee7237a'
files={'design/spec.json','kicad/power.kicad_sch','kicad/digital.kicad_sch','aiflow/run/components.json','aiflow/run/plan-pours.json','videos/inventory.json','docs/completion-plan.md','docs/build-clips.md','tools/check_canonical_library_bindings.py','tools/publish_board32_revalidation.py','tools/record_mmbt_hero_review.mjs','tools/render_mmbt_hero.mjs','tools/run_mmbt_hero_render.py','checkpoints/scaffold-fit-review/board32-fit-review.json','checkpoints/board32-discrete-review/published-review.json','videos/board32-model-review-rejected.json','videos/board32-model-review-sheet.jpg'}
for r in json.loads((R/'checkpoints/board32-model-gate/portable-path-repair.json').read_text())['models']:
 if r['action'].startswith('copied'):files.add('kicad/3d/'+r['name'])
for folder in ['checkpoints/board32-interface-contract','checkpoints/board32-library-provenance','checkpoints/board32-pour-review','checkpoints/mmbt-hero-repair','videos/mmbt-hero-review']:
 for p in (R/folder).rglob('*'):
  if p.is_file()and p.suffix in ['.json','.md','.diff','.log','.png','.jpg','.glb','.kicad_mod','.mp4','.webm']:files.add(str(p.relative_to(R)))
for n in ['portable-path-repair.json','result.json','testplan-result.json','canonical-bindings.json','schematic-binding-repair/repair.json']:files.add('checkpoints/board32-model-gate/'+n)
for s in ['mmbt3904-7-f','machinepinmediumshort','machinecontactmedium','lvk12r020der']:
 for p in (R/'checkpoints/published-ic-review').glob(s+'-*'):files.add(str(p.relative_to(R)))
for f in files:
 p=R/f;assert p.is_file(),f
 if p.suffix in ['.json','.md','.py','.mjs','.diff','.log']:
  assert not re.search(r'[a-z0-9-]+\.adom\.cloud',p.read_text()),f
head=json.loads(subprocess.check_output(['adom-wiki','repo','log',repo,'--limit','1','--json']))['data']['log'][0]['hash'];assert head==base,('Reinspect concurrent source changes',head)
p=R/'checkpoints/board32-interface-contract';(p/'publication-manifest.json').write_text(json.dumps({'base':base,'files':sorted(files),'scope':'Board32 portable libraries, explicit reviewed interface contract, native checks and bounded video evidence; not fabrication or thermal acceptance'},indent=2)+'\n')
r=subprocess.run(['adom-wiki','repo','push',repo,'--files',*sorted(files),'-m','Revalidate Board32 libraries and preserve reviewed scaffold interface contract','--json'],cwd=R,capture_output=True,text=True);(p/'project-source-push.json').write_text(r.stdout or r.stderr);print(r.stdout or r.stderr);r.check_returncode()