Summary
REST-layer lifecycle tests only cover the superseded branch of is_hidden_by_lifecycle. Add coverage for an explicitly retired record (and a non-active lifecycle_status) so all hiding branches are tested at the REST layer.
Background
is_hidden_by_lifecycle (crates/lance-context-core/src/record.rs) hides a record for three reasons:
superseded_by_id is set,
retired_at is set,
lifecycle_status is not active/contradicted.
The existing REST tests only exercise (1):
search_respects_retired_visibility (crates/lance-context-server/src/routes/search.rs:257) — supersedes via update_record, then checks include_retired surfaces the original.
list_respects_retired_visibility (crates/lance-context-server/src/routes/records.rs:881) — same supersession setup.
Branches (2) and (3) are untested at the REST layer, even though RecordPatchDto exposes retired_at / retired_reason / lifecycle_status (records.rs:425), so a client can put a record into those states over REST.
Proposed work
Add REST tests (mirroring the existing supersession tests) that:
- patch a record to set
retired_at (without supersession) and assert it is hidden from default search / list, and surfaced when include_retired = true;
- patch a record to a non-active/contradicted
lifecycle_status and assert the same default-hidden / include_retired-surfaced behavior.
Acceptance criteria
- New REST tests cover the
retired_at and lifecycle_status hiding branches for both search and list.
- Tests assert default-hidden and
include_retired = true-visible for each branch.
Notes
Small, self-contained test-coverage gap (flagged during the #89 / #92 REST filter work). good first issue.
Summary
REST-layer lifecycle tests only cover the superseded branch of
is_hidden_by_lifecycle. Add coverage for an explicitly retired record (and a non-activelifecycle_status) so all hiding branches are tested at the REST layer.Background
is_hidden_by_lifecycle(crates/lance-context-core/src/record.rs) hides a record for three reasons:superseded_by_idis set,retired_atis set,lifecycle_statusis notactive/contradicted.The existing REST tests only exercise (1):
search_respects_retired_visibility(crates/lance-context-server/src/routes/search.rs:257) — supersedes viaupdate_record, then checksinclude_retiredsurfaces the original.list_respects_retired_visibility(crates/lance-context-server/src/routes/records.rs:881) — same supersession setup.Branches (2) and (3) are untested at the REST layer, even though
RecordPatchDtoexposesretired_at/retired_reason/lifecycle_status(records.rs:425), so a client can put a record into those states over REST.Proposed work
Add REST tests (mirroring the existing supersession tests) that:
retired_at(without supersession) and assert it is hidden from defaultsearch/list, and surfaced wheninclude_retired = true;lifecycle_statusand assert the same default-hidden /include_retired-surfaced behavior.Acceptance criteria
retired_atandlifecycle_statushiding branches for bothsearchandlist.include_retired = true-visible for each branch.Notes
Small, self-contained test-coverage gap (flagged during the #89 / #92 REST filter work).
good first issue.