Repository navigation
Description
Problem
Item 1 of the Fit note of #1329. Three places turn settings into a Qdrant client, an embedder and the collection names:
_get_rag_componentsincommands/rag.py.commands/ai.pyimports it by its private name._resolve_runtime_qdrant_and_embedderincommands/ai_ingest.py._get_or_create_retrieverinai/rag/investigator.py. It buildsQdrantClientandEmbeddingsEngineinline, so it skips the Qdrant and embedder seams.
build_runtime_vector_store is library logic. It lives in commands/ai_ingest.py and has a private alias, _build_runtime_vector_store. ai/rag/library_store.py has a private alias, _load_local_contracts, with no user. commands/rag.py has a pass-through load_settings.
The tree has moved since #1329 was written. load_local_contracts is public in ai/rag/library_store.py (#848). commands/ai_ingest.py no longer imports the private commands.valkey._resolve_client: it uses shared_cache_tier.
Expected
- One public function in
ai/rag/indexer.py,resolve_rag_components, builds the Qdrant client, the embedder and the two collection names from the settings.commands/rag.py,commands/ai.py, the investigator and the library vector store call it. build_library_vector_storeis a public function inai/rag/library_store.py, next toLibraryVectorStoreandload_local_contracts.commands/ai_ingest.pyonly calls it.- The private aliases
_build_runtime_vector_storeand_load_local_contractsare gone. - The pass-through
load_settingsincommands/rag.pyis gone. - Commands are thin adapters: they turn a
ConfigurationErrorinto the exit code and the output.
Acceptance criteria
-
resolve_rag_componentshas tests that use the Qdrant and embedder fakes. They check the collection names, the missing URL error and the settings it is given. -
build_library_vector_storehas tests that use the Qdrant, embedder and Valkey fakes. -
rg -n "_get_rag_components|_build_runtime_vector_store|_load_local_contracts|_resolve_runtime_qdrant_and_embedder" src tests docsprints no stale name. -
commands/rag.pydefines noload_settings. - The investigator builds no
QdrantClientand noEmbeddingsEngine. - The behavior of
devops ai raganddevops ai index-librariesdoes not change. -
uv run devops cipasses.
Existing tool considered
No open tool covers this. It is a move of project code into one function. The cost of the move is lower than the cost of three copies that drift apart.
Related
Related: #1329 (parent item). Not in this item: the 23 ai/rag test migration, the ai/library and command tests, and the docs ingester rewrite. Those are items 2 to 4 of the Fit note.
Activity
dan-petty commentedon Nov 6, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
refactorprefix of the title gives the type.(ai)scope of the title gives the scope.Three copies of the same wiring can drift, but no user-facing defect is reported.It removes three duplicated code paths that risk silent divergence, but user-visible behaviour does not change.It touches four source files, adds two public functions, removes three aliases, and requires new tests with fakes.Both target ai/rag wiring, but #1329 owns the test migration while this item owns the code consolidation that #1329's Fit note lists as item 1.devops-cli-service commentedon Nov 6, 2026
Released in v0.74.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.74.0
devops-cli-service commentedon Nov 6, 2026
Live since 2026-11-06 22:51 UTC
test(ai): wire rag once in ai/rag, test with edge fakes (#4245)