pub struct SearchHit {
pub id: u64,
pub kind: String,
pub body: String,
pub score: f64,
pub branch: SoftFallbackBranch,
pub source_id: Option<String>,
pub ce_score: Option<f64>,
}Expand description
A single structured search hit (G1 / AC-057a-clean).
Both retrieval branches emit this shape. id is the canonical row’s
write_cursor — the interim identity carrier per
dev/adr/ADR-0.8.0-canonical-identity-substrate.md; it swaps to
logical_id at the G0 keystone (Slice 15) with no carrier reshape.
score is the G9 RRF-fused relevance (Σ 1/(RRF_K + rank) over the
branches that surfaced this body; higher = more relevant), optionally
recency-reweighted when the dedicated recency flag is on. Raw vec_distance_l2
and bm25() are fused on rank, never compared raw (they are not
comparable). branch tags which retrieval branch produced the representative
hit (vector-first when a body is surfaced by both).
source_id (G0 Phase-2 / BLOCK-2) carries the source-document provenance of
a hit. For the GraphArm branch it is the traversed edge’s source_id
(the session the fact-edge was extracted from), enabling doc_id_of to
resolve a graph-reached entity back to a gold session id. For every two-arm
(vector/text/edge) hit it is None — those resolve via the cursor map. The
field is additive and nullable; use_graph_arm=false results are byte-stable
(every hit source_id == None).
Derives Clone, Debug, PartialEq but not Eq — score: f64 forbids
total equality.
Fields§
§id: u64§kind: String§body: String§score: f64§branch: SoftFallbackBranch§source_id: Option<String>§ce_score: Option<f64>0.8.5 (EXP-0) — per-candidate cross-encoder score ce_norm = sigmoid(ce_logit) ∈ [0,1]. Some ONLY for hits inside the reranked pool
(the top pool_n when the CE model is loaded); None for the unreranked
remainder, the rerank_depth == 0 identity path, an empty list, and the
no-CE-model soft-fallback. Additive + nullable: it never participates in
ranking, so default-path ordering/scores stay byte-stable.