from pathlib import Path ROOT = Path(__file__).resolve().parents[2] def test_operator_hard_negative_matrix_scores_background_samples_without_qa() -> None: script_path = ROOT / "scripts" / "run_operator_hard_negative_detection_matrix.sh" readiness = (ROOT / "scripts" / "run_readiness_check.sh").read_text(encoding="utf-8") assert script_path.exists() script = script_path.read_text(encoding="utf-8") assert "bash -n scripts/run_operator_hard_negative_detection_matrix.sh" in readiness assert "OPERATOR_SAMPLE_MANIFEST_PATH" in script assert "OPERATOR_BACKGROUND_SAMPLE_SLUGS" in script assert "background_candidate" in script assert "allow_empty_reference" in script assert "/api/v1/detection/run" in script assert "/api/v1/detection/runs/${analysis_run_id}/detections" in script assert "hard_negative_matrix_summary.json" in script assert "false_positive_pressure" in script assert "best_by_lowest_pressure" in script assert "REAL_REFERENCE_VECTOR_PATH" not in script assert "/qa/reference" not in script assert "fixture_mode" not in script assert "demo/workflow" not in script