Evaluator file
An Evaluator file holds one Evaluator: the rubric and the code that grade an output and return a verdict.
| Property | Value |
|---|---|
| Path | evaluators/ |
| Holds | Evaluator |
| Kind | file |
| Leaders | db-first, git-first |
| Team | Quality Team |
| Written by | Change.merge |
| Compiled by | SoftwareBuilder |
Example
evaluators/ in a Startup repository.
import { evaluator } from 'startup-builder'
export default evaluator({
rubric: 'Every bank line matches one entry, and the closing balance equals the statement.',
grade: (close: { unmatched: number; difference: number }) => ({
pass: close.unmatched === 0 && close.difference === 0,
score: close.unmatched === 0 ? 1 : 0,
reason: `${close.unmatched} unmatched lines, ${close.difference} difference`,
}),
})Exports
| Export | Kind | Type |
|---|---|---|
default | default | Evaluator |
Signature
evaluator(definition: { rubric: string; grade: (output: unknown, $: $) => Verdict | Promise<Verdict> }): EvaluatorGenerates
SoftwareBuilder compiles it into these records, Verbs and routes.