From e8cd463cabc15ffc039ed10e7ad1949324a746a3 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 7 Jul 2026 02:20:56 +0200 Subject: [PATCH] Fix calibration f1 metric fallback --- backend/tests/test_sprint124_detection_calibration_sweep.py | 1 + scripts/run_detection_calibration_sweep.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/tests/test_sprint124_detection_calibration_sweep.py b/backend/tests/test_sprint124_detection_calibration_sweep.py index 24588218..777bc7d7 100644 --- a/backend/tests/test_sprint124_detection_calibration_sweep.py +++ b/backend/tests/test_sprint124_detection_calibration_sweep.py @@ -22,6 +22,7 @@ def test_detection_calibration_sweep_reuses_real_data_workflow_and_reports_qa_me assert "false_positives" in script assert "false_negatives" in script assert "quality_score" in script + assert 'metrics.get("f1")' in script assert "best_by_score" in script assert "calibration_summary.json" in script assert "demo/workflow" not in script diff --git a/scripts/run_detection_calibration_sweep.sh b/scripts/run_detection_calibration_sweep.sh index b0e4b0c7..ccab3ae5 100644 --- a/scripts/run_detection_calibration_sweep.sh +++ b/scripts/run_detection_calibration_sweep.sh @@ -159,7 +159,7 @@ summary = { "quality_score": quality_check.get("score"), "precision": metrics.get("precision"), "recall": metrics.get("recall"), - "f1_score": metrics.get("f1_score"), + "f1_score": metrics.get("f1_score", metrics.get("f1")), "mean_iou": metrics.get("mean_iou"), "matches": findings.get("matches"), "false_positives": findings.get("false_positives"),