Commit Graph
8 Commits
Author SHA1 Message Date
serversdownandClaude Opus 5.5 eada7ba767 feat(sfm): start/stop monitoring for Series 4 -- identity, state, dry run, audit, read-back, never retried
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-23 16:29:03 -04:00
serversdownandClaude Opus 5.5 4e1e6a9d5c fix(sfm): Series-3 events list with no record type, not a wrong one
minimateplus's _extract_record_type returns "Waveform" for every 0C
record layout -- it cannot tell a histogram -- so a MiniMate histogram
was listed as "waveform".  The fake's "Histogram" was a value the real
client never produces, which is why no test saw it.

- _s3_ref: record_type is always None, with
  detail.record_type_note = "Series 3's event record does not say
  waveform or histogram; not decoded yet".
- default_s3_events(): both events "Waveform", as the real client gives.
- The shared-shape contract test allows exactly {"record_type"} to be
  None for Series 3 and nothing for Series 4.

Rows SFM stores for Series 3 still carry "Waveform" from the decode (the
same as the legacy blastware_file route); parked in the spec.  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-21 17:40:26 -04:00
serversdownandClaude Opus 5.5 59dff06f1c fix(sfm): the Series-3 header walk fails loudly, and listing uses the normal timeout
One lost 1F reply made the list return 1 of 3 events as a 200, and on a
download gave a false 404.  The list also ran on the 120 s download
timeout, so each lost reply stalled the walk 120 s with the unit locked.

- get_events() strict mode (headers_only, or only_key): a lost 0A reply,
  a lost 1F(browse) reply on the success path and on the partial-record
  path all re-raise their ProtocolError; a 1F that hands back a key
  already walked raises ProtocolError("event chain did not advance ...").
  Legacy calls (none of the new options) behave exactly as before --
  pinned by tests of the same three faults under get_events().
- Series3Adapter.list_events runs on the default timeout (10 s on TCP);
  download_event keeps 120 s.
- FakeProto gains optional lost-reply injection; its default is unchanged.

The repeat-key guard sits at the loop head, which is reached only for a
non-null key -- equivalent to checking each 1F's key, in one place.

Read-only; nothing new on the wire.  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-21 17:39:54 -04:00
serversdownandClaude Opus 5.5 01b9188f25 fix(sfm): a stale Series-3 id is refused before the full download, not after
Series3Adapter.download_event compared the timestamp only after
download_event_by_key had run the whole 5A.  A stale id cost a full
download of the wrong event (minutes on cellular), could surface the
64 KB-page 502 instead of 409, and a lost 0C reply was reported as "the
unit was erased".

- get_events() gains only_key_timestamp: with only_key, if the target's 0C
  says another time (or none), the target takes the existing bypass --
  no 1F(arm), no POLL, no 5A.  A new branch only; it adds no command.
- download_event_by_key(key4, *, expected_timestamp=None) passes it on.
- The adapter converts the id's stamp to that ISO form and checks, in
  order: no event -> 404; no readable 0C timestamp -> 502 MalformedReply
  ("could not read ... record (0C)"); a different time -> 409 StaleEvent;
  no frames -> 502.
- The fake's download mirrors the real walk (no frames on a mismatch) and
  records what it was asked for.
- Legacy get_events() (none of the new options) is pinned by a test of
  its exact call sequence and 5A arguments, written before the change.

Read-only; nothing new on the wire.  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-21 17:38:34 -04:00
serversdownandClaude Opus 5.5 ef096e3082 fix(sfm): a download never downgrades a stored event -- an existing row is returned, nothing written
THOR's watcher (and Blastware's ACH) store every event through
/db/import/idf_file and /db/import/blastware_file, with the paired report.
Storing a download of the same event afterwards overwrote that richer copy:
on Series 4 the file, .h5 and sidecar were rewritten (extensions dropped);
on Series 3 the row lost PVS, project strings and ZC frequencies and was
repointed at a second, review-less file set.

persist_download now looks up (serial, timestamp) first.  A row there is
returned as it stands -- inserted false, detail.already_stored true -- with
no store call, no insert_events and no sidecar write.  Never merge.

- DownloadedEvent gains `timestamp` (the unit's own event time) and
  `record` (Series 4's 0x0C fields); both adapters set them.
- The Series-3 `event is None` guard now runs before backfill/save, with a
  message that is true there ("nothing was stored").
- Tests build the watcher's state exactly as the import endpoints do and
  prove the row dict, the sidecar bytes and the file mtimes are unchanged.

No schema change, no migration, no codec change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-21 17:35:23 -04:00
serversdownandClaude Opus 5.5 b79309eb72 feat(sfm): Series-3 events -- header list, one-event download, stale ids refused
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-21 16:57:26 -04:00
serversdownandClaude Opus 5.5 d39f8ef360 fix(sfm): Series-3 status says its serial is unverified
Series 3 status reads no serial, so the serial shown is the requested one, not one the unit reported. detail now carries serial_verified=False.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-21 01:12:17 -04:00
serversdownandClaude Opus 5.5 5c6ca049c8 feat(sfm): Series-3 adapter -- identify, status, settings into the shared models
Connect-per-request with the TCP cold-boot retry kept; a different unit answering is refused (409) whenever the serial is already in hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
2026-10-21 01:10:23 -04:00