Skip to main content

apply_floor

Function apply_floor 

Source
pub fn apply_floor(hits: &mut Vec<Hit>)
Expand description

Adaptive confidence floor — a presentation filter, applied at the surface (MCP/CLI), NOT in the retrieval/eval path. The engine always returns the full ranked list so the eval can measure rank-2+ recall honestly; the surface uses this to drop trailing noise before showing results.

When a confident hit exists (Exact/Strong/Ambiguous), the trailing Fallback-band hits are noise, not answers — drop them (the “1 strong + 7 fallback” cleanup). When nothing is confident (a genuinely weak query, or garbage), the ranked list is kept untouched so a weak-but-real answer still surfaces and garbage still reads as rejected. The TOP hit’s band is never changed.