PythiloLesson 11 of 12 · progress kept in this browser

Require quality, latency and cost evidence together

A candidate model can improve an offline metric while exceeding the serving latency or cost budget. A release gate should evaluate all declared constraints and retain the reason for each rejection. Missing or nonfinite evidence should not be treated as a passing score.

This exercise is a deterministic policy over already collected evidence. It does not claim to perform a real deployment or statistical significance test. The quality margin and budgets are predeclared inputs. Production rollout additionally needs a shadow or canary phase, monitoring, rollback ownership and a plan for delayed outcome labels.

candidate={"gain":.02,"p95_ms":80,"cost":.01}
print(candidate["gain"]>=.01 and candidate["p95_ms"]<=100)
Your task

Implement promotion_reasons(candidate,min_gain,max_p95,max_cost). candidate has gain,p95_ms,cost. Return ordered reasons quality,latency,cost for failed bounds; missing/nonfinite evidence yields only ["invalid evidence"]. Require nonnegative latency and cost evidence.