fix(minimateplus): every A5 header is 12 bytes once inner DLE pairs count as one -- the general rule
Review of 352f694: the metadata-page detection fixed every observed stream but
was one case of a general rule. An A5 header is 12 bytes in the stripped sense
(TERM's 11); its raw length is 13 whenever the echoed address carries an inner
DLE pair -- the metadata pages at 0x1002 / 0x1004, but equally a sample chunk
or TERM boundary that lands there (inferred: ~1 in 128 events spanning
0x1000-0x1200, not in any capture). _raw_skip() counts it per frame, the way
probe_skip already did; _has_metadata_pages is gone. The reviewer measured
the rule reproducing the shipped bodies byte for byte on all 26 current-walk
streams on this box. Test: a chunk moved to 0x1002 yields the same body.
No DB or schema change; TOOL_VERSION not bumped (the file builder changed, the
.h5 decode did not).
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
f6166b4b04
commit
ac34f80daa
3 files changed
+54
-35
No files matched your search
@@ -90,6 +90,12 @@ def test_be9441_event_1_downloads_verified():
|
||||
|
||||
|
||||
def test_the_check_refuses_the_file_the_metadata_page_bug_produced(monkeypatch):
|
||||
monkeypatch.setattr(bw, "_has_metadata_pages", lambda frames: True) # the bug, back
|
||||
real = bw._frame_body_bytes
|
||||
calls = []
|
||||
|
||||
def old_rule(frame, skip): # the bug, back: frames 1 and 2 cut as metadata pages
|
||||
calls.append(1)
|
||||
return real(frame, skip + 1 if len(calls) in (2, 3) and skip == 12 else skip)
|
||||
monkeypatch.setattr(bw, "_frame_body_bytes", old_rule)
|
||||
with pytest.raises(MalformedReply, match="not saved"):
|
||||
adapter().download_event(CABLE, "BE9441", KEY, "20261025141049")
|
||||
Reference in new issue
Block a user