Commit Graph
716 Commits
Author SHA1 Message Date
serversdownandClaude Opus 5.5 7491cd4b6f docs: the 1c bench pass and the ring-path results (2026-10-29)
- Spec: the 1c bench pass on BE9441 and UM20147, each on its own modem, and
  its 16 findings (a new 'Left open by the 1c bench' section).  Ring-path
  results, measured: with THOR's watchdog off a call-home reaches THOR when
  nobody holds the line (Run 0, via ListenerAchTcp) and is lost when SFM holds
  it (Run A: the unit times out and does not retry); with THOR polling, SFM gets
  no reply and THOR is undisturbed (A2, step 1).  Decision owed before merge:
  the Micromate line hold.
- Micromate reference: retracts 'ListenerAchTcp never used' in place (it
  accepted tonight's call-home; port 12345); a call-home that rings on another
  receiver's connection is lost; a second TCP connection while THOR holds the
  line is accepted but silent.
- CLAUDE.md: 1c status, the open decision, THOR's log location.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 20:49:28 -04:00
serversdownandClaude Opus 5.5 3528dde970 docs(micromate): THOR's log location, its watchdog cadence, and the unit that went quiet after a THOR disconnect
C:\THORDATA\Logs\ (Brian).  From the 2026-10-29 log: the watchdog reads each
unit's serial every ~15 s; Unit_CommandOutOfRange follows every ReadUnitStatus
for every unit (fleet-wide noise); after a manual THOR disconnect UM20147
answered neither SFM nor THOR's own reconnect ("Mismatch connection found").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 20:16:46 -04:00
serversdownandClaude Opus 5.5 4117b056aa scratch: ring-path poller for the Runs A/B bench test
Asks the bench SFM for a Micromate's status on a fixed interval (Run B) or
once (Run A), with run_state=true, and logs each answer with its time as JSON
lines: HTTP status, seconds, the raw 0x49 code, and the detail of any refusal
(503 call-home-in-progress / could-not-connect).  Read-only on the unit;
refuses :8200.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 13:17:43 -04:00
serversdownandClaude Opus 5.5 ee02874cb0 feat(sfm): opt-in raw SUB 0x49 code on a Series-4 status read
GET /device/monitor/status?serial=UM...&run_state=true adds
detail.run_state = {code, name}.  For the ring-path bench test: the code
during and after a call-home (0x01 for ~18 s after a stop, inferred to be
call-home attempts; 0x03 = calling home) is what the test watches.  Opt-in
because it is one more round trip (~0.65 s on cellular); a plain status read
is unchanged.  Series 3 has no 0x49 and ignores it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 13:15:44 -04:00
serversdownandClaude Opus 5.5 2560ef4586 docs: THOR's watchdog interval is a setting; the ring-path test varies it
- micromate reference: the watchdog can check every 5 s, hourly or never
  (Brian, operator-reported).  The 10-14 "reconnects continuously" describes
  that THOR's setting, not fixed behaviour; whether a check holds the line,
  and how a call-home reaches THOR with the watchdog off, are unmeasured.
- spec, ring-path test: the old setup ("a unit THOR is not otherwise
  watching") would not test the production path, since THOR receives a
  call-home on its own connection.  Revised: UM20147 as a THOR test unit; Run 0
  baseline with the watchdog off; Run A with SFM holding the line; Run A2 and
  Run B at the fleet's watchdog setting; after the 1c bench pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 13:12:29 -04:00
serversdownandClaude Opus 5.5 9082236c5e fix(webapp): the final review's three page findings
- The arrow keys reached the legacy per-index waveform route in serial mode,
  even with no list loaded (an unlocked MiniMate chain walk + 5A on the same
  modem session).  perIndexLive() is now the one rule for the per-index
  buttons, the chips and the keyboard: live only for a list loaded without a
  serial that has events.
- A failed reconnect left the previous unit's confirmation live (badge,
  Diagnostics incl. the unguarded blind/slow-drip stops, call-home read).
  connectUnit() now drops it before it identifies; only this answer confirms.
- Unit strings reached innerHTML: the Device tab's cards (active_setup, new in
  1c) and its compliance/project tables now render as text, and Diagnostics'
  error spans go through escapeHtml().
- CLAUDE.md: the ring-path Runs A/B are a merge gate (the spec's prerequisite
  to a webapp sending serial), not only a use-time one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 12:16:49 -04:00
serversdownandClaude Opus 5.5 073284fc88 docs: phase 1c -- the webapp by serial, and the Series-3 guard on legacy writes
- CLAUDE.md: a 1c entry under Where things stand (serial mode, what follows
  the unit's own answer, writes off until phases 4-5, the Node-run page tests)
  and the legacy-route guard in the REST API notes, with why the stop tools
  are exempt.
- Spec: the 1c build status; the ring-path Runs A/B are still owed before
  serial mode is used on a unit that calls home to THOR; which parked 1c items
  the page settles (CORS: same origin; the S4 mic is not shown).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 12:01:39 -04:00
serversdownandClaude Opus 5.5 c4cb979dfb feat(webapp): the status panel shows the unit's clock and event count
Task 3's brief asked for them and they were missed: with a serial, the panel
now shows UnitStatus.device_time and event_count, "—" where null (Series 3
reports both as null).  Without a serial the two fields stay hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 12:00:12 -04:00
serversdownandClaude Opus 5.5 a709d2388d feat(webapp): config and call-home writes wait for phases 4-5; Diagnostics only for a confirmed Series-3 unit
- Config, with a serial: Read shows the unit's shared UnitSettings (setup,
  record mode, sample rate, record time, histogram interval, geo trigger,
  notes; — for null) in place of the write form.  settingsRows() is in the
  device-routing block, Node-tested; the rows are rendered as text, since
  setup names and notes come from the unit.
