Skip to content

Reading reports & exit codes

A plune run reports a pass/fail summary with token cost, and writes its full result to .plune/last-run.json. How you read it depends on whether a human or a machine is looking.

plune run and plune report both take --format and an optional -o, --output <file>:

Terminal window
plune run --format console # default — readable summary in the terminal
plune run --format markdown -o report.md
plune run --format json -o run.json

The console summary looks like:

3 passed · 0 failed · 0 errored · 3 total · $0.0042 · 5120ms

plune report re-renders the most recent run (from .plune/last-run.json) without calling the provider again — useful to turn a local run into a Markdown artifact after the fact:

Terminal window
plune report --format markdown -o report.md

Every invocation communicates its result through the exit code, so a shell script or CI step can gate on it directly:

Exit codeMeaning
0every assertion passed
1at least one assertion failed (or, for diff, a measured gate failure: a regression under --fail-on-regression, or a value over the limit of --max-pass-rate-drop-percent, --max-cost-usd, --max-cost-increase-percent or --max-tokens; it wins over 3)
2configuration or execution error (bad plune.yaml, unknown prompt variable, provider failure; for diff, an input file that cannot be read or is not a run result, a limit that is not a number of 0 or more, or a malformed waivers file)
3for diff with --fail-on-regression or any of the four limit flags: nothing failed, but something was not measured (an eval errored or was not judged, the current run has no evals, or a gate’s value is missing). From 0.34.1 for --fail-on-regression, from 0.38.0 for the limit flags. --waivers alone turns on no gate, and a waiver never lifts a 3.

The commands that test an MCP server — plune mcp check, lint, snapshot and diff (from 0.34.5) — read the same four codes their own way: 0 nothing at the --fail-on level and everything measured, 1 a finding, failed check or change at that level, 2 the server could not be tested or a flag or file is wrong, 3 nothing was measured, which is never a pass. See Test an MCP server.

An eval with an mcp block is an agentic eval: each of its rows carries an agent field, the transcript of the model’s tool calls, in last-run.json and in --format json. A negative check on a loop that a limit stopped cannot be measured, so that row is errored and plune run exits 2, not 0 (a failed row elsewhere in the run still makes it 1); see What «not measured» means.

Terminal window
if plune run; then
echo "evals green"
else
echo "evals failed (exit $?)" && exit 1
fi

--format json emits the full run: a summary plus per-row detail (the resolved prompt, the model output, and each assertion’s result). Read the summary for a gate:

Terminal window
plune run --format json -o run.json
node -e 'const r=require("./run.json"); process.exit(r.summary.failed > 0 ? 1 : 0)'

The summary carries total, passed, failed, errored, blocked and skipped counts, and passed + failed + errored + blocked + skipped is total.

A row can say it was never judged — "inconclusive": "blocked" or "skipped" (Result statuses). From @plune-ai/cli 0.18.0 such rows count apart:

  • such a row counts by that word, whatever its assertions or its error say: a blocked row whose assertions failed is blocked, not failed;
  • plune run always writes blocked and skipped; they are optional in the schema, so a RunResult written before them still validates and schemaVersion stays 1 — a gate that reads them should take a missing one as 0;
  • the console line names N blocked and N skipped after errored, and the Markdown table adds a Blocked and a Skipped row — each only when it is not zero, so an all-pass report reads as before;
  • exit codes do not change: only failed (1) and errored (2) move them, so a run whose only rows not passed are blocked or skipped exits 0.

With runs above 1 (Repeats and a pass threshold) every row runs that many times. The console and Markdown reports then say, for each repeated row, how many of its runs passed, the threshold and the row’s status, as in 6/10 passed (pass_threshold 0.7): failed · flaky 0.6.

  • · flaky <share> ends the line of a row that passed some of its runs but not all, whether the row itself passed or failed: 3/5 passed (pass_threshold 0.6): passed · flaky 0.6. The share is the passed runs over all the runs of the row, errored ones included, with two decimals at most.
  • No mark on a row that passed every run, or none: it is steady.
  • The Markdown report has a Repeats table, a line per repeated row: Eval, Vars, Passed, pass_threshold, Status, with the mark at the end of Status.
  • A run in which no row repeats prints stability: not measured (runs: 1) once under its summary.
  • A dry run ran nothing, so a repeated row reads dry run: estimate × N runs and has no mark.

--format json and .plune/last-run.json carry the counts, not the mark: a repeated row has attempts with runs, pass_threshold, passed, failed, errored and the result of each run.

The same rows are named in two more places. plune diff --format markdown lists them in one line: Unsteady rows in the Markdown diff. And after plune sync, the run’s page in Plune marks their evals unsteady: An eval run with repeats.

The same engine that powers plune run is exported. Unlike the CLI, the library does not parse argv or auto-load .env — set the provider key in process.env yourself:

import { run } from "@plune-ai/cli";
import type { RunResult } from "@plune-ai/cli";
const result: RunResult = await run({ configPath: "plune.yaml", dryRun: false });
console.log(result.summary); // { total, passed, failed, errored, ... }
if (result.summary.failed > 0) process.exit(1);