Skip to content

Fix doctor chunk purity proxy to check provenance group map (#237) - #252

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

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

Conversation

@mhaye9545

Copy link
Copy Markdown
Contributor

Resolves #237. Updates the doctor's chunk purity check to read the \group/\ namespace keys from \provenance/v1\ metadata and assert that each chunk spans no more than one group (throwing \chunk-mixes-groups). Falls back to the legacy video-versus-state approximation for files lacking a group map.

@github-actions

Copy link
Copy Markdown

👋 Hi @mhaye9545 — thank you so much for your first contribution to HFlow!

A maintainer will review your pull request as soon as possible. In the meantime:

💡 Tip: one open pull request per contributor at a time. Issues with an assignee are taken; everything else is fair game.

We are excited to have you here and appreciate your help making the project better! 🙌

All three new tests called Writer.add_metadata(name=, metadata=), but the
stock signature is (name, data), so every one raised TypeError and the
feature shipped unverified: 3 failed and 6 ty diagnostics on the branch.

Also restores the backticks the two new finding-code rows dropped, reflows
the paragraph above the table, and replaces k/v with descriptive names in the
group-map loop.

@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, with a fixup that was more than cosmetic: none of your three tests ran.

All three called Writer.add_metadata(name=..., metadata={...}), but the stock MCAP writer's signature is add_metadata(name, data). Every one raised TypeError before reaching diagnose, so on the branch as submitted:

3 failed, 1186 passed, 6 skipped
ty check: 6 diagnostics
ruff format --check: 1 file would be reformatted

The feature shipped unverified. Your PR body has no validation section, so nothing was claimed that was not true, but uv run pytest -q from the repo root would have shown this in a minute and it is what the section is for. Please run it before pushing.

The design is right and I verified it independently, with the reproduction from #237:

one group per chunk          conforming=True  codes=[]
state + bulk in one chunk    conforming=True  codes=['chunk-mixes-groups']

Before this change the second line read codes=[]. And the case the issue cared most about protecting, HFlow's own output, is untouched: a synthesized two-camera episode and a camera-less one both still report conforming with no findings.

Reading the group map from provenance/v1 rather than adding a column, keeping the video-versus-state approximation for files with no map, and choosing warning for the same reason the old code gives, are all exactly what the issue asked for. Splitting into a new code instead of overloading the old one is the right call too: the two mean different things and an automation matching on codes can tell them apart.

Fixup (277b7a8): the three add_metadata calls, the backticks the two new table rows dropped, a reflow of the paragraph above the table, and k/v renamed in the group-map loop, since this repo spells variables out.

Welcome, and thanks. #239 is the sibling of this one, still open and unassigned: same convention item, the other half of the sentence.

@kstonekuan
kstonekuan merged commit 871800b into Hebbian-Robotics:main Aug 29, 2026
@mhaye9545
mhaye9545 deleted the fix-issue-237 branch August 29, 2026 08:02
kstonekuan added a commit to mhaye9545/hflow that referenced this pull request Aug 29, 2026
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 added a commit that referenced this pull request Aug 29, 2026
* Enforce per-group chunk time order in doctor (#239)

* style: backtick the new finding code, reflow, and drop working notes

The table row lost its backticks the same way the two rows in #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.

---------

Co-authored-by: Kingston <kingston@hebbianrobotics.com>
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.

The doctor approximates chunk purity as video-versus-state, so two non-video groups sharing a chunk pass

2 participants