- Write stays off for both series (and without a serial), tooltip
  "Coming in phase 5 (#46)"; Call Home write likewise, "Coming in phase 4".
- Call Home read follows controlsFor().callHomeRead; for a confirmed Series 4
  the tab says "Not yet available for Series 4".
- Diagnostics: every button follows controlsFor().diagnostics (Task 3), and a
  refresh for anything but a confirmed Series-3 unit sends nothing and says
  why.  Its requests carry the typed serial, so the server guard checks it.
- Without a serial the legacy reads are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 11:59:11 -04:00
serversdownandClaude Opus 5.5 3f249e2322 feat(webapp): start/stop through the audited serial path, with the honest result
- With a serial, Start / Stop ask first ("Start monitoring on BE9441?"), then
  POST once to the audited change -- never retried; both buttons stay off while
  it is in flight, so a double click cannot send twice.
- The status bar shows changeSummary() of the ChangeResult, on a 409/502 too
  (dry run, already-in-state, confirmed a -> b, or the outcome and read-back);
  an error without one shows its detail verbatim; no reply from SFM says the
  command may have been sent and where to look, rather than that nothing was.
- Then one status read updates the panel.  The legacy 5 s confirm poll is not
  used in serial mode; with a blank serial start/stop are unchanged.
- Diagnostics' Stop, which goes the same way in serial mode, shows the same
  summary; deviceFetch errors carry it for any non-200 ChangeResult.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 11:56:36 -04:00
serversdownandClaude Opus 5.5 9aae3b09de feat(webapp): list and download events by serial, for both series
- Load events with a serial lists the shared EventRef shape as a table: index,
  time, type, PVS and the three peaks (or —), each row with its own Download.
- Download POSTs the row's event_id; SFM checks and stores it.  The status bar
  says what was stored (or that it already was), and the stored event opens
  in the viewer.  A refusal shows the server's detail verbatim.
- eventView() (device-routing block, Node-tested) reads both event shapes for
  the table, the chips and the peaks bar.
- A list loaded without a serial keeps the chips and the per-index Load /
  Save / Download buttons, unchanged; for a serial-loaded list those buttons
  are off with a tooltip pointing at the rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 11:54:43 -04:00
serversdownandClaude Opus 5.5 44d6e754bd feat(webapp): name a unit by serial; series badge from the unit's own answer; Hang up for Series 4
- A Serial field beside host/port.  With one, the Live tabs use the serial-based
  endpoints (both series); without, every read behaves as before.
- The series badge, Hang up (Series 4), Diagnostics (Series 3), call-home read and
  the disabled config/call-home writes all follow applyControls() <- controlsFor()
  on the unit's own /device/info answer; editing the serial, host or port drops
  the confirmation.  Erase additionally needs a confirmed Series 3.
- Every /device/ request goes through deviceRequest/deviceFetch <- deviceUrl
  (a static test enforces it); the legacy per-event routes joined deviceUrl
  (event_waveform / event_file, index in the path).
- The status panel and Device tab read both shapes (shared and legacy).
- In serial mode the connect skips the legacy storage_range read (one connection
  fewer; a Micromate has no such route).  Start/stop without a serial behave as
  before; with one, only for a confirmed series.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 11:50:24 -04:00
serversdownandClaude Opus 5.5 e3717706f8 feat(webapp): the device-routing rules as pure functions, tested through Node
One block of sfm_webapp.html (/* <device-routing> */) holds every rule that
decides where a /device/ request goes or whether a series-specific control is
live: seriesFromSerial, unitQuery, deviceUrl, confirmedSeries, controlsFor,
changeSummary, downloadSummary.  No DOM, no fetch, so the tests run it in Node.

The safety rules it pins: a control follows the unit's own /device/info answer,
never a typed serial alone, and stops counting when the serial is edited;
Diagnostics only for a confirmed Series 3, Hang up only for Series 4; config and
call-home writes off for both series until phases 4-5.  Also a test that the
page's inline scripts parse together (shared global scope).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 11:46:08 -04:00
serversdownandClaude Opus 5.5 1cb11abcef fix(sfm): legacy Series-3 writes and erase refuse a unit that does not answer as Series 3
0xA2 is CONFIRM ERASE on a MiniMate and ends a call-home on a Micromate, and the
legacy host/port routes had no identity check: only the MiniMate parser's
inability to read a Micromate's replies stood between Diagnostics' Erase and a
Micromate (phase 1c safeguard, agreed with Brian 2026-10-28).

