fix(framing): an escaped checksum no longer leaves its 0x10 in a reply's data (#58)
A MiniMate sends a checksum of 02, 03 or 04 as `10 X`. S3FrameParser kept both bytes and _finalise took only the last as the checksum, so the frame's data ended in a stray 0x10. It now takes the pair. Measured on every recorded reply (60 captures, March to October 2026): SUM8 of the unescaped payload is the checksum on 7,747 of 7,747; 272 arrived escaped, all valid as an escape pair. What the stray byte did: - 1C status: battery and memory are counted from the end; 12 of 760 recorded status replies read 419.84 V / 251,654,656 bytes (6.76 V / 983,026). - 2C call-home read: one byte long, refused as "monitoring". - 1A, 09 reads: already trimmed (bench 2026-11-04); the trims stay as guards. - 5A file builder: compensated in _frame_body_bytes; that pairing is removed, else a real 0x10 ending a chunk (one in ten do) would be dropped. Stored .a5.pkl frames: A5_PICKLE_VERSION 2; load_a5 drops the stray 0x10 from version-1 frames. All 28 pickles on this box rebuild byte-identical to dev's build. Operational consequence: none for prod's stored events (S3 events arrive through save_imported_bw, which keeps no frames); no schema change, no TOOL_VERSION bump, no backfill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
1 parent
d2fe675650
commit
89c5234ac0
6 files changed
+214
-71
No files matched your search
@@ -2354,8 +2354,9 @@ def _decode_monitor_status(data: bytes) -> MonitorStatus:
|
||||
header, so field offsets below are relative to data[11]).
|
||||
|
||||
NOTE: frame.data has the checksum byte already stripped by S3FrameParser
|
||||
(_finalise returns raw_payload[5:] where raw_payload = body[:-1]).
|
||||
There is NO trailing checksum byte in section.
|
||||
(_finalise returns raw_payload[5:], the checksum and, since #58, the 10 of
|
||||
an escaped checksum removed). There is NO trailing checksum byte in section;
|
||||
before #58 one status reply in 63 kept that 10 and read 419.84 V.
|
||||
|
||||
Monitoring flag (confirmed 4-8-26/2ndtry, byte diff of all 144 data frames):
|
||||
section[1] == 0x00 → idle
|
||||
|
||||
Reference in new issue
Block a user