Skip to content

SPEC-010: Evaluators

  • Status: Implemented
  • Milestone: M5
  • Owners: lead maintainer

1. Purpose

Score what happened using code outside the agent, and summarize many runs. Evaluators read only the log.

2. Terms

  • Checker: a code evaluator. Judge: a model evaluator (interface only in v0.1). Summary: statistics over N runs.

3. Requirements

  • EVL-001 An evaluator MUST provide evaluate(log: Log) -> EvalResult, taking only the parsed run log (plain data).
  • EVL-002 EvalResult MUST be plain data: name, passed (bool or null), score (number or null), details (object), and optional evidence (list of log seq numbers).
  • EVL-003 Independence: evaluators MUST run after the episode, MUST NOT receive world or agent objects, and agents MUST NOT be able to read or change them.
  • EVL-004 Evaluators MUST NOT modify the log; results are written as separate files or an eval section appended only by core.
  • EVL-005 A failing evaluator MUST NOT change the episode result (RUN-013); the failure is reported.
  • EVL-006 The judge slot: an evaluator MAY call a model via the same adapter interface (SPEC-009); judge usage and cost MUST be reported separately from agent cost. One example judge ships; behavior tagging waits for v0.5.
  • EVL-007 agentplaykit play --runs N MUST run N episodes with seeds derived from the base seed and print a summary: pass rate, mean and spread of steps and cost, outcome counts.
  • EVL-008 A multi-run summary MUST be reproducible from its seeds and recorded replies; the summary lists seeds and log paths.
  • EVL-009 The framework MUST ship the built-in checker outcome (winners and scores from run_end). A checker interface example: treasure (found the item within N steps).
  • EVL-010 Evaluators MUST register under agentplaykit.evaluators (REG-002).
  • EVL-011 The interface MUST live in core as the base class Evaluator (with name, config and evaluate(log)), where log is a read-only copy of the parsed run log: log.events (list of event objects) and log.complete. Implementations live in evals/ or in plugins.
  • EVL-012 Results MUST be written by core to <log>.eval.json (the log path with .jsonl replaced) and MUST validate against specs/schemas/evalresult.schema.json. A result MAY carry error (why the evaluator failed) and usage (a judge's tokens and cost).
  • EVL-013 The built-in judge evaluator MUST take agent: {use, config} (any agent adapter, SPEC-009) and a rubric. It sends that agent one Request whose observation holds the rubric and a transcript of the log and whose actions is a JSON Schema for {passed, score, reason}. Judge usage MUST go in the result's usage and MUST NOT count toward the run's cost or limits.
  • EVL-015 A summary row MUST carry the run's error when it ended world_error or aborted; the summary MUST list each distinct error with how many runs it ended (errors), and the printed summary MUST show them, so a failing provider is visible without opening logs.
  • EVL-016 The judge evaluator MAY take tags (tag name to definition) and then MUST return per-agent behaviour tags as SPEC-013 RPT-020 describes; a result MAY carry tags (agent id to a list of tag names).
  • EVL-014 With --runs N, run i (from 0) MUST use seed base + i; logs are named <name>-<seed>.jsonl; a summary <name>-summary.json goes next to them. The summary MUST NOT contain timestamps or durations, so the same inputs give an identical file. "Spread" means the population standard deviation, minimum and maximum.

4. Acceptance criteria

Requirement Test ID Notes
EVL-001..004 EVL-001..EVL-004 agent cannot reach checker
EVL-005..006 EVL-005, EVL-006
EVL-007..008 EVL-007, EVL-008 20-run summary reproduced
EVL-009..010 EVL-009, EVL-010

5. Open questions

  • None.

6. Change log

  • 2026-11-30: Initial draft.
  • 2026-11-30: Accepted by the lead maintainer.
  • 2026-11-30: Resolved the result-file question (<log>.eval.json); added EVL-011 to EVL-014; found while implementing M5.
  • 2026-11-30: Implemented in v0.1.0; every requirement has a test (PRO-004, PRO-011).
  • 2026-11-30: Added EVL-015 (errors in multi-run summaries), from user feedback on v0.1.0.
  • 2026-12-01: Added EVL-016 (judge behaviour tags), with SPEC-013.