main
John Lauer
Preserve adopted board30 and validated resistor library candidates with native-render dependency
7fa0c9c
"""Publish the explicitly selected engineering checkpoint against an unchanged Wiki head."""
from pathlib import Path
import json,hashlib,subprocess
R=Path(__file__).resolve().parents[1];O=R/'checkpoints/precision-land-review';repo='adom/adom-custom-electronic-load';base=json.loads((O/'project-head.json').read_text())['data']['log'][0]['hash'];assert base=='1ac01c36cfa6d48195564e08321c54363bfbedee'
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/board-30.kicad_pcb','aiflow/run/board-30.kicad_pro','aiflow/run/board-30.kicad_dru','design/netlist.json','design/spec.json','design/bom.csv','design/cost-summary.json','design/component-catalog-audit/current-assets-screen.json','tools/netlist.py','tools/audit_library.py','tools/audit_sensor_retention.py','tools/test_mechanical_pad_audit.py','tools/sync_sensor_adoption.py','tools/review_sensor_native_save.py','tools/publish_resistor_checkpoint.py']:add(R/name)
for pattern in ['tools/*bourns*.py','tools/*precision_land*.py','tools/validate_precision_netlist_native.py','kicad/*.kicad_sch','kicad/lib/Load.kicad_sym','kicad/lib/Load.pretty/JST_GH_BM03B*.kicad_mod','kicad/3d/bm03b-ghs-tbt-kicad.step','aiflow/run/lib/Load.pretty/JST_GH_BM03B*.kicad_mod','aiflow/run/3d/bm03b-ghs-tbt-kicad.step']:
for p in R.glob(pattern):add(p)
for name in ['checkpoints/bourns-land-review','checkpoints/bourns-land-review-v2','checkpoints/precision-land-review','checkpoints/sensor-gh-review-v8/native-saved','videos/bourns-land-review']:
for p in (R/name).rglob('*'):
if any(v in p.parts for v in ['__pycache__','source','before-adoption']):continue
if p.suffix.lower()in ['.json','.md','.txt','.log','.png','.mp4','.kicad_pcb','.kicad_sch','.kicad_pro','.kicad_dru','.kicad_mod','.step','.xml'] or p.name=='fp-lib-table':add(p)
for name in ['adoption-evidence.json','adoption-sync.json','native-save-review.json','live-validation.json','bridge-library-context-issue.md','bridge-library-context-issue.json','components-refresh.log','adoption.log']:
add(R/'checkpoints/sensor-gh-review-v8'/name)
for name in ['project-push.json','publication-manifest.json','project-head.json']:files.discard(str((O/name).relative_to(R)))
manifest={'baseHead':base,'files':sorted(files),'sha256':{f:hashlib.sha256((R/f).read_bytes()).hexdigest()for f in sorted(files)},'scope':'Adopted board30 canonical synchronization; unadopted Bourns and precision resistor candidates; native validation and blank-view dependency. No acceptance gate advance. Manufacturer PDFs/crops and third-party catalog clone excluded.'};(O/'publication-manifest.json').write_text(json.dumps(manifest,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 update; review before retry'
p=subprocess.run(['adom-wiki','repo','push',repo,'--files',*sorted(files),'-m','Preserve adopted board30 and validated resistor library candidates with native-render dependency','--json'],cwd=R,capture_output=True,text=True);(O/'project-push.json').write_text(p.stdout);assert p.returncode==0,p.stderr;x=json.loads(p.stdout);assert x['status']=='ok',x;print(json.dumps({'files':len(files),'result':x['data']}))