diff --git a/.github/workflows/maint-78-model-evaluation-pilot.yml b/.github/workflows/maint-78-model-evaluation-pilot.yml index b559920c3..7f3836f00 100644 --- a/.github/workflows/maint-78-model-evaluation-pilot.yml +++ b/.github/workflows/maint-78-model-evaluation-pilot.yml @@ -24,10 +24,16 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} CLAUDE_API_STRANSKE: ${{ secrets.CLAUDE_API_STRANSKE }} run: | - uv run --extra dev python tools/run_model_eval_pilot.py --output pilot-results.json + uv run --extra dev python -m tools.run_model_eval_pilot --output pilot-results.json - name: Summarize pilot if: always() run: | + if [ ! -f pilot-results.json ]; then + echo '## Verifier model pilot' >> "$GITHUB_STEP_SUMMARY" + echo 'The pilot failed before producing a results artifact; inspect the run step.' \ + >> "$GITHUB_STEP_SUMMARY" + exit 0 + fi { echo '## Verifier model pilot' echo 'The pilot narrows candidates only; approval still requires the 75-case corpus.' @@ -43,4 +49,4 @@ jobs: name: verifier-model-pilot-${{ github.run_id }} path: | pilot-results.json - if-no-files-found: error + if-no-files-found: warn diff --git a/tests/workflows/test_model_eval_pilot_workflow.py b/tests/workflows/test_model_eval_pilot_workflow.py new file mode 100644 index 000000000..5a37bce8e --- /dev/null +++ b/tests/workflows/test_model_eval_pilot_workflow.py @@ -0,0 +1,21 @@ +from pathlib import Path + +import yaml + + +def test_model_eval_pilot_runs_as_importable_module() -> None: + root = Path(__file__).resolve().parents[2] + workflow = yaml.safe_load( + (root / ".github/workflows/maint-78-model-evaluation-pilot.yml").read_text(encoding="utf-8") + ) + steps = workflow["jobs"]["pilot"]["steps"] + pilot = next(step for step in steps if step.get("name") == "Run paired 30-case pilot") + summary = next(step for step in steps if step.get("name") == "Summarize pilot") + upload = next(step for step in steps if "actions/upload-artifact@" in step.get("uses", "")) + + assert pilot["run"].count("python -m tools.run_model_eval_pilot") == 1 + assert "python tools/run_model_eval_pilot.py" not in pilot["run"] + assert summary["if"] == "always()" + assert "if [ ! -f pilot-results.json ]" in summary["run"] + assert upload["if"] == "always()" + assert upload["with"]["if-no-files-found"] == "warn"