main
John Lauer
Advance Board32 through current acceptance and retain unresolved thermal gate
1f15473
"""One-shot Board32 review publication; refuses concurrent edits to touched source files."""
from pathlib import Path
import json,subprocess,hashlib,re
R=Path(__file__).resolve().parents[1];out=R/'checkpoints/board32-fields';repo='adom/adom-custom-electronic-load'
base='8af5c3b074b90c9f8770f2ea11d7722664f609a5';head='29955052c4e09c0fca430a03c369a8854ed587f9'
tracked=['README.md','docs/completion-plan.md','docs/operating-heat-corners.md','docs/package-cooling-study.md','design/operating-heat-corners.json','tools/derive_operating_heat_corners.py','videos/inventory.json']
for f in tracked:
blobs=[]
for rev in [base,head]:
dest=out/'upstream-review'/rev/f;dest.parent.mkdir(parents=True,exist_ok=True)
subprocess.run(['adom-wiki','repo','show',repo,f,'--ref',rev,'--out',str(dest),'--json'],check=True,capture_output=True)
blobs.append(dest.read_bytes())
assert blobs[0]==blobs[1],('Concurrent edit requires reconciliation',f)
files=set(tracked+['docs/board32-revalidation.md','tools/plot_board32_fields.py','tools/plot_board32_cooling.py','tools/publish_board32_fields.py','aiflow/run/timeline/board32-current-screen.png','aiflow/run/timeline/board32-package-thermal.png','aiflow/run/placement-verify.json','aiflow/run/plan-thermal-vias.json'])
for folder in ['checkpoints/board32-fields','checkpoints/board32-package-cooling','checkpoints/board32-heat-corner-review','checkpoints/board32-placement-verification','checkpoints/board32-via-review']:
for p in (R/folder).rglob('*'):
if any(x in p.parts for x in ['tex','upstream-review','source-readback']):continue
if p.is_file() and p.suffix in ['.json','.md','.log','.diff'] and p.name not in ['native-state.json','owner-issues.json','project-heads.json','project-source-push.json','publication-manifest.json']:
files.add(str(p.relative_to(R)))
files.add('checkpoints/board32-interface-alternatives/175-6-220p-review.json')
for f in files:
p=R/f;assert p.is_file(),f
if p.suffix in ['.json','.md','.py','.diff','.log']:
assert not re.search(r'[a-z0-9-]+\.adom\.cloud',p.read_text()),f
live=json.loads(subprocess.check_output(['adom-wiki','repo','log',repo,'--limit','1','--json']))['data']['log'][0]['hash'];assert live==head,('HEAD changed',live)
manifest={'base':head,'files':sorted(files),'sha256':{f:hashlib.sha256((R/f).read_bytes()).hexdigest() for f in files},'scope':'Board32 revalidation: current pass at assumed copper; thermal fail, no hardware or manufacturing release'}
(out/'publication-manifest.json').write_text(json.dumps(manifest,indent=2)+'\n')
r=subprocess.run(['adom-wiki','repo','push',repo,'--files',*sorted(files),'-m','Advance Board32 through current acceptance and retain unresolved thermal gate','--json'],cwd=R,capture_output=True,text=True)
(out/'project-source-push.json').write_text(r.stdout or r.stderr);print(r.stdout or r.stderr);r.check_returncode()