Skip to content

Report ​

highbar run --report json=<file> writes the results to a file as well as to the terminal, so a run can be compared with another, kept as a CI artifact or read by a script, without parsing the output.

console
highbar run --report json=.highbar/reports/run.json

One file holds every spec of the run. The schema is report.schema.json, shipped in the package.

console
jq -r '.specs[].tests[] | [.id, .counts.passed, .counts.failed, .counts.error] | @tsv' run.json

The file holds what the agent said

Responses and tool arguments go in whole, so treat it like a trace file from --keep-traces. Values from ${VAR} where a secret goes (a header, a body, a session hook, a URL's query) are masked everywhere, the same way as in the output. A tool's result and context have no field of their own, but a result can still get in: a failed check quotes it in errors, and a {{previous.*}} template puts it in turns[].trigger. The session's values appear where agent.correlate uses them.

What the file says about the run ​

Field
schema_version1. It changes only on a breaking change. New fields can appear within a version, so a reader ignores what it does not know.
highbar_version
started_at, duration_msUTC with milliseconds; wall time of the run.
exit_codeThe code the process returned. null means the run did not finish: it is still going, or it was killed.
completeEvery test of every spec ran all of its executions. A run that --max-cost stopped after its last test is complete: stopped says the ceiling was passed. So is a run that --max-errors stopped at the last execution of its last test.
stoppedWhy the run ended early, or null: {"reason": ..., "message": ...}.
git_shaHEAD where highbar ran, which is not always the agent's version. null outside a repository.
summarytotal, passed, failed, errored and variations of the whole run.
totalsTokens and cost of the whole run.
specsOne entry per spec that started.

stopped.reason is one of usage_error, spec_invalid, hooks_invalid, no_specs, agent_start_failed, agent_not_observed, budget_exceeded, repeated_errors, interrupted and crashed. A reason can be added within a version, as repeated_errors was, so a reader treats one it does not know as a run that stopped early.

The file is written before the first message and again on every way out of the run, through a temporary file and a rename. So it is never half written, and it never shows an older run:

  • A path that cannot be written stops the run with exit code 2 before anything is sent.
  • A run that was killed leaves exit_code: null.
  • A run whose agent.run setup failed has stopped.reason: "run_setup_failed", exit code 2 and no tests: nothing was sent.
  • An interrupted run keeps the tests that finished, and the test in progress is left out.
  • A run stopped by --max-cost keeps every test that ran, with stopped.reason: "budget_exceeded". The test in progress had time to finish, and the ones after it are not in the file. When the ceiling is passed only at the last test, or by what was read after it, no test was left out, and complete is true. stopped.message says how much of the spend had no test context: that part of an agent highbar started counts for the ceiling and is in no totals.
  • A run stopped by --max-errors has stopped.reason: "repeated_errors", exit_code: 4, and the line it printed in stopped.message, without the body of any reply. Its executions keep the status they had. The test it stopped in is in the file with the executions that ran, as an error whose errors say how many of its executions ran, and its spec's complete is false; the tests after it are not in the file. When the last error was the last execution of the last test, nothing was left out, and complete is true.
  • A run that cannot write the final file exits with 2, whatever its tests did.

The one exception is a command line that highbar cannot read: an unknown option, --runs abc, --max-errors abc or a --report value without a known format. It exits with 2 before the file is opened, so an older file stays in place. A script that keeps reports should check the exit code first.

Each spec ​

Field
keyThe spec's path inside its repository. Outside a repository, the path as given.
pathAs given on the command line.
sha256Of the file, read before the first test.
complete, summary, totalsAs above, for this spec.
warningsWhat the run warned about.
suitesOne entry per suite that ran: its name and its totals.
testsThe tests that finished, and the one --max-errors stopped in.

Each test ​

json
{
  "id": "Orders/looks the order up",
  "suite": "Orders",
  "name": "looks the order up",
  "definition_sha256": "99be0aae47025a244100b9ab66aaf298c8d49f2b3f1966ad9520e6a9d2410e7c",
  "status": "passed",
  "runs": 1,
  "min_pass": 1,
  "counts": {"passed": 1, "failed": 0, "error": 0},
  "duration_ms": 652.0,
  "errors": [],
  "phrasings": [
    {
      "kind": "trigger",
      "text": "Where is order 1042?",
      "status": "passed",
      "counts": {"passed": 1, "failed": 0, "error": 0},
      "executions": [
        {
          "execution_id": "066328e340184d0dbe2a63aa92e35e95",
          "run": 1,
          "started_at": "2026-10-30T15:56:08.739Z",
          "status": "passed",
          "duration_ms": 652.0,
          "errors": [],
          "turns": [
            {
              "trigger": "Where is order 1042?",
              "response": "Order 1042 is in transit, arriving Thursday.",
              "response_ms": 3.5,
              "correlate": {"test": "066328e340184d0dbe2a63aa92e35e95"},
              "tools": [
                {
                  "name": "get_order",
                  "args": {"order_id": "1042"},
                  "error": null,
                  "duration_ms": 0.1,
                  "late": false
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
Field
idThe test's id in the spec, or <suite>/<name>. Unique in a spec.
definition_sha256Of the trigger, the turns, the expectation, the number of variations and expect_status. name, id, runs and min_pass stay out, and so does an option left at its default, so a new one changes the hash of no test that does not use it. A budget changes what counts as right, so it is part of the expectation: one from defaults.budget hashes the same as one written in the test.
status, errorsThe final ones, late calls included. With expect_status, status is judged against it: passed when the test ended exactly there. The phrasings and executions keep what happened.
expect_statusfailed or error, the state this negative control must end in, or null. See a test that must fail.
runs, min_passAs they applied to this test, with fractions resolved.
countsHow the executions ended. There is no rate: an error is neither a pass nor a failure, so whoever computes one has to decide what to do with it.
phrasings[].kindtrigger, variation, or conversation for a multi-turn test, whose text is null. A test that stopped before running, such as one without its variations, has no phrasings.
executions[].execution_idThe X-Highbar-Test value of this execution.
duration_msIncludes agent.settle_time.
turns[]The turns that ran: a conversation stops at the first one that does not pass.
turns[].responsenull when no reply came, which is not the same as "".
turns[].response_msThe send alone, without agent.settle_time.
turns[].correlateThe values of agent.correlate for this turn: what finds its records in the trace file.
tools[].lateRecorded after the test's window closed.
turns[].usageWhat the turn consumed, or null when it reported nothing. See below.
watched_msFor a test that forbids a call: how long after its last reply highbar kept reading the trace, at least agent.watch. A call later than that was not seen. null for other tests, and when the run stopped before its last read.
turns[].budgetThe turn's own limit, or null.
budgetWhat each execution of the test could spend, or null: its own budget, else defaults.budget.
totalsOn each test and each execution, its tokens and cost.

Tokens and cost ​

A turn's usage has the fields of the trace contract, with the cost and currency of the price table when the agent sent no cost:

json
{
  "model": "gpt-4o-mini",
  "provider": "openai",
  "input_tokens": 1000,
  "output_tokens": 200,
  "cached_input_tokens": 800,
  "cost": 0.00021,
  "currency": "USD",
  "llm_calls": 2
}

totals adds up the turns of a level. It has the same shape at every level: each execution and each test (tests[].totals), each suite (specs[].suites[].totals), each spec (specs[].totals) and the run (totals). For a single turn, turns[].usage is the sum. When a message has several turn records, input_tokens, output_tokens and cost are null there unless all of them give the value, cached_input_tokens and llm_calls add up the ones given, and totals still holds what each one gave.

json
{
  "turns": 3,
  "input_tokens": 3000,
  "output_tokens": 300,
  "cached_input_tokens": 800,
  "llm_calls": 3,
  "cost": {"USD": 0.0123},
  "complete": false,
  "warnings": ["1 of 3 turns with no cost"]
}
Field
turnsHow many turns are behind the numbers, with usage or without.
input_tokens, output_tokens, cached_input_tokens, llm_callsThe sum of what is known. null when no turn reported it, which is not zero.
costOne sum per currency.
completefalse when something was left out, or when costs came in more than one currency.
warningsWhat was left out.

totals is null at a level where no turn reported usage, with no warning: an agent that writes no usage owes none. Once a turn at that level does, each of these makes the sum partial, holding only the parts that are known:

  • A turn with no usage at all.
  • A turn without input_tokens or output_tokens.
  • A turn without a cost: not sent, and not in the price table.
  • A cost without a currency. It stays in turns[].usage, and is left out of the sum.
  • Costs in more than one currency. They are never added together: each has its own sum in cost, so no number is lost, and complete is false because no single total exists.
  • A turn with usage and no test context, read next to a test's records. It counts for no test, so it is left out of the sum. It marks the turn it was read with and the last turn before it, since either may have made it.

Which turns are counted follows the results: a turn that ran is counted whether or not the test passed, and the test in progress when a run stops is left out. Usage recorded after a test's window closed counts for that test.

JUnit XML ​

--report junit=<file> writes the same report as JUnit XML, for the CI tools that read that format (test summaries in a pull request, a dashboard of test history). It is replaced before the first message and written on every way out, like the JSON file.

console
highbar run --report junit=.highbar/reports/junit.xml
  • Each spec is a testsuite, named by its key, and each test a testcase, with its suite as classname and its duration as time, in seconds.
  • A failed test has a failure, and a test that could not be verified an error, with its first error as message and all of them as the text.
  • A run that did not finish, stopped halfway, or exited with an error code while no test failed (a spec that does not load, an agent that does not start, --max-cost) gets one more case, highbar.run, with an error that says why. A JUnit reader counts cases, and zero failed cases would read as a pass.
  • Text that XML cannot hold, such as a NUL or a terminal escape in a reply, is written as its escape (\x1b).

JUnit has no place for usage, phrasings or executions: keep the JSON report for those, from the same run (below).

Markdown summary ​

--report markdown=<file> writes the report as a page to read. GitHub Actions shows the file at $GITHUB_STEP_SUMMARY on the page of the run.

console
highbar run --report markdown="$GITHUB_STEP_SUMMARY"
  • The heading says whether the run passed: passed only when it exited 0, not passed (exit code 1) otherwise, and the run did not finish while it runs or when it died.
  • When the tests do not say why the run did not pass (it stopped halfway, or exited with an error code while no test failed), a quote under the heading does.
  • The tests that failed or errored come first, in a table with their first error. The ones that passed are folded under them.
  • Text from the agent is escaped, so a pipe, a tag or a link shows as written. A table shows 200 tests and a cell 300 characters, no row is added once the page reaches 900 KiB, and the page says how many tests it left out: GitHub drops a step summary over 1 MiB whole.

$GITHUB_STEP_SUMMARY belongs to one step, and highbar replaces the file. Give the run a step of its own, or write the summary to another file and add it in a later step that runs either way: cat summary.md >> "$GITHUB_STEP_SUMMARY", with if: always().

More than one format ​

Give --report once per file:

console
highbar run --report json=report.json --report junit=junit.xml --report markdown=summary.md

They are one report in three formats, written at the same moments and with the same result. When one file cannot be written, none of them keeps the result: they all say the run did not finish, and the run exits 2. If a file that was already written cannot be put back either, the error names it. A path given twice, or one that is a spec of the run, stops the run before it starts (exit 2).

Comparing runs ​

A test is the pair (specs[].key, tests[].id): the same id can appear in two specs.

Before putting two results together, compare definition_sha256: equal hashes measured the same thing. For a test with variations, the hash holds how many it asks for and not their text, so compare phrasings[].text too. A changed sha256 of the spec says only that something in the file changed.

Keep one report per run, and compare them as groups. Two rounds of an LLM agent can differ with nothing changed: when it chooses between two near-identical passages, the choice can hold within a round and flip in the next one. In that case 5 runs are not 5 independent observations, and a test of proportions over the executions reports a change that did not happen. Several short rounds show that variation, and one long round hides it.

Released under the MIT License.