Skip to content

prepared-manifest.json and the converter version it carries are never read back by a test #386

Description

@kstonekuan

prepared-manifest.json is written by every LeRobot import and nothing reads it back in the test suite. The manifest test asserts only that the file exists:

tests/test_lerobot_converter.py:1107   assert (output_dir / "prepared-manifest.json").is_file()

So every field in it is unpinned. The one that matters most is converter_version, because it is part of episode identity rather than decoration. It is written into three places:

src/hflow/importers/lerobot.py:50     CONVERTER_VERSION = "lerobot-converter-v5"
src/hflow/importers/lerobot.py:739    "converter_version": CONVERTER_VERSION,   <- prepared-manifest.json
src/hflow/importers/lerobot.py:1022   "converter_version": CONVERTER_VERSION,   <- episode metadata
src/hflow/importers/lerobot.py:1028   "converter_version": CONVERTER_VERSION,   <- source-provenance/v1

grep -rn converter_version tests/ returns nothing. Editing that constant, or dropping the key from any of the three writers, leaves the suite green. The constant moved from v4 to v5 in #383 for a real reason: outputs from a corrected importer must not share an identity with outputs from a broken one. A version that carries that much weight should not be changeable without a test noticing.

What to do

Add a test that reads prepared-manifest.json back and asserts its contents, and a test that asserts the same version reaches the canonical episode.

test_import_publishes_into_a_local_data_root at tests/test_lerobot_converter.py:1080 already runs a real import and has the manifest path in hand at :1107, so the manifest half can hang there or on a test in the same shape.

For reading a written JSON artifact back, copy tests/test_sync_reuse.py:89:

marker_payload = json.loads(marker_path.read_text())

Definition of done

  1. prepared-manifest.json is parsed and its fields asserted: schema_version, dataset (repo_id, revision, license), camera_keys, episodes_converted, and converter_version.
  2. converter_version is asserted against prep.CONVERTER_VERSION rather than a copy of the literal string, so the test pins that the manifest carries the module's version and does not need editing when the version legitimately moves.
  3. Separately, one assertion that the version written into the canonical episode's source-provenance/v1 metadata is the same value. That block is also unasserted today.
  4. Changing CONVERTER_VERSION's value alone still passes (it is not a literal-string pin); removing the key from any of the three writers fails.

Not in scope

Do not add per-episode entries to the manifest or bump schema_version. That is #379 and it has a direction already. Expect this test to need one line updated when #379 lands, which is the point of having it.

Validation

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

See CONTRIBUTING.md.

Activity

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