use roboticus_agent::ranking::{CandidateKind, RankedCandidate, top_k_with_pinned};
#[test]
fn ranking_works_with_mixed_sources() {
let candidates = vec![
RankedCandidate {
source_id: "github::create_issue".into(),
source_kind: CandidateKind::Tool,
raw_score: 0.9,
adjusted_score: 0.85,
token_cost: 80,
},
RankedCandidate {
source_id: "memory_store".into(),
source_kind: CandidateKind::Tool,
raw_score: 0.5,
adjusted_score: 0.5,
token_cost: 40,
},
RankedCandidate {
source_id: "episodic_42".into(),
source_kind: CandidateKind::Memory,
raw_score: 0.88,
adjusted_score: 0.88,
token_cost: 120,
},
];
let result = top_k_with_pinned(&candidates, 2, 200, &["memory_store"]);
assert!(result.iter().any(|c| c.source_id == "memory_store"));
assert_eq!(result.len(), 2);
}