Skip to content

checks: add required_topics, the missing-topic QC built-in - #59

Closed
chintondutta wants to merge 1 commit into
Hebbian-Robotics:mainfrom
chintondutta:feat/6-required-topics-check
Closed

checks: add required_topics, the missing-topic QC built-in#59
chintondutta wants to merge 1 commit into
Hebbian-Robotics:mainfrom
chintondutta:feat/6-required-topics-check

Conversation

@chintondutta

Copy link
Copy Markdown
Contributor

Fixes #6.

What was missing

src/hflow/checks.py ships built-in checks for timestamps, joints, cameras, idle segments, duration, and digest -- but nothing answered the cheapest and most common corpus-level QC question: did this rig record every topic it was supposed to?

Change

Added required_topics(episode, *, topics), following episode_duration's evidence-only shape (docstring pointing at the curation query where the pass/fail policy lives, no verdict). For each requested topic, records:

  • f"{topic}/present" -- boolean
  • f"{topic}/message_count" -- int

plus a missing_topic_count summary.

Presence is derived from Episode.channels (dict[int, TopicInfo]), summed across every channel whose topic matches -- never Episode.channel(), which explicitly raises ValueError when a topic maps to more than one channel (episode.py's _resolve_channel_info). A topic counts present when the summed message count is > 0 (an empty channel is schema without a recording, matching episode_duration's own message_count >= 1 presence convention).

No __all__ to update -- checks.py has none; the module is imported and used as hflow.checks.<name>, same as every sibling.

Testing

Two new tests in tests/test_checks.py, using the existing module-scoped jittery_episode synthetic fixture:

  • test_required_topics_all_present: /joint_states and /wrist_cam/compressed both present with positive message counts, missing_topic_count == 0.
  • test_required_topics_reports_a_missing_topic: a topic name not in the file reports present=False, message_count=0, and missing_topic_count == 1, alongside a genuinely present topic.
uv run pytest -q       # 299 passed, 3 skipped; unrelated: tests/test_ffmpeg.py fails/errors in this sandbox (no ffmpeg/ffprobe on PATH)
uv run ruff check --fix
uv run ruff format
uv run ty check

Nothing in checks.py answered the cheapest corpus-level QC question: did
this rig record every topic it was supposed to? Follows episode_duration's
evidence-only shape: per topic, {topic}/present and {topic}/message_count,
plus a missing_topic_count summary; the pass/fail cut is a curation query.

Presence is derived from Episode.channels (summed across every channel
matching the topic) rather than Episode.channel(), which raises when a
topic maps to more than one channel.
@github-actions

Copy link
Copy Markdown

👋 Hi @chintondutta — thanks for the contribution! To keep starter issues available
for other contributors and give every pull request a real review, we accept
1 open pull request per contributor at a time.

You already have #52 open, so this one is being closed automatically.
Once your open pull request is merged or closed, feel free to reopen this one —
no work is lost.

@github-actions github-actions Bot closed this Aug 20, 2026
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.

Add a required_topics built-in check (missing-topic QC)

1 participant