Release v0.36.0 — Micromate events from the file alone, and three loose ends tied #61

Merged
serversdown merged 16 commits from dev into main 2026-12-03 16:07:23 -05:00
Owner

v0.36.0: Micromate events from the file alone, and three loose ends tied

Full detail in CHANGELOG.md → v0.36.0.

Micromate files (#44, #45). SFM reads a Thor file's own settings, notes and event time.

  • Its own Micromate downloads no longer store a sample rate, pre-trigger and record time of 0, blank notes, or a 1970 date.
  • Every Micromate .h5 now carries its pre-trigger. It had been 0, report or not.
  • Measured against Thor's own reports on 2,027 corpus files: sample rate and notes 2,027 / 2,027; record time and pre-trigger 291 / 291 waveforms; event time = filename 2,384 / 2,384.

MiniMate settings (#48). The legacy settings decode reads by position, not by a "stable anchor" that was really the pre-trigger and stop mode. It never struck: all 70,041 DL2 events were recorded in Fixed stop mode.

Housekeeping.

  • A fresh checkout passes the whole test suite on its own.
  • The bridges/ bench tools leave the production image. The database volume stays at /app/bridges/captures.

Fixes #44
Fixes #45
Fixes #48

Deploy

⚠ A Thor-only backfill, no schema change. This has not been rehearsed on a prod snapshot.

  1. Back up seismo_relay.db.
  2. Deploy.
  3. In the sfm container, run python scripts/backfill_thor_events.py --dry-run, then the same without --dry-run. TOOL_VERSION 0.36.0 gates the regeneration, so no --force is needed.
  4. ⚠ Do not run backfill_sidecars.py or backfill_event_shape.py. The Series-3 decode did not change. The version bump would make backfill_sidecars.py regenerate every Series-3 event (~8 h) for nothing.

What changes in Terra-View (no Terra-View change is needed): a Micromate waveform chart's time axis now has 0 at the trigger rather than at the first sample, as MiniMate charts already do.

Tests

dev at 0d9eb51: 1,806 passed, 0 failed, 0 skipped.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ALX2R9LdWawLzUxwewZGA1

## v0.36.0: Micromate events from the file alone, and three loose ends tied Full detail in `CHANGELOG.md` → v0.36.0. **Micromate files (#44, #45).** SFM reads a Thor file's own settings, notes and event time. - Its own Micromate downloads no longer store a sample rate, pre-trigger and record time of 0, blank notes, or a 1970 date. - Every Micromate `.h5` now carries its pre-trigger. It had been 0, report or not. - Measured against Thor's own reports on 2,027 corpus files: sample rate and notes 2,027 / 2,027; record time and pre-trigger 291 / 291 waveforms; event time = filename 2,384 / 2,384. **MiniMate settings (#48).** The legacy settings decode reads by position, not by a "stable anchor" that was really the pre-trigger and stop mode. It never struck: all 70,041 DL2 events were recorded in Fixed stop mode. **Housekeeping.** - A fresh checkout passes the whole test suite on its own. - The `bridges/` bench tools leave the production image. The database volume stays at `/app/bridges/captures`. Fixes #44 Fixes #45 Fixes #48 ## Deploy ⚠ **A Thor-only backfill, no schema change.** This has not been rehearsed on a prod snapshot. 1. Back up `seismo_relay.db`. 2. Deploy. 3. In the `sfm` container, run `python scripts/backfill_thor_events.py --dry-run`, then the same without `--dry-run`. `TOOL_VERSION` 0.36.0 gates the regeneration, so no `--force` is needed. 4. ⚠ **Do not run `backfill_sidecars.py` or `backfill_event_shape.py`.** The Series-3 decode did not change. The version bump would make `backfill_sidecars.py` regenerate every Series-3 event (~8 h) for nothing. **What changes in Terra-View** (no Terra-View change is needed): a Micromate waveform chart's time axis now has 0 at the trigger rather than at the first sample, as MiniMate charts already do. ## Tests `dev` at `0d9eb51`: 1,806 passed, 0 failed, 0 skipped. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ALX2R9LdWawLzUxwewZGA1
serversdown added 15 commits 2026-12-03 15:29:57 -05:00
A fresh checkout of dev failed 10 tests, errored 3 and skipped 64: the
tests read 100 files that were only on the dev box.  Recorded with an
audit hook over a full run: 100 files, 2.3 MB, out of 1.1 GB of
bridges/captures/ and 45 MB of histogram-extension-re/.

- Force-added in place: tests/fixtures/thor-idf (14), histogram-multi-
  interval (2) and the one histogram-extension-re file read.
- Copied into tests/fixtures/example-events/ (10) and
  tests/fixtures/captures/ (73, from bridges/captures/), and the tests
  pointed there.
- The presence skips ('not on this machine', 'gitignored', 'fixture
  missing') are gone: a missing fixture now fails instead of skipping.

The worktree now runs as the dev box does: 1,787 passed, 0 failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
httpx is FastAPI's TestClient transport; without it
tests/test_db_snapshot_endpoints.py skipped its 3 tests everywhere.
`pip install -e .[test]` now brings what the suite needs.  The
runtime requirements are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Its 19 tests pinned the May 2026 5A model -- a raw offset_hi 0x10,
11-byte params, metadata pages at 0x1002 / 0x1004 -- retracted on
2026-10-26, and the 5-1-26 capture they read no longer exists on the dev
box, so they skipped everywhere.  tests/test_5a_blastware_walk.py
replaced them: all 540 of Blastware's 5A requests rebuilt from tracked
fixtures.  Removed with them, from framing.py, the four helpers marked
'superseded, no production caller, kept for test_5a_protocol.py':
build_5a_frame, bulk_waveform_params, bulk_waveform_term_params,
bulk_waveform_term_v2.  parse_strt_end_offset stays: test_5a_blastware_
walk.py uses it to show the old misread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
- scripts/backfill_event_zc_freq.py copied ZC frequency from Blastware
  reports into the DB; the decoder reads it from the file since v0.35.0,
  whose backfill refreshed every row.  Its two tests go with it; the DB
  column tests in test_zc_freq_columns.py stay.
- scripts/backfill_record_type.py: a one-time fix from May; the record
  type is read from the file since v0.33.0.
- scripts/test_thor_render.py: a one-off re-import of two prod Thor files
  (May); nothing referenced it.
- scratch/next_experiment_skeleton.py: codec research scaffolding from
  before the codec was solved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
The bench and lab tools (MITM proxy, the old ACH servers, probes, link
simulator) were copied into the SFM image and installed as a package,
though SFM imports nothing from them (ADR 0003: lab tools leave the
image).  Dockerfile and the package list now carry minimateplus,
micromate, sfm and scripts only; the backfills still run in the
container.  Checked: the image builds, sfm.server and the backfill /
import scripts import inside it.  Tests that use bridges/ run from a
checkout, unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Copy what a test needs from bridges/captures/ or example-events/ into
tests/fixtures/ (git add -f), never guard a fixture with a skip, and
check with a fresh worktree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
A Micromate event read without Thor's report (SFM's own downloads) came out
with sample rate, pre-trigger and record time 0, empty notes, and a
1970-01-01 time; every Micromate .h5, report or not, stored pre-trigger 0.

- The settings were found by the bytes be 80 00 00 00 00 -- a -0.25 s
  pre-trigger and Fixed stop mode, not a marker -- so any other pre-trigger
  left them unread.  The event's settings record is now found by its own
  signature 00 2a 04 00 00 (fields at the live 0x1A block's head offsets).
- The event time is read at settings record + 0x34, not two fixed offsets
  that miss a header shape.
- The four notes are read at 0x23c ([label 22][value 42] x 4).
- IdfEvent.to_minimateplus_event sets pretrig_samples.
- save_imported_idf fills the pre-trigger and notes from the file when the
  report lacks them.

Measured against Thor's own reports on 2,027 corpus files: sample rate and
notes 2,027 / 2,027; record time and pre-trigger 291 / 291 waveforms; event
time = filename on 2,384 / 2,384.  The issues' 20 UM12947 bench files now
store 4096 S/s, 4096 pre-trigger samples (1.0 s), 3 s and their notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R9LdWawLzUxwewZGA1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R9LdWawLzUxwewZGA1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R9LdWawLzUxwewZGA1
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R9LdWawLzUxwewZGA1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R9LdWawLzUxwewZGA1
CHANGELOG: Unreleased -> v0.35.1 (2026-12-03), with its theme and a
Migration: a Thor-only backfill (scripts/backfill_thor_events.py); do NOT
run backfill_sidecars.py (the Series-3 decode did not change).
pyproject, README, CLAUDE.md -> 0.35.1.  TOOL_VERSION -> 0.35.1: the Thor
codec changed (#44, #45), which gates backfill_thor_events' regeneration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R9LdWawLzUxwewZGA1
serversdown added 1 commit 2026-12-03 15:40:54 -05:00
Every release since v0.23.0 has been a minor bump, and this one takes the
bench tools and four scripts out of the image: v0.36.0, not v0.35.1.
Version strings only (CHANGELOG, README, CLAUDE.md, pyproject,
TOOL_VERSION); the content and the deploy steps are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R9LdWawLzUxwewZGA1
serversdown changed title from Release v0.35.1 — Micromate events from the file alone, and three loose ends tied to Release v0.36.0 — Micromate events from the file alone, and three loose ends tied 2026-12-03 15:40:58 -05:00
serversdown merged commit ab3bab764a into main 2026-12-03 16:07:23 -05:00
Sign in to join this conversation.