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/run-final-checks.py

from pathlib import Path
import hashlib, json, os, re, subprocess

root = Path(__file__).resolve().parent.parent
bun = '/workspace/.cloud-tools/node_modules/.bin/bun'
env = dict(os.environ, XDG_CONFIG_HOME='/workspace/.cloud-tools/config',
           XDG_CACHE_HOME='/workspace/.cache', XDG_STATE_HOME='/workspace/.cloud-tools/state',
           NODE_USE_ENV_PROXY='1')
env['PATH'] = '/workspace/.cloud-tools/node_modules/.bin:' + env['PATH']
jobs = [('typecheck', [bun, 'node_modules/typescript/bin/tsc', '--noEmit']),
        ('source', [bun, 'scripts/check-cli-complete.mjs', 'check', 'source', 'index.tsx']),
        ('netlist', [bun, 'scripts/check-cli-complete.mjs', 'check', 'netlist', 'index.tsx']),
        ('pins', [bun, 'scripts/check-cli-complete.mjs', 'check', 'pin_specification', 'index.tsx']),
        ('source-integrity', ['python', 'scripts/verify-warning-invariants.py'])]
records = []
for name, command in jobs:
    result = subprocess.run(command, cwd=root, env=env, stdin=subprocess.DEVNULL,
                            stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
    log = root / f'final-check-{name}.log'
    log.write_text(result.stdout)
    record = dict(name=name, command=command, exitCode=result.returncode,
                  log=str(log.relative_to(root)), logSha256=hashlib.sha256(log.read_bytes()).hexdigest())
    if name in ['source', 'netlist', 'pins']:
        match = re.search(r'Errors:\s*(\d+)', result.stdout)
        warnings = re.search(r'Warnings:\s*(\d+)', result.stdout)
        record.update(errors=int(match[1]) if match else None,
                      warnings=int(warnings[1]) if warnings else None)
    records.append(record)
    (root/'reports/final-checks.json').write_text(json.dumps(records, indent=2)+'\n')
    print(name, record['exitCode'], flush=True)
    assert result.returncode == 0, result.stdout
    if name in ['source', 'netlist', 'pins']:
        assert record['errors'] == 0, result.stdout