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:
1 parent
385716d8e1
commit
08d0a6c0d4
9 files changed
+209
-43
No files matched your search
@@ -288,3 +288,20 @@ def test_editable_fields_describe_both_series():
|
||||
assert s3["note_1"]["label"] == "Project" and s3["note_1"]["maxlength"] == 41
|
||||
assert s4["note_1"]["label"] == "Location"
|
||||
assert s4["record_time_s"]["max"] == 90.0 and s3["record_time_s"]["max"] == 26.0
|
||||
|
||||
|
||||
# Final review #2: the limits hold on the block that would result, not only on the
|
||||
# fields in the request -- a one-field change must not leave the unit over them.
|
||||
def test_limits_hold_on_the_resulting_block():
|
||||
hot = encode_setup(S3_BLOCK, 3, {"geo_trigger_ips": 2.0})
|
||||
_refused(hot, 3, {"geo_range": "sensitive"}) # trigger 2.0 > 1.25
|
||||
alarm = bytearray(S3_BLOCK)
|
||||
struct.pack_into(">f", alarm, 1708 + 38, 2.0)
|
||||
for k in (1, 2):
|
||||
struct.pack_into(">f", alarm, 1708 + 48 * k + 38, 2.0)
|
||||
_refused(bytes(alarm), 3, {"geo_range": "sensitive"}) # alarm 2.0 > 1.25
|
||||
_refused(S3_BLOCK, 3, {"record_mode": "histogram_continuous"}) # it holds 20 s; combo max 13
|
||||
slow = encode_setup(S3_BLOCK, 3, {"sample_rate": 1024, "record_time_s": 100.0})
|
||||
_refused(slow, 3, {"sample_rate": 4096}) # 100 s > 26 at 4096
|
||||
assert check_changes(S3_BLOCK, 3, {"note_1": "x"}) # nothing limit-related touched
|
||||
assert check_changes(hot, 3, {"geo_range": "normal"}) # 2.0 <= 10
|
||||
Reference in new issue
Block a user