Skip to main content

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:

Exactness levels​

LevelMeaning
Embedded JS source paritymadbench 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 portmadbench implements the same deterministic algorithm in Go and verifies it against Mastra on shared testdata.
Compatible madbench judgemadbench exposes the same scorer ID and semantic inputs through llmjudge, preserving madbench's high-is-good score contract and risk evidence.

Registry​

IDCategoryTypeDefault thresholdImplementationSource versionReference
answer-relevancyOutput qualityLLM judge0.7Compatible madbench judge in pkg/check/llmjudge; prompt is injected as Vars["prompt"] when absent.@mastra/evals@1.2.3 semanticsMastra answer relevancy
toxicityOutput qualityLLM judge, risk-inverted0.7Compatible madbench judge; primary score is 1 - raw_toxicity, with raw_toxicity in evidence.@mastra/evals@1.2.3 semanticsMastra toxicity
prompt-alignmentOutput qualityLLM judge0.7Compatible madbench judge that evaluates output adherence to prompt instructions and format.@mastra/evals@1.2.3 semanticsMastra prompt alignment
completenessOutput qualityCode0.7Embedded 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.1Mastra completeness
keyword-coverageOutput qualityCode1.0Embedded 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.28Mastra keyword coverage
toneOutput qualityCode0.7Embedded 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.2Mastra tone consistency
biasAccuracy and reliabilityLLM judge, risk-inverted0.7Compatible madbench judge; primary score is 1 - raw_bias, with raw_bias in evidence.@mastra/evals@1.2.3 semanticsMastra bias
faithfulnessAccuracy and reliabilityLLM judge0.7Compatible madbench judge comparing output to supplied context/reference material.@mastra/evals@1.2.3 semanticsMastra faithfulness
hallucinationAccuracy and reliabilityLLM judge, risk-inverted0.7Compatible madbench judge; primary score is 1 - raw_hallucination, with raw_hallucination in evidence.@mastra/evals@1.2.3 semanticsMastra hallucination
llm-tool-call-accuracyAccuracy and reliabilityLLM judge0.7Compatible madbench judge that evaluates intended tool usage, available tools, expected tools, and observed session.@mastra/evals@1.2.3 semanticsMastra tool call accuracy
noise-sensitivityAccuracy and reliabilityLLM judge, risk-inverted0.7Compatible madbench judge; primary score is 1 - raw_noise_sensitivity, with raw_noise_sensitivity in evidence.@mastra/evals@1.2.3 semanticsMastra noise sensitivity
content-similarityAccuracy and reliabilityCode0.7Native Go algorithm port of Mastra's string-similarity character-bigram Dice comparison.@mastra/evals@1.2.3, string-similarity@4.0.4Mastra content similarity
textual-differenceAccuracy and reliabilityCode0.7Native Go algorithm port using longest-common-subsequence ratio; higher means more similar.@mastra/evals@1.2.3 algorithmMastra textual difference
code-tool-call-accuracyAccuracy and reliabilityCode1.0Native Go algorithm port for expected-tool and expected-tool-order checks, including strict mode.@mastra/evals@1.2.3 algorithmMastra tool call accuracy
context-precisionContext qualityLLM judge0.7Compatible madbench judge for context ordering and precision.@mastra/evals@1.2.3 semanticsMastra context precision
context-relevanceContext qualityLLM judge0.7Compatible madbench judge for context utility and relevance to the prompt/output.@mastra/evals@1.2.3 semanticsMastra 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.