Scorer registry
This registry records the built-in Check (scorer) IDs madbench exposes, the scoring
contract they follow, and the implementation source used when adding Mastra
parity. Result.Score remains normalized high-is-good in [0,1] for every
Check. Risk-native measurements, such as toxicity or hallucination risk, are
stored in Result.Evidence.
Source policy
The ID list and categories come from the user-captured mastra scorers list
output. Implementation references come from the published Mastra scorer
surface and the package versions pinned by madbench's parity testdata.
These IDs correspond to madbench Check types:
- Mastra built-in scorer docs:
mastra.ai/docs/evals/built-in-scorers - Mastra scorer package:
@mastra/evals@1.2.3 - Parity runner package:
@mastra/core@1.37.1 - Embedded JS dependencies:
compromise@14.15.1,keyword-extractor@0.0.28,sentiment@5.0.2 - Native-port dependency reference:
string-similarity@4.0.4
Exactness levels
| Level | Meaning |
|---|---|
| Embedded JS source parity | madbench bundles the same JS dependency family Mastra uses and runs it in-process with goja; no Node, Bun, npm, or esbuild is needed at runtime. |
| Native Go algorithm port | madbench implements the same deterministic algorithm in Go and verifies it against Mastra on shared testdata. |
| Compatible madbench judge | madbench exposes the same scorer ID and semantic inputs through llmjudge, preserving madbench's high-is-good score contract and risk evidence. |
Registry
| ID | Category | Type | Default threshold | Implementation | Source version | Reference |
|---|---|---|---|---|---|---|
answer-relevancy | Output quality | LLM judge | 0.7 | Compatible madbench judge in pkg/check/llmjudge; prompt is injected as Vars["prompt"] when absent. | @mastra/evals@1.2.3 semantics | Mastra answer relevancy |
toxicity | Output quality | LLM judge, risk-inverted | 0.7 | Compatible madbench judge; primary score is 1 - raw_toxicity, with raw_toxicity in evidence. | @mastra/evals@1.2.3 semantics | Mastra toxicity |
prompt-alignment | Output quality | LLM judge | 0.7 | Compatible madbench judge that evaluates output adherence to prompt instructions and format. | @mastra/evals@1.2.3 semantics | Mastra prompt alignment |
completeness | Output quality | Code | 0.7 | Embedded JS source parity through pkg/check/builtin/mastra_js; uses compromise extraction for nouns, verbs, topics, and terms. | @mastra/evals@1.2.3, compromise@14.15.1 | Mastra completeness |
keyword-coverage | Output quality | Code | 1.0 | Embedded JS source parity through pkg/check/builtin/mastra_js; uses keyword-extractor with English stop-word filtering and deduplication. | @mastra/evals@1.2.3, keyword-extractor@0.0.28 | Mastra keyword coverage |
tone | Output quality | Code | 0.7 | Embedded JS source parity through pkg/check/builtin/mastra_js; uses sentiment comparative scores and Mastra's variance/reference-tone modes. | @mastra/evals@1.2.3, sentiment@5.0.2 | Mastra tone consistency |
bias | Accuracy and reliability | LLM judge, risk-inverted | 0.7 | Compatible madbench judge; primary score is 1 - raw_bias, with raw_bias in evidence. | @mastra/evals@1.2.3 semantics | Mastra bias |
faithfulness | Accuracy and reliability | LLM judge | 0.7 | Compatible madbench judge comparing output to supplied context/reference material. | @mastra/evals@1.2.3 semantics | Mastra faithfulness |
hallucination | Accuracy and reliability | LLM judge, risk-inverted | 0.7 | Compatible madbench judge; primary score is 1 - raw_hallucination, with raw_hallucination in evidence. | @mastra/evals@1.2.3 semantics | Mastra hallucination |
llm-tool-call-accuracy | Accuracy and reliability | LLM judge | 0.7 | Compatible madbench judge that evaluates intended tool usage, available tools, expected tools, and observed session. | @mastra/evals@1.2.3 semantics | Mastra tool call accuracy |
noise-sensitivity | Accuracy and reliability | LLM judge, risk-inverted | 0.7 | Compatible madbench judge; primary score is 1 - raw_noise_sensitivity, with raw_noise_sensitivity in evidence. | @mastra/evals@1.2.3 semantics | Mastra noise sensitivity |
content-similarity | Accuracy and reliability | Code | 0.7 | Native Go algorithm port of Mastra's string-similarity character-bigram Dice comparison. | @mastra/evals@1.2.3, string-similarity@4.0.4 | Mastra content similarity |
textual-difference | Accuracy and reliability | Code | 0.7 | Native Go algorithm port using longest-common-subsequence ratio; higher means more similar. | @mastra/evals@1.2.3 algorithm | Mastra textual difference |
code-tool-call-accuracy | Accuracy and reliability | Code | 1.0 | Native Go algorithm port for expected-tool and expected-tool-order checks, including strict mode. | @mastra/evals@1.2.3 algorithm | Mastra tool call accuracy |
context-precision | Context quality | LLM judge | 0.7 | Compatible madbench judge for context ordering and precision. | @mastra/evals@1.2.3 semantics | Mastra context precision |
context-relevance | Context quality | LLM judge | 0.7 | Compatible madbench judge for context utility and relevance to the prompt/output. | @mastra/evals@1.2.3 semantics | Mastra context relevance |
Runtime notes
completeness, keyword-coverage, and tone are the only built-ins that
carry embedded JavaScript. The source file is
pkg/check/builtin/mastra_js/scorers.js; bundle.js is generated with esbuild
and embedded into the Go binary. Regenerate it only when changing the bridge
source or the pinned JS dependency versions.
The deterministic code Checks are covered by the cross-framework parity suite
under tests/mastra-parity/. The AI Check scorer IDs are covered by mock-provider
tests for registration, prompt construction, Expectation handling, and risk
evidence. Live AI Check parity should use the same configured judge Model on both
Mastra and madbench; pass/fail is the acceptance signal, while exact score
matching is diagnostic.