feat: add benchmark reporting command (task 0031)
All checks were successful
CI / test (pull_request) Successful in 52s
CI / test (push) Successful in 52s

Add the maintainer-facing `bench:report` command, the offline counterpart
to `bench:run`: it opens the sample store, drains it, aggregates against the
scored suite and bonus definitions, and prints the aggregator's comparison to
stdout. It renders whatever has accumulated, annotating incomplete coverage
rather than blocking on a complete matrix.

`parseReportArgs` is the pure argument seam (`--store`, `--help`, plus a
`--self-review` / `--no-self-review` variant selector). Unlike `bench:run` the
boundary is offline — it reads only the local store, no host or Agent SDK — so
the whole `runReportCommand` is deterministic and unit-tested, not smoke-run.

Move `DEFAULT_STORE_ROOT` to `store.ts` as the single source of truth,
re-exported from `run.ts` for its existing importers.
This commit was merged in pull request #32.
This commit is contained in:
2026-07-16 16:30:20 -04:00
parent 7216d3cc31
commit 53342f67e3
7 changed files with 407 additions and 7 deletions

View File

@@ -2,6 +2,9 @@ import { appendFileSync, mkdirSync, readdirSync, readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import type { CellKey, ResultRecord } from "./result.js";
/** Where accumulated samples are stored when no store root is given. */
export const DEFAULT_STORE_ROOT = "bench/results";
/** Run `read`, returning `fallback` when the target does not exist yet. */
function ignoreEnoent<T>(read: () => T, fallback: T): T {
try {