Skip to content

SPEC-013: Reports, tournaments and ratings

  • Status: Implemented
  • Milestone: v0.5.0
  • Owners: lead maintainer

1. Purpose

Answer "which agent is better, by how much, and at what cost?" from recorded runs. A report reads run logs (like every other reader) and shows, for each agent: its results with honest uncertainty, a rating for head-to-head games, cost, errors and rule-breaking, and optional behaviour tags from a judge model. A tournament scenario produces the games a fair comparison needs: every agent against every other, on both sides of the board, with the same seeds.

2. Terms

Keywords MUST, SHOULD and MAY follow RFC 2119. - Competitor: one agent setup being compared, for example "llama3.2 on Ollama" or "scripted/minimax". The same competitor can play any role (x or o) in different runs. - Role: the agent id a world expects (x, o); unchanged from SPEC-001 and SPEC-005. - Game: a run with at least two competitors. - Rated game: a game whose run_end.outcome.winners is a list (not null), so the result is known. Runs that ended without a result (for example aborted or world_error) are not rated. - Score rate: (wins + draws / 2) / rated games. - Rating: a number on the familiar Elo scale (a 400-point gap means the stronger side is expected to score 10 times as much), fitted to all rated games at once (ADR-0008). - Tournament: a scenario that names competitors (entrants) instead of fixed agents and plays every seating of them. - Seating: one assignment of distinct entrants to the roles, for example x=llama, o=minimax.

3. Requirements

