main
John Lauer
Publish input-bound R11 prototype bundle and completed CLI clearance review
7007e93
"""Build a review bundle with exact provenance; never a fabrication release receipt."""
from pathlib import Path
import json,hashlib,zipfile,datetime
R=Path(__file__).resolve().parents[1];D=R/'revisions/compact-r11';O=D/'prototype-review-package';O.mkdir(exist_ok=True)
files=[]
def add(p):
assert p.is_file(),p
if p not in files:files.append(p)
add(O/'README.md')
for name in ['compact-sidefan-v5-native.kicad_pcb','compact-sidefan-v5-native.kicad_pro','compact-sidefan-v5-native.kicad_dru']:
p=D/'kicad'/name
if p.exists():add(p)
for name in ['sidefan-v5-review.step','sidefan-v5-molecule.plain.glb','sidefan-v5-molecule_footprint.json']:add(D/'kicad'/name)
add(R/'components/cfm-4010-03-22/states/fan-animated.glb');add(R/'components/cfm-4010-03-22/states.json')
for name in ['bom.csv','netlist.json','firmware-review.json','cooling-fixture-procedure.md','auxiliary-power-budget.md']:add(D/name)
for p in (D/'assumed-assembly').rglob('*'):
if p.is_file() and p.suffix in ['.md','.csv','.json','.glb','.step','.stl','.png','.jpg'] and 'plain_footprint' not in p.name:add(p)
for p in (D/'prototype-fabrication').iterdir():
if p.is_file() and p.suffix!='.zip':add(p)
for p in (D/'firmware').rglob('*'):
if p.is_file() and p.suffix in ['.c','.h','.md','.ld','.json']:add(p)
for n in ['adom-load-bringup.bin','adom-load-bringup.hex','build-manifest.json']:add(D/'build/stm32-assumed-locked'/n)
for n in ['assumed-pwm-tests.log','assumed-firmware-build.log','assumed-final-probe.log','assumed-probe-resume.log','assumed-probe-input-review.json','assumed-probe-margins.log','assumed-probe-coverage.log']:add(D/'evidence'/n)
for n in ['tether-edge-selection.patch','tether-edge-selection-review.md','tether-edge-selection-tests.log','tether-edge-selection-identity.json','assumed-j7-tether-conflict.json','assumed-mp1-tether-conflict.json','assumed-mp2-tether-conflict.json','assumed-rotation0-conflict.json','assumed-rotation270-conflict.json','assumed-edge-priority-conflict.json','assumed-final-board.log','assembly-current-video-review.json','probing-obstacle-label-followup.md']:
add(D/'evidence'/n)
for n in ['state.json','plan.json','layout.json','workcell.json','access.json','stack.json','sequence.json','collide.json','margins.json','coverage.json']:
p=D/'probing-assumed-assembly/probing-flow'/n
if p.is_file():add(p)
for n in ['build_r11_assumed_assembly.py','merge_r11_presentation_fan.py','check_r11_assumed_mechanical.py','check_r11_assembly_pairs.py','review_r11_assembly_contacts.py','export_r11_fit_parts.py','check_r11_assumed_probe.py','glb_shape_helpers.py','batch_glb_primitives.py','r11_assumed_thermal_sweep.py','package_r11_prototype_review.py']:add(R/'tools'/n)
manifest={'createdAt':datetime.datetime.now(datetime.timezone.utc).isoformat(),'status':'Assumption-based prototype review bundle; not manufacturing release','thermalQualified':False,'firmwareOutputLocked':True,'ordered':False,'flashed':False,'sourceBoardSha256':hashlib.sha256((D/'kicad/compact-sidefan-v5-native.kicad_pcb').read_bytes()).hexdigest(),'files':{str(p.relative_to(R)):hashlib.sha256(p.read_bytes()).hexdigest() for p in files},'remaining':['Manufactured fit, material/creep, thread engagement, cable bend radius and isolation checks','Installed airflow, interface resistance, fan control and sensor/fault response measurements','Browser tether-obstacle parity requires owner integration; CLI candidate is not shared deployment','Original AIFlow thermal and final release gates remain unmet']}
mp=O/'manifest.json';mp.write_text(json.dumps(manifest,indent=2)+'\n')
z=O/'compact-r11-prototype-review.zip'
with zipfile.ZipFile(z,'w',zipfile.ZIP_DEFLATED) as f:
for p in files:f.write(p,str(p.relative_to(R)))
f.write(mp,'manifest.json')
with zipfile.ZipFile(z) as f:
assert f.testzip() is None
for name,digest in manifest['files'].items():assert hashlib.sha256(f.read(name)).hexdigest()==digest
print(json.dumps({'file':str(z),'files':len(files),'bytes':z.stat().st_size,'sha256':hashlib.sha256(z.read_bytes()).hexdigest()}))