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 decideDecision
// 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.
| Call | Meaning | Reference engine |
|---|---|---|
Eval.suite(name, { target, cases, scorers, trials?, concurrency?, gate? }) | Declare a suite. Runs nothing | Suite.make, Binding.make |
Eval.run(suite, { runId? }) | Run every case, score every output | Runner.run, with a CaseExecutor built from target |
Eval.baseline(run), Eval.write, Eval.load | A baseline from a run, as text to commit, and back | Baseline.fromRun, Baseline.write, Baseline.load |
Eval.compare(baseline, run, tolerances?) | Regressions, nondeterminism and missing observations, as a value | Regression.compare |
Eval.gate(report, { mean?, min? }) | A verdict and a CI grade | Gate.check, Gate.ciGrade, ScoreGate |
Eval.fromJsonLines(text, options) | Cases from a JSONL file | Suite.fromJsonLines |
Eval.passAtK(n, c, k) | The chance at least one of k trials passes, from c passes in n | Trials.passAtK |
| Scorer | Grades | Reference engine |
|---|---|---|
Scorer.exact | Normalized equality with expected | Scorers |
Scorer.contains(text) | Containment | Scorers |
Scorer.checks([...]) | A list of pure text and action checks | Checks |
Scorer.rubric(criteria, { model }) | A model grades the output against written criteria | Rubric |
Scorer.make({ name, version, config?, score }) | Your own function from { input, output, expected } to a number or an Effect of one | Scorer.make |
Scorer.bind(scorer, W, { sampling }) | Score a workflow's live runs | Binding.make, Sampling |
Rules
- A score is a finite number in
[0, 1]. Anything else is refused. - A scorer has an identity. Its name, version and configuration hash into a
scorerKeythat is written on every score it produces. A score recorded a month ago still names the exact grader. Change the grader, bumpversion. - 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.
- 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.
trialsruns a case several times to measure the spread. A trial is a new call: replaying one recorded answer measures the recording. - A baseline never updates itself.
Eval.baselinerecords successful scores only, and writing one is a separate act with a diff to review. - A gate is pure. It takes a report and options and returns a verdict.
minis the lowest passing score,meanthe lowest passing average, andtolerancehow far a score may fall below its baseline. - Three exit codes.
0when every case cleared the gate,1when a score regressed or an observation went missing,5when the gate could not decide. A5is a broken harness, not a result. A partial pass never exits0. - Rubric judges are models.
Scorer.rubricnames 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 ofRubric. - 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). - 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.EvalandExperimental.Scorer, in scope with no import, as VIP-33 rules. Design · Review.- Their code is
vibelang-runtime/experimental/Evaland…/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 aCaseExecutorbuilt fromtarget. 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 ofktrials passes, fromcpasses inn; reference engine:Trials.passAtK. Design · Review. - Scorer
Scorer.exact: Grades: Normalized equality withexpected; 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
scorerKeythat 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.
trialsruns 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.baselinerecords 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.
minis the lowest passing score,meanthe lowest passing average, andtolerancehow far a score may fall below its baseline. Design · Review.- Three exit codes.
0when every case cleared the gate,1when a score regressed or an observation went missing,5when the gate could not decide. Design · Review. - A
5is a broken harness, not a result. Design · Review. - A partial pass never exits
0. Design · Review. - Rubric judges are models.
Scorer.rubricnames 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.suiteandExperimental.Scorer.makenever throw, because a plain VibeLang function may not throw: a scorer with no stable identity keeps the reason asscorer.problem, andEval.runrefuses a malformed suite withinvalid_suiteand 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'snametakes the place of the reference engine's separateid. 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, exit5). A gate with no score at all, an inconclusive scorer, or an invalid threshold exits5. Eval.gate(report, options)returns{ verdict, exitCode, summary }with no Effect, and also takesperCaseandtolerance;toleranceignores a regression or nondeterminism no larger than it.Eval.comparekeeps the reference engine's{ absolute, relative }tolerances.Eval.writekeeps 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'sBaseline.loadreads it, andEval.loadreads the reference engine's files.- A scorer grades
{ input, output, expected }, withexpectedtyped as the target's output; a case with noexpectedpassesundefined.Scorer.exactcompares text after collapsing whitespace and other values by canonical JSON;Scorer.contains(text?)falls back to the case'sexpected. Scorer.checkstakes data records,includes,excludes,words,excludesOpenerandcomplete, ported from the reference engine'sChecks, so the list is the scorer's configuration and identity. The reference engine's link and action checks are not ported.Eval.run'srunIddefaults to the suite name and the start time read from Effect'sClock;trialsandkmay be overridden per run.Eval.passAtKreturnsNaNfor impossible counts instead of throwing.Scorer.bind(scorer, W, { sampling, timeout })is a layer over theWorkflowEngineit is given. It wrapsW'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 andscorerKey, so re-executing, joining or resuming a run records it once. Scoring adds at mosttimeout(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.ScoreStoreservice withrecordOnce,observations,aggregateandprune;Scorer.memoryandScorer.layerSql(one table,score_observations, over Effect'sSqlClient) provide it. Ratio sampling is the reference engine's FNV-1a over the run id,scorerKeyand seed, exposed asScorer.sampled. Scorer.rubric(criteria, { model, layer }):modelis the judge's seat and part of the identity with the criteria, examples, rule and instructions;layeris the EffectLanguageModelthat answers for the seat, so a test passes a scripted model. Until VIP-62'sExperimental.Model.uselands,layeris required; it then defaults toExperimental.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 itsmeta.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 (exit1). Scores left over at changed step keys pair by score rank. A case's scorers run one after another, so at mostconcurrencytargets 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 oneDecision.probability,Decision.rateorDecision.classifyon Effect'sDecisionModel, 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 thepasslabels, which a classify decision requires;meta.passsays whether the chosen label passes. The seat, the decision andpassare the scorer's identity. A refused, missing or invalid answer is inconclusive, and a locate decision is refused. As withrubric,layeris required until VIP-62'sExperimental.Modellands.- Follow-up question 3 has no default tolerance. A suite whose
rubricordecidescorer meets a gate with notolerancelists a warning insuite.warnings, andEval.runlogs each one withEffect.logWarningbefore it runs. A scorer'sjudgeis 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.Xnames 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)))| Program | Tokens (o200k_base) | Lines |
|---|---|---|
| Vibe, proposed | 130 | 16 |
| Reference engine 1.x | 392 | 34 |
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.EvalandExperimental.Scorerare 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
- Baseline format. The reference engine's baseline is versioned JSON (
Baseline.versionis 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. - Decision models as judges. The reference engine's agent checks completions with Jev, not a rubric. Should
Scorer.decide(decision)exist, overDecisionModel? Recommendation: yes; it is cheaper and typed. - 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 notoleranceis a warning. - Retention. Nothing prunes the reference engine's score tables. Decide with std-durable's
Durable.sweep.
Depends on
- std-model: rubric judges.
- std-durable: persisted scores of live runs. A suite run needs neither.
eval-declarations builds on this VIP: it defines the file kind and the command.