Commit Graph
765 Commits
Author SHA1 Message Date
serversdownandClaude Opus 5.5 dbd8a91661 fix(sfm): wake a MiniMate before the read-back reconnect reads its serial (#9 review)
The reconnect in ce441a0 opened a fresh connection and sent a bare 0x15 (the
identity check) before any SESSION_RESET + POLL.  It exists for a unit that has
just started -- sensor check, then monitoring -- and a monitoring MiniMate
ignores a bare request until woken (measured 2026-04-08), so the identity read
would have timed out and the start reported unconfirmed anyway.  Now: open,
wake (the same retried wake the read-back uses), read the serial, read 0x1C --
the order the status read and the legacy write routes use.  Still one
reconnect, TCP only, nothing re-sent.

The fake gains bare_requests_ignored (off unless a test asks): a fresh
connection's reads time out, with the real client's TimeoutError, until woken.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 23:56:44 -04:00
serversdownandClaude Opus 5.5 1626e521ae docs: 1c bench Batch 1 -- #1, #8, #9 fixed; #15 retracted; the 1A layout after unescaping
- Spec (Left open by the 1c bench): #1 b320a53, #8 9492e49, #9 ce441a0, #2 via the
  dev merge 342c696; #15 retracted in place (sent NULL = unknown, by design).
- Series-III reference: a 2026-10-29 row -- the SUB 1A settings fields read after
  unescaping (mode -7, rate -6, interval -4, record time +6), the old
  'anchor-7 constant 0x10' was the escape before 04 at 1024 sps, the channel
  block stays on raw bytes (open: a float containing an escapable byte), and a
  monitoring BE9441 answers 1A with its device-info block.  CRLF kept.
- CLAUDE.md: Batch 1 status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 23:28:39 -04:00
serversdownandClaude Opus 5.5 9492e49400 fix(sfm): store a MiniMate download through the Blastware-file import path, as production does (#8)
A live Series-3 download was stored from the live 5A decode (store.save): a
histogram got no samples and nothing to plot (bench 2026-10-29).  The download
now carries the assembled Blastware file (DownloadedEvent.bw_bytes, built by the
new blastware_file_bytes -- byte-identical to Blastware's own K441LTON.900 and
K441LTOK.R10), and persist_download stores it through save_imported_bw, the
path the watcher uses for Blastware's files, the way Series 4 already uses
save_imported_idf.  The event is decoded from the file: histogram samples,
setup-block sample rate and record time (#44/#45).  source.kind is 'sfm-live'.

The file path does not yet read three things right (measured on BE9441): a
histogram's vector sum (0.503 where Blastware and the unit say 0.385 -- the
decode checker's open finding), the mic peak (0), and a sensitive range.  So the
unit's own 0C channel peaks, mic and vector sum are overlaid, as Series 4 does,
except an impossible vector sum (below the largest channel; BE9441's 0C read
-0.0, bench #4), and the unit's range is passed through for the stored samples.

Store consequence: new live MiniMate downloads only; existing rows and files are
untouched; no backfill, no migration.  The record type still reads 'Waveform'
for a live histogram until #41 (record type from STRT[18]) lands from the decode
checker's branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 23:27:44 -04:00
serversdownandClaude Opus 5.5 ce441a0911 fix(sfm): a MiniMate start's read-back reconnects once when the modem dropped the line (#9)
BE9441 over a modem, 2026-10-29: the start was acked, but the modem closed the
line during the ~30 s sensor check, so the read-back's first wake hit
'[Errno 32] Broken pipe' and the change was reported 503 'not checked' although
the unit was monitoring.  On an OSError in the read-back, a TCP unit is now
reconnected once, its serial checked against the named unit, and its state read.
Nothing is re-sent: the start still goes out exactly once.  A serial cable is
never reconnected (opening a MiniMate's port reboots it), a second failure or a
silence (a cleanly closed line) ends 'not checked' as before, and a different
unit after the reconnect is refused (409, change unconfirmed).

Store consequence: none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 23:21:27 -04:00
serversdownandClaude Opus 5.5 b320a534bc fix(minimateplus): read a MiniMate's mode, sample rate, interval and record time after removing escapes (#1)
The unit escapes 02/03/04/10 in every reply and S3FrameParser keeps the 10 of
10 02/03/04, so on the raw SUB 1A bytes an escaped mode, rate or interval
shifted every field after it: BE9441 at Histogram / 4096 sps / 2 s read back as
0 sps and a 4098 s interval (bench 2026-10-29), and a Continuous unit read as
Single Shot.  The four anchor fields are now read from unescape_reply(data):
mode anchor-7, sample rate anchor-6, interval anchor-4, record time anchor+6 --
measured on all four distinct recorded replies, two of them Blastware's own
writes (15 min, then 2 s).  The old 'anchor-7 = constant 0x10' was the escape
before 04 at 1024 sps.

The channel block and strings still read the raw bytes: their label offsets were
measured there and are wrong unescaped (pinned by a test).  A reply with no
anchor -- BE9441's monitoring-time 1A answer was its device-info block -- leaves
all four None.

Store consequence: none; this is the live settings read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 23:19:11 -04:00
serversdownandClaude Opus 5.5 0dbd0b506d docs(plan): 1c bench fixes, Batch 1 -- #1 settings decode, #9 read-back reconnect, #8 downloads via the file import path; #15 retracted
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 23:08:56 -04:00
serversdownandClaude Opus 5.5 342c69602d merge: dev into feat/series4-sfm-parity -- v0.32.0, #42, #47/#49, #44/#45, the S3 decode checker
Brings the branch up to dev (41 commits) before the 1c bench fixes, which
touch code dev changed: the histogram reader (#47/#49, bench finding #2), the
v0.32.0 event-time rules, the Blastware file's setup-block fields (#44/#45),
and the decode checker for verifying stored S3 downloads.

One conflict: the top of the Series-III reference's change table -- both sides
added rows; kept all, in date order, CRLF preserved.  CLAUDE.md, README,
blastware_file.py, models.py and database.py merged cleanly.  Suite: the known
16 failures only (15 test_bw_ascii_report, test_save_imported_bw_without_report_
works_unchanged, which also fails on dev); 1237 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 22:51:42 -04:00
serversdownandClaude Opus 5.5 b92c8e489e docs(changelog): Unreleased -- the Series 3 decode checker, and the corrected #53 note
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 22:46:08 -04:00
serversdownandClaude Opus 5.5 fed6489330 merge: the Series 3 decode checker -- SFM's file-only decode against Blastware's XML reports
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 22:45:24 -04:00
serversdownandClaude Opus 5.5 335f70ff46 docs: the Micromate line hold stays for now; SFM handling call-ins is the long-term fix
Brian, 2026-10-29: not expected to be a problem in practice.  Settles the 1c
ring-path merge gate; Run B stays open, not blocking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-29 21:02:20 -04:00
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 c0d837c14f fix(checker): final-review fixes -- regressions, baselines, the PVS carve-out, the headline
- A matching event that now fails outright is a regression: compare_runs
  walks the previous run's matching rows, so a check that collapses to
  one error row no longer hides every field it used to match.  Counts
  moved are taken over the events both runs checked.
- The default baseline is the newest completed run (run.json written) of
  the same scope; a 2,000-event sample is no baseline for a full run.
  changes.md names the previous run's scope.
- The PVS saturation carve-out now needs Blastware's OORANGE, a channel
  Blastware clamped at SFM's ceiling, and SFM's sum within three channels
  at the ceiling -- an unclipped Sensitive-range channel read 8x can no
  longer let an 8x sum through.
- 'Fields fully matching' needs a match: an always-empty element proves
  nothing.  Events without a report are a line of their own.
- CLAUDE.md: histogram PVS described correctly; 35 sub-minute histograms
  plus 2 one-minute no-mic ones, not '~37 sub-minute'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 20:11:33 -04:00
serversdownandClaude Opus 5.5 e9d352ad99 docs: the decode checker's first full run; correct the #53 note
First full run over DL2's 70,042 report-paired events (22 min, --jobs 4):
every expectation the spec set holds.  Setup and notes match everywhere;
geophone samples are exact on 6,491/6,524 waveforms across 2016-2026,
the other 33 being the 1.250 in/s range read 8x on SFM's Normal
assumption; every histogram is typed as a waveform without its filename
(#41); the three #53 files are the only waveform time mismatches.  New
findings: histogram PVS, mic psi, mic dB on ~1,000 events, ~37
sub-minute histograms, 26 histogram start dates.

The #53 note is corrected in place: those files decode as waveforms with
Blastware's full sample count; only their time falls back to the footer
start.  scratch/verify_bw_fields_against_xml.py is retired -- the
checker replaces it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 19:55:07 -04:00
serversdownandClaude Opus 5.5 c8fc649568 tooling(scratch): decode-check run-to-run changes and a one-event view
Each run is diffed against the previous one (--compare-to, or the newest
other run in ~/dl2-archive/checker-runs): changes.md lists every
(event, field) that matched before and no longer does, how many now
match, and how each field's counts moved; summary.md leads with the
regression count.  --file NAME checks one event and prints its table,
writing no run folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 19:30:53 -04:00
serversdownandClaude Opus 5.5 5e85cf1018 tooling(scratch): decode-check summary and grouped detail report
summary.md for Brian: per field, events per verdict, how many fields
fully match, non-matches by event year, carve-out counts.  details.json
for Claude: each non-matching (field, verdict) with the attribute values
its failures concentrate in (>= 10% of the failures; concentrated at
>= 95% of compared events) and example events, each with a one-event
re-run command.  On a 2,000-event sample the event-type mismatches group
as 'type = Full Histogram, 1815/1815' -- #41, named by the report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 19:30:00 -04:00
serversdownandClaude Opus 5.5 5b48be3f25 tooling(scratch): run the decode check over the archive in parallel
check_s3_decode.py pairs each Series 3 event file with its _XML.XML
report (deduped by basename -- Sent/ mirrors the root), checks each in a
process pool, and writes results.jsonl.gz and run.json to a run folder
outside the repo.  A missing report or any failure is one row for that
event; the run goes on.  Partial runs by serial, year, type, field
prefix or random sample.

Timing: --sample 2000 --jobs 4 took 35 s on tmi-dev (~20 min projected
for all 70,042).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 19:28:50 -04:00
serversdownandClaude Opus 5.5 ff7dd908a7 feat(codec): carve-outs for proven Blastware differences -- saturation first
A mismatch becomes 'accepted' only through a written carve-out whose
evidence does not rest on SFM's output.  Saturation: Blastware clamps a
clipped channel to the range maximum and prints OORANGE, while the file
holds counts past full scale.  SFM's value must sit at the ceiling
(r - 0.0006 .. r * 1.01), so a Sensitive-range event read 8x high on
SFM's Normal assumption stays a mismatch; a vector sum is accepted when
a clipped channel under it is at the ceiling.  series_pairs() is now the
one place waveform rows and interval columns are paired.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 19:27:01 -04:00
serversdownandClaude Opus 5.5 3662d2fac1 feat(codec): compare SFM's file-only decode with Blastware's XML, field by field
Every field the report carries (bar its format version and Blastware's
file name), the notes in order, the job number, the channel list, every
waveform sample and every histogram interval column.  Numbers match at
Blastware's printed precision, halves rounding away from zero; N/A and
empty text are no_reference; >100 needs SFM's above-range flag; OORANGE
is a mismatch unless a carve-out says otherwise.  Waveform rows pair
cells with the channels still running, so channels that end early
(T438HGTZ.B30W) match, and any row-length disagreement is counted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 19:26:00 -04:00
serversdownandClaude Opus 5.5 3e69a2acdd feat(codec): SFM's side of the decode check, from the event bytes alone
decode_blastware_bytes with no filename and no report: the values SFM
produces today in Blastware's field names, its notes, channels and raw
counts, with its Normal-range assumption kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 19:24:31 -04:00
serversdownandClaude Opus 5.5 52809a5310 feat(codec): parse Blastware's _XML.XML event report
The reference for the Series 3 decode checker: scalars and value units,
channels, the job number, the user notes in order under their
operator-edited labels, waveform rows as printed (ragged where channels
end at different lengths) and histogram intervals.  Seven real DL2
events as fixtures, each covering a case the comparison must handle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 19:23:43 -04:00
serversdownandClaude Opus 5.5 b023083c79 docs(changelog): T438HGTZ.B30W is not a decoder truncation
Its Tran, Vert and MicL end 3 samples before Long in Blastware's own XML
sample table as well; the setup-field harness compared Tran's length with
the table's row count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 18:30:27 -04:00
serversdownandClaude Opus 5.5 6bdd140c29 docs(plan): the Series 3 decode checker, task by task -- and T438HGTZ is not truncated
Eight tasks: the XML report parser, SFM's side from the bytes alone, the
field-by-field comparison, carve-outs (saturation first), the parallel
runner, the summary and grouped detail report, run-to-run changes with a
one-event view, and the first full run checked against what is known.

While pinning the plan's test values on real files: T438HGTZ.B30W, called
"3 samples short" by the setup-field harness, matches Blastware exactly.
Its Tran, Vert and MicL end 3 samples before Long, and Blastware's own
sample table does the same -- its last three rows carry only the Long cell.
The harness compared Tran's length with the table's row count.  The spec
now says so, and the plan compares samples row by row by running channel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 18:30:08 -04:00
serversdownandClaude Opus 5.5 af703808db docs(spec): the Series 3 decode checker -- SFM's file-only decode against Blastware's XML reports
The first of four pieces toward SFM producing everything Blastware reports
from the event file alone: compare every field, sample and histogram
interval with DL2's 70,042 _XML.XML reports (2016-2026), report what
matches, what doesn't and what SFM can't produce yet, grouped for
diagnosis, run after run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 17:47:34 -04:00
serversdownandClaude Opus 5.5 29c8e2b034 docs(changelog): Unreleased — Blastware file-only setup and notes (#44, #45), the XML checker
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 17:30:45 -04:00
serversdownandClaude Opus 5.5 42fe35f3b3 merge: a Blastware file's setup and notes from its recording-setup block (#44, #45)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 17:30:31 -04:00
serversdownandClaude Opus 5.5 6def0d1f41 docs: park the event importer; DL2's XML reports reach back to 2016, its ASCII pairs only to 2025
- README roadmap, Ingestion gaps: a bulk importer for event files on disk,
  parked -- one of the four ways events should reach SFM.
- CLAUDE.md: the 14,338 ASCII pairs were described as "back to 2018"; they
  are all 2025-26 events.  Corrected in place.  DL2's Sent/ _XML.XML files
  are Blastware's full event reports, samples included, for 70,042 events
  back to 2016 -- the reference for proving SFM's file-only decode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 17:21:26 -04:00
serversdownandClaude Opus 5.5 f46afafdb4 tooling(scratch): check file-only setup and note fields against Blastware's XML reports
verify_bw_fields_against_xml.py decodes each Blastware event file the way
ingest does, without a report, and compares sample rate, record time,
pre-trigger, sample count, the four notes and the job number with the
event's _XML.XML report -- Blastware's full event report, which DL2 kept
for 70,042 events back to 2016 (ASCII reports exist only for 2025-26).
Every disagreement counts against SFM; there is no carve-out list yet.
The first piece of the decode checker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 17:20:47 -04:00
serversdownandClaude Opus 5.5 b4706a30f0 fix(decode): a Blastware file's setup and notes come from its recording-setup block (#44, #45)
Without a paired ASCII report, a Blastware import stored no sample rate,
the record-type byte as its record time (every waveform read "70 s"), a
pre-trigger and sample count read from STRT bytes that are neither, and
blank notes (the reader stopped at the NUL after each label).

- The recording-setup block is found by structure -- 1c 08, the setup
  name, NUL -- not by the name "Standard Recording Setup", which 37% of
  DL2's files do not use.  One match in each of 70,041 archive files.
- Sample rate (uint16 BE, name-42), pre-trigger (f32 BE, name-36) and
  record time (f32 BE, name-30).  A waveform's sample count is the
  decoded count.  A histogram gets a sample rate only: Blastware reports
  neither a record time nor a pre-trigger for one.
- The setup name and the four user notes by position, as bw_ascii_report
  reads them: the labels are operator-editable ("Seis. Loc:",
  "Location:", "Project: ").
- STRT now yields only the waveform key.

Verified against Blastware's own _XML.XML event reports for the 70,042
DL2 archive events that have one (2016-2026): sample rate 70,042/70,042,
record time 6,524/6,524, pre-trigger 6,484/6,484, notes 70,042/70,042,
sample count 6,523/6,524 (one waveform the decoder ends 3 samples short;
separate).  Events imported with an ASCII report are unchanged -- the
report still overlays.

Not changed: the waveform-time estimate still finds the record time by
the marker; moving it would add a validation constraint for 37% of files
and is to be measured first.  The job number is not read yet (2,997
archive events carry one).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 17:20:39 -04:00
serversdown a8c91809a6 chore(git): ignore symlinked example-events directory 2026-10-29 15:49:37 -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 184a03a5cd docs(changelog): Unreleased — tier model superseded by Terra-View ADR 0003
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MUHR251NLznsFvPSrfegqL
2026-10-27 18:50:02 -04:00
serversdownandClaude Opus 5.5 560869ed61 merge: the SFM/SDM tier model marked superseded by Terra-View ADR 0003
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MUHR251NLznsFvPSrfegqL
2026-10-27 18:50:02 -04:00
serversdownandClaude Opus 5.5 b69ff4171d docs(claude): mark the SFM/SDM tier model superseded by Terra-View ADR 0003
SFM is the whole seismograph module and "SDM" is retired; the codec
library stays pure; lab tools leave the production image and are ported
into sfm/ when they become production tools; the call-in server becomes
SFM's front door; the repo becomes `sfm` after the parity branch merges.
The old section stays in place below the banner as history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MUHR251NLznsFvPSrfegqL
2026-10-27 15:04:02 -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