Skip to content

Build a regression suite + diff

A single plune run tells you the state now. To catch quality regressions — checks that used to pass and no longer do — compare two runs with plune diff.

plune diff takes two JSON run outputs (a baseline and a current) and classifies every eval by its transition. Only a genuine passed → failed transition is a regression:

TransitionMeaningCounts as a regression?
passed → faileda check that used to pass now failsyes
failed → passedimprovementno
failed → failedpre-existing failureno
errored (current run)execution error, not a quality change — the eval was not measuredno
errored → failedthe baseline errored, so there is nothing to compare against — not measured (from 0.34.1)no
no row judged (current run)every row was blocked or skipped, or the dataset is empty — not measured (from 0.34.4)no

An eval is read from its rows: any failed row makes it failed, else any errored row makes it errored, else any passed row makes it passed. An eval with no judged row at all is not measured.

  1. Save a baseline from a known-good state (e.g. main). The diff needs JSON, so write it with --format json:

    Terminal window
    plune run --format json -o baseline.json
  2. Make your change — edit the prompt, swap the model, tune an assertion — then capture the current run:

    Terminal window
    plune run --format json -o current.json
  3. Diff the two. --fail-on-regression makes the command exit non-zero when a passed → failed transition appears, so a script or CI step can gate on it:

    Terminal window
    plune diff baseline.json current.json --fail-on-regression

A Markdown diff is handy for humans; JSON is handy for tooling:

Terminal window
plune diff baseline.json current.json --format markdown -o diff.md
plune diff baseline.json current.json --format json -o diff.json

The JSON diff exposes a summary with hasRegression, regressions, and improvements — the same fields the eval-action reads to drive its PR comment and gate. From 0.34.1 it also carries unmeasured: the evals that errored in the current run, plus those that errored in the baseline and fail now.

From 0.39.12, plune diff --format markdown adds one line under its summary when a row of the current run passed some of its repeats but not all. It names the eval of each such row, with the mark plune report prints:

Unsteady in this run: `a` · flaky 0.6

At most 10 are named, and the rest are counted: , and N more. A current run without repeats, or a dry run, gets no line. The line is for the reader only: the JSON diff, the gates and the exit code do not read it, and the baseline’s repeats are not looked at.