Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

test: remove 10 duplicate dual_confidence tests already covered by sibling file (#4255)

LearningCircuitdc507337bb27
diff --git a/tests/advanced_search_system/constraint_checking/test_dual_confidence_checker.py b/tests/advanced_search_system/constraint_checking/test_dual_confidence_checker.py
index 0e2126a298..151e21405d 100644
--- a/tests/advanced_search_system/constraint_checking/test_dual_confidence_checker.py
+++ b/tests/advanced_search_system/constraint_checking/test_dual_confidence_checker.py
@@ -136,143 +136,9 @@ class TestDualConfidenceCheckerInit:
assert checker.model is mock_model
-class TestShouldEarlyReject:
- """Tests for _should_early_reject method."""
-
- def test_rejects_high_negative(self):
- """Rejects when negative evidence exceeds threshold."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- checker = DualConfidenceChecker(mock_model, negative_threshold=0.25)
-
- result = checker._should_early_reject(0.5, 0.3) # negative > 0.25
-
- assert result is True
-
- def test_rejects_low_positive(self):
- """Rejects when positive evidence below threshold."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- checker = DualConfidenceChecker(mock_model, positive_threshold=0.4)
-
- result = checker._should_early_reject(0.3, 0.1) # positive < 0.4
-
- assert result is True
-
- def test_accepts_good_scores(self):
- """Accepts when scores meet thresholds."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- checker = DualConfidenceChecker(
- mock_model, negative_threshold=0.25, positive_threshold=0.4
- )
-
- result = checker._should_early_reject(0.6, 0.1) # Good scores
-
- assert result is False
-
-
-class TestShouldRejectCandidateFromAverages:
- """Tests for should_reject_candidate_from_averages method."""
-
- def test_rejects_high_negative_evidence(self):
- """Rejects when average negative evidence high."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- checker = DualConfidenceChecker(mock_model, negative_threshold=0.25)
-
- candidate = MockCandidate(name="Test")
- constraint = MockConstraint(value="test constraint")
-
- should_reject, reason = checker.should_reject_candidate_from_averages(
- candidate,
- constraint,
- 0.5,
- 0.3, # negative > 0.25
- )
-
- assert should_reject is True
- assert "negative evidence" in reason.lower()
-
- def test_rejects_low_positive_evidence(self):
- """Rejects when average positive evidence low."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- checker = DualConfidenceChecker(mock_model, positive_threshold=0.4)
-
- candidate = MockCandidate(name="Test")
- constraint = MockConstraint(value="test constraint")
-
- should_reject, reason = checker.should_reject_candidate_from_averages(
- candidate,
- constraint,
- 0.2,
- 0.1, # positive < 0.4
- )
-
- assert should_reject is True
- assert "positive evidence" in reason.lower()
-
- def test_accepts_good_averages(self):
- """Accepts when averages meet thresholds."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- checker = DualConfidenceChecker(mock_model)
-
- candidate = MockCandidate(name="Test")
- constraint = MockConstraint(value="test constraint")
-
- should_reject, reason = checker.should_reject_candidate_from_averages(
- candidate,
- constraint,
- 0.7,
- 0.1, # Good averages
- )
-
- assert should_reject is False
- assert reason == ""
-
-
class TestShouldRejectCandidate:
"""Tests for should_reject_candidate method."""
- def test_returns_false_for_empty_evidence(self):
- """Returns false when no evidence provided."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- checker = DualConfidenceChecker(mock_model)
-
- candidate = MockCandidate(name="Test")
- constraint = MockConstraint(value="constraint")
-
- should_reject, reason = checker.should_reject_candidate(
- candidate, constraint, []
- )
-
- assert should_reject is False
- assert reason == ""
-
def test_calculates_averages_from_evidence(self):
"""Calculates averages from dual evidence."""
from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
@@ -303,61 +169,6 @@ class TestShouldRejectCandidate:
class TestLLMPrescreenCandidate:
"""Tests for _llm_prescreen_candidate method."""
- def test_returns_not_rejected_without_query(self):
- """Returns not rejected when no original query."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- checker = DualConfidenceChecker(mock_model)
-
- candidate = MockCandidate(name="Test")
- constraints = [MockConstraint(value="c1")]
-
- result = checker._llm_prescreen_candidate(candidate, constraints, None)
-
- assert result["should_reject"] is False
-
- def test_accepts_high_quality_answer(self):
- """Accepts answer with high quality score."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- mock_model.invoke.return_value = Mock(content="85")
- checker = DualConfidenceChecker(mock_model)
-
- candidate = MockCandidate(name="Good Answer")
- constraints = [MockConstraint(value="c1")]
-
- result = checker._llm_prescreen_candidate(
- candidate, constraints, "What is the answer?"
- )
-
- assert result["should_reject"] is False
-
- def test_rejects_low_quality_answer(self):
- """Rejects answer with low quality score."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- mock_model.invoke.return_value = Mock(content="25")
- checker = DualConfidenceChecker(mock_model)
-
- candidate = MockCandidate(name="Bad Answer")
- constraints = [MockConstraint(value="c1")]
-
- result = checker._llm_prescreen_candidate(
- candidate, constraints, "What is the answer?"
- )
-
- assert result["should_reject"] is True
- assert "Poor answer quality" in result["reason"]
-
def test_accepts_on_parse_failure(self):
"""Accepts by default when score parsing fails."""
from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (