Skip to content

feat: add lifecycle retention filters#62

Merged
beinan merged 6 commits into
lance-format:mainfrom
dcfocus:codex/issue-56-ttl-retention
Jun 10, 2026
Merged

feat: add lifecycle retention filters#62
beinan merged 6 commits into
lance-format:mainfrom
dcfocus:codex/issue-56-ttl-retention

Conversation

@dcfocus

@dcfocus dcfocus commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add first-class lifecycle fields: expires_at, retention_policy, lifecycle_status, retired_at/retired_reason, supersedes_id/superseded_by_id.
  • Hide tombstoned, expired, retired, and superseded records from default list/search while keeping contradicted records visible as guardrails.
  • Add include_expired/include_retired retrieval options and document query-time lifecycle filtering, with tests for TTL, supersession history, and contradicted records.

Closes #56

Notes

  • This is a query-time first implementation; physical archival/cleanup remains a future maintenance path layered on delete/forget and compaction.
  • Supersession can be represented by either marking the old record retired/superseded or by having a newer record point back with supersedes_id.

Testing

  • cargo-fmt --all -- --check
  • cargo test -p lance-context-core --lib
  • cargo clippy -p lance-context-core -p lance-context-python --all-targets -- -D warnings
  • uv run --with maturin maturin develop
  • uv run --with pytest pytest tests/test_search.py tests/test_delete.py tests/test_persistence.py::test_lifecycle_fields_round_trip_and_default_filtering tests/test_persistence.py::test_search_applies_lifecycle_filter_before_limit tests/test_persistence.py::test_supersedes_pointer_hides_old_record_by_default -q
  • uv run --with pytest pytest python/tests/test_context.py -q
  • uv run --with ruff ruff format --check python/python/lance_context/api.py python/python/tests/test_context.py python/tests/test_delete.py python/tests/test_persistence.py python/tests/test_search.py
  • uv run --with ruff ruff check python/python/lance_context/api.py python/python/tests/test_context.py python/tests/test_delete.py python/tests/test_persistence.py python/tests/test_search.py
  • uv run --with pyright --with pytest pyright python/lance_context tests/test_search.py tests/test_delete.py tests/test_persistence.py python/tests/test_context.py (0 errors; editable-extension missing-stub warnings only)

@beinan beinan merged commit c2ce799 into lance-format:main Jun 10, 2026
7 checks passed
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.

Add TTL and retention policy support for memory lifecycle

2 participants