Skip to content

2.4.0

Choose a tag to compare

@scottpmiller scottpmiller released this 09 Aug 13:50
· 12 commits to main since this release
2.4.0
a4a7e93

What's Changed

A run without a baseline can now say whether it passed.

Added

  • RunResult.checks, a models.ThresholdCheck the runner fills in: the suite's absolute guardrails (min/max) measured against this run. Most of a suite's rules are absolute and answerable from one run; only the win metric and the relative rules need a baseline.

    There is nothing new to call. compare is for comparing, and a single run was never a comparison — so the runner does it, the same way it already records graders.

    verdict: pass
      [ok] errors - 0.0000 ok
      [ok] length_ok - 1.0000 ok
      [skipped] cta_mentions_offer - must_not_decrease not evaluated: needs a baseline
    
  • compare.check_thresholds(scorecard, thresholds), which the runner uses.

Changed

  • Breaking: GuardrailResult.passed is now bool | None. None means the rule could not be evaluated — a must_not_increase / must_not_decrease with no baseline. Test passed is False for a breach; not passed now also catches the skipped case. The Markdown and HTML reporters render it as skipped rather than a breach.

  • store.score_rows reports run.checks on the gate columns when no Comparison is passed: gate_verdict and the per-metric guardrail become real, while gate_win stays 'none'.

    That split is the point. gate_win is what marks the three win_* fields as never computed rather than measured at zero, so an ungated run reports a real verdict without claiming a comparison happened. A rule that could not run reports guardrail = 'none' with the reason in guardrail_gap, never a false pass.

  • A Comparison supersedes the run's own checks: same rules, plus a baseline, so it gets the relative ones too.

Upgrading: if you read GuardrailResult.passed, change not g.passed to g.passed is False.