feat(sfm): POST /device/settings/change; retire the legacy config write

DeviceAccess.change_settings refuses before any I/O a request with no
changes, a live change without its preview's revision, or no audit log,
then dispatches the series' change (never retried).  The route returns
the preview (fields old -> new, warnings, blocked, revision) or the
result (fields old/new/now), statuses as the other changes, and marks
the cached by-host config dirty after a live change.

/device/config and /device/config/project now answer 410 with a pointer.
Deleted with them: MiniMateClient.apply_config / set_project_info and
the raw-offset _encode_compliance_config (#46 found it wrong), the
lab script poc_set_project.py and experiments.py's EXP6, both of which
wrote a live unit through it.  Git keeps them.

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 21:51:20 -05:00
1 parent 66bb29b9d4
commit e8eabee4a2
10 files changed
+316 -749

No files matched your search

+2 -34
View File
@@ -213,40 +213,8 @@ def test_each_read_returns_the_block_blastware_then_wrote(read, sub, size):
assert block[:-2] == want[:-2] if sub == 0x69 else block == want[:-2]
# -- apply_config writes this unit's own trigger block ---------------------------
class StubProto:
"""Serves BE9441's blocks as read on 2026-10-26; records every write."""
def __init__(self):
self.writes = []
def read_event_index(self):
return _image(0x68)[:-2]
def read_compliance_config(self):
return _image(0x71)[:-2]
def read_waveform_data_raw(self):
return _image(0x69)
def read_trigger_config(self):
return _image(0x82)[:-2]
def __getattr__(self, name):
if name.startswith("write_"):
return lambda *a, **k: self.writes.append((name, a))
raise AttributeError(name)
def test_apply_config_writes_the_units_own_trigger_block():
from minimateplus.client import MiniMateClient
c = MiniMateClient(transport=object())
c._proto = StubProto()
c.apply_config() # nothing changed: a round trip
trig = [a[0] for n, a in c._proto.writes if n == "write_trigger_config"]
assert trig == [_image(0x82)[:-2]]
assert trig[0][5] == 0x01 # BE9441's; the March copy had 0x03
# -- the unit's own trigger block is sent back: tests/test_device_access_s3_settings.py
# (test_s3_trigger_change_sends_the_units_own_blocks), phase 5.
def test_a_bad_block_is_refused_before_the_first_write_goes_out():