fix: use batch_size=1 for diversity test + rename Autre to Divers in overflow test

Diversity filter works across batches (source_counts updated after classify).
With batch_size=5, all 3 articles fit in one batch, bypassing the filter.
batch_size=1 forces per-article processing so the filter triggers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
master
oabrivard 3 months ago
parent e444f79c0b
commit 7ba1da4d92

@ -240,14 +240,14 @@ async fn category_overflow_spills_to_autre() {
// - 1 goes to AI News // - 1 goes to AI News
// - Overflow goes to Autre // - Overflow goes to Autre
let ai_section = sections.iter().find(|s| s["title"] == "AI News"); let ai_section = sections.iter().find(|s| s["title"] == "AI News");
let autre_section = sections.iter().find(|s| s["title"] == "Autre"); let divers_section = sections.iter().find(|s| s["title"] == "Divers");
assert!(ai_section.is_some(), "Should have AI News section"); assert!(ai_section.is_some(), "Should have AI News section");
let ai_items = ai_section.unwrap()["items"].as_array().unwrap(); let ai_items = ai_section.unwrap()["items"].as_array().unwrap();
assert_eq!(ai_items.len(), 1, "AI News should have exactly 1 item (max)"); assert_eq!(ai_items.len(), 1, "AI News should have exactly 1 item (max)");
if sections.len() > 1 { if sections.len() > 1 {
assert!(autre_section.is_some(), "Overflow should create Autre section"); assert!(divers_section.is_some(), "Overflow should create Divers section");
} }
} }
@ -293,7 +293,7 @@ async fn source_diversity_limits_articles_per_source() {
"max_links_per_source": 8, "max_links_per_source": 8,
"use_brave_search": false, "use_brave_search": false,
"article_history_days": 0, "article_history_days": 0,
"batch_size": 5, "batch_size": 1,
"source_extraction_window": 3, "source_extraction_window": 3,
"search_agent_behavior": "", "search_agent_behavior": "",
"ai_provider": "", "ai_provider": "",

Loading…
Cancel
Save