Scoring contract
madbench separates the verdict from the measurement details:
passis the Check's Expectation verdict.scoreis the normalized utility score used for aggregation and comparison.reasonis the human-readable explanation.evidenceholds structured details, including raw metric-native values.
The unified score
score is always a number from 0 to 1, and higher is always better.
This is deliberate. Composite Checks such as select-best, max-score,
and compare add, average, and maximize child Check scores. They must be
able to treat every child score the same way, regardless of whether the
underlying measurement is answer quality, latency, cost, toxicity risk, or
hallucination risk.
Examples:
containsreturns1when the text is present and0when it is absent.latencypasses when actual latency is under the Expectation, but its score is normalized as quality: faster runs score higher.costpasses when actual cost is under the Expectation, but its score is also normalized as quality: cheaper runs score higher.- Safety Checks should return a high-is-good safety score, while preserving
raw risk values such as
raw_toxicity,raw_bias, orraw_hallucinationinevidence.
Details metrics
Keep raw measurements in evidence when they are useful for debugging but
should not participate directly in score aggregation. Use explicit named
metrics only when the raw value is intentionally part of a user's report or of a
metrics: expression.
Good evidence fields:
{
"raw_toxicity": 0.82,
"unsafe_categories": ["personal_attack"],
"judge_model": "claude-sonnet-5"
}
Good named scores:
scenarios:
- name: answers
checks:
- type: llm-rubric
metric: answer_quality
value: "answers the question accurately"
- type: latency
metric: latency_quality
threshold: 90000
metrics:
- metrics.answerQuality = mean(answer_quality)
- metrics.overall = (mean(answer_quality) + mean(latency_quality)) / 2
metric: names the score on the scores line, and the report block reads it under
that name as the array of the score across the run's Scenarios. No entry copies it.
A Check's metric: and an entry that writes the same name
(metrics.answer_quality = score) refuse the bench at load: a name is a Check's
score or a written value, never both. See
A Check's metric: is a sample.
Check author rules
When adding a Check:
- Return
Result.Scoreas normalized utility, where1is best and0is worst. - Set
Result.Passfrom the Check's Expectation semantics. - Put raw lower-is-better values in
Result.Evidence. - Document any evidence keys that users might depend on.
- Never return a lower-is-better value as
Result.Score; it will invert composites and row-level averages.
This means madbench can preserve metric-native detail without making users remember which Check types need to be minimized.