You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MilvusVectorStore broken against real Milvus (no primary key, IndexParams misuse, metadata lost, event-loop block) — hidden by MagicMock #840
MilvusVectorStore (src/synapsekit/retrieval/milvus.py), previously only MagicMock-tested, was broken against a real Milvus. Found via real Milvus Lite (embedded real engine) tests (epic #829).
Bugs (all hidden by the mock)
Schema has no primary key — _ensure_collection adds text + embedding but no primary field (the comment claimed auto_id means "do NOT add a manual primary field"). Milvus requires an explicit PK even with auto_id → PrimaryKeyException: Schema must have a primary key field. Every add/search failed.
create_index gets a dict, not IndexParams — MilvusClient.create_index requires an IndexParams object built via prepare_index_params().add_index(...); passing the raw dict raises ParamError.
Metadata never returned — stored as dynamic fields with output_fields=["text"], so search results carried no metadata (dynamic fields aren't returned unless named).
Blocks the event loop — add/search call the synchronous MilvusClient directly inside async def.
Fix
Declare an auto-id INT64 primary key; store metadata in a JSON field (queried via metadata["key"] == ... and returned via output_fields=["text","metadata"]).
Build IndexParams with prepare_index_params().add_index(...).
Offload all client calls via asyncio.to_thread.
Test
Real Milvus Lite (the official embedded engine — standalone needs etcd+minio): true nearest-neighbour ranking, metadata filter, top_k, persistence across reopen, empty/negative, async contract. First-ever test for this store; runs in the CI integration job (with milvus-lite declared).
Activity
fix(retrieval): fix MilvusVectorStore against a real Milvus (SynapseK…