Skip to content

vlm_captions Order is Assumed Stable but model_dump() Doesn't Guarantee It #135

@soumyaranjan77-web

Description

@soumyaranjan77-web

@Devnil434 Where: vlm_captions=["Person reaching toward keypad", "Person pressing keypad buttons"]

What's wrong:

  • Tests that refactor to import these fixtures and then assert result.vlm_captions[0] == "Person reaching toward keypad" are making an index-order assumption. If ReasoningResult internally stores captions in a set (to deduplicate), or if a future schema migration changes vlm_captions to list[VLMCaption] with its own serialiser, the round-trip model_validate(result.model_dump()) may return captions in a different order. The fixture locks in a fragile positional contract with no sorted() or order-agnostic assertion.

Fix:

  • In refactored tests, assert membership not position

  • assert "Person reaching toward keypad" in result.vlm_captions
  • NOT: assert result.vlm_captions[0] == "Person reaching toward keypad"

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions