main
John Lauer Preserve board29, component assets and scaffold-fit correction candidate with reviewed footage c54169e
"""Publish explicit project checkpoint files against the observed current wiki head."""
from pathlib import Path
import json,subprocess,hashlib
R=Path(__file__).resolve().parents[1];O=R/'checkpoints/scaffold-fit-review';repo='adom/adom-custom-electronic-load';base=json.loads((O/'project-head.json').read_text())['data']['log'][0]['hash'];files=set()
def add(p):
 if p.is_file():files.add(str(p.relative_to(R)))
for name in ['docs/completion-plan.md','videos/inventory.json','aiflow/run/run.json','aiflow/run/run.jsonl','aiflow/run/components.json','aiflow/run/timeline/presentation.json','aiflow/run/timeline/timeline.json','aiflow/run/3d/ixtp15n50l2-formed-study.step','mechanical/sensor-crimp-compatibility.json','mechanical/sensor-study/README.md','design/component-catalog-audit/offboard-register.json']:add(R/name)
for pattern in ['aiflow/run/board-29.*','aiflow/run/artifact-8a9c141*.mp4','aiflow/run/artifact-6d51970*.mp4','design/component-catalog-audit/jst-gh-*']:
 for p in R.glob(pattern):add(p)
for name in ['tools','mechanical/formed-stack-study','mechanical/scaffold-stack-study','videos/formed-q1-detail','videos/scaffold-fit-candidate','checkpoints/formed-stack-review','checkpoints/scaffold-fit-review']:
 for p in (R/name).rglob('*'):
  if p.suffix.lower() in ['.py','.json','.md','.glb','.step','.png','.jpg','.mp4','.txt','.log','.kicad_pcb','.kicad_pro','.kicad_dru','.kicad_mod'] and not any(v in p.parts for v in ['__pycache__','native-saved','3d','lib','source','aiflow-tests']):add(p)
for slug in ['m20-1060200','m20-1060300','m20-1180046']:
 for p in (R/'components'/slug).rglob('*'):
  if 'review' in p.relative_to(R/'components'/slug).parts:continue
  if p.suffix.lower() in ['.json','.md','.step','.glb','.kicad_sym','.kicad_mod','.svg'] or p.name=='LICENSE':add(p)
# Do not redistribute copyrighted manufacturer PDFs/drawing crops or bulk cloned JST assets.
for p in (O/'native-saved').glob('*.kicad_pcb'):add(p)
add(O/'aiflow-tests/summary.json')
files.discard('checkpoints/scaffold-fit-review/project-push.json');files.discard('checkpoints/scaffold-fit-review/publication-manifest.json')
r={'baseHead':base,'files':sorted(files),'sha256':{f:hashlib.sha256((R/f).read_bytes()).hexdigest() for f in sorted(files)},'scope':'Board29 adopted; scaffold candidate and study remain unadopted. No acceptance gates waived.'};(O/'publication-manifest.json').write_text(json.dumps(r,indent=2)+'\n')
x=json.loads(subprocess.check_output(['adom-wiki','repo','log',repo,'--limit','1','--json']));assert x['data']['log'][0]['hash']==base,'Concurrent source update; rebase/review before push'
p=subprocess.run(['adom-wiki','repo','push',repo,'--files',*sorted(files),'-m','Preserve board29, component assets and scaffold-fit correction candidate with reviewed footage','--json'],cwd=R,capture_output=True,text=True);(O/'project-push.json').write_text(p.stdout);assert p.returncode==0,p.stderr;d=json.loads(p.stdout);assert d.get('status')=='ok',d;print(json.dumps({'files':len(files),'result':d.get('data')}))