Skip to main content

record_recommend

Function record_recommend 

Source
pub fn record_recommend(
    session_id: &str,
    prompt: &str,
    stage: Stage,
    considered: &[(String, f32)],
    recs: &[Rec],
    injected: &[(String, f32)],
    abstained: Option<&str>,
)
Expand description

Record the hook’s decision on a prompt. Emitted on every ranked prompt, even when ski injects nothing, so the always-present considered ranking records where ski placed each skill on a prompt it stayed silent on.

  • considered — the top-K of the ranking the winning stage produced, before the gate: (id, raw stage score) (cosine-blend for stage 1, reranker logit for stage 2). This is the chooser’s view; joining the native pick (a use event) against it shows whether ski near-missed or never surfaced it.
  • recs — the candidates that cleared the gate (empty on abstention).
  • injected — the subset that fit the char budget (id + shown confidence).
  • abstained — why nothing was injected (Some("below_gate") etc.), or None when an injection was emitted.