Skip to content

A camera topic mixing image formats is still filed as an infrastructure failure #331

Closed

Description

@kstonekuan

What happens

_decode_camera_images (src/hflow/transform.py:509) refuses a camera topic whose messages
carry more than one image format:

if len(formats) != 1:
    raise ValueError(f"camera topic {topic!r} mixes image formats {sorted(formats)}")
return images, frame_ids, _input_codec_for_image_format(formats.pop(), topic)

The very next line calls _input_codec_for_image_format, which raises SourceNotConforming
after #288. So two refusals about the same channel's contents, one line apart, land in
different ingest_failures.failure_kind values:

camera topic '/cam' mixes image formats ['jpeg', 'png']  -> infrastructure
camera topic '/cam' carries unsupported format 'bogus'   -> source-unsupported

Why it matters

infrastructure is the kind an operator retries. A recording whose camera topic mixes jpeg and
png fails identically on every retry, which is exactly the reasoning in #203 that produced
source-unsupported in the first place. #288 scoped itself to the four refusals #203 listed,
and this one was not on that list, so nothing here is a regression. It is the one place the new
vocabulary is inconsistent with itself.

Definition of done

_decode_camera_images raises SourceNotConforming for the mixed-format case, and a test
triggers the real raise site (not a synthetic exception) and asserts
classify_ingest_failure(error) == IngestFailureKind.SOURCE_UNSUPPORTED. tests/test_ingest_ledger.py
has four of these to copy. The message text does not need to change.

Check whether the docstring list in SourceNotConforming (transform.py:114) and the paragraph
in docs/how-to/write-a-converter.md enumerate the refusal categories, and add this one if they
do.

Validation

uv sync --locked --all-extras
uv run ruff check --fix
uv run ruff format
uv run ty check
uv run pytest -q

Run plain uv run pytest -q from the repo root: pytest tests alone misses
packages/hflow-server/tests.

Notes

Found while reviewing #288.

Activity

  1. aadetya commented on Aug 31, 2026

    @aadetya
    Contributor

    @kstonekuan I’ve opened #337 to address this. It includes the mixed-format classification change, regression coverage, and the related documentation updates. It’s ready for review whenever you have time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions