Skip to content

Add REST tests for explicitly-retired / non-active lifecycle records (not just superseded) #105

Closed

Description

@dcfocus

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:

  1. superseded_by_id is set,
  2. retired_at is set,
  3. 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.

Activity

  1. self-assigned this
    on Jun 28, 2026
  2. added a commit that references this issue on Jul 10, 2026
    af77642
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions