Repository navigation
Enforce per-group chunk time order in doctor (#239) - #256
Conversation
The table row lost its backticks the same way the two rows in Hebbian-Robotics#252 did, so the code and message_start_time now match every other row. Also reflows the paragraph above the table, annotates the two new locals, and replaces the thinking-aloud comments in the descending-chunk test, one of which named chunk_size=1024 where the fixture uses 1.
kstonekuan
left a comment
There was a problem hiding this comment.
Merging, and the thing I most wanted to see is that this one passes its own gate. It does: ruff check, ruff format --check, ty check, 1195 passed, 6 skipped, lychee 345 OK. Last time all three of your tests raised TypeError before reaching diagnose; here every one runs. That is the difference that matters.
Checked two things rather than taking them:
The tripwire. I replaced the comparison with and False and got one failure, test_group_chunks_out_of_order, and nothing else. The check is load-bearing for exactly its own test.
My reproduction from #239. Same fixture, two channels in one group with the late burst written first:
chunks in time order starts=[0, 2] codes=[]
chunks OUT of time order starts=[10, 0] codes=['group-chunks-out-of-order']
The second line read codes=[] before this change.
Three design calls I would have had to make and you made correctly. Tracking a last-start per group so groups can interleave freely, which is what item 3 actually says and what your third test pins. Accumulating into a set and reporting once per group, so _MAX_FINDINGS_PER_CODE cannot hide which groups are affected behind a suppression count. And comparing with < rather than <=, so two chunks sharing a start time are not a violation.
Fixup (fd9c7f5): the new table row lost its backticks the same way the two rows in #252 did, so that is twice now, worth a glance before pushing a docs table. Also reflowed the paragraph above it, annotated the two new locals, and replaced the working notes in the descending-chunk test, one of which said chunk_size=1024 where the fixture uses 1.
That closes both halves of FORMAT.md item 3, which was unchecked in both directions until this morning.
Resolves #239. This PR implements the second half of \FORMAT.md\ item 3, checking that chunks within a single group ascend strictly by \message_start_time. It adds the \group-chunks-out-of-order\ warning finding, updates the documentation table, and includes 4 new test cases covering all edge cases defined in the issue.