Push Project and Matter search filters into SQL with minimal viewing #10

Closed
opened 2026-06-14 10:21:21 +00:00 by liang · 1 comment
Owner

Parent

Parent PRD: #2

What to build

Update search and minimal viewing paths for the Project Matter foundation. Search filters for Project and Matter must be applied in SQL before top-k truncation. Project filtering should consider both Communication Project Hints and Project Matter links, while Matter filtering should return only evidence linked to the selected Project Matter. Provide enough API or Streamlit viewing to inspect Project Matters, linked Communications, and Review Queue state in this phase.

Acceptance criteria

  • Project and Matter filters are pushed down into SQL before FTS/vector/hybrid top-k truncation rather than applied afterward in Python.
  • Project filtering returns Communication chunks found through Communication Project Hints and Project Matter links during the migration period.
  • Matter filtering returns only evidence linked to that Project Matter.
  • Minimal API or Streamlit views can inspect Project Matters, linked Communications for Matter Communication Review, and Review Queue status without implementing full approval UI.
  • Automated tests verify SQL filtering behavior, Observed Project searchable-without-active-workflow behavior, and minimal viewing responses.

Blocked by

## Parent Parent PRD: #2 ## What to build Update search and minimal viewing paths for the Project Matter foundation. Search filters for Project and Matter must be applied in SQL before top-k truncation. Project filtering should consider both Communication Project Hints and Project Matter links, while Matter filtering should return only evidence linked to the selected Project Matter. Provide enough API or Streamlit viewing to inspect Project Matters, linked Communications, and Review Queue state in this phase. ## Acceptance criteria - [ ] Project and Matter filters are pushed down into SQL before FTS/vector/hybrid top-k truncation rather than applied afterward in Python. - [ ] Project filtering returns Communication chunks found through Communication Project Hints and Project Matter links during the migration period. - [ ] Matter filtering returns only evidence linked to that Project Matter. - [ ] Minimal API or Streamlit views can inspect Project Matters, linked Communications for Matter Communication Review, and Review Queue status without implementing full approval UI. - [ ] Automated tests verify SQL filtering behavior, Observed Project searchable-without-active-workflow behavior, and minimal viewing responses. ## Blocked by - #9
Author
Owner

Implemented issue #10.

Summary:

  • Added services.search_service.search_communication_chunks with Project/Matter filters applied before limit/top-k.
  • Added services.matter_views for minimal Project Matter and Review Queue viewing.
  • Updated /api/search to pass Project/Matter filters into SQL instead of filtering after retrieval, and added /api/project-matters/{matter_id} plus /api/review-queue.

Verification: .venv/bin/pytest tests/test_search_and_viewing.py -q -> passed.

Implemented issue #10. Summary: - Added `services.search_service.search_communication_chunks` with Project/Matter filters applied before limit/top-k. - Added `services.matter_views` for minimal Project Matter and Review Queue viewing. - Updated `/api/search` to pass Project/Matter filters into SQL instead of filtering after retrieval, and added `/api/project-matters/{matter_id}` plus `/api/review-queue`. Verification: `.venv/bin/pytest tests/test_search_and_viewing.py -q` -> passed.
liang closed this issue 2026-06-14 10:54:22 +00:00
Sign in to join this conversation.
No labels
ready-for-agent
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
liang/sales-ai#10
No description provided.