test(micromate): an AST scan pins execute() as the only write grant; cover the last mutants

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-10-23 16:17:04 -04:00
1 parent a90b8158b6
commit 9ed9578d12
4 files changed
+90 -25

No files matched your search

+5 -7
View File
@@ -55,7 +55,7 @@ from .framing import (
FLAGS_BLASTWARE, FLAGS_THOR, MicromateFrame, MicromateFrameParser,
build_request, request_sub,
)
from .opcodes import ENABLEABLE_WRITES, WRITE_SUBS, OpcodeRefused, check_transmit
from .opcodes import ENABLEABLE_WRITES, OpcodeRefused, check_transmit
if TYPE_CHECKING:
from .writes import WritePlan
@@ -513,11 +513,9 @@ class MicromateProtocol:
) -> MicromateFrame:
if offset is None:
offset = _OFFSETS.get(sub, READ_ALL)
# Start every exchange clean: drop any half-frame and any frame left
# stashed by the last one. This is a strict request/response protocol,
# so anything already buffered when we send is by definition stale, and
# `expected_sub` would reject it anyway — better to discard it here than
# to raise a confusing UnexpectedResponse one command later.
# `_request` starts every exchange clean (drops any half-frame and any
# stashed frame): this is a strict request/response protocol, so anything
# already buffered when we send is stale.
return self._request(build_request(sub, offset, params), 0xFF - sub,
timeout=timeout)
@@ -561,7 +559,7 @@ class MicromateProtocol:
def _send(self, frame: bytes, *, permit: frozenset = frozenset()) -> None:
# The gate sees the bytes about to go out, not the caller's intent.
# `permit` is passed only by execute(), for exactly one step.
# `permit` is passed only via _request, from execute(), for one step.
frame = bytes(frame)
# Trust means the most recent request got a validated Micromate reply.
self.last_flags = None