Skip to content

Fix top backlog items: FacetSort enum, include-field semantics, docs#21

Merged
whitewalls86 merged 4 commits into
masterfrom
fix-backlog-top-items
Jun 17, 2026
Merged

Fix top backlog items: FacetSort enum, include-field semantics, docs#21
whitewalls86 merged 4 commits into
masterfrom
fix-backlog-top-items

Conversation

@whitewalls86

@whitewalls86 whitewalls86 commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • FacetSort enum — converts FacetSort from a Literal type alias to a str, Enum matching the SortOrder pattern (COUNT, COUNT_DESC, METRIC, METRIC_DESC). Raw string values like -count still coerce through Pydantic lax mode. FacetSort is now exported from the visor package root. FacetsFilter.sort defaults to FacetSort.COUNT_DESC; to_params() serializes via .value.
  • Include-field semantics — documents and tests the None / [] / [...] contract for ListingDetail.price_history, ListingSnapshot.price_history, and VehicleBuild.options. Live-verified (2026-06-17) that the API omits price_history and options entirely from ListingSummary when include= is not passed; two release_gate integration tests guard that invariant going forward.
  • Pagination comment — adds a comment to paginate_listings and paginate_dealers explaining why async generators use explicit yield instead of yield from.
  • CHANGELOG / README[Unreleased] entry with Added / Changed / Fixed sections; new ### Optional include fields section in README explaining the three-state semantics with a usage example.

Test plan

  • pytest — 256 unit tests pass
  • ruff check / ruff format --check — clean
  • mypy — clean
  • Live integration: pytest tests/integration --run-integration -k absent_without_include — 2 release_gate tests pass against live API

🤖 Generated with Claude Code

whitewalls86 and others added 4 commits June 17, 2026 12:08
- Convert FacetSort from Literal TypeAlias to str Enum matching SortOrder pattern;
  update FacetsFilter.sort default to FacetSort.COUNT_DESC and serialize with .value.
- Export FacetSort from visor package root alongside FacetsFilter.
- Add tests for FacetSort default, explicit enum, raw-string coercion, and wire values.
- Add include-field semantics tests (None/[]/[...]) for ListingDetail.price_history,
  ListingSnapshot.price_history, and VehicleBuild.options.
- Add comment in paginate_listings/paginate_dealers explaining why async generators
  use explicit item-yield instead of yield from.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Live probe (2026-06-17) confirmed the API omits price_history and options
entirely from ListingSummary when include= is not passed — not null, not [].
Pydantic default_factory=list is correct and unambiguous.

Two release_gate integration tests now guard this: if the API ever starts
sending null or [] for these fields without include=, the tests fail and
signal that the model type needs review. Backlog P2 updated with findings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CHANGELOG: add Unreleased entries for the FacetSort enum conversion and
the FacetsFilter.sort default/serialization fix.

README: add Optional include fields section explaining the None/[]/[...]
semantics for price_history and options, with a usage example and a note
that ListingSummary variants are not include-backed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CHANGELOG: split FacetSort Unreleased entry into Added (root export) and
Changed (enum conversion, sort default); Fixed entry is unchanged.

README: correct the include-field note for ListingSummary — those fields
ARE include-backed via ListingsFilter(include=...) but default to [] when
the key is absent, so callers cannot distinguish not-requested from
requested-but-empty on summary listings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@whitewalls86
whitewalls86 merged commit b5e30aa into master Jun 17, 2026
12 checks passed
@whitewalls86
whitewalls86 deleted the fix-backlog-top-items branch June 17, 2026 20:23
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.

1 participant