burgee
Packages

replz

Code review benchmark for AI reviewers and a repo's checks: replays each pull request a revert or fix blamed beside clean controls, and grades findings against a one-line answer key. No dependency outside the burgee family. A promptfoo migration path.

replz grades a code reviewer, and a repository's own checks, against bugs that actually shipped. Each case is a merged pull request a later revert or fix blamed, with a one-sentence answer key; size-matched clean pull requests are its controls. replz run checks each case out at its head, the commit the reviewer saw (its base with the pull request applied), runs the reviewer and the checks there, and grades every finding against the answer key, the last stage's findings first: only a finding that describes that bug counts. The report gives recall per stage, severity, false alarms on the controls, and how often every check fired and was right.

It covers the review half of promptfoo: where a promptfoo suite asserts on a model's answer to prompts someone wrote, replz replays pull requests that really shipped a bug and asserts on what the reviewer said about them. replz propose prints draft cases from the history, and every command prints burgee's --json envelope, each error with its fix:, for a pipe or an agent.

Install

npm install replz
pnpm add replz
yarn add replz
bun add replz

Install it as a dev dependency (-D) of the repository whose history it replays. It needs git, and run needs the reviewer and grader commands its config names.

Quick start

npm install replz
import { parseLog, propose } from "replz";

// What `git log --first-parent --shortstat` prints for three merged pull requests and a revert.
const record = (sha, parent, subject, lines) => `\0${sha}\t${parent}\t${subject}\t\u0001\n 1 file changed, ${lines} insertions(+)\n`;
const log = [
  record("d4".repeat(20), "c3".repeat(20), 'Revert "feat: cache the config (#12)"', 40),
  record("c3".repeat(20), "b2".repeat(20), "docs: a usage page (#13)", 35),
  record("b2".repeat(20), "a1".repeat(20), "feat: cache the config (#12)", 40),
  record("a1".repeat(20), "90".repeat(20), "feat: a --quiet flag (#11)", 300),
].join("");

const { bugs, controls } = propose(parseLog(log), 10);
console.log(bugs.map((c) => `${c.id} at ${c.base}`).join("\n"));
console.log(controls.map((c) => `${c.id} (size-matched)`).join("\n"));
bug-12 at a1a1a1a1a1a1
control-13 (size-matched)

That is what replz propose prints: each draft under the file name it belongs at in .sdlc/replz/cases/, each bug with an answer: line for a person to fill in. It writes no file; save the drafts you keep, and replz check refuses one whose answer is still the draft's TODO.

What it checks

replz propose --limit 10                       # prints ten bug drafts and ten size-matched controls
replz check                                    # the config and every case, and each set's count
replz run --set test                           # the score on the held-out cases
replz run --set tune --max-findings 5 --record # a cheaper run, appended to the history
CommandExit 1 when
checkthe config or a case file is invalid, a case file is not named <id>.yaml, an answer is still the draft's TODO, or a set lacks a bug or a control, each with the fix: that repairs it
runa case could not be replayed

run calls a model once per case and once per graded finding, so it is never a per-pull-request step: run it by hand or on a schedule. check and propose cost nothing.

Every command in the config runs in the case's worktree with REPLZ_BASE, REPLZ_HEAD, REPLZ_PR and REPLZ_REPO set. REPLZ_REPO is the repository replz run started in, as an absolute path: name a reviewer script kept there as bash "$REPLZ_REPO/review.sh", because a relative path is read in the worktree, at a head that may predate the script.

Migrating

The switch is one command, npx replz run, where the review suite ran:

  // package.json
  "scripts": {
-   "eval:review": "promptfoo eval -c review.promptfooconfig.yaml",
+   "eval:review": "npx replz run --set test",
  }

and the hand-written review prompts come out, replaced by case files saved from the drafts npx replz propose prints from the history. Keep promptfoo for prompts that are not reviews of a pull request.

Compatibility

