pub struct SelectorInput<T> {
pub id: String,
pub content: T,
pub size: usize,
pub score: f32,
pub category: Option<String>,
pub information_gain: Option<f32>,
pub rank_score: Option<f64>,
}Expand description
A single input item to a selector operation.
Fields§
§id: StringStable string identifier for deterministic tie-breaking.
content: TThe item payload carried through selection.
size: usizeSize in the unit of the caller’s budget (tokens, bytes, count).
score: f32Pre-computed relevance score.
category: Option<String>Optional category for diversity and category-weight scoring.
information_gain: Option<f32>Pre-computed information gain (KL divergence proxy) for this candidate.
Callers pre-compute this because the Selector is pure-math and has no
access to the embedding space required to estimate KL divergence. When
None (the default), the value is treated as 0.0. Only has an effect
when SelectorWeights.epistemic_weight > 0.0.
rank_score: Option<f64>Higher-precision pre-conversion effective score used for rank comparisons, when available.
Callers that compute the score in f64 (e.g. ComposePipeline, which
multiplies an objective score by a precision weight) should set this
instead of relying solely on the narrowed score: f32 field — ranking
widens score back through DeterministicScore::from_f32 when this is
None, but two f64 scores that differ by less than an f32 ulp would
otherwise collapse to the same f32 bit pattern before the selector
ever compares them (khive-score contract: ADR fixed-point ranking).
Does not affect min_score filtering, which continues to operate on
score. category_weights multipliers DO scale rank_score (by the
same weight applied to score) so a caller-supplied high-precision
rank base still reflects category weighting during rank comparisons.
Trait Implementations§
Source§impl<T: Clone> Clone for SelectorInput<T>
impl<T: Clone> Clone for SelectorInput<T>
Source§fn clone(&self) -> SelectorInput<T>
fn clone(&self) -> SelectorInput<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more