fix(settings): final-review fixes -- revision, resulting limits, logical writes

From the whole-branch review of phase 5:
- The preview's revision now covers the changes asked for, so a live
  change must be exactly what was previewed (any API caller, not only the
  page).  It covers what the preview showed -- the settings block (and a
  Micromate's setup name) -- not the blocks a write only echoes, which are
  re-read at send and sent as read (a MiniMate's trigger block byte 5
  differs by session, #46).
- The units' limits hold on the block that would result: a range, rate or
  mode change alone can no longer leave a held trigger, alarm or record
  time over them.
- Every MiniMate block read is logical, so push_config_raw no longer
  unescapes again (a job number of 4098, 10 02, was refused at Send); the
  preview runs the write's own block check, so a block it would refuse is
  shown as blocked.
- A MiniMate's monitoring refusal says a stop makes it call in (spec).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-11-03 22:10:49 -05:00
1 parent 385716d8e1
commit 08d0a6c0d4
9 files changed
+209 -43

No files matched your search

+11 -5
View File
@@ -915,6 +915,8 @@ class MiniMateClient:
compliance_data: bytes,
trigger_data: bytes,
waveform_data: bytes,
*,
escaped: bool = False,
) -> None:
"""
Push a complete config update to the device using the confirmed write
@@ -942,6 +944,10 @@ class MiniMateClient:
trigger_data: Raw bytes for SUB 82 write (44-byte trigger config).
waveform_data: Raw bytes for SUB 69 write.
`escaped`: False (the default) -- the blocks are logical, as every block
read returns them since phase 5; True for blocks that still hold the
parser's kept escape bytes.
Raises:
RuntimeError: if the client is not connected.
ProtocolError: if any write step fails (timeout, bad ack SUB).
@@ -960,29 +966,29 @@ class MiniMateClient:
(SUB_TRIGGER_CONFIG_WRITE, trigger_data),
(SUB_WAVEFORM_DATA_WRITE, waveform_data)):
try:
write_image(sub, data)
write_image(sub, data, escaped=escaped)
except ValueError as exc: # refused before any frame: the caller audits "nothing sent"
raise ImageRefused(str(exc)) from exc
# 68 → 73
log.info("push_config_raw: write event index (SUB 68)")
proto.write_event_index(event_index_data)
proto.write_event_index(event_index_data, escaped=escaped)
log.info("push_config_raw: confirm B (SUB 73)")
proto.write_confirm(SUB_WRITE_CONFIRM_B)
# 71×3 → 72 (handled internally by write_compliance_config_raw)
log.info("push_config_raw: write compliance config (SUB 71 ×3 + confirm 72)")
proto.write_compliance_config_raw(compliance_data)
proto.write_compliance_config_raw(compliance_data, escaped=escaped)
# 82 → 83
log.info("push_config_raw: write trigger config (SUB 82)")
proto.write_trigger_config(trigger_data)
proto.write_trigger_config(trigger_data, escaped=escaped)
log.info("push_config_raw: trigger confirm (SUB 83)")
proto.write_confirm(SUB_TRIGGER_CONFIRM)
# 69 → 74 → 72
log.info("push_config_raw: write waveform data (SUB 69)")
proto.write_waveform_data(waveform_data)
proto.write_waveform_data(waveform_data, escaped=escaped)
log.info("push_config_raw: confirm C (SUB 74)")
proto.write_confirm(SUB_WRITE_CONFIRM_C)
log.info("push_config_raw: confirm A (SUB 72)")