Context
Parent: #8757. src/selfhost/vectorize.ts cosineSimilarity (line ~35) computes over Math.min(a.length, b.length) — a store containing mixed-width vectors (operator swaps embed model without reindexing) silently produces wrong similarity scores. Qdrant hard-fails this at the collection level (qdrant-vectorize.ts:93-95) and pgvector raises; the SQLite adapter is the odd one out. No existing test covers the mismatch case (test/unit/selfhost-vectorize.test.ts).
Requirements
- On width mismatch, skip the row (degrade-to-fewer-results, consistent with RAG's fail-safe posture) and log once per query at WARN with both widths; never silently truncate.
- Pin with a test: mismatched-width row excluded, matching rows still returned, log emitted.
Deliverables
Test Coverage Requirements
99%+ patch coverage, branch-counted.
Context
Parent: #8757. src/selfhost/vectorize.ts cosineSimilarity (line ~35) computes over Math.min(a.length, b.length) — a store containing mixed-width vectors (operator swaps embed model without reindexing) silently produces wrong similarity scores. Qdrant hard-fails this at the collection level (qdrant-vectorize.ts:93-95) and pgvector raises; the SQLite adapter is the odd one out. No existing test covers the mismatch case (test/unit/selfhost-vectorize.test.ts).
Requirements
Deliverables
Test Coverage Requirements
99%+ patch coverage, branch-counted.