From 51e7dddcb34692285c959d339977793945a14300 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 2 Nov 2026 17:07:04 -0500 Subject: [PATCH] test(micromate): corpus counts are floors, and 0x71 is the over-the-ceiling example Two test-side breaks, found by the full suite after phase-4 task 6: - test_micromate_framing's three whole-session tests pinned exact counts of a gitignored corpus (bridges/captures/9-24-26 - micromate2, a symlink into the main checkout). The full copy of the BW VM's captures on 2026-11-02 added sessions: 287 responses / 241 reads / 287 requests, every one passing the same per-frame checks. The counts are now floors (>= 251 / 218 / 251), so a lost file still fails and a grown corpus does not. - test_micromate_opcodes' beyond-the-ceiling permit took 0x7E, enableable since the call-home commit (eeb55ef); 0x71 (the setup write, phase 5) replaces it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- tests/test_micromate_framing.py | 15 ++++++++++++--- tests/test_micromate_opcodes.py | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/test_micromate_framing.py b/tests/test_micromate_framing.py index 3e72f81..0ea1b31 100644 --- a/tests/test_micromate_framing.py +++ b/tests/test_micromate_framing.py @@ -373,7 +373,10 @@ def test_whole_captured_sessions_parse_with_no_bad_checksums(): bad = [f for f in frames if not f.checksum_valid] assert not bad, f"{path.name}: {len(bad)} bad checksums" total += len(frames) - assert total == 251, f"expected 251 response frames across the corpus, got {total}" + # A floor, not an exact count: the corpus is a gitignored folder that grows + # (2026-11-02, the full copy from the BW VM: 287 responses, 241 reads, every + # one passing the same rule). Fewer than first verified means a lost file. + assert total >= 251, f"expected at least 251 response frames across the corpus, got {total}" @pytest.mark.skipif( @@ -410,7 +413,10 @@ def test_builder_reproduces_every_captured_read_frame(): ) checked += 1 i = j + 1 - assert checked == 218, f"expected 218 read frames, checked {checked}" + # A floor, not an exact count: the corpus is a gitignored folder that grows + # (2026-11-02, the full copy from the BW VM: 287 responses, 241 reads, every + # one passing the same rule). Fewer than first verified means a lost file. + assert checked >= 218, f"expected at least 218 read frames, checked {checked}" # ── the data section (writes) ───────────────────────────────────────────────── @@ -523,4 +529,7 @@ def test_builder_reproduces_every_captured_request_frame_including_writes(): ) checked += 1 i = j + 1 - assert checked == 251, f"expected 251 request frames, checked {checked}" + # A floor, not an exact count: the corpus is a gitignored folder that grows + # (2026-11-02, the full copy from the BW VM: 287 responses, 241 reads, every + # one passing the same rule). Fewer than first verified means a lost file. + assert checked >= 251, f"expected at least 251 request frames, checked {checked}" diff --git a/tests/test_micromate_opcodes.py b/tests/test_micromate_opcodes.py index 6b68e35..d5b3f4e 100644 --- a/tests/test_micromate_opcodes.py +++ b/tests/test_micromate_opcodes.py @@ -98,7 +98,7 @@ def test_an_unknown_opcode_is_refused_and_nothing_is_written(sub): assert t.written == [] -@pytest.mark.parametrize("sub", [0xEE, 0x7E, 0xA8]) +@pytest.mark.parametrize("sub", [0xEE, 0x71, 0xA8]) # 0x71 (setup write) stays above the ceiling until phase 5 def test_a_permit_beyond_the_ceiling_is_refused_at_the_wire(sub): p, t = proto([]) with pytest.raises(OpcodeRefused):