Skip to content

test(host): cover AUTOREPORT temperature interleave as wire behavior - #31

Merged
CameronBrooks11 merged 1 commit into
mainfrom
test/autoreport-temp-interleave
Aug 20, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
test/autoreport-temp-interleave

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Closes #19.

Problem

The dialect matrix (test_dialect_matrix_connect_and_stream) exercised
AUTOREPORT_TEMP only as a negotiated cap flag (profile.has), never as
wire behavior. With AUTO_REPORT_TEMPERATURES the controller pushes
unsolicited T: telemetry on a timer (temperature.cpp print_heater_states),
interleaved with command traffic. The host must absorb it as a non-terminal
report — never mistake it for the terminal ok — so ok-per-command pacing
stays in sync.

Approach

A focused, test-only case driven through the collecting query path so the
absorbed line is observable:

t = FakeTransport(responder=lambda _line: [_AUTOREPORT_TEMP_LINE, "ok"])
collected = MarlinHost(t).query("M114")
assert [r.kind for r in collected] == [MarlinResponseKind.TEMPERATURE]

This matters: a bare send/stream calls _await_terminal with collect=None,
so absorbed intermediates are dropped and a stream assertion alone cannot tell
whether the interleave happened at all
. The query-based assertion is
load-bearing — it fails if the T: is dropped or misclassified (verified by
mutation: setting the responder to ["ok"] fails the test). A supplementary
stream assertion then shows a short program still completes one ack per command
with a T: pushed ahead of every ack.

No host changes — the telemetry is already absorbed by the same _await_terminal
catch-all that handles the wait heartbeat.

Verification

just check clean (ruff format + lint, pyright 0 errors); just test green
(120 passed, 4 skipped).

Note: this addresses adversarial-review feedback on an earlier draft that folded
the case into the dialect matrix — that version passed even with the interleave
removed (the absorbed line never surfaced), so it did not actually pin the wire
behavior. This version does.

https://claude.ai/code/session_017N6LZRKsJYXcNMQZqeEvpd

The dialect matrix exercised AUTOREPORT_TEMP only as a negotiated cap
flag (asserted via profile.has), never as wire behavior. With
AUTO_REPORT_TEMPERATURES the controller pushes unsolicited `T:` telemetry
on a timer, interleaved with command traffic; the host must absorb it as
a non-terminal report so ok-per-command pacing stays in sync.

Add a focused test driven through the collecting `query` path, so the
absorbed line is observable and the assertion is load-bearing: a bare
send/stream discards intermediates (collect=None), so a stream alone
cannot tell whether the interleave happened at all. The test fails if the
`T:` is dropped or misclassified (mutation-checked). A supplementary
stream assertion shows a short program still completes one ack per
command with a `T:` ahead of every ack. Test-only; no host changes.

Closes #19.

Claude-Session: https://claude.ai/code/session_017N6LZRKsJYXcNMQZqeEvpd
@CameronBrooks11
CameronBrooks11 merged commit d29cac9 into main Aug 20, 2026
5 checks passed
@CameronBrooks11
CameronBrooks11 deleted the test/autoreport-temp-interleave branch August 20, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(host): cover AUTOREPORT telemetry-interleave as wire behavior, not just a cap flag

1 participant