Architecture decision
ADR-009: Evaluate relevance before rank fusion
Use raw semantic and lexical evidence to decide acceptance, then fuse accepted rankings.
Context
Every nearest-neighbour query can return a closest chunk, even when the question has no supporting evidence. A document’s position in a result list cannot establish that it answers the question. Generic lexical terms can cause the same problem.
Decision
Gate each branch before reciprocal rank fusion. Semantic acceptance uses a raw cosine-similarity floor. Lexical acceptance requires a matching strong technical identifier, or both a rank floor and enough distinct useful matched terms. Ambiguous terms such as Go, Java and Spring do not count as strong identifiers alone. When both branches reject their candidates, return no evidence.
Fuse only accepted rankings, with deterministic ties, bounded evidence count, at most two chunks per page, and a combined evidence-size budget. Preserve each page’s evidence type and canonical link. Fusion scores describe ordering within accepted evidence; they are not confidence or truth scores.
Consequences and verification
One branch may supply evidence when the other is weak or unavailable. A missing local vector can still produce gated lexical evidence without a model call. Thresholds need calibration using real cached embeddings and expected-source / no-evidence questions. The initial numerical defaults are provisional.
Offline synthetic contract tests exercise rejection before fusion, disagreement, deduplication, deterministic ordering, page caps and evidence budgets. They do not measure a real embedding model’s semantic quality. Separate cached local-model fixtures evaluate that question without a paid inference API. A similarity gate can still accept a topically related passage that does not support a requested fact, so generated answers need further grounding checks. Production activation requires an approved execution plan and acceptable measured quality.