feat(search): add score_kind to VectorRetriever (Cosine) and hybrid test helpers (Rrf)
This commit unblocks Tasks 3 and 4 of fb-38: - VectorRetriever::build_hit now labels hits with ScoreKind::Cosine - Hybrid retriever test helpers (mk_hit functions) label synthetic hits with ScoreKind::Rrf - Updated lexical snapshot fixture to reflect new score_kind field in output Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -505,6 +505,7 @@ mod tests {
|
||||
// a fixed UNIX_EPOCH so synthetic hits remain deterministic.
|
||||
indexed_at: time::OffsetDateTime::UNIX_EPOCH,
|
||||
stale: false,
|
||||
score_kind: kebab_core::ScoreKind::Rrf,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -755,6 +756,7 @@ mod tests {
|
||||
chunker_version: ChunkerVersion("c1".into()),
|
||||
indexed_at: time::OffsetDateTime::UNIX_EPOCH,
|
||||
stale: false,
|
||||
score_kind: kebab_core::ScoreKind::Rrf,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ use std::sync::Arc;
|
||||
use anyhow::{Context, Result};
|
||||
use kebab_core::{
|
||||
ChunkId, ChunkerVersion, DocumentId, Embedder, EmbeddingInput, EmbeddingKind,
|
||||
IndexVersion, RetrievalDetail, Retriever, SearchHit, SearchMode, SearchQuery,
|
||||
IndexVersion, RetrievalDetail, Retriever, ScoreKind, SearchHit, SearchMode, SearchQuery,
|
||||
SourceSpan, VectorHit, VectorStore, WorkspacePath,
|
||||
};
|
||||
use kebab_store_sqlite::SqliteStore;
|
||||
@@ -326,6 +326,7 @@ fn build_hit(
|
||||
// (called from `App::search` / `App::search_uncached`) and the equivalent
|
||||
// in `RagPipeline::ask` against the configured threshold.
|
||||
stale: false,
|
||||
score_kind: ScoreKind::Cosine,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
"vector_rank": null,
|
||||
"vector_score": null
|
||||
},
|
||||
"score_kind": "bm25",
|
||||
"section_label": "Snap",
|
||||
"snippet": "alpha alpha",
|
||||
"stale": false
|
||||
@@ -57,6 +58,7 @@
|
||||
"vector_rank": null,
|
||||
"vector_score": null
|
||||
},
|
||||
"score_kind": "bm25",
|
||||
"section_label": "Snap",
|
||||
"snippet": "alpha bravo charlie",
|
||||
"stale": false
|
||||
|
||||
Reference in New Issue
Block a user