_require_series3(unit_serial, expected) refuses (409, 'nothing sent') unless the
unit's own serial is Series 3 and, when ?serial= names one, that one:
- POST /device/config (+ /config/project) and /device/events/erase: the serial
  connect() already reads -- no extra request;
- /device/rescue (when it writes call-home or erases) and POST /device/call_home:
  one SUB 0x15 read (new MiniMateClient.read_serial).
Exempt, with the reason in a comment: legacy monitor start/stop, blind stop, slow
drip, spam -- 0x96/0x97 mean the same on both series (measured), and the rescue
tools must reach a unit too wedged to answer.

Tests: each guarded route refuses a unit answering UM20147 and a different BE
unit with no write call, proceeds for the named unit (normalised), reuses
connect()'s serial where it has one; the blind stop builds no client;
read_serial decodes BE9441's recorded 0x15 reply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 11:43:42 -04:00
serversdownandClaude Opus 5.5 c3746a6a01 docs(spec): park event deletion with the future call-in receiver
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 11:38:05 -04:00
serversdownandClaude Opus 5.5 eecabc76eb docs(plan): phase 1c -- the webapp by serial, and the wrong-series safeguards
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-28 23:20:26 -04:00
serversdownandClaude Opus 5.5 02d8517ebd docs(spec): park the MiniMate speed-ups, measured -- after 1c
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-28 23:16:50 -04:00
serversdownandClaude Opus 5.5 20ea61e0e9 fix(minimateplus): push_config_raw checks every block before the first write goes out (#46 review)
Review of b5037b0 (measured on 12 recorded SFM compliance reads): the read
keeps three escape bytes from its reply headers, so every real config image is
refused by write_image -- correctly, but only after 68 and 73 had been sent,
with a message saying nothing was.  All four blocks are now checked first; the
test feeds the block exactly as SFM's read produces it and asserts no frame is
sent (two went out without the check).

Config push stays unusable on purpose: fixing that read alone would let the
compliance encoder write some fields to the wrong bytes (e.g. 4,096 sps as
4,112) while the image still passes.  The rework -- logical read, encoding at
measured offsets with #48, a diff check, N pinned per SUB, an idle check, the
start/stop safeguards on POST /device/config -- is recorded in the spec and on
#46.  Start/stop frames are unchanged (verified byte-identical by the review).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-27 03:17:34 -04:00
serversdownandClaude Opus 5.5 329f7f2abb docs: retract the MiniMate write-frame model in place (#46)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-27 02:54:56 -04:00
serversdownandClaude Opus 5.5 b5037b0b1e fix(minimateplus): MiniMate config writes are ordinary escaped requests carrying whole blocks; apply_config reads the unit's own trigger block (#46)
Measured against every Blastware request on record: the uploaded Feb-Apr 2026
captures (3,869 frames, 3,869 re-encode exactly) and BE9441's two sends on
2026-10-26 (26 write frames).  A write is the standard 16-byte request plus its
data, every 02/03/04/10 escaped, SUM8 checksum; the length field is the data's
length.  A config block starts with its own length N and is written as N + 2
bytes: event index (68) and trigger (82) as read plus 02 00 / 00 00 (constant on
15 sends), waveform data (69) and the 2,092-byte compliance image (71) whole.
The compliance image goes in addressed chunks (params[2:4] = address): 512 bytes
tonight (Blastware 10.74), 1,024 in March.

- framing.build_bw_write_frame: uniform escaping, SUM8, length = len(data).
  RETRACTED: 'only BW_CMD doubled', the 'DLE-aware checksum', 'offset = data[1]
  + 2' -- fitted to frames still holding their escape bytes ('data 91, offset 90'
  was 90 bytes and one escape).  It got 7 of every 13 frames in a write wrong.
- protocol.write_image(): unescapes (callers may pass the parser's form), adds
  the trailing two bytes to an N-byte block, and REFUSES anything else before a
  byte is sent -- an edit beside a kept escape byte (the old encoder's anc-9
  hazard) leaves an image one byte long.
- write_compliance_config_raw: 512-byte addressed chunks, then confirm 72.
- read_event_index / read_waveform_data_raw unescape before slicing (a block
  holding 02/03/04/10 came out short); new read_trigger_config (SUB 0x2E).
- apply_config reads the unit's trigger block.  RETRACTED: the block
  'hardcoded from 3-11-26 -- no read exists'.  Blastware reads it; byte 5 has
  been 01 / 03 / 04 by unit and session, and the March copy (03) would have
  changed BE9441's (01).
- The call-home write (7E) goes through write_image: its 127-byte 'read + 00 00'
  is the 126-byte image (N = 0x7C).  No Blastware 7E is on record here -- that
  one is inferred from the other 77 write frames.

Tests: tonight's 26 and every Feb-Apr write frame rebuilt byte for byte; each
block as read written exactly as Blastware wrote it; the parser's form; the
stray-byte refusal; the reads against the unit's recorded replies; apply_config
writes BE9441's own trigger block.  Six mutants, each caught.  The old
test_write_frames.py (25 tests that had been skipping) runs now that the
captures are here, rewritten to the measured model.

Not yet sent to a unit: a config push changes settings, so its first live use
is a bench session with Brian.  No codec, store or DB change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-27 02:54:26 -04:00
serversdownandClaude Opus 5.5 a7f581f66a docs(spec): the persist_download alignment follows what v0.32.0 shipped -- event-record times, the estimate guard
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-27 00:20:54 -04:00
serversdownandClaude Opus 5.5 98def4aae0 docs(spec): a stop starts a call-home on a unit with auto-call-home -- unmeasured on Series 3
Brian: stopping by command or keypad with ACH enabled makes the unit call home
and upload events + MLG, which can take minutes.  Fits UM20147's 0x01 after a
stop (10-25).  Owed: measure a MiniMate stop with ACH on, through the bridge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-27 00:17:29 -04:00
serversdownandClaude Opus 5.5 d7e65f5d15 docs: MiniMate start through SFM verified on BE9441 -- the start/stop bench check is complete
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-27 00:13:37 -04:00
serversdownandClaude Opus 5.5 ca5c401c6f fix(device_access): a start's read-back waits out the sensor check, then wakes the MiniMate with retries
Second start through SFM, BE9441 2026-10-26 23:54:41: acked 0x69, and Brian saw
'starting, performing sensor check, recording' -- but the read-back's single
SESSION_RESET + POLL went out 2.3 s after the ack, inside the ~30 s sensor
check, and was never answered or re-sent (504 after 120 s, audit ca7b5b42).
Brian: every unit is set to sensor-check before monitoring, ~30 s, then
'Recording...'.

- MiniMateProtocol.wake(attempt_s, deadline_s): SESSION_RESET + POLL re-sent
  every attempt_s until the unit answers, then the POLL data step; a named
  timeout at the deadline.  Reads only.  MiniMateClient.wake() wraps it.
- The Series-3 change: after a START, the first read waits S3_SENSOR_CHECK_S
  (30 s) before asking; every read then wakes with retries (every 5 s, up to
  60 s).  A stop is unchanged -- its read-back was confirmed three times tonight.

Tests: a unit deaf for 4 probes is asked a 5th time and answers; a unit that
never answers ends in the named timeout after ~6 probes; a start's first read
waits the sensor check, a stop's does not; every read is preceded by a wake.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-27 00:02:10 -04:00
serversdownandClaude Opus 5.5 9886422212 fix(device_access): wake a MiniMate before every state read in a start/stop, so a start's read-back is answered
BE9441, 2026-10-26 23:41:48 (through the bridge): SFM's start (0x96, Blastware's
own bytes) was acked 0x69 and the unit began monitoring -- Brian saw it -- but
the read-back sent one bare 0x1C two seconds later and got nothing for 120 s,
so the change reported 'sent and acknowledged, but reading the state back
failed' (504, audit 0c1cf813).  Nothing was retried.

A monitoring MiniMate ignores a bare request until SESSION_RESET + POLL
(measured 2026-04-08).  The read-back had relied on the connect's wake; a stop's
read-back (18:53, the unit idle by then) never needed it.  Every state read in
the change now goes through _woken_state: client.poll() (41 03, POLL, 41 03,
POLL -- the connect's own sequence), then 0x1C.

Test: after the send, every 0x1C read is preceded by a POLL.  No codec, store or
DB change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-26 23:51:15 -04:00
serversdownandClaude Opus 5.5 6f2acc79e6 docs(spec): owe persist_download an alignment with dev's waveform-time restamp before the merge
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-26 19:16:25 -04:00
serversdownandClaude Opus 5.5 1da3083665 docs: the MiniMate histogram and stop checks are done; start is still owed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-26 19:10:04 -04:00
serversdownandClaude Opus 5.5 258a6e2143 test(minimateplus): a 71 KB histogram past the old 128-chunk cap walks as Blastware's and rebuilds its file
Tonight's bridge recording of BE9441 (16:08-19:06) as a fixture, with
Blastware's files: Blastware's and SFM's requests in order (1,596, 722 of them
5A, 722 A5 replies), two Blastware config writes, SFM's stop, and three events.
Event 2 is a 4,096-sps, 2 s histogram of 71,088 bytes -- 139 requests, two 64 KB
crossings.

Measured live the same evening (SFM through the bridge, read-only downloads):
SFM's files for events 1 and 2 are byte-identical to Blastware's (sha256), the
71 KB histogram included -- the first event past the old cap downloaded from a
unit.  Event 0, the mic-off histogram, was refused ('decodes as neither'), as
expected on this branch: its decoder fix (#47) is on dev.

The test, fed the recorded replies with max_chunks=128: SFM's walks send
exactly Blastware's 139 and 118 requests and rebuild both files byte for byte.
Reverting the STRT-sized cap (8acb951) fails it.  No code change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-26 19:09:48 -04:00
serversdownandClaude Opus 5.5 d990466407 fix(minimateplus): the 0x1C status reads a histogram run as monitoring, and unescapes before counting from the end
Measured on BE9441 tonight, through the recording bridge:

- Monitoring flag 0x0B while recording a histogram (confirmed at the unit), 0x00
  idle.  Only 0x10 had been measured as monitoring (BE11529, 2026-04-08), so the
  status showed 'not monitoring' and the change path refused the state as
  unknown(0x0B) -- refused, not skipped, which is the design working.  0x0B joins
  S3_RUN_STATES and S3_MONITORING_FLAGS as measured.  The shared status's
  'monitoring' now follows the change path's reading: None for an unmeasured
  flag, never a guessed False.
- Free memory 0x000D0E04 arrived as 0d 0e 10 04.  The parser keeps the 10 of a
  10 02/03/04 escape, so every field counted from the end read one byte off:
  419.84 V and 251,655,168 bytes for 6.76 V and 983,028.  New
  framing.unescape_reply() (also used by parse_strt_end_key) runs first.

Tests: the two recorded replies (idle 16:24, monitoring 18:47) decode to the
unit's own values; each escaped value in the last ten bytes decodes; the status
mapping for 00 / 10 / 0B / unmeasured.  No codec, store or DB change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-26 18:53:11 -04:00
serversdownandClaude Opus 5.5 8acb9512a9 fix(minimateplus): size the 5A chunk cap from STRT, refuse a misread STRT, TERM only a tail
Follow-ups from the review of 887e75d (verdict: keep, with fixes; no critical).

- The cap: a caller's max_chunks (client.py passes 128) now bounds only a walk
  whose end is unknown.  With STRT it cut every event past ~66 KB short --
  2,545 of 63,500 archived histograms are bigger (the review's count, DL2).
  Strict raised; legacy sent a TERM for most of the event, or a bare ValueError.
- A STRT claiming less than one 0x200 chunk, or more than 4 MiB (a sanity bound,
  not a measured limit), is refused as a misread, in both modes -- once a bare
  ValueError and a 500.
- TERM is sent only for a true tail (< 0x200).  After an early end the legacy
  walk returns what arrived and sends none.
- build_5a_request wraps build_bw_frame; the old 5A helpers are marked
  superseded (kept for tests/test_5a_protocol.py) and their imports dropped.

Tests: all 8 recorded events (were 4) walk exactly as Blastware and rebuild its
own files; an end key holding escaped bytes; a 300 KB event past a 128 cap; both
misread-STRT refusals; the 1A frames BE9441 answered post-fix; the checksum
vectors retargeted.  Mutants the review saw survive (no STRT un-escape; a
standard-request escape revert) and 3 new ones are each caught.

Measured on the way: a reply's checksum is SUM8 of its unescaped payload,
748/748.  The 'S3 checksums frequently fail' note was the parser summing its
own kept escape bytes; noted, parser unchanged.

Docs: the crossing count corrected to four (events 1, 3, 5, 7); the remaining
stale 5A sections in CLAUDE.md annotated; the write-frame suspicion recorded as
inferred only.  No codec, store or DB change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-26 15:16:10 -04:00
serversdownandClaude Opus 5.5 f61fc3cc78 test(minimateplus): the walk rebuilds Blastware's own files for the page-crossing events
Brian's Blastware files from the recorded session (events 0, 1, 3, 7 -- three
cross a 64 KB page) as fixtures; SFM's walk, fed Blastware's recorded replies,
writes each one byte for byte.  Live the same day, SFM's own downloads of all 8
events were byte-identical to Blastware's (sha256), the 4 crossings included --
and events 2-5's shorter sample counts (20,490-21,011 vs 21,504) are in
Blastware's files too: the unit's own recording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-26 14:45:38 -04:00
serversdownandClaude Opus 5.5 6f31eca366 docs: the 64 KB page bug is fixed; the 5A 'non-standard frame' model retracted in place
CLAUDE.md: the KNOWN BUG entry marked fixed (887e75d) with what settled it, and
retraction notes under the 5A sections that described the misreading (partial
stuffing, offset_hi 0x10 raw, 11-byte params, metadata pages 0x1002/0x1004).
Series-III reference: a 2026-10-26 (3) row.  Spec: the MiniMate check updated.
Code comments that called the page bug open, updated; the adapter's struct.error
mapping kept as a defence, its message and test no longer naming the old bug.

Verified live on BE9441 the same day: all 8 events downloaded by serial, the 4
that cross a 64 KB page included, each whole and matching the unit's own peaks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-26 14:44:11 -04:00
serversdownandClaude Opus 5.5 887e75d1ba fix(minimateplus): MiniMate requests escape 02/03/04/10, and the 5A walk is 32-bit linear -- the 64 KB page bug
A recording of Blastware downloading all 8 of BE9441's events (three crossing
a 64 KB page; tests/fixtures/minimate-bench-10-26-26-blastware/) settles it:
every one of its 748 requests is the standard 16-byte payload with a SUM8
checksum and every 02 / 03 / 04 / 10 byte DLE-escaped -- 748/748 re-encode
byte-identically.  A 5A request is not a special frame: it is that payload with
a 2-byte LENGTH (0x0200 per chunk, the remainder for TERM) and a 4-byte linear
ADDRESS.  The walk is the event's start, +0x200 at a time carrying into the page
byte, then TERM at the next boundary for exactly the remainder.

What the old model misread: the fixed 'offset 0x1002' is length 0x0200 escaped
(10 02 00); the first event's 'metadata pages at 0x1002/0x1004' are its chunks
at 0x0200 and 0x0400; the 16-bit counter could not leave the key's page.

- build_bw_frame escapes the four values (was 0x10 only); new s3_stuff().
- build_5a_request(address, length); parse_strt_end_key() -> the full 32 bits.
- read_bulk_waveform_stream: one linear walk, no event-1 special case; strict
  mode keeps every refusal; an end at or before the start is refused as a
  corrupt STRT (a page crossing is no longer refused -- it downloads).

Tests: all 540 Blastware 5A requests and all 208 others rebuilt byte for byte;
SFM's walks for events 0, 1, 3 and 7 send exactly Blastware's requests and,
fed Blastware's recorded replies, build whole events.  In-page requests are
byte-identical to before.  No codec, store or DB change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-26 14:38:19 -04:00
serversdownandClaude Opus 5.5 465bc704dd test+docs: SFM's MiniMate downloads are byte-identical to Blastware's; the 64 KB bug narrowed
Brian's Blastware downloads of BE9441's 20 events give ground truth.  SFM's
re-run downloads of events 0, 1, 3, 4 and 10 are byte-identical to Blastware's
own files; imported first through the watcher route, the same events download
as already_stored (no duplicate rows -- the unit's 0C and Blastware's file agree
on serial + timestamp).  Fixtures: Blastware's P00/Q10 (now asserted equal to
SFM's builds) and QZ0/T80, the two page-crossing events, as byte-exact targets.

The 64 KB page bug, narrowed by a read-only test walk: carrying the page byte
addresses the first chunk in page 0x12 (answered), but the next request carries
a raw 0x03 inside its params (counter 0x032c) and gets no reply.  Pages after
0x11 have such counters; 0x11 does not (event 1 skips 0x0000-0x05FF).  Needs a
Blastware wire capture of event 2 or 19 (recorded in CLAUDE.md, the Series-III
reference and the spec).  No code change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-26 12:15:50 -04:00
serversdownandClaude Opus 5.5 1ded70fcd9 docs: the MiniMate re-run -- every in-page event verifies; the 'reboot' was our bare 0x02 checksum
Series-III reference: a 2026-10-26 row (5A checksum escape, measured), and the
2026-10-25 row's guessed cause of the mid-download reboot (battery, firmware)
retracted in place -- it was our request.  CRLF kept.  Spec: the re-run, item
by item, and what is still owed.  CLAUDE.md: the phase-1b bullet brought up to
date.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-26 01:19:46 -04:00
serversdownandClaude Opus 5.5 bf9e32cfc0 fix(minimateplus): a one-event download names an event that crosses the 64 KB page boundary
Bench re-run 2026-10-26: BE9441 events 2 (0111c92c) and 19 (0118a4ca) end in
the next page, so STRT's 16-bit end offset reads lower than the start.  The walk
then failed in bulk_waveform_term_v2 with a ValueError ('end_offset 0x2F06 must
be > last_chunk_counter 0xC92C') that the adapter's struct.error mapping did not
catch: a generic 500.  Strict mode now refuses such an event by name right
after the probe -- 'crosses the unit's 64 KB page boundary ... the known 5A
page bug; not saved' -- before any chunk is sent.  Not stored either way.  The
page bug itself is unchanged (CLAUDE.md: needs a BW capture of a spanning event).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-26 01:16:12 -04:00
serversdownandClaude Opus 5.5 d56dde768d fix(minimateplus): a 5A request's checksum is DLE-escaped when it is a framing byte
BE9441 never answered 5A chunk 0x7D06 of event 01122f06 -- twice (bench
2026-10-25 and 2026-10-26), each time rebooting ~11 s later.  The request ended
'... 02 03': build_5a_frame wrote the checksum bare, and 0x02 is STX.  Sent with
the checksum escaped ('10 02 03') the unit answered in 28 ms; so did chunk
0x7F06 (checksum 0x04) and 0x8B06 (0x10, which bare reads as DLE+ETX), and the
event downloaded whole and verified (21,504 x 3, peaks equal to the unit's).
Escape set {02, 03, 04, 10}: a Micromate's, measured on 251/251 THOR requests;
the MiniMate's own de-stuffing keeps 10 02/03/04 literal.  About 1 chunk
request in 64 has such a checksum, so roughly half of all multi-chunk downloads
hit one.

Not changed (no evidence either way): build_bw_frame escapes only 0x10 in its
checksum; a keyed read whose checksum is 02/03/04 is untested.  The BW 5A
byte-perfect tests skip on this box (captures absent) -- worth running where
they exist.  No codec, store or DB change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-26 01:14:42 -04:00
serversdownandClaude Opus 5.5 f34f5c3376 test(minimateplus): pin the BE9441 bodies and files byte for byte, and the TERM's header skip
Re-review of 64273c0: nothing pinned the TERM skip -- a TERM cut one byte off
loses a byte after the END record, invisible to every decode and peak check.
Golden sha256 of both fixtures' bodies and written files (event 0's file is
byte-identical to the one SFM stored at the bench before any fix; event 1's is
the bench's 25,810 bytes plus the 2 recovered), and a TERM moved to 0x1002.
The clipped-blast test now sits two steps past full scale (32032 counts), so it
needs the carve-out.  Spec: the TOOL_VERSION reason corrected (no stored file
is affected); a MicL-only waveform is now refused -- failing safe, bench-check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-25 19:01:36 -04:00
serversdownandClaude Opus 5.5 64273c07d3 docs(spec): the MiniMate fixes' review -- the changelog's operational note, a behaviour change, a bench-first item
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-25 18:52:42 -04:00
serversdownandClaude Opus 5.5 78617d47ce test(minimateplus): each strict-stream refusal has its own test; a re-poll always follows a SESSION_RESET
Review of 75d79ec / d73a27d (mutation): removing the chunk-timeout raise went
unnoticed because the TERM raise also said 'ended early', and the no-STRT,
metadata-page, mid-stream-terminator and chunk-cap raises had no test at all;
a re-poll without SESSION_RESET passed because the test double ignored it.
Each refusal is now pinned by its own message, each verified by removing it
(bytecode caching off -- same-second, same-size rewrites reuse a stale .pyc).
The strict tests use the shared replay helpers, which load either fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-25 18:52:23 -04:00
serversdownandClaude Opus 5.5 a7214c50de test: the Series-3 fake downloads a real event -- c32a9e7 was pushed with 4 tests failing
c32a9e7 made the download check read the 5A body; the Series-3 fake handed
back placeholder frames (['frame']), so 4 plumbing tests in
test_device_access_s3_events.py and test_device_access_event_dispatch.py
failed with "'str' object has no attribute 'data'" -- and that commit was
pushed without the failure set being read.  The fake's one-event download now
carries what a real one does: BE9441 event 1's recorded frames, their decoded
waveform and the unit's own peaks for it.  Those tests now see verified=True
on a whole event.  Suite back to the 16 known fixture failures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-25 18:49:44 -04:00
serversdownandClaude Opus 5.5 c32a9e7851 fix(sfm): a MiniMate download that decodes as nothing is refused, not stored as a histogram
Review of 36f4e5d (measured): with the metadata-page bug put back, 4 of 7
BE12599 non-first waveforms decoded to nothing, and the check stored them
unverified as 'a histogram' -- the worst form of the bug it was built for.
Now: no waveform decode must decode as a histogram (stored unverified) or it is
refused; a waveform's record chain must end on its END record (0x06), as the
file reader requires -- cut-short streams have none; the structure checks run
for every unit and only the peak comparison is limited to a unit confirmed in
normal range (geo_range == 0; an unread range is no longer assumed normal);
a clipped blast at full scale on both sides counts as a match.  Tests pin the
one-step tolerance, both ranges, the END record and the neither case.

No DB or schema change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-25 18:47:39 -04:00
serversdownandClaude Opus 5.5 ac34f80daa fix(minimateplus): every A5 header is 12 bytes once inner DLE pairs count as one -- the general rule
Review of 352f694: the metadata-page detection fixed every observed stream but
was one case of a general rule.  An A5 header is 12 bytes in the stripped sense
(TERM's 11); its raw length is 13 whenever the echoed address carries an inner
DLE pair -- the metadata pages at 0x1002 / 0x1004, but equally a sample chunk
or TERM boundary that lands there (inferred: ~1 in 128 events spanning
0x1000-0x1200, not in any capture).  _raw_skip() counts it per frame, the way
probe_skip already did; _has_metadata_pages is gone.  The reviewer measured
the rule reproducing the shipped bodies byte for byte on all 26 current-walk
streams on this box.  Test: a chunk moved to 0x1002 yields the same body.

No DB or schema change; TOOL_VERSION not bumped (the file builder changed, the
.h5 decode did not).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-25 18:45:44 -04:00
serversdownandClaude Opus 5.5 f6166b4b04 fix(minimateplus): the boot-aware first POLL resets the parser; a drained or long-trailed banner is seen
Review of d73a27d: _await_poll_or_boot no longer reset the parser and pending
frames the way _recv_one(reset_parser=True) did, so a reused protocol object
with half a frame left over failed startup (UnexpectedResponse A4 vs A5).
Restored.  Also: the banner check now runs before the tail is trimmed (a read
carrying >48 bytes after the banner lost it), and a banner caught during the
200 ms drain is reported, so startup goes straight to the re-poll loop instead
of the full timeout.  Tests for all three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-25 18:43:49 -04:00
serversdownandClaude Opus 5.5 151782365b docs: restore the Series-III reference's CRLF line endings; the pre-trigger is 0.25 s
3898d03 rewrote docs/instantel_protocol_reference.md with LF endings (a 7,327-line
diff for 3 added lines).  CRLF restored; the file's real change is the 3 lines.
Also: BE9441's 21,504 samples are 5 s record + 0.25 s pre-trigger at 4096 sps,
not '+ 1 s' (reference row, fixture README, test comment).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-25 18:41:53 -04:00
serversdownandClaude Opus 5.5 3898d03236 docs: the first MiniMate bench run -- four bugs found, what remains of the check
Series-III reference: the 0x15 serial is a C string (BE9441's "BE9441\x00?"),
A5 replies echo their address at data[2:6] (metadata pages only on the
event-1 walk), the unit boots on serial-port open (banner ~3 s, answered 8.8 s
after a reboot's banner), one mid-download reboot, and 24 index entries vs 20
listed events (inferred: monitor-log entries).  Spec: the MiniMate check's
first run, item by item, and what is still owed.  CLAUDE.md: the phase-1b
"unproven" line retracted in place, with the four bugs and the re-run owed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-25 18:19:14 -04:00
serversdownandClaude Opus 5.5 d73a27d2e3 fix(minimateplus): a MiniMate that boots on connect is waited for, not given up on
BE9441 on a serial cable (bench, 2026-10-25) twice sent "Operating System"
~3 s after the port opened and ignored the POLL sent before it; the request
then failed at the full receive timeout (502 after 15 s on /device/info, 504
after 120 s on a download).  After a mid-download reboot it answered 8.8 s
after its banner -- the one measured readiness point.

startup()'s first POLL now stops waiting the moment the banner arrives (that
POLL will never be answered) and polls again every 2 s for up to 20 s.  Without
a banner nothing changes: a silent unit fails at the normal timeout, with no
re-polling.  Only SESSION_RESET and POLL are sent, so this is safe in front of
the change path too.

No codec, store or DB change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-25 18:17:09 -04:00
serversdownandClaude Opus 5.5 36f4e5d985 feat(sfm): a MiniMate download is checked against the unit's own peaks before it is stored
Series 4 downloads were checked (decoded PVS against the unit's); Series 3's
were stored unchecked (verified=None), so BE9441's two bad files went in as
successes at the bench (2026-10-25).  verify_s3_download(): if the waveform
decodes, all three geophone channels must be the same length and each peak must
be the unit's own 0C peak to one 0.005 in/s step, or the download is refused
(MalformedReply, "not saved").  Unverified (stored, as before): no waveform
decode -- a histogram; 0 of ~430 fixture histograms decode as one -- or a
sensitive-range unit, whose scale is still open.  The reason goes in
detail["check"].

A test puts the metadata-page bug back and the check refuses the file it
produced.  Session-replay helpers move to tests/minimate_replay.py.

No codec, store or DB change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-25 18:14:44 -04:00
serversdownandClaude Opus 5.5 75d79ece6c fix(minimateplus): a one-event download is whole or it is an error
BE9441 rebooted mid-download at the bench (2026-10-25): the chunk at 0x7D06
got one stray byte and then silence, the 5A loop logged "unexpected end-of-
stream -- proceeding to TERM", the TERM got no reply either, and the short event
(17,920 / 17,920 / 17,408 of 21,504 samples) was stored as a success.

read_bulk_waveform_stream(strict=True) now raises on every early end: no STRT,
a metadata page or chunk with no reply, a mid-stream terminator, the chunk cap,
or no TERM reply.  get_events passes it for the strict walks (headers_only,
only_key) and, in strict mode, re-raises a 5A error instead of logging
"metadata unavailable" and returning the event without frames.  The legacy
full walk is unchanged, call for call (strict passed only when on).

Tests replay BE9441's recorded session through the real MiniMateClient: whole,
event 1 comes back in full; with the 5A stream quiet from chunk 40 while the
walk is still answered -- the bench's reboot -- it raises "ended early".

No codec, store or DB change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-25 18:11:13 -04:00
serversdownandClaude Opus 5.5 352f6944e7 fix(minimateplus): a non-first event's 5A stream has no metadata pages -- stop cutting 2 bytes
extract_body_bytes() and write_blastware_file() skipped 13 bytes on A5 frames
1 and 2 unconditionally, as if they were the global metadata pages (0x1002,
0x1004).  Only the event-1 walk fetches those; a non-first event goes straight
from the probe to sample chunks (skip 12), so every non-first event SFM built
lost two bytes and decoded truncated (BE9441 event 1: 1,024 / 2,782 / 512
samples instead of 21,504, peaks far low).  Frames now say which they are: each
A5 reply echoes its address, and both 0x1002 at frame 1 and 0x1004 at frame 2
must match.  Rebuilt from the bench's logged bytes, event 1 decodes 21,504 x 3
with peaks equal to the unit's own 0C values.

Fixtures: BE9441's raw replies for events 0 and 1 (force-added).

Operational: affects only Series-3 files SFM assembled itself (live downloads,
bridges/ach_server.py) for non-first events -- not Blastware's own files, which
is what the production store ingests.  Such files are two bytes short; their
.a5.pkl sidecars can rebuild them.  No DB or schema change; codec unchanged
(TOOL_VERSION not bumped).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-25 18:05:44 -04:00