pub fn rank<'a>(
challenges: &'a [Challenge],
context: &str,
) -> Vec<(f64, &'a Challenge)>Expand description
BM25 over the challenges’ own question text, queried with the drone’s
context (prompt, touches, its plan). Evaluated against keyword-IDF, dense
and reranked retrieval on graded qrels (internal evaluation “retrieval-plan-queries”, not published):
BM25 ranked the relevant lessons highest. Each score is multiplied by the
challenge’s outcome weight, so a lesson that keeps being asked and then
corrected anyway sinks below equally relevant ones, and by its authors’
trust in its area relative to neutral (trust / 0.5: no evidence leaves the
score unchanged). A lesson hidden by its successor is never ranked; the live
successor inherits its relevance (trust.rs successors), so the replacing
claim is asked where the replaced one would have been. A supersession that
does not hide (a less trusted engineer contradicting another) keeps both
live, and render shows them as a disagreement. A scoped lesson whose scope
the context never names scores 0 (in_scope): it is neither asked nor passes
its relevance on. Returns every challenge with score > 0, best first.
A lesson with facets (facets.rs) is several documents: its question and each facet. Its score is its
best document’s (bm25_groups), with idf counted over lessons, so a store without facets ranks
exactly as BM25 over the questions, and the prefilter’s normalisation by the largest idf stays valid.