Tests: a version declared over the API is blocked only by ML-01b

models dev (feb934d) relaxed ML-01a: not every model has the five routine records (a prevalence-incidence mixture
such as CaCu's PIM has no class balance or classifier calibration), so requiring all of them blocked the promotion
of models whose training run is in order. ML-01a now passes when the version comes from its training run, and its
detail reports which routine records that run holds. A version registered over HTTP still has a run, so it passes
ML-01a too; what keeps it from production is that it carries no saved model (ML-01b). This test expected both checks
to fail and would break as soon as the WebApi runs on that models dev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
This commit is contained in:
2026-11-21 19:22:32 -06:00
parent b7ce3e7ddd
commit 4840bd3dc8
+4 -4
View File
@@ -113,13 +113,13 @@ REPORTS = {"technical_validation_report_uri": "docs/tecnica.pdf", "clinical_vali
def test_model_version_lifecycle_over_http(client):
"""A version registered over HTTP carries no routine records or model, so it can't be promoted; trained ones can,
and promoting the second retires the first. Fails if the ML-01a/ML-01b checks start trusting what's declared
over the API, or promotion stops retiring the previous version."""
"""A version registered over HTTP carries no saved model, so it can't be promoted; trained ones can, and promoting
the second retires the first. Fails if the ML-01b check starts trusting what's declared over the API, or promotion
stops retiring the previous version."""
declared = _register(client, "v0", scenario="lifecycle")
checks = client.get(f"/governance/model-versions/cacu/lifecycle/{declared['version']}/checks").get_json()
assert checks["ready"] is False
assert [c["code"] for c in checks["checks"] if not c["passed"]] == ["ML-01a", "ML-01b"]
assert [c["code"] for c in checks["checks"] if not c["passed"]] == ["ML-01b"]
blocked = client.post(f"/governance/model-versions/cacu/lifecycle/{declared['version']}/promote")
assert blocked.status_code == 409 and any(not c["passed"] for c in blocked.get_json()["checks"])