feat(search): implement Phase 1 scoped search vertical slice
Resolve persisted enabled actors and atomically replace knowledge selection with revision checks, removal epochs, stable locking and audit updates. Reuse compatible query embeddings for scoped pgvector cosine retrieval, revalidate authority after remote work, and expose opt-in operator inspection with uncalibrated candidates. Validation: 37 targeted tests passed (14 unit, 23 PostgreSQL); provider-free inactive-to-active demonstration passed. Real-provider demonstration remains pending ingestion database connectivity. Applied migrations are unchanged.
This commit is contained in:
@@ -68,7 +68,7 @@ Prototype runtime prerequisites remain unverified: configured credentials, appro
|
||||
## Gaps and decisions
|
||||
|
||||
- Required document content is available under `specifications/`; no reference-dependent workflow is currently blocked by missing content. If a linked document later disappears, mark only dependent contract work blocked, report its exact path, and continue unrelated work without inventing it.
|
||||
- Material implementation gap: prototype Chroma/local Markdown/in-memory chat does not search the uploaded-document pipeline. Worker/publication/retry are implemented; remaining work includes authenticated review transport, scoped pgvector search, HTTP identity/upload, LangChain integration, native Live and UI. Full durable text turns/history are deferred; no component test certifies this integration.
|
||||
- Material implementation gap: prototype Chroma/local Markdown/in-memory chat does not search the uploaded-document pipeline. Worker/publication/retry are implemented; remaining work includes authenticated review transport, calibrated search/exact identifiers, HTTP identity/upload, LangChain integration, native Live and UI. The Fast-Track Search Phase 1 core and operator selection/inspection CLIs now exist; see the checkpoint below. Full durable text turns/history are deferred; no component test certifies this integration.
|
||||
- Open validations: exact format/size caps, funded model profiles/vector dimension, Gemini Live WSS/tool/transcript and Persian speech proof, hosting/connectivity, account/session/retention policy, quality target and delivery date. Direct Gemini Live, LangChain, new browser uploads, existing embedding reuse and all supplied example structures are confirmed MVP direction. See guide 13 and plan 2. Do not turn proposals into recorded approvals.
|
||||
- The 2026-10-06 MVP supersedes provisional SDP/WebRTC with backend-managed direct Gemini Live WSS; see API Section 7. Current-session provider answer transcripts/sources are displayed when available; durable full voice history remains deferred. Broader features do not authorize model selectors or CTI.
|
||||
- Project documentation now lives under `docs/`; sample corpus files remain under `data/documents/`. A future default corpus rebuild excludes the moved specifications and reference map. Existing vector indexes are not rebuilt or cleaned by this reorganization and may retain previously indexed project documentation. Use an approved corpus for real-provider evaluation.
|
||||
@@ -1323,3 +1323,43 @@ Affected repair files (all other baseline files are unchanged):
|
||||
- docs/specifications/RAG-Phase1-Implementation-Guide.md
|
||||
- tests/integration/test_phase6.py
|
||||
- tests/unit/test_phase6.py
|
||||
|
||||
## Fast-Track Search Phase 1 first-result checkpoint (2026-10-07)
|
||||
|
||||
Current inventory supersedes historical statements that scoped search and
|
||||
selection are still entirely absent. [Shared selection/search core](../app/modules/knowledge/service.py),
|
||||
[selection CLI](../app/knowledge.py), [inspection CLI](../app/search.py),
|
||||
[targeted PostgreSQL tests](../tests/integration/test_scoped_search.py),
|
||||
[input/CLI tests](../tests/unit/test_scoped_search.py), and
|
||||
[provider-free demonstration](../tests/search_demo.py) now exist.
|
||||
See the [operator checkpoint guide](guides/scoped-search-checkpoint.md)
|
||||
for setup, commands, exact observed source IDs/text and limitations.
|
||||
|
||||
Implemented: persisted enabled actor/organization resolution; full-set selection
|
||||
with expected knowledge revision, settings-first document locks in UUID order,
|
||||
no-op counter preservation, knowledge revision increments, removal epochs and
|
||||
atomic change audit; compatible bounded one-input query embeddings outside
|
||||
transactions; exact pgvector cosine eligibility joins; actor/epoch revalidation;
|
||||
whole-chunk diagnostic results (five chunks, 12000 text characters).
|
||||
No migration, dependency, prototype retriever, HTTP search or framework was added.
|
||||
The inspection format is uncalibrated_candidates, not the model-tool contract.
|
||||
|
||||
Actual checks:
|
||||
- PostgreSQL prerequisite probe passed: PostgreSQL 16.15 / pgvector 0.8.7 in a
|
||||
fresh dedicated container/database on 127.0.0.1:54938.
|
||||
- `.venv/Scripts/python -m pytest tests/unit/test_scoped_search.py tests/integration/test_scoped_search.py --require-postgres -q --tb=short`:
|
||||
**37 passed** (14 unit, 23 PostgreSQL), zero skips, 28.46 seconds.
|
||||
- `.venv/Scripts/python -m tests.search_demo` with isolated TEST_DATABASE_URL:
|
||||
inactive=0 candidates; after legitimate selection revision=2/epoch=1,
|
||||
one faithful pump-limit candidate with document/chunk IDs and actual locator.
|
||||
- Selection/search CLI help verified; tracked and new-file whitespace passed;
|
||||
all applied migration files compared byte-for-byte with HEAD and preserved.
|
||||
|
||||
The available operator URL was rejected by the isolated-test guard because its
|
||||
database name was not suffixed _test; it was not used for test writes.
|
||||
The deployment ingestion database connection failed with OperationalError.
|
||||
Credentials/configuration were present but no hosted call was attempted;
|
||||
approved ready real-document/provider demonstration remains pending a reachable
|
||||
compatible ingestion database. This is provider-free database validation, not
|
||||
semantic-quality acceptance. Full regressions/calibration/LangChain/UI/Live/ANN
|
||||
were not run or built; Fast-Track phases 2-4 remain pending.
|
||||
|
||||
Reference in New Issue
Block a user