pub struct SamplingDecision {
pub resolved: InferenceConfig,
pub sources: FieldSources,
pub layer_names: [&'static str; 6],
pub floor: FloorClass,
pub agentic_turn: bool,
pub agentic_ceiling_applied: Option<f32>,
pub client_fields_rejected: Vec<FieldIssue>,
pub client_fields_discarded: Vec<String>,
pub applied: bool,
}Expand description
Everything resolve_sampling decided, and why.
§Why this is returned rather than logged
It used to be neither: resolve_sampling computed sources and consumed
them only inside a debug!. Three consequences, all of which cost real
defects:
- No test could assert on the pipeline’s own provenance. The tests
that look like they do build a ladder by hand and call
resolve_layers_with_sourcesdirectly, bypassing this function entirely — and did so five rungs wide against a six-rung ladder. - The agentic ceiling’s provenance interaction is invisible. Six tests assert the resulting temperature; none could assert what provenance reports when the ceiling bites, because nothing was reachable.
- There is no intent side to compare a readback against. Verifying that what gglib resolved is what llama-server applied needs both halves, and this is the half that did not exist outside a log line.
Fields§
§resolved: InferenceConfigThe values written into the body.
sources: FieldSourcesWhich rung supplied each one. Indices are into Self::layer_names.
layer_names: [&'static str; 6]The ladder’s rung names, highest priority first.
floor: FloorClassWhich class floor sat beneath it.
agentic_turn: boolWhether the request was eligible for the agentic-turn ceiling.
agentic_ceiling_applied: Option<f32>The ceiling value, if it actually capped the temperature.
Some does not mean sources.temperature is wrong: the cap is
applied after the fold and deliberately leaves the rung that supplied
the value named, because that rung did supply it — the ceiling capped
what it supplied.
client_fields_rejected: Vec<FieldIssue>Client fields that could not be read as sent. See FieldIssue.
client_fields_discarded: Vec<String>Client fields dropped by the trust gate rather than by a parse
failure — empty whenever trust_client_sampling is on.
Carries both kinds of drop: modelled fields the gate binned, and
UNMODELLED_SAMPLER_KEYS stripped from the body itself, which have
no layer to be binned from.
applied: boolWhether the resolved values actually reached body.
false when the body was not a JSON object, in which case everything
above describes a resolution that was computed and then not applied.
Distinguishing the two matters to a readback: nothing was sent, so
nothing can diverge.
Trait Implementations§
Source§impl Clone for SamplingDecision
impl Clone for SamplingDecision
Source§fn clone(&self) -> SamplingDecision
fn clone(&self) -> SamplingDecision
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SamplingDecision
impl Debug for SamplingDecision
Source§impl PartialEq for SamplingDecision
impl PartialEq for SamplingDecision
Source§fn eq(&self, other: &SamplingDecision) -> bool
fn eq(&self, other: &SamplingDecision) -> bool
self and other values to be equal, and is used by ==.