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 6 more duplicate dual_confidence tests (batch 2) (#4257)

LearningCircuit5db82b51e8bc
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 151e21405d..d2ddd5e57c 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
@@ -166,48 +166,6 @@ class TestShouldRejectCandidate:
assert should_reject is False
-class TestLLMPrescreenCandidate:
- """Tests for _llm_prescreen_candidate method."""
-
- 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 (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- mock_model.invoke.return_value = Mock(content="no score here")
- checker = DualConfidenceChecker(mock_model)
-
- candidate = MockCandidate(name="Answer")
- constraints = [MockConstraint(value="c1")]
-
- result = checker._llm_prescreen_candidate(
- candidate, constraints, "question"
- )
-
- assert result["should_reject"] is False
-
- def test_accepts_on_exception(self):
- """Accepts by default when exception occurs."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- mock_model.invoke.side_effect = Exception("LLM error")
- checker = DualConfidenceChecker(mock_model)
-
- candidate = MockCandidate(name="Answer")
- constraints = [MockConstraint(value="c1")]
-
- result = checker._llm_prescreen_candidate(
- candidate, constraints, "question"
- )
-
- assert result["should_reject"] is False
-
-
class TestEvaluateConstraintWithReevaluation:
"""Tests for _evaluate_constraint_with_reevaluation method."""
@@ -320,27 +278,6 @@ class TestCheckCandidate:
assert hasattr(result, "constraint_scores")
assert hasattr(result, "detailed_results")
- def test_prescreen_rejects_low_quality_answer(self):
- """Pre-screen rejects low quality answers via _llm_prescreen_candidate."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- mock_model.invoke.return_value = Mock(content="20") # Low quality score
- checker = DualConfidenceChecker(mock_model)
-
- candidate = MockCandidate(name="Bad Answer")
- constraints = [MockConstraint(value="c1")]
-
- # Test the pre-screen method directly
- result = checker._llm_prescreen_candidate(
- candidate, constraints, "test query"
- )
-
- assert result["should_reject"] is True
- assert "Poor answer quality" in result["reason"]
-
def test_stores_positive_negative_uncertainty(self):
"""Stores positive/negative/uncertainty in constraint scores."""
from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
@@ -526,54 +463,3 @@ class TestLogConstraintResultDetailed:
checker._log_constraint_result_detailed(
candidate, constraint, 0.3, 0.2, 0.5, 0.3, 2
)
-
-
-class TestCalculateWeightedScore:
- """Tests for _calculate_weighted_score method."""
-
- def test_calculates_weighted_average(self):
- """Calculates weighted average correctly."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- checker = DualConfidenceChecker(mock_model)
-
- scores = [0.8, 0.4]
- weights = [2.0, 1.0]
-
- result = checker._calculate_weighted_score(scores, weights)
-
- # (0.8 * 2.0 + 0.4 * 1.0) / 3.0 = 2.0 / 3.0 = 0.667
- assert abs(result - 0.667) < 0.01
-
- def test_handles_empty_scores(self):
- """Handles empty score list."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- checker = DualConfidenceChecker(mock_model)
-
- result = checker._calculate_weighted_score([], [])
-
- assert result == 0.0
-
- def test_handles_equal_weights(self):
- """Calculates simple average for equal weights."""
- from local_deep_research.advanced_search_system.constraint_checking.dual_confidence_checker import (
- DualConfidenceChecker,
- )
-
- mock_model = Mock()
- checker = DualConfidenceChecker(mock_model)
-
- scores = [0.9, 0.5, 0.1]
- weights = [1.0, 1.0, 1.0]
-
- result = checker._calculate_weighted_score(scores, weights)
-
- # Simple average: 0.5
- assert abs(result - 0.5) < 0.01