abse/museair-usb
USB-C–powered ESP32-C3 controller board with AP63203 buck conversion, AP2112K 3.3V regulation, I²C SEN62 sensor interface, status LED, buttons, UART/I²C headers, and extensive decoupling.
- Version
- 0.5.7
- License
- unset
- Stars
- 0
scripts/verify-handoff.py
"""Verify cloud-transfer integrity without changing files or claiming new DRC."""
from pathlib import Path
import hashlib,json,sys
root=Path(__file__).resolve().parent.parent
manifest=json.loads((root/'HANDOFF-MANIFEST.json').read_text())
for rel,record in manifest['files'].items():
target=(root/rel).resolve()
if not target.is_relative_to(root.resolve()):raise SystemExit(f'Unsafe manifest path: {rel}')
if not target.is_file():raise SystemExit(f'Missing file: {rel}')
data=target.read_bytes()
if len(data)!=record['bytes'] or hashlib.sha256(data).hexdigest()!=record['sha256']:
raise SystemExit(f'Transfer mismatch: {rel}')
audit=json.loads((root/'validation/production-audit.json').read_text())
assert audit['status']=='pass'
for rel,digest in audit['sha256'].items():
assert hashlib.sha256((root/rel).read_bytes()).hexdigest()==digest,rel
pub=json.loads((root/'validation/tscircuit-publication.json').read_text())
assert pub['status']=='pass' and pub['version']=='0.5.5'
for rel,digest in pub['file_sha256'].items():
if rel.endswith('.tsx') or (rel.startswith('models/') and rel.endswith('.ts')):
assert hashlib.sha256((root/rel).read_bytes()).hexdigest()==digest,rel
chat=json.loads((root/'docs/CHAT-TRANSCRIPT.json').read_text())
assert chat['history_pagination_complete']
assert chat['turns'][0]['items'][0]['content'][0]['text'].strip()=="Let's use AI gadgets that we can build using pure circuits."
assert chat['user_messages']==manifest['history']['user_messages']
assert chat['assistant_messages']==manifest['history']['assistant_messages']
assert chat['user_messages']==sum(i['type']=='userMessage' for t in chat['turns'] for i in t['items'])
assert chat['assistant_messages']==sum(i['type']=='agentMessage' for t in chat['turns'] for i in t['items'])
assert len(chat['turns'])==39
assert json.loads((root/'package.json').read_text())['version']=='0.5.5'
print(f"PASS: {len(manifest['files'])} files match the handoff manifest")
print('Production files and 18 published sources retain their verified hashes.')
print(f"Chat: {len(chat['turns'])} turns, {chat['user_messages']} user messages, {chat['assistant_messages']} assistant messages; all history pages included.")
print('Integrity check only: cloud execution, physical hardware and fresh stock are not verified.')