Skip to content

Enforce per-group chunk time order in doctor (#239) - #256

Merged
kstonekuan merged 2 commits into
Hebbian-Robotics:mainfrom
mhaye9545:fix-issue-239
Aug 29, 2026
Merged

kstonekuan merged 2 commits into
Hebbian-Robotics:mainfrom
mhaye9545:fix-issue-239

Conversation

@mhaye9545

Copy link
Copy Markdown
Contributor

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.

mhaye9545 and others added 2 commits August 29, 2026 12:12
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 kstonekuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@kstonekuan
kstonekuan merged commit cdcc8d2 into Hebbian-Robotics:main Aug 29, 2026
5 checks passed
@mhaye9545
mhaye9545 deleted the fix-issue-239 branch August 29, 2026 12:19
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.

FORMAT.md item 3 also requires each group's chunks to be time-ordered, and nothing checks it

2 participants