| REQ-SRCH-001 |
The system shall provide full-text search over document metadata and content across all scopes the user is authorized for, without requiring any LLM. |
STR-008; ADR-0006, ADR-0044 |
| REQ-SRCH-002 |
On every content-freezing transition, content shall be indexed: text extracted from the blob, chunked, and embedded; failures shall be visible and retryable. Delta note (2026-07-10, ADR-0057/0058): for a PM_DOC record, plain-text extraction is a server-side structural tree walk (PmDocText, ADR-0057 §3) into a per-version search_text column, not markdown-stripping of a blob — it cannot drift from the record and never trusts a client extraction. The realized FTS baseline (ADR-0044) already indexes the frozen Markdown projection body, so the M5′ search "cutover" was a documented no-op; search_text is reserved for the RAG layer. |
STR-008; ADR-0006, ADR-0057/0058 |
| REQ-SRCH-003 |
Embeddings shall be computed exclusively by a locally running model; no content shall be sent to external services at indexing time. |
STR-008, STR-003; ADR-0006 |
| REQ-SRCH-004 |
Index data (vectors, FTS rows) shall be stored in PostgreSQL carrying the scope key, subject to the same RLS policies as content tables, and covered by the separation test suite. |
STR-003; ADR-0006, ADR-0044, REQ-SEP-007 |
| REQ-SRCH-005 |
The question-answering function shall send only the retrieved, permission-filtered chunks and the user's question to the LLM — never whole documents or unfiltered content. |
STR-008, STR-003; ADR-0006 |
| REQ-SRCH-006 |
LLM providers shall be pluggable behind one interface, supporting cloud-based and on-premise providers. |
STR-013; ADR-0006 |
| REQ-SRCH-007 |
Each mandator shall configure its LLM policy (cloud / on-prem / none); a query spanning scopes with different policies shall apply the most restrictive one, where restrictiveness orders none > on-prem > cloud. The global base scope's LLM policy is set at installation level (default: most restrictive). |
STR-003, STR-008; ADR-0006 |
| REQ-SRCH-008 |
Every LLM call shall be audit-logged with provider and the exact chunks sent. |
STR-009; ADR-0006 |
| REQ-SRCH-009 |
The search index shall be derived data: fully rebuildable from stored content on demand. |
STR-010; ADR-0006, ADR-0044 |
| REQ-SRCH-010 |
Search/RAG quality shall be verified against a curated benchmark query set with expected top results, run as a regression check; the benchmark is maintained as search behaviour evolves. |
STR-008, STR-014; ADR-0006 |
| REQ-SRCH-011 |
Disposal and erasure shall synchronously delete or invalidate the corresponding full-text and vector index rows (not deferred to a rebuild), so disposed/erased content cannot be retrieved or disclosed via search or the LLM. |
STR-003, STR-021; ADR-0025, ADR-0006, ADR-0044 |
| REQ-SRCH-012 |
The system shall provide a document lookup that matches documents visible to the caller (RLS-scoped) by a fragment of their human document ID or title, returning lightweight results (row id, human ID, title, state) suitable for typeahead and reference pickers. This lookup is distinct from full-text/RAG search (REQ-SRCH-001). |
STR-007, STR-008, STR-003; ADR-0051, ADR-0049 |