mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-09-25 12:43:37 +00:00
Skip redundant modulation writes during owned fast RX retunes when the last acknowledged SF/BW/CR/LDRO tuple matches. Invalidate that cache after ordinary setters, failed writes, and lifecycle changes. Include the remaining scan, preamble, settling, and memory-soak experiments, their collectors, validation notes, and original capture records. Preserve capture bytes across checkouts and keep private soak credentials local. Run lab collector and compiled contract tests in CI. Update the expectation, profile mapping, and result-buffer tests for the extended lab tools, and make the private WiFi override header optional for ordinary soak diagnostics. Validation: 145 host tests passed from the staged source snapshot. Clean heltec_v4_repeater and Xiao_S3_WIO_companion_radio_usb builds passed their RAM/flash gates. All 229 staged capture files retain their original bytes; all 75 local documentation links resolve in the clean snapshot.
26 lines
1.2 KiB
Python
26 lines
1.2 KiB
Python
"""Bounded artifact chunk receiver for the existing SSH bridge's argv limit."""
|
|
import base64
|
|
import hashlib
|
|
import json
|
|
from pathlib import Path
|
|
import struct
|
|
|
|
frame=base64.b64decode('__PAYLOAD_B64__',validate=True)
|
|
offset,total=struct.unpack_from('<II',frame)
|
|
expected=frame[8:40].hex();chunk=frame[40:]
|
|
root=Path.home()/'hwtest/runs/four-tx-sf10-20260914'
|
|
if not root.exists():root.mkdir(mode=0o700,parents=True)
|
|
if (root/'deployment.json').exists():raise RuntimeError('Deployment already exists')
|
|
archive=root/'bundle.zip'
|
|
size=archive.stat().st_size if archive.exists() else 0
|
|
if len(chunk)>32768 or offset+len(chunk)>total or total>2000000:raise ValueError('Invalid chunk bounds')
|
|
if size==offset:
|
|
with archive.open('ab') as f:f.write(chunk)
|
|
elif size==offset+len(chunk):
|
|
with archive.open('rb') as f:f.seek(offset);existing=f.read(len(chunk))
|
|
if existing!=chunk:raise RuntimeError('Mismatched duplicate chunk')
|
|
else:raise RuntimeError('Out-of-order upload')
|
|
done=archive.stat().st_size==total
|
|
if done and hashlib.sha256(archive.read_bytes()).hexdigest()!=expected:raise RuntimeError('Final bundle hash mismatch')
|
|
print(json.dumps({'uploaded':archive.stat().st_size,'total':total,'complete':done}),flush=True)
|