Who played: competitor identity

  • RPT-001 run_start.agents[] MUST also carry use (the agent's scenario reference as written, for example scripted/random or openrouter) and, when the scenario gives one, name (SPEC-005 SCN-015). Additive; log_version stays 1.
  • RPT-002 A competitor's key MUST be its name when present; otherwise use, followed by : and the model when the log records one (openrouter:<provider>/<model>). Logs without use (from earlier versions) fall back to kind in its place. Two agents with the same key are the same competitor.

Tournaments: playing the games

  • RPT-003 A scenario MAY have tournament instead of agents, with roles (the role ids the world expects, at least two), entrants (at least two, each with a unique name, use and optional config, as SCN-004), and MAY set games (per seating, default 2) and max_total_cost_usd.
  • RPT-004 agentplaykit play on a tournament MUST play every seating of distinct entrants in the roles (for 2 roles and n entrants: n × (n − 1) seatings, so each pair meets on both sides) in a fixed order: seatings sorted by entrant order, then game number. Game i of every seating MUST use seed base + i, so each pairing faces the same randomness on both sides.
  • RPT-005 Before the first game, play MUST print the number of seatings and games and the per-run cost cap. When max_total_cost_usd is set, play MUST NOT start another game once the cost so far has reached it, and MUST say how many games were skipped. A run's own limits still apply to each game.
  • RPT-006 A tournament MUST write each game's log as <name>-<entrant for role 1>-vs-<entrant for role 2>…-<seed>.jsonl (names made safe for file names), a <name>-summary.json in the format of EVL-014 whose rows also carry entrants (role → name), and then the report of RPT-008 for those logs.
  • RPT-007 --live on a tournament MUST follow each game in turn, as --runs does (VWR-023).

The report

  • RPT-008 agentplaykit report <path>... [--out DIR] [--no-open] [--no-pages] MUST accept run logs, summaries (their listed logs) and directories (every *.jsonl directly inside), and MUST write report.json and report.html (default directory: the common folder of the inputs), print a leaderboard to the terminal, and open the page unless --no-open. Unless --no-pages, it MUST also write the replay page (VWR-001) of every included log, and link to them.
  • RPT-009 Reports MUST be built only from logs and their .eval.json files (VWR-004). A log that cannot be read MUST be listed as skipped with the reason, and MUST NOT stop the report; inputs with no readable log MUST fail with the standard error (CLI-007), exit code 2.
  • RPT-010 Runs MUST be grouped by world (name and version); ratings and head-to-head tables MUST NOT mix worlds. When the runs of one world come from more than one scenario (scenario_sha256), the report MUST say so, since different limits or rules make results less comparable.
  • RPT-011 For every competitor in a world the report MUST show: runs, rated games, wins, draws, losses, score rate with a 95% Wilson interval, rating with a 95% interval, mean steps, mean and total cost (unknown costs counted as unknown, not zero), illegal moves per run, forfeits, runs that ended with that competitor's provider_error or agent_error, and the pass rate (with a 95% Wilson interval) and mean score of every evaluator.
  • RPT-012 The report MUST show a head-to-head table: for each pair of competitors, wins, draws and losses, and the score rate per role (so a first-move advantage is visible).
  • RPT-013 Results of a run with more than two competitors MUST count as pairwise games: each winner beats each non-winner, and competitors on the same side of the result draw. A competitor playing against itself MUST NOT count toward its rating or head-to-head results.
  • RPT-014 Single-agent runs (for example the treasure world) have no rating; the report MUST still compare their competitors by evaluator pass rates, outcomes, steps and cost.
  • RPT-015 The rating MUST be a Bradley–Terry fit over all rated games of a world, with draws as half a win, a prior of one draw against a fixed 1500-point reference so that unbeaten competitors stay finite, shown on the Elo scale. Its 95% interval MUST come from a bootstrap over games with a fixed seed. The fit MUST NOT depend on the order of the games (ADR-0008). A competitor with fewer than 10 rated games MUST be marked provisional.
  • RPT-016 The report MUST be deterministic: the same inputs, in any order, give byte-identical report.json and report.html (no timestamps, absolute paths or unseeded randomness).
  • RPT-017 report.json MUST validate against specs/schemas/report.schema.json and carry report_version: 1.
  • RPT-018 report.html MUST follow the page rules of SPEC-012: data inserted only as text, embedded data escaped, everything inline, no network loads under a Content-Security-Policy, usable at 360 px and in light and dark themes (VWR-006, VWR-007, VWR-016).
  • RPT-019 The terminal leaderboard MUST list competitors by rating (or by pass rate for single-agent worlds) with games, score rate, rating interval and mean cost, and MUST say when two competitors' intervals overlap ("not clearly different"), so a small sample is not read as a win.

Behaviour tags (judge)

  • RPT-020 The judge evaluator (EVL-013) MAY take tags: a map from tag name to its definition, for example {cooperated: "…", deceived: "…", gave_up: "…"}. The judge MUST then also return, for each agent id, the list of tags that apply, chosen only from those names; any other tag MUST be dropped with a warning in the result. The result carries them as tags (agent id → list).
  • RPT-021 The report MUST show, for each competitor and tag, in how many judged runs it got that tag, and link to the runs. Judge cost MUST be shown separately from agent cost (EVL-006).

Changes to other specs on acceptance

  • SPEC-003, new LOG-023: run_start.agents[] carries use and optional name (RPT-001).
  • SPEC-005, new SCN-015: an agent MAY have name, a display name used in reports. New SCN-016: a scenario has either agents or tournament (RPT-003), never both.
  • SPEC-007, new CLI-014: the report command (RPT-008); play on a tournament (RPT-004 to RPT-007).
  • SPEC-010, new EVL-016: judge tags (RPT-020); evalresult.schema.json gains optional tags.

4. Acceptance criteria

Requirement Test ID Notes
RPT-001..002 RPT-001, RPT-002 use/name in run_start; key rules; old logs without use
RPT-003..007 RPT-003..RPT-007 3 scripted entrants: 6 seatings, seeds, file names, budget stop, live follow
RPT-008..010 RPT-008..RPT-010 CLI with --no-open; bad log skipped; worlds kept apart; mixed-scenario note
RPT-011..014 RPT-011..RPT-014 hand-computed W/D/L, Wilson intervals, per-role table, 3-player and solo runs
RPT-015 RPT-015 known Bradley–Terry fixtures; shuffled input gives same ratings; unbeaten stays finite
RPT-016..019 RPT-016..RPT-019 byte-identical output; schema; page safety and browser checks; overlap wording
RPT-020..021 RPT-020, RPT-021 fake judge returns allowed and unknown tags; counts per competitor

5. Examples

agentplay: 1
name: tic-tac-toe-arena
seed: 1
world: {use: tic-tac-toe}
tournament:
  roles: [x, o]
  games: 4                       # per seating: 3 entrants -> 6 seatings -> 24 games
  max_total_cost_usd: 2.00
  entrants:
    - {name: llama3.2, use: ollama, config: {model: llama3.2}}
    - {name: minimax, use: scripted/minimax}
    - {name: random, use: scripted/random}
evaluators:
  - use: judge
    config:
      agent: {use: ollama, config: {model: llama3.2}}
      rubric: "How did each player behave?"
      tags:
        cooperated: "worked with the other player toward a shared goal"
        deceived: "said something it knew was false to gain an advantage"
        gave_up: "stopped trying to win before the game was over"
agentplaykit play examples/arena/scenario.yaml      # plays 24 games, writes the report
agentplaykit report runs/                            # or: a report from any logs you have
tic-tac-toe 1 · 24 rated games
  #  competitor  games  score rate          rating (95%)        cost/game
  1  minimax        16  0.81 (0.57-0.93)    1712 (1601-1840)    $0.0000
  2  llama3.2       16  0.47 (0.26-0.69)    1489 (1380-1597)    $0.0031
  3  random         16  0.22 (0.08-0.45)    1299 (1170-1405)    $0.0000
  llama3.2 and random: intervals overlap, not clearly different

6. Open questions

  • Ratings across worlds (a single "overall" number) are deliberately left out: they hide where an agent is strong or weak.
  • Teams (several agents on one side) and TrueSkill-style ratings for them.
  • A shared, hosted leaderboard (needs the hosted service on the roadmap).
  • Swiss or knockout formats for large tournaments; v0.5 plays full round robins only.

7. Change log

  • 2026-12-01: Initial draft.
  • 2026-12-01: Accepted by the lead maintainer.
  • 2026-12-01: Implemented in v0.5.0.