abse/smartwatch-flex-top-only

Three-panel flex smartwatch with two parallel R3.9 bends, all components flat-top, low-profile JST connector harnesses, split heartbeat optical windows and screw-retained PCB mounting. Modeled 39 × 50.5 × 14.5mm prototype; 100% routing, zero native DRC and shorts. Hardware qualification pending.

Version
0.2.20
License
unset
Stars
0

scripts/collect-warning-cleanup.py

"""Collect fresh local receipts without changing the published release's reports."""
from pathlib import Path
from collections import Counter
from datetime import datetime,timezone
import hashlib,json
root=Path(__file__).resolve().parent.parent
read=lambda p:json.loads((root/p).read_text())
sha=lambda p:hashlib.sha256((root/p).read_bytes()).hexdigest()
c=read('dist/index/circuit.json');old=read('baseline-v0216/index.circuit.json')
warnings=lambda a:dict(Counter(e['type'] for e in a if e['type'].endswith('_warning')))
errors=[e for e in c if e['type'].endswith('_error')];assert not errors
assert sum(warnings(old).values())==80 and warnings(c)=={'pcb_trace_style_warning':1}
checks=read('reports/final-checks.json');assert len(checks)==5 and all(r['exitCode']==0 for r in checks)
entries=read('reports/native-entry-builds.json');assert len(entries)==6 and all(r['exitCode']==0 for r in entries)
for entry in entries:
 name=entry['entry'].split('.')[0];name={'enclosure-fit':'enclosure-fit'}.get(name,name)
 source=f'dist/{name}/circuit.json';data=read(source)
 assert not any(e['type'].endswith('_error') for e in data)
 entry.update(source=source,sourceSha256=sha(source),nativeWarnings=warnings(data))
shorts=read('reports/shorts/manifest.json');assert len(shorts['runs'])==16
for run in shorts['runs']:
 assert run['exitCode']==0 and run['reportedShorts']==0 and run['sourceSha256']==sha(run['sourceFile'])
 assert run['logSha256']==sha(run['log'])
electrical=['reports/copper-audit.json','reports/clearance-audit.json','reports/board-edge-audit.json','reports/native-drill-audit.json','reports/electrical-fixes/thermal-vias.json','reports/flex-geometry.json','reports/printed-coil-audit.json','reports/pour-board-edge-audit.json']
mechanical=['reports/cabled-assembly.json','reports/pcb-insertion.json','reports/pcb-mount-clearance.json','reports/harness-clearance.json','reports/mount-installation.json','reports/optical-paths.json','reports/button-actuator.json','reports/rendered-bends.json','reports/folded-panel-clearance.json','reports/pcb-component-meshes.json']
receipts=[]
for p in electrical+mechanical:
 r=read(p)
 if 'status' in r:assert r['status']=='PASS',(p,r['status'])
 for k,v in r.items():
  if k.endswith('Failures') or k=='failures':assert not v,(p,k)
 if 'sourceSha256' in r:assert r['sourceSha256']==sha('dist/index/circuit.json'),p
 receipts.append(dict(path=p,sha256=sha(p)))
copper=read(electrical[0]);assert len(copper['netResults'])==94 and not copper['orphanTraceIds'] and not copper['floatingGroundPourIds']
invariants=read('reports/warning-cleanup/invariants.json');meshes=read('reports/warning-cleanup/mesh-invariants.json')
assert invariants['status']==meshes['status']=='PASS' and invariants['newSourceSha256']==sha('dist/index/circuit.json')
style=read('reports/electrical-fixes/pcb-style.json');assert style['nativeCircuitSha256']==sha('dist/index/circuit.json')
assert sha('/workspace/smartwatch-flex-cabled-optics/routing/final/cache.json')==sha('baseline-v0216/cache.json'),'Changed original project route cache'
report=dict(status='PASS_WITH_ONE_RETAINED_STYLE_WARNING',createdAt=datetime.now(timezone.utc).isoformat(),localOnly=True,published=False,baseline='Published v0.2.16',nativeWarningsBefore=warnings(old),nativeWarningsAfter=warnings(c),warningsCleared=79,nativeDrcErrors=0,functionalNets=94,functionalPads=500,routingComplete=True,shorts=0,shortChecks=16,topComponents=162,retainedWarning=[e for e in c if e['type'].endswith('_warning')],reasonRetained='No tested 45-degree candidate preserved required copper clearance and actual junction anchors; keep OLED_CLK unchanged.',styleFindingsBefore=74,styleFindingsAfter=style['styleFindings'],styleCategories=style['styleCategories'],pcbStyleExitCode=style['exitCode'],pcbStylePassed=style['styleCheckPassed'],nativeEntries=entries,finalChecks=checks,electricalAndMechanicalReceipts=receipts,shortsManifest=dict(path='reports/shorts/manifest.json',sha256=sha('reports/shorts/manifest.json')),invariants=invariants,meshInvariants=meshes,styleChanges=read('reports/warning-cleanup/style-changes.json'),modeledEnclosureMM=read('reports/cabled-assembly.json')['modeledOutsideDimensionsMM'],sourceSha256=sha('dist/index/circuit.json'),cacheSha256=sha('routing/final/cache.json'),prototypeOrderStatus='HOLD: existing supplier drawing, flex fabrication, harness, power/coil and physical qualification gaps remain unchanged.')
(root/'reports/warning-cleanup/result.json').write_text(json.dumps(report,indent=2)+'\n');print({k:report[k] for k in ['status','warningsCleared','nativeDrcErrors','functionalNets','functionalPads','shorts','shortChecks','styleFindingsAfter','modeledEnclosureMM']})