Skip to content

VIP-69: Experimental.Eval and Experimental.Scorer: suites, scorers, judges, baselines and gates

Status: accepted by Will, 2026-11-23 — standard library only (no compiler or language changes). Will: "58 I accept. I accept every other language proposal but ones that don't require a change to the language and are purely library functions that don't require compiler changes at all should be marked as such". Implemented in the runtime as Experimental.Eval and Experimental.Scorer.

Will's words

Ok so give me a list of [the reference engine's] features. We need to figure out what the VIP should look like. Some of the features outside of durable execution likely should simply be in the standard library I'm guessing but we should enumerate all of them

Summary

Agentic behavior is probabilistic, so evals are as fundamental as tests.

One sentence. Experimental.Eval runs a fixed set of cases against a target, Experimental.Scorer grades each answer from 0 to 1, and a gate compares the scores with a committed baseline and returns an exit code.

One paragraph. A test asserts that an answer equals something. An answer from a model rarely equals anything; it is better or worse than the last one. The evaluation and scoring packages of the reference engine (an existing Effect durable-execution framework these built-ins are modelled on) score the answer, compare the score with a committed baseline, and turn the comparison into a CI result. This VIP ports both behind two namespaces. eval-declarations says where an eval lives and how it is run. This VIP says what runs: the suite, the scorers, model-graded rubrics, baselines, regression comparison, the gate, and scoring of live runs. Five outcomes stay distinct all the way to the exit code: a target that failed, a scorer that could not decide, a score that regressed, a score that moved for no stated reason, and a score that is missing.

 cases ──► target ──► output ──► scorers ──► scores in [0, 1] ──► compare with baseline ──► gate
                                  │ exact, contains, checks                │ regressed?       │ 0  pass
                                  │ rubric: a model grades                 │ moved? missing?  │ 1  regressed
                                  │ yours: Scorer.make                     │ only noise?      │ 5  could not decide

Decision

// proposed
effect function greet(name: string) {
  return `Hello, ${name}`
}
 
const polite = Experimental.Scorer.make({
  name: "polite",
  version: "1",
  score: (run: { output: string; expected: string }) => run.output === run.expected ? 1 : 0
})
 
export default Experimental.Eval.suite("greet", {
  target: greet,
  cases: [{ name: "ada", input: ["Ada"], expected: "Hello, Ada" }],
  scorers: [polite],
  gate: { min: 1, tolerance: 0 }
})

Module

Experimental.Eval and Experimental.Scorer, in scope with no import, as VIP-33 rules. Their code is vibelang-runtime/experimental/Eval and …/Scorer. They port the reference engine's evaluation and scoring packages.

CallMeaningReference engine
Eval.suite(name, { target, cases, scorers, trials?, concurrency?, gate? })Declare a suite. Runs nothingSuite.make, Binding.make
Eval.run(suite, { runId? })Run every case, score every outputRunner.run, with a CaseExecutor built from target
Eval.baseline(run), Eval.write, Eval.loadA baseline from a run, as text to commit, and backBaseline.fromRun, Baseline.write, Baseline.load
Eval.compare(baseline, run, tolerances?)Regressions, nondeterminism and missing observations, as a valueRegression.compare
Eval.gate(report, { mean?, min? })A verdict and a CI gradeGate.check, Gate.ciGrade, ScoreGate
Eval.fromJsonLines(text, options)Cases from a JSONL fileSuite.fromJsonLines
Eval.passAtK(n, c, k)The chance at least one of k trials passes, from c passes in nTrials.passAtK
ScorerGradesReference engine
Scorer.exactNormalized equality with expectedScorers
Scorer.contains(text)ContainmentScorers
Scorer.checks([...])A list of pure text and action checksChecks
Scorer.rubric(criteria, { model })A model grades the output against written criteriaRubric
Scorer.make({ name, version, config?, score })Your own function from { input, output, expected } to a number or an Effect of oneScorer.make
Scorer.bind(scorer, W, { sampling })Score a workflow's live runsBinding.make, Sampling

Rules

  1. A score is a finite number in [0, 1]. Anything else is refused.
  2. A scorer has an identity. Its name, version and configuration hash into a scorerKey that is written on every score it produces. A score recorded a month ago still names the exact grader. Change the grader, bump version.
  3. A scorer that fails does not fail the suite. It records an inconclusive observation with a reason and a code. A target that fails is a failed case. Neither becomes a score of zero.
  4. Regression and noise are different facts. The comparison separates a score that dropped from a case whose step key changed, which means the target took a different path. trials runs a case several times to measure the spread. A trial is a new call: replaying one recorded answer measures the recording.
  5. A baseline never updates itself. Eval.baseline records successful scores only, and writing one is a separate act with a diff to review.
  6. A gate is pure. It takes a report and options and returns a verdict. min is the lowest passing score, mean the lowest passing average, and tolerance how far a score may fall below its baseline.
  7. Three exit codes. 0 when every case cleared the gate, 1 when a score regressed or an observation went missing, 5 when the gate could not decide. A 5 is a broken harness, not a result. A partial pass never exits 0.
  8. Rubric judges are models. Scorer.rubric names its judge, { model: seat }, and records it in the scorer's identity. It does not default to the model under test, which would grade itself. A judge that cannot be reached is inconclusive; it never passes. Judge calibration, grading known answers to measure the judge, is part of Rubric.
  9. Live runs can be scored. Sampling is "all", "none", or a ratio strictly between 0 and 1 with a seed, so a replay samples the same runs. Scores persist as observations (SqlScoreStore).
  10. Limits. A suite holds at most 10,000 cases and runs at most 1,024 at once (Suite.limits).

Host needs

None for scoring. A rubric needs a model (std-model). Persisted observations need the SQL store std-durable provides.

Maintainers' decisions

This record comes from the 2026-11-09 built-in set review. The Status line above records Will’s subsequent ruling.

  • Experimental.Eval and Experimental.Scorer, in scope with no import, as VIP-33 rules. Design · Review.
  • Their code is vibelang-runtime/experimental/Eval and …/Scorer. Design · Review.
  • They port the reference engine's evaluation and scoring packages. Design · Review.
  • Call Eval.suite(name, { target, cases, scorers, trials?, concurrency?, gate? }): Meaning: Declare a suite. Runs nothing; reference engine: Suite.make, Binding.make. Design · Review.
  • Runs nothing | Suite.make, Binding.make | Design · Review.
  • Call Eval.run(suite, { runId? }): Meaning: Run every case, score every output; reference engine: Runner.run, with a CaseExecutor built from target. Design · Review.
  • Call Eval.baseline(run), Eval.write, Eval.load: Meaning: A baseline from a run, as text to commit, and back; reference engine: Baseline.fromRun, Baseline.write, Baseline.load. Design · Review.
  • Call Eval.compare(baseline, run, tolerances?): Meaning: Regressions, nondeterminism and missing observations, as a value; reference engine: Regression.compare. Design · Review.
  • Call Eval.gate(report, { mean?, min? }): Meaning: A verdict and a CI grade; reference engine: Gate.check, Gate.ciGrade, ScoreGate. Design · Review.
  • Call Eval.fromJsonLines(text, options): Meaning: Cases from a JSONL file; reference engine: Suite.fromJsonLines. Design · Review.
  • Call Eval.passAtK(n, c, k): Meaning: The chance at least one of k trials passes, from c passes in n; reference engine: Trials.passAtK. Design · Review.
  • Scorer Scorer.exact: Grades: Normalized equality with expected; reference engine: Scorers. Design · Review.
  • Scorer Scorer.contains(text): Grades: Containment; reference engine: Scorers. Design · Review.
  • Scorer Scorer.checks([...]): Grades: A list of pure text and action checks; reference engine: Checks. Design · Review.
  • Scorer Scorer.rubric(criteria, { model }): Grades: A model grades the output against written criteria; reference engine: Rubric. Design · Review.
  • Scorer Scorer.make({ name, version, config?, score }): Grades: Your own function from { input, output, expected } to a number or an Effect of one; reference engine: Scorer.make. Design · Review.
  • Scorer Scorer.bind(scorer, W, { sampling }): Grades: Score a workflow's live runs; reference engine: Binding.make, Sampling. Design · Review.
  • A score is a finite number in [0, 1]. Anything else is refused. Design · Review.
  • A scorer has an identity. Its name, version and configuration hash into a scorerKey that is written on every score it produces. Design · Review.
  • A score recorded a month ago still names the exact grader. Design · Review.
  • Change the grader, bump version. Design · Review.
  • A scorer that fails does not fail the suite. It records an inconclusive observation with a reason and a code. Design · Review.
  • A target that fails is a failed case. Design · Review.
  • Neither becomes a score of zero. Design · Review.
  • Regression and noise are different facts. The comparison separates a score that dropped from a case whose step key changed, which means the target took a different path. Design · Review.
  • trials runs a case several times to measure the spread. Design · Review.
  • A trial is a new call: replaying one recorded answer measures the recording. Design · Review.
  • A baseline never updates itself. Eval.baseline records successful scores only, and writing one is a separate act with a diff to review. Design · Review.
  • A gate is pure. It takes a report and options and returns a verdict. Design · Review.
  • min is the lowest passing score, mean the lowest passing average, and tolerance how far a score may fall below its baseline. Design · Review.
  • Three exit codes. 0 when every case cleared the gate, 1 when a score regressed or an observation went missing, 5 when the gate could not decide. Design · Review.
  • A 5 is a broken harness, not a result. Design · Review.
  • A partial pass never exits 0. Design · Review.
  • Rubric judges are models. Scorer.rubric names its judge, { model: seat }, and records it in the scorer's identity. Design · Review.
  • It does not default to the model under test, which would grade itself. Design · Review.
  • A judge that cannot be reached is inconclusive; it never passes. Design · Review.
  • Judge calibration, grading known answers to measure the judge, is part of Rubric. Design · Review.
  • Live runs can be scored. Sampling is "all", "none", or a ratio strictly between 0 and 1 with a seed, so a replay samples the same runs. Design · Review.
  • Scores persist as observations (SqlScoreStore). Design · Review.
  • Limits. A suite holds at most 10,000 cases and runs at most 1,024 at once (Suite.limits). Design · Review.
  • None for scoring. Design · Review.
  • A rubric needs a model (std-model). Design · Review.
  • Persisted observations need the SQL store std-durable provides. Design · Review.

Decisions made while building it

  • Experimental.Eval.suite and Experimental.Scorer.make never throw, because a plain VibeLang function may not throw: a scorer with no stable identity keeps the reason as scorer.problem, and Eval.run refuses a malformed suite with invalid_suite and the offending path before running anything.
  • A scorer's identity is SHA-256 of the RFC 8785 canonical JSON of { id: name, version, config }, so the VIP's name takes the place of the reference engine's separate id. Two scorers with one identity in a suite are refused.
  • A case's step key is the first 16 hex digits of SHA-256 of the output's canonical JSON, sets and maps sorted. A score that dropped at a changed step key is a regression; a score that moved at the same step key is nondeterminism (the reference engine's rule). Output that is not JSON gets one step key per type.
  • Exit codes: a missing score on either side and a failed target exit 1, as rules 3 and 7 say (the reference engine reports both as unresolved, exit 5). A gate with no score at all, an inconclusive scorer, or an invalid threshold exits 5.
  • Eval.gate(report, options) returns { verdict, exitCode, summary } with no Effect, and also takes perCase and tolerance; tolerance ignores a regression or nondeterminism no larger than it. Eval.compare keeps the reference engine's { absolute, relative } tolerances.
  • Eval.write keeps the reference engine's baseline JSON (version 1, keys and records sorted) but puts each record on its own line, so a review sees one changed line per changed score; the reference engine's Baseline.load reads it, and Eval.load reads the reference engine's files.
  • A scorer grades { input, output, expected }, with expected typed as the target's output; a case with no expected passes undefined. Scorer.exact compares text after collapsing whitespace and other values by canonical JSON; Scorer.contains(text?) falls back to the case's expected.
  • Scorer.checks takes data records, includes, excludes, words, excludesOpener and complete, ported from the reference engine's Checks, so the list is the scorer's configuration and identity. The reference engine's link and action checks are not ported.
  • Eval.run's runId defaults to the suite name and the start time read from Effect's Clock; trials and k may be overridden per run. Eval.passAtK returns NaN for impossible counts instead of throwing.
  • Scorer.bind(scorer, W, { sampling, timeout }) is a layer over the WorkflowEngine it is given. It wraps W's registered body, so a run is scored when its body returns a result; a failed run is not scored. The observation's identity is the workflow, run id and scorerKey, so re-executing, joining or resuming a run records it once. Scoring adds at most timeout (one minute by default) to the run, and any scorer outcome, a timeout or self-interruption included, is an inconclusive observation that never changes the run's result.
  • The score store is the Scorer.ScoreStore service with recordOnce, observations, aggregate and prune; Scorer.memory and Scorer.layerSql (one table, score_observations, over Effect's SqlClient) provide it. Ratio sampling is the reference engine's FNV-1a over the run id, scorerKey and seed, exposed as Scorer.sampled.
  • Scorer.rubric(criteria, { model, layer }): model is the judge's seat and part of the identity with the criteria, examples, rule and instructions; layer is the Effect LanguageModel that answers for the seat, so a test passes a scripted model. Until VIP-62's Experimental.Model.use lands, layer is required; it then defaults to Experimental.Model.use(model). In a suite, a single argument is the judge's subject.
  • Scorer.calibrate(scorer, labelled) grades answers with known verdicts and returns agreement counts; a judgement passes by its meta.pass, or by a score at least a threshold (default 1), and an inconclusive judgement agrees with nothing.
  • An inconclusive observation accounts for one baseline record of its case and scorer, so a judge outage is undecided (exit 5), not missing (exit 1). Scores left over at changed step keys pair by score rank. A case's scorers run one after another, so at most concurrency targets or scorers run at once. A target or scorer that interrupts itself fails only its case or score.
  • Every scorer configuration, check list and rubric declaration is copied and frozen when it is declared, so mutating the caller's object cannot change grading under the same scorerKey.
  • Scorer.decide(decision, { model, layer, pass? }) answers follow-up question 2: it grades with one Decision.probability, Decision.rate or Decision.classify on Effect's DecisionModel, and the judge reads { context, focus?, output }. The score is the probability, the rating from 0 at the lowest level to 1 at the highest, or the probability of the pass labels, which a classify decision requires; meta.pass says whether the chosen label passes. The seat, the decision and pass are the scorer's identity. A refused, missing or invalid answer is inconclusive, and a locate decision is refused. As with rubric, layer is required until VIP-62's Experimental.Model lands.
  • Follow-up question 3 has no default tolerance. A suite whose rubric or decide scorer meets a gate with no tolerance lists a warning in suite.warnings, and Eval.run logs each one with Effect.logWarning before it runs. A scorer's judge is the seat of the model that grades it.
  • Follow-up question 4 keeps scores apart from run history. Durable.sweep({ olderThan }) deletes finished runs and leaves their scores, so a score trend outlives the runs it graded; ScoreStore.prune({ olderThan }) deletes the observations older than the duration and answers how many. Nothing prunes scores on a schedule the program did not set.

Adopted review answers

  • Keep Experimental.X names under VIP-33. Promotion to a bare module name requires a later decision. Review question 1.

Compared

A suite, a custom scorer, a baseline comparison and a gate in the reference engine 1.x. It type-checks against the reference engine's evaluation and scoring packages at 1.0.0-rc.16.

import { Baseline, CaseExecutor, Gate, Regression, Runner, Suite } from "@smthrs/evals"
import { Binding, Scorer } from "@smthrs/scorers"
import { Effect, Layer } from "effect"
 
const greet = (name: string) => Effect.succeed(`Hello, ${name}`)
 
const exactMatch = Scorer.make({
  id: "example/exact-match",
  version: "1",
  name: "exact-match",
  score: ({ groundTruth, output }) => Effect.succeed({ score: output === groundTruth ? 1 : 0 })
})
 
const executor = CaseExecutor.make((suiteCase) =>
  Effect.map(greet((suiteCase.input as { readonly name: string }).name), (output) => ({
    output,
    stepKey: suiteCase.name,
    latencyMs: 0,
    target: { name: "greet" }
  }))
)
 
export const gate = (committed: string) =>
  Effect.gen(function*() {
    const suite = yield* Suite.make({
      name: "greet",
      cases: [{ name: "ada", input: { name: "Ada" }, expected: "Hello, Ada" }],
      bindings: [Binding.make({ scorer: exactMatch, appliesTo: { name: "greet" }, groundTruth: "Hello, Ada" })],
      concurrency: 1
    })
    const run = yield* Runner.run(suite, { runId: "nightly-2026-11-09", at: "2026-11-09T00:00:00.000Z" })
    const report = yield* Regression.compare(yield* Baseline.load(committed), run)
    return Gate.ciGrade(yield* Gate.check(report))
  }).pipe(Effect.provide(Layer.succeed(CaseExecutor.CaseExecutor)(executor)))
ProgramTokens (o200k_base)Lines
Vibe, proposed13016
Reference engine 1.x39234

The reference engine's program loads the baseline and runs the gate by hand. In Vibe, vibelang eval does both for a suite that declares gate (eval-declarations).

Checked. The Vibe example uses only existing syntax and compiles under vibelang 0.0.13 against a declaration of Eval and Scorer. The reference engine's program type-checks as shown. No eval-agent package exists at main@origin bcf8076a4ff4. The nearest sources are agent/regression, which runs agent cases through Suite, Runner and Trials, and the reference engine's own evals package.

Principles

  • TypeScript-first. A call with a record, the shape Evalite and Vitest set.
  • Effect-second. A target, a scorer and a run are Effects. Effect has no eval module to reuse.
  • Optimized for agentic programs. The same module can evaluate agents in this project and in users’ projects.
  • Highly forkable. A scorer is a function. A gate is a pure function. A fork replaces either.
  • Factory-first. Each release's eval baseline is a committed file, and the comparison that passed it is reproducible.

What this changes

  • Experimental.Eval and Experimental.Scorer are new. No grammar changes.

Alternatives

  • Evalite or another npm framework. One import away, and it stays available. It has no step keys, so it cannot tell a regression from a different path, and it does not score a durable run.
  • Evals as tests with a threshold, expect(score).toBeGreaterThan(0.8). A fixed threshold fails on noise and hides a slow decline. A baseline comparison does neither.
  • The reference engine's names as they are: Suite, Runner, Baseline, Regression, Gate, CaseExecutor. Six namespaces and an executor service for what one call declares. The port keeps their behavior and their file formats.
  • One namespace, Eval.scorer. A scorer is used outside eval files, on live runs. It earns its own name.
  • Scores in the journal. The reference engine keeps them in their own tables with their own identity, because nothing in a run reads a score back.

Follow-up questions

  1. Baseline format. The reference engine's baseline is versioned JSON (Baseline.version is 1). Vibe commits it beside the eval file. Keep the format as it is, so the reference engine's tools read Vibe baselines? Recommendation: yes.
  2. Decision models as judges. The reference engine's agent checks completions with Jev, not a rubric. Should Scorer.decide(decision) exist, over DecisionModel? Recommendation: yes; it is cheaper and typed.
  3. A default tolerance. With tolerance: 0, any lower score on a model-graded case is a regression, and model scores move. Recommendation: no default; a suite with a rubric scorer and no tolerance is a warning.
  4. Retention. Nothing prunes the reference engine's score tables. Decide with std-durable's Durable.sweep.

Depends on

eval-declarations builds on this VIP: it defines the file kind and the command.