Not graded: replz replays a repository's own history, and no suite is graded against it. It runs anywhere git does.

Benchmarks

Every number here is produced by npm run bench and published at burgee.interlace.tools/docs/benchmarks.

No suite is graded against this package yet, so there is no compatibility number to quote.

For agents

  • replz check --json, run --json and propose --json print burgee's --json envelope; a failure carries its remedy as error.fix, and prose prints it on a fix: line.
  • --json, --schema and an MCP server come from one declaration on burgee: replz --mcp serves its commands as tools.
  • Exit codes are the contract. 0 passed; 1 a check failed, as the table above says, with its fix:; 2 a usage error, with the command's usage.
  • The docs are machine-readable at burgee.interlace.tools/llms.txt.

API

ImportWhat it gives you
replzparseLog(), propose(), parseCase(), selectCases(), parseConfig(), replayCase(), score() and program

The replz bin is that API, declared once on burgee.

Requirements

Node 22.13 or later, and git.

Where it sits

It hosts no plugin key of its own.

Nothing in this family builds on it yet, and it builds on bellpull, burgee, seniority, truefit.

The family

18 packages, one repository, one release pipeline. Each installs and works on its own, and each owns one job. Seven of them — bellpull, closeout, linegauge, paratext, roundel, seniority, truefit — depend on nothing; the others depend only on packages in this table, and every dependency points one way, down the layers.

No package declares a dependency from outside the family; react and react-reconciler are optional peers of controlroom, which npm does not install; vitest is an optional peer of oxmutate, which npm does not install; eslint is an optional peer of truepass, which npm does not install. package-shape-lock holds that for every manifest, and independence-install-lock installs each package alone and finds nothing but the family packages it declares.

Releases are published by one workflow through npm trusted publishing: no npm token is used, and each release carries SLSA provenance, which npm view <package> dist.attestations shows. trusted-publishing-lock keeps both true.

PackageWhat it isMigrates from
burgeeThe CLI framework: one declaration, every surfacecommander, yargs and meow
roundelColour: one output policy, semantic tokens, a themechalk, colorette, kleur, picocolors, supports-color and yoctocolors
flagstaffThe frame loop: spinners, progress, boxes and tablesora, log-update, boxen and cli-table3
caiquePrompts that are flags first, and never hang@inquirer/core
linegaugeMeasuring, wrapping, truncating and slicing styled textstring-width, wrap-ansi, strip-ansi, slice-ansi, cli-truncate and widest-line
paratextHyperlinks, images, title, clipboard and notificationsansi-escapes, terminal-link and term-img
seniorityConfiguration precedence and discovery, with provenancecosmiconfig, lilconfig, dotenv and rc
closeoutExit handlers, terminal restore and a bounded shutdownsignal-exit, exit-hook, restore-cursor, cli-cursor and onetime
bellpullSubprocesses, and which executable actually rancross-spawn and which
controlroomKeyboard-driven terminal screens, inline or full-screenink
oxmutateMutation testing on the oxc engine, inside your own VitestStryker
truepassLint rules and a pre-push check that keep a test suite honest@vitest/eslint-plugin
contractdiffAPI contracts: breaking-change diff, lint, and code from the specopenapi-typescript
truefitValidation whose schemas are data, with no evalzod
provedoneA receipt for how every change was verified, and a gate that reads it@commitlint/cli
replz (this package)Recall of a reviewer and its checks, replayed on bugs that shippedpromptfoo
hooksetThe same git and Claude Code hooks in every repository, pinned by taghusky
triggerlistThe review checklist a diff selects, read from the base branchdanger

Every migration guide, and the family-wide compatibility and benchmarks pages, are on burgee.interlace.tools.

Contributing

Issues and pull requests are welcome at ofri-peretz/burgee; read CONTRIBUTING.md first. Report a vulnerability privately, as SECURITY.md describes — never in a public issue.

Licence

MIT © Ofri Peretz — see LICENSE.

On this page