from __future__ import annotations from pathlib import Path ROOT = Path(__file__).resolve().parents[2] def test_split_background_promotion_workflow_runs_split_then_split_aware_report() -> None: script_path = ROOT / "scripts" / "run_split_background_promotion_workflow.sh" assert script_path.exists() source = script_path.read_text(encoding="utf-8") assert "run_background_corpus_split_matrix.sh" in source assert "build_detection_model_promotion_report.py" in source assert "--background-split-summary" in source assert "background_corpus_split_summary.json" in source assert "PROMOTION_POSITIVE_PORTFOLIO_PATH" in source assert "BACKGROUND_SPLIT_OUTPUT_DIR" in source assert "PROMOTION_OUTPUT_DIR" in source assert "--hard-negative-summary" not in source assert "download model" not in source.lower() assert "promote model default" not in source.lower() def test_readiness_checks_split_background_promotion_workflow_syntax() -> None: readiness = (ROOT / "scripts" / "run_readiness_check.sh").read_text(encoding="utf-8") assert "bash -n scripts/run_split_background_promotion_workflow.sh" in readiness