Eval compare
Decide whether a new agent version beats the current one before it rolls out.
What a screen is
A screen is a whole page exported from the kit, built only from kit components and tokens. Import it once, pass your data and callbacks, and render it as the page: it brings its own nav and <main>, and its loading and empty states are built in. A pattern is the copy-in version you own and change; a block is one area that sits inside your <main>.
When to use
- a new prompt, model or tool version ran on the same fixed cases as the live one and a person decides whether to roll it out
- the decision needs the gain, the cost and the regression risk side by side, with every case one click away
- you want the whole page done, with running, loading, empty and error states, and only need to pass the run and callbacks
When not to use
- the eval inside your own page or panel — EvalSuite
- a live traffic split between variants — ExperimentCard
- one run's steps and metrics — RunDetail
- approving an agent's plan before it runs — PlanReviewScreen
Usage
Both versions run on the same cases, and the comparison strip says at a glance whether the new one is more often right, costs more per run and answers faster, each in words: Better or Worse. The case table shows a pass or fail for each version, with Regressions and Improvements one click away, and each case opens with both outputs side by side, the expected answer and why it passed or failed. Under it, the decision: promote the new version with the gain, the cost and the regression risk spelled out, or a warning while a regression still waits for review. Import it once and pass your run and callbacks.
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
run | object | — | { title, agent, dataset, baseline: { label, metrics: { passRate, avgCost, p50LatencyMs } }, candidate: same, cases: EvalCase[], status?: "running" | "done", progress?, live?: "baseline" | "candidate", currency? } The eval run. title is the page h1, agent the breadcrumb, dataset ("50 sample invoices") the subtitle and the block title. cases is EvalSuite's case shape; put the expected answer and why in graderNote ("Expected: Send final notice. Why it failed: …"). status running shows the block's progress with progress (0–1) and holds the decision. live "candidate" is the promoted state. Sample Collections agent A vs B on 50 invoices when omitted. |
view | enum | — | Which cases the table shows. Uncontrolled when omitted: Regressions while a regression waits for review, else All. |
onViewChange | function | — | (view) => void. |
onRunEval | function | — | () => void. Run eval, the solid primary of the empty state (kit Empty first-use). |
onRerun | function | — | () => void. Re-run, outline, in the block footer. |
onAcceptExpected | function | — | (caseId) => void. Accept as new expected in the case Drawer. The screen marks the case reviewed. |
onFlag | function | — | (caseId) => void. Flag case in the case Drawer. The screen marks the case reviewed. |
onPromote | function | — | () => void. Promote <candidate> on the ApprovalCard, the page's one solid primary (or ⌘/Ctrl+Enter in the card). The screen shows the live state and a Toast with Undo. |
onKeepCurrent | function | — | () => void. Keep <baseline> on the ApprovalCard (outline, or Escape in the card). |
onUndoPromote | function | — | () => void. Undo on the promoted Toast. The decision goes back to pending. |
workspace | object | — | { name: string, icon?: KitIcon } App nav brand (and the Drawer title below --grid-breakpoint-md). Northwind when omitted. |
user | object | — | { name: string, email?: string, src?: string } Account menu at the foot of the app nav (kit DropdownMenu: the avatar on the rail, the account card in the Drawer, both with src as the photo and an online presence mark; the menu holds View profile, Account settings, Documentation, Switch account with a sample second account, Add account and Sign out, all samples that only close the menu except Account settings, which goes to a Settings row when the screen has one). Example person when omitted. |
onNavigate | function | — | (destination) => void. destination is "overview" | "customers" | "invoices" | "subscriptions" | "agents" (app nav rows; "agents" also from the breadcrumb). |
loading | boolean | false | Nav and PageHeader stay; Skeletons for the strip, the table and the decision (one Loading eval label); main is aria-busy. |
empty | boolean | false | Kit Empty (first-use) "No eval runs yet" with the solid Run eval in place of the results. Also shown when run.cases is []. |
error | object | — | { message: string, reference?: string } The run failed to load: kit LoadError (lg) with the message, the reference and Try again in place of the results. |
onRetry | function | — | () => void. Try again on the LoadError. |
className | string | — | On the root layout-shell. |
States
- page: default, loading, empty, running, regression, promoted, error
- run: running (the block's Progress, "Running n of N cases"; the strip shows the numbers so far; no decision yet; main is aria-busy), results (default: done, every regression reviewed; the ApprovalCard is pending with the gain, cost and regression risk; the table on All), regression (a case passed with the baseline and fails with the candidate and nobody reviewed it: a warning Alert in the decision's place names it, the table opens on Regressions), promoted (the ApprovalCard's resolved row, the header Badge says <candidate> live in success, a Toast with Undo), kept (Keep <baseline>: the ApprovalCard's resolved row, an info Toast)
- layout: the block full width, the decision under it at most --grid-width-sm wide (the case table needs the width; it scrolls sideways in its frame when narrower), the nav in a left Drawer (below --grid-breakpoint-md), the strip stacks and the case Drawer's outputs stack (below --grid-breakpoint-sm)
Accessibility
- Renders its own main landmark named by the run title; the app SideNav is an aside named App. Don't wrap the screen in another main
- PageHeader title is the page h1; the EvalSuite section has its h2; the decision is an aside named Decision
- Results, reviews and deltas are words (Pass / Fail / Error, To review / Accepted / Flagged, Better / Worse), and which version is live is a Badge in words, never colour alone
- Promote is the ApprovalCard's Approve: ⌘/Ctrl+Enter approves and Escape keeps the baseline while focus is in the card
- While a regression waits for review the decision is a warning Alert that names the case in text, so Promote is not offered
- running sets aria-busy on main and the block announces progress in a status region; loading says Loading eval once
- Below --grid-breakpoint-md the nav opens from an IconButton named Menu into a kit Drawer
- No motion of its own; the kit components it composes bring theirs and stop it with reduced motion
Responsive
- Wide: SideNav on the canvas, the page on the inset panel; the EvalSuite block takes the full width and the decision follows it, at most --grid-width-sm wide
- Below --grid-breakpoint-md: the nav moves into a left kit Drawer behind a Menu IconButton
- Below --grid-breakpoint-sm: the subtitle wraps, the strip stacks, the case table scrolls sideways in its frame and the case Drawer's outputs stack
- Dark mode follows the root theme; semantic tokens only
Do not
- Do not copy the screen's parts into a local cousin; change it through its props or compose EvalSuite yourself
- Do not wrap it in an app shell or another main
- Do not add a second solid primary Button; Promote on the ApprovalCard is the only one (Run eval in the empty state)
- Do not offer Promote while a regression is unreviewed
- Do not add a Regressions tile to the strip; the view tabs carry the counts
- Do not show results, deltas or the live version by colour alone
- Do not use raw hex
Built from
Related
- Block
Eval suite
Test a candidate agent version against the baseline, case by case, before you ship it.
- Component
ExperimentCard
A compact A/B or A/B/n experiment: status in words, the metric and traffic split under each variant's value ("paid within 7 days · 50%"), a confidence note in plain words and one decision (Ship winner, Stop, Extend, Start).
- Block
Run detail
One agent run on one screen: clock, cost, pending approval and every step, all following the step you pick.
- Screen
Plan review
Approve an agent's plan before it runs, step by step, as a whole page.