fix(minimateplus): read a MiniMate's settings by position, not the 'anchor' (#48)

The legacy SUB 1A decode found the record mode, sample rate, histogram
interval and record time by searching for be 80 00 00 00 00, believed a
stable anchor.  It is the block's [12:18]: the pre-trigger (-0.25 s) and
the stop mode (Fixed).  A unit in Auto stop mode, or with another
pre-trigger, has no such bytes, and all four read None -- in connect()'s
legacy routes (/device/info without a serial, the legacy event download's
sample rate).  The serial-routed settings path already read by position.

The block is now found by its own length field N = 2090 (08 2a, at
unescaped[12] on every recorded reply) and read by position, Series IV's
0x1A layout.

It never struck: every DL2 event file's setup copy has stop mode Fixed,
70,041 / 70,041, and Blastware's reports agree (7,631 / 7,631).
Tested on recorded replies patched to Auto stop and to a -0.5 s
pre-trigger (8 new tests; the 7 existing ones unchanged); not yet on a
unit in Auto stop mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R9LdWawLzUxwewZGA1
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-12-01 01:08:36 -05:00
1 parent 621c836109
commit 71bd14156d
4 files changed
+90 -35

No files matched your search

+1
View File
@@ -11,6 +11,7 @@
| Date | Section | Change |
|---|---|---|
| 2026-12-01 | §7.6.1, SUB 1A (legacy decode) | ✅ **#48 fixed: the settings are read by position, not by the "stable anchor".** `_decode_compliance_config_into` unescapes the 1A reply, finds the block by its own length field N = 2090 (`08 2a`, at unescaped[12] on all 4 recorded replies), and reads mode `[5]`, sample rate `[6:8]`, histogram interval `[8:10]` and record time `[18:22]` by position: Series IV's `0x1A` layout, as the 2026-11-03 (5) row measured. The anchor `be 80 00 00 00 00` was `[12:18]`, the pre-trigger and the stop mode, so a unit in Auto stop mode would have read all four as None. **How often it could strike (measured 2026-12-01):** every DL2 event file's setup copy has stop mode Fixed, 70,041 / 70,041 (63,500 histograms, 6,541 waveforms), and Blastware's reports agree (7,631 / 7,631 `RecordStopMode` Fixed). Tested on recorded replies patched to Auto stop and to a −0.5 s pre-trigger (`tests/test_s3_compliance_anchor_fields.py`); not yet on a unit in Auto stop. Resolves the 2026-10-17 row below. |
| 2026-11-13 | Appendix D.4 (rewritten), D.4.1–D.4.4 | ✅ **The `.MLG` format, measured.** An 18-byte prefix, then 292-byte records `[length 290 LE][id 0e a0 header / 0e 80 log][…][00 00][CRC]`. The CRC is **CRC-16/AUG-CCITT over `[0:288]`, little-endian** (3,329 / 3,329 records, 1,282 files). Fields: times with the year LE, the monitor-log flag word and trigger source LE, the serial, Blastware's text. Also: one file per call-in, how sessions appear, and a Modem Exit that is not a file's last record was a call that left no file. Cross-checked against DL2 event footers: 785 / 785 for BE8081. The old D.4.1–D.4.3 (308-byte header, CRC at the start) are kept, marked retracted. Reader/writer `minimateplus/mlg_file.py`. |
| 2026-11-11 | Appendix D.3.3 | ✅ **The footer's last two bytes are a CRC-16/AUG-CCITT** (init `0x1D0F`), big-endian, over the footer record from its length prefix `00 1a` through footer `[0:22]`: 70,041 / 70,041 DL2 files. Found by the `.MLG` session, verified here. Retracts 2026-11-08's "no common CRC-16 fits": every attempt had started at the footer itself. Same CRC family as the Series IV `0x1A` block's and the `.MLG` record's. |
| 2026-11-09 | Appendix D.6.15 (NEW), D.6.6, D.6.11 | ✅ **Over range and the mic.** **D.6.15:** a peak past full scale (2,000 units = 32,000 counts; the mic in counts) is Blastware's `OORANGE`, per channel and per histogram interval, from the unit's own summary peaks. The vector sum is `OORANGE` exactly when a geophone is (43 / 43); never on its own (38 / 38 numeric), which retracts D.6.11's open "vector sum alone" case. The `<OORANGE>` line marks the mic over (18 / 18). **D.6.6:** the mic has its own range byte (label + 29): at 1 a count is an eighth, 7 DL2 events SFM read 8× high. The dB offset is **81.938216**: [81.9383, 81.9385] was too high, and every count Blastware printed leaves [81.9382058, 81.9382266]. Blastware's mic unit labels do not hold on every report; some mix dB and psi in one column. **80 of 88 report fields now match on every DL2 event.** |