Skip to content

test(live): an idle frame that advances its sequence fails closed - #54

Merged
M3gA-Mind merged 1 commit into
tinyhumansai:mainfrom
M3gA-Mind:test/idle-frame-sequence
Oct 23, 2026
Merged

M3gA-Mind merged 1 commit into
tinyhumansai:mainfrom
M3gA-Mind:test/idle-frame-sequence

Conversation

@M3gA-Mind

Copy link
Copy Markdown
Collaborator

Summary

The live transport loop refuses an idle reply from the host's input callback (frame: None) whose sequence is not the acknowledged one, failing with "idle live frame advanced its sequence" and closing the transport. Without that check an idle reply could move the host's sequence one past what the module acknowledged, so the next real frame would be judged against the wrong ack. The non-contiguous frame case was tested; the idle case was not. This adds that test only.

Related issue

None.

API or behavior changes

None (tests only).

Validation

  • rustfmt --edition 2024 --check on the touched file
  • N/A: cargo clippy --all-targets --all-features -- -D warnings: left to CI
  • N/A: cargo build --all-targets --all-features: left to CI
  • N/A: cargo test --all-features: only the new test ran locally (below); CI runs the suite

CARGO_INCREMENTAL=0 cargo test --manifest-path crates/tinyvoice-module/Cargo.toml --all-features --lib an_idle_frame_that_advances_its_sequence_fails_closed

  • As is: ok. 1 passed; 0 failed.
  • With the idle sequence check removed on purpose (restored afterwards): FAILED. 0 passed; 1 failed ("fixture deadline": the transport kept polling and never closed).

Tests

service/live/transport_tests.rs: the fake socket gains invalid_idle_sequence (an idle reply with sequence = ack + 1), and an_idle_frame_that_advances_its_sequence_fails_closed asserts the transport closes within 1 s and delivers no effects, mirroring noncontiguous_socket_input_fails_closed_without_applying_effects.

Documentation

Not needed (tests only).

Checklist

  • The change is focused on one logical change
  • No new #[allow(...)], #[ignore], or relaxed lints
  • No secrets, tokens, or .env contents in the diff or the description

The transport refuses an idle live reply (no frame) whose sequence moved
past the acknowledged one, but only the non-contiguous frame case was
tested. Add the idle case to the fake socket and pin that the transport
closes without delivering effects.
@tinysweeper

tinysweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: 41e32a8a17661add5d022e23f1bf2ce1656fb394

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 1 of 1 files.
Pull request purpose (title): test(live): an idle…

Diagnostics and supporting details

Full summary

Pull request purpose (title): test(live): an idle frame that advances its sequence fails closed. Tiny Sweeper completed its review; deterministic results follow.

Review snapshot

Change surface Files Review signal Count
Production 0 Active findings 0
Tests 1 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: Test coverage is assessed from changed tests and lane evidence; execution is not claimed without trusted check data.

Features

  • Added — invalid_idle_sequence fixture mode: Lets the test socket simulate a host idle reply whose sequence skips ahead of the acknowledged frame, exercising the coordinator's idle-sequence guard. (crates/tinyvoice-module/src/service/live/transport_tests.rs impl Socket {, crates/tinyvoice-module/src/service/live/transport_tests.rs struct Socket {)
  • Added — an_idle_frame_that_advances_its_sequence_fails_closed test: Pins the existing fail-closed behavior for non-advancing-contract idle replies: the transport closes within 1 s and no effects are attempted. (crates/tinyvoice-module/src/service/live/transport_tests.rs async fn noncontiguous_socket_input_fails_closed_without_applying_effects() -> t)

Tests

  • unit — Builds the socket with invalid_idle_sequence, runs the fixture to Running, waits for the close notification under a 1 s timeout, asserts the attempts counter is 0, then releases the session.: Runs against a real 1 s timeout rather than start_paused, consistent with the sibling test; test lanes report it fails when the guard is removed and that the fixture branch is exercised. No execution is claimed by this review beyond what trusted evidence states. (crates/tinyvoice-module/src/service/live/transport_tests.rs async fn noncontiguous_socket_input_fails_closed_without_applying_effects() -> t)

Findings

No active actionable findings.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The new test `an_idle_frame_that_advances_its_sequence_fails_closed` mirrors the existing noncontiguous-input test and the `invalid_idle_sequence` fixture mode correctly exercises the `reply.frame == None && reply.sequence != input_ack` guard in `transport.rs`; the test asserts no effects were attempted and then releases. Passing the socket by clone with shared `Arc` fields means the `closed` notification and `attempts` counter are observed correctly. One thing I could not fully verify from the diff: the new test is not `start_paused`, relying on the real 1s timeout, which is consistent with the sibling test. No defects found. _The code index is behind this pull request (indexed at `04c51f6b043a`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Change only extends a test fixture with no untrusted input path, network, or dependency change, and follows repository test-naming and module rules.
  • Lane summary: The change only extends a test fixture: a new `invalid_idle_sequence` flag makes the fake socket return an idle reply whose sequence is ahead of the acknowledged frame, plus a test asserting the coordinator closes the transport and applies no effects. It exercises the existing guard in `transport.rs` (`if reply.sequence != input_ack { ... }`) against the documented contract that idle replies retain the last acknowledged number; it adds no untrusted input path, network or dependency change, and follows the repository's test-naming and module rules. No defect found. _The code index is behind this pull request (indexed at `04c51f6b043a`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Test would fail if the idle-sequence guard were removed (loop would continue and never close), so it guards real behavior.
  • Lane summary: The diff only adds a new branch to the test fixture socket and a new test, `an_idle_frame_that_advances_its_sequence_fails_closed`, which pins the coordinator's existing idle-sequence guard (`if reply.sequence != input_ack { return Err(...) }`): the fixture's idle reply returns `acknowledged_frame + 1` with `frame: None`, and the test asserts the coordinator fails closed by waiting for the close notification and asserting zero deliveries. The test can fail if that guard is removed (the loop would `continue` and never close), so it earns its keep; the fixture's `invalid_idle_sequence` branch is exercised. One mainline path looks plausible, but I could not settle whether it actually misbehaves from here. _The code index is behind this pull request (indexed at `04c51f6b043a`), so retrieved context may be out of date._

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: No sensitive content in committed files.
  • Lane summary: No sensitive content in committed files. _The code index is behind this pull request (indexed at `04c51f6b043a`), so retrieved context may be out of date._

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Description accurately covers the fixture extension and new test, and no production code is touched.
  • Lane summary: The change is test-only and does exactly what the description says: it adds an `invalid_idle_sequence` mode to the fake socket that replies `frame: None` with `sequence = acknowledged_frame + 1`, plus `an_idle_frame_that_advances_its_sequence_fails_closed`, which asserts the transport closes within 1 s and delivers no effects. That mirrors the existing non-contiguous test and plausibly exercises the `reply.sequence != input_ack` check in `transport.rs`; the description accurately covers the fixture extension and the test, and no production code is touched. Nothing in the diff fails to compile or breaks a test it touches, and I found no violation of the repository's coding rules. Safe to merge. _The code index is behind this pull request (indexed at `04c51f6b043a`), so retrieved context may be out of date._
Evidence and run details
  • Models: deepseek-v4.1-flash, ladder/vectors-oai3
  • Spend: $0.000299
  • Tokens: 117864 input · 3146 output · 36352 cached · 132 embedding
  • Updated: 2026-10-22T23:06:14Z
Head State Pass summary
41e32a8a1766 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-22T23:06:14Z)

tinysweeper 0.1.2

@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 921b87f0-1a26-48aa-8484-976eeea02725
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking. Approving.

Diagnostics

Total spend: $0.0003

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Oct 22, 2026
@M3gA-Mind
M3gA-Mind merged commit cc48b7e into tinyhumansai:main Oct 23, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant