diff --git a/CLAUDE.md b/CLAUDE.md index ba04dc2..7e654c3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -45,12 +45,14 @@ Read this first when picking the project back up. - **Byte layouts** of every field read from the file: `docs/instantel_protocol_reference.md` Appendix **D.6**. - **Where the decoder stands on `dev`** (2026-11-06, run `20261106-125854`): - **71 of 88 fields match on every event**, up from about 6 before v0.33.0, + **Where the decoder stands on `dev`** (2026-11-08, run `20261108-034313`): + **72 of 88 fields match on every event**, up from about 6 before v0.33.0, 47 before group D and 59 after it. - Groups A, B, C and D part 1 shipped in v0.34.0 (#50, #51). - - D part 2 (the unit's own summary) and E (the sensor check) are on `dev` - and owe the next release a backfill. + - D part 2 (the unit's own summary), E (the sensor check) and F (the + monitor log) are on `dev` and owe the next release a backfill. + - Still open: the mic stragglers, the `OORANGE` tag (18 events), the PPV / + vector-sum `OORANGE` carve-out, 4 accelerations. - πŸ”‘ **Events are keyed unit + time + type:** `UNIQUE(serial, timestamp, record_type)` (#51, Migration 3 in `sfm/database.py`, `dev`). - A waveform and its histogram may share a second: 209 times in prod's @@ -81,6 +83,9 @@ Read this first when picking the project back up. result, every record type. Also the unit's own, in each sensor-check record's header. "Check" is the unit's status code, not a limit SFM can recompute. + - group F (D.6.14): the Monitor Log line. It is the footer's start and + stop plus words from the footer's flag word (Modem Exit, Timer Stop, + Keyboard Exit…), character for character on 69,983 / 69,983. - πŸ”‘ **The tail of every event file is one record chain** (D.6.13): event record β†’ unit summary β†’ sensor checks β†’ footer, each `[length][id][payload]`. It ends exactly at the file's end on all 70,041 @@ -124,9 +129,7 @@ Read this first when picking the project back up. is Blastware's. - ~~**E. Sensor check results**~~ βœ… done (D.6.13). Plus the traces of a unit without a mic, which the trace decoder had been dropping. - - **F. Monitor log:** probably not in the event file at all. Lead, not - measured: O117I1NK's report prints its log as the event record's - start – stop. + - ~~**F. Monitor log**~~ βœ… done (D.6.14): in the footer after all. - πŸ”Ά **#48 is still open.** The event file's setup block puts the pre-trigger where the 1A "stable anchor" `be 80 00 00 00 00` sits. In the file, though, it is **each event's own pre-trigger**, not the setting: 253–256 samples at diff --git a/docs/instantel_protocol_reference.md b/docs/instantel_protocol_reference.md index 64083e9..b5ad40e 100644 --- a/docs/instantel_protocol_reference.md +++ b/docs/instantel_protocol_reference.md @@ -11,6 +11,7 @@ | Date | Section | Change | |---|---|---| +| 2026-11-08 | Appendix D.6.14 (NEW), D.3.3, D.6.11 | βœ… **The monitor log is in the footer.** Every DL2 report prints one Monitor Log line: the footer's ts1 and ts2, then words for the footer's flag word `[18:20]` (`0x0001` Event Recorded, `0x0002` Keyboard Exit, `0x0004` Remote Exit, `0x0008` Selfcheck Passed, `0x0010` Timer Stop, `0x0020` Modem Exit, `0x0200` Battery Low Exit, `0x0800` Memory Full Exit; the higher session-end bit wins, from one file). Rebuilt, it equals Blastware's character for character on 69,983 / 69,983. **D.3.3:** footer `[20:22]` is the trigger source again, `[22:24]` is zero; `[24:26]` still unknown, and no common CRC-16 or sum fits. **72 of 88 report fields now match on every DL2 event.** | | 2026-11-06 | Appendix D.6.13 (NEW), D.3.3, D.6.11, D.6.12 | βœ… **The record chain to the footer, and the sensor check.** Walked from the event record, the chain (event `0x05` β†’ unit's summary `0x32`–`0x35` β†’ sensor checks `0x3c`–`0x3f` β†’ footer `0x0e`) ends exactly at the file's end on all 70,041 DL2 files. The footer is its last record: `00 1a` is its length, `0e` its id. **Each sensor-check record's header holds the unit's results:** channel type `[2]`, status `[4]` (0 = passed), frequency Γ— 10 `[5:7]`, ratio Γ— 10 `[7:9]` and amplitude mV `[9:11]`. Blastware prints them as they are: 209,943 / 209,943 geophone frequencies and ratios, 69,975 / 69,975 mic frequencies and amplitudes. The result is Passed / Check / Disabled by status and type. The status is the unit's own verdict, its bits not decoded. D.6.12's "`0x3c` / `0x3d`, before and after" retracted in place: one record per channel. **71 of 88 report fields now match on every DL2 event.** | | 2026-11-05 | Appendix D.6.12 (NEW), D.6.11, Β§7.8.9 | βœ… **The unit's own event summary, in every event file.** The embedded event record is the first of a `[length][id][payload]` chain. It holds the vector-sum peak's sample (6,492 / 6,493). Then one 22-byte record per channel, ids `0x32` Tran … `0x35` MicL: min, max, peak sample, **half-period** and a **displacement integral**. Blastware prints them as they are. **ZC frequency** = (rate / 2) / half-period, with the interval rule's words: 25,966 / 25,966 waveform and 253,958 / 253,958 histogram channel values. **Peak displacement** = half the integral: 19,479 / 19,479. Recomputing from the samples had reached 46% and 84%: the unit works at full resolution. **Times of peak** follow the unit's peak sample. That differs from the samples only on **O117I1NK.R70W**, whose stored samples wrap at the trigger by 65,536 counts (Blastware's own table has the same values). Peak acceleration is Blastware's own computation from the stored samples (group D part 1, documented here too). The unit stores its own largest step at `[15:21]` (inferred), which Blastware does not print. Β§7.8.9's "constant, meaning ❓" bytes amended in place. 59 of 88 report fields now match on every DL2 event (47 before group D). | | 2026-11-04 | SUB 1A / 09 reads, SUB 68–74 settings write, the keypad | **SFM's settings write, benched on BE9441 (Brian at the unit; ~12 writes, each with his go).** **Every write** -- trigger 0.04 ↔ 0.05, a note, several fields at once (Project, job number + its report flag, trigger), the alarm 1.0 ↔ 1.5, and a full restore -- was acknowledged on all nine steps (`97 8C 8EΓ—5 8D 7D 7C 96 8B 8D`), read back as sent, and **confirmed on the unit's own screen**; the unit ended byte for byte as found. Moved bytes were exactly the field's: trigger f32 at each geophone channel +30 (`+31..+33` moved), **alarm f32 at channel +38** (`+39` moved; the first Series-3 alarm write), job number `[40:42]`, its report bit `[39]` `0x02`, a note's value window. **`[26:28]`** went `01 7f` β†’ `00 00` on SFM's first write (Blastware's value) and the unit **set `01 7f` again during the next monitoring session**. The **two bytes after the block** went out as `00 00` (Blastware sends a per-unit constant) and were taken. **πŸ”‘ Escaped-checksum artifact:** when a reply's checksum byte is itself escaped (02 / 03 / 04, ~1 frame in 85), `S3FrameParser` keeps the escape's `0x10` and strips only the byte after it, so the frame's data gains one trailing `0x10`. It hit the first live 1A read (frame B 1,026 bytes after the header); the 12 recorded reads never had. SFM's settings read and waveform read now take exactly the length they asked for. **πŸ”‘ The keypad menu wins:** a write sent while the setup menu was open was acknowledged and read back, then **lost when the operator pressed Cancel or Save** -- the menu writes its own copy of the **whole** block back (both times the block returned byte for byte to its state when the menu was opened). A keypad Cancel with nothing pending leaves the block unchanged. **While monitoring**, the 1A read returns the device-info block (SFM refuses, nothing sent), and the opening poll was answered only intermittently (2 of 3 attempts timed out). Code: `minimateplus.protocol.read_compliance_content` / `read_waveform_data_raw`, `micromate.setup_fields`; notes `~/bench-logs/2026-11-04-sfm-settings/`. | @@ -3479,8 +3480,11 @@ The footer terminates the N00 file. Its bytes come directly from the terminator | 0 | 2 | `0e 08` | Fixed marker | | 2 | 8 | ts1 | Start timestamp (8B big-endian) | | 10 | 8 | ts2 | Stop timestamp (8B big-endian) | -| 18 | 6 | varies | ⚠ **Not fixed** (2026-11-03). `00 01 00 02 00 00` in M529LIY6.N00. Elsewhere: `00 21 04 00 00 00` (K558L9XP.FK0H, K439I2WY.RK0H, T1895KDW.6J0H), `00 01 02 00 00 00` (K5575KDW.5L0W), `00 01 00 01 00 00` (S3545KFL.S60W). Not identified | -| 24 | 2 | CRC | 2-byte CRC β€” algorithm unconfirmed | +| 18 | 6 | varies | ⚠ **Not fixed** (2026-11-03). `00 01 00 02 00 00` in M529LIY6.N00. Elsewhere: `00 21 04 00 00 00` (K558L9XP.FK0H, K439I2WY.RK0H, T1895KDW.6J0H), `00 01 02 00 00 00` (K5575KDW.5L0W), `00 01 00 01 00 00` (S3545KFL.S60W). Not identified. **Identified 2026-11-08, three rows below** | +| 18 | 2 | monitor-log flags | uint16 BE: the words of Blastware's Monitor Log line (D.6.14) βœ… 69,983 / 69,983 | +| 20 | 2 | trigger source | the event record's again: `00 01`–`00 08` a channel, `02 00` Manual, `04 00` a histogram βœ… 69,983 / 69,983 | +| 22 | 2 | `00 00` | 69,983 / 69,983 | +| 24 | 2 | CRC | 2-byte CRC β€” algorithm unconfirmed. ⚠ 2026-11-08: no common CRC-16 (XMODEM, CCITT-FALSE, AUG-CCITT, KERMIT, ARC, MODBUS, BUYPASS) nor a 16-bit sum, over the file, from STRT, after STRT or over the footer, fits 40 sampled files. That it is a checksum is not shown | **CRC:** The 2-byte CRC at footer[24:26] has an unconfirmed algorithm. In M529LIY6.N00 it reads `fe da`. Attempts to match CRC-16/CCITT, CRC-16/IBM, CRC-32 (truncated), and 40+ polynomial/init combinations all failed. The writer copies it verbatim from the terminator frame. @@ -3964,13 +3968,15 @@ All four channels match every DL2 histogram. #### D.6.11 Not read from the file yet -*Updated 2026-11-06. 71 of 88 report fields now match on every DL2 event: 47 before group D, -59 after it, 71 with the sensor check (run `20261106-125854`, 0 regressions).* +*Updated 2026-11-08. 72 of 88 report fields now match on every DL2 event: 47 before group D, +59 after it, 71 with the sensor check, 72 with the monitor log (run `20261108-034313`, +0 regressions). Still open: the mic stragglers, the `OORANGE` tag (18 events), the +PPV / vector-sum `OORANGE` carve-out, and 4 accelerations (D.6.12).* - **Fields not read yet:** - extended notes - ~~sensor check results~~ **read, 2026-11-06 (D.6.13)**: the unit's own, in the header of each sensor-check record - - monitor log + - ~~monitor log~~ **read, 2026-11-08 (D.6.14)**: the footer's times and flag word - ~~the values Blastware computes: ZC frequency, acceleration, displacement, time of peak~~ **Read, 2026-11-04 β†’ 05 (D.6.12).** Blastware prints the unit's own ZC frequency, displacement and time of peak, all stored in the file. Acceleration is the exception: @@ -4102,6 +4108,49 @@ of the four bits occurs across the whole range of frequency, ratio and amplitude meanings are not decoded. Every mic `Check` in DL2 (691) is status 13 with frequency 0 and amplitude 0: a mic that did not respond (inferred). +#### D.6.14 The monitor log β€” the footer βœ… 2026-11-08 + +**Every DL2 report prints exactly one Monitor Log line**, built from the footer (D.3.3) alone: + +