pub fn pick_primary(snapshots: &[AgentSnapshot]) -> Option<&AgentSnapshot>Expand description
Pick the primary candidate.
Two paths to “primary”:
- Recency dominance: top was used ≥ 4 h after the runner-up. Wins unconditionally — fresh activity beats accumulated volume.
- Score gap: top’s score is ≥ 1.5× the runner-up’s. Used when both candidates were touched recently and the formula has to break ties on volume.
Returns None when neither path applies (caller should ask the user) or
when no candidate has a positive score.