Skip to main content

pick_tier

Function pick_tier 

Source
pub fn pick_tier(
    signal: &ToolSignals,
    mode: PickerMode,
    confidence_threshold: f64,
) -> PickOutcome
Expand description

Decide a turn’s tier from its signal.

The rules run in order; the first that fires wins:

  1. Escalate — repeated failure, critical error, or compaction.
  2. Scorer — no hard reason, so weigh the two axes; if confident, follow it.
  3. Fall open — not confident: hand to the classifier, else the default.

Deterministic and pure: the async classifier lives in the caller, so rule 3 returns PickOutcome::ConsultClassifier instead of calling it here. The no_signal case (no tool activity yet) is handled one level up.