fix(eval): score full anchored completions

This commit is contained in:
Joseph Magly
2026-08-29 19:00:51 -04:00
parent 4b737cba64
commit 95c0cd606d
2 changed files with 19 additions and 5 deletions
+9
View File
@@ -118,6 +118,14 @@ class TestCoherenceScoring:
def test_accepts_relevant_completion(self, prompt, completion):
assert _is_coherent_completion(prompt, completion) is True
def test_accepts_concise_anchored_completion(self):
assert _is_coherent_completion("The capital of France is", "Paris") is True
def test_scores_anchors_after_log_preview_boundary(self):
completion = "The exact defined value follows. " + ("context " * 30) + "299,792,458 m/s"
assert len(completion) > 200
assert _is_coherent_completion("The speed of light in a vacuum is", completion) is True
def test_rejects_fluent_but_irrelevant_completion(self):
assert _is_coherent_completion(
"The capital of France is",
@@ -305,6 +313,7 @@ class TestPipelineInit:
pipeline._enforce_generation_guardrails(coherence, degenerate)
assert exc_info.value.metric == metric
assert pipeline._quality_metrics["coherence_degenerate_fraction"] == degenerate
def test_cancellation_is_terminal_and_cleanup_unloads_model(self):
from threading import Event