Skip to content

Evaluators

A file in evaluators/ defines one Evaluator, a rubric and the Function that grades an output against it.

A file in evaluators/ defines one Evaluator: a rubric and the Function that grades an output against it and returns a verdict.

  • evaluators/
  • notice-tone.tsgrades every renewal notice before it sends

Reference

TypeScript with one default export.

ExportTypeHolds
defaultevaluator({ rubric, grade })The Evaluator
rubricstringWhat a passing output does, in plain words
grade(output, $) => verdictReturns { pass, score, reason }; its kind follows its code, as in any Function

A Verb, a Role or an Offer names an Evaluator by its path.

Examples

Minimal

evaluators/notice-tone.ts
import { evaluator } from 'startup-builder'

export default evaluator({ rubric: 'Under 120 words.', grade: (text: string) => ({ pass: text.split(' ').length < 120 }) })

Leaseline

evaluators/notice-tone.ts
import { evaluator } from 'startup-builder'

export default evaluator({
  rubric: 'States the end date and the new rent, offers one clear next step, and makes no threat.',
  grade: async (notice: string, $) => $`Grade this renewal notice against the rubric: ${notice}`,
})

What it builds

The SoftwareBuilder compiles the file into one Evaluator Version.

  • an Evaluator with its rubric
  • a verdict Event for each graded output, written to the Action
  • a failing verdict on a required Evaluator blocks the output and opens a Task

Good to know

  • Change.review runs every Evaluator on a Change's preview.
  • A Role's autonomy climbs on its Evaluators' verdicts; see Role tests.