JSON contract
Every command takes --json and prints one JSON object on stdout, and nothing else there. A JSON Schema in
schema/v1/ describes each object, with a sample in schema/v1/samples/. An agent, a CI job or another tool reads
Rehearse only through these.
The following pipes one command’s JSON into rehearse validate, which checks it against its schema.
$ rehearse services --json | rehearse validate servicesIt meets the services schema.The rule
Section titled “The rule”- Every output carries
"v": 1, the contract’s major version. - Within v1, an output only gains optional fields. A field typed as an open string (one whose schema gives examples,
such as
failure,steporfidelity) may gain new values. A verdict stays one of its five values. - A reader ignores fields it doesn’t know, and reads a value it doesn’t know as “something else”, never as an error.
- A refusal is
{"v": 1, "ok": false, "error": {"code": "…", "says": "…"}}, seeerror. It exits 2 for a usage error and 1 otherwise.
The schemas are JSON Schema 2020-12. Each $id is
https://rehearse.kurvball.ca/schema/v1/<name>.schema.json: the docs site serves each schema at its id. The
package exports them as @kurvball/rehearse/schema/v1/*, and a schema’s $ref to another
(common.schema.json#/$defs/…) resolves beside it, at either address. rehearse validate
checks a file or stdin against one.
Two answers fall outside the schemas: rehearse <command> --help --json prints {"v": 1, "usage": "…"}, and
rehearse --version --json prints {"v": 1, "version": "…"}.
The schemas
Section titled “The schemas”Each command’s output has a schema. So do a refusal, a line of .rehearse/tries.jsonl, and what Rehearse reads from
an import graph.
| Schema | Printed by |
|---|---|
init |
rehearse init --json Added in: v0.1.0 |
check |
rehearse check --json Added in: v0.1.0 |
services |
rehearse services --json Added in: v0.1.0 |
people |
rehearse people --json Added in: v0.1.0 |
worlds |
rehearse worlds --json Added in: v0.1.0 |
list |
rehearse list --json Added in: v0.1.0 |
up |
rehearse up --json and rehearse down --json Added in: v0.2.0 |
observation |
rehearse run --json Added in: v0.1.0 |
comparison |
rehearse compare --json Added in: v0.1.0 |
drive |
rehearse drive --json Added in: v0.1.0 |
stage |
rehearse stage --json Added in: v0.4.0 |
open |
rehearse open --json Added in: v0.1.0 |
clean |
rehearse clean --json Added in: v0.2.0 |
validate |
rehearse validate --json Added in: v0.1.0 |
try |
Each line of .rehearse/tries.jsonl, written by the stage Added in: v0.1.0 |
error |
Any command that refuses, with --json Added in: v0.1.0 |
dependents |
An import graph, such as ashlar dependents, for Rehearse to read Added in: v0.1.0 |
The files you write have schemas too, and rehearse validate checks them the same way.
| Schema | Describes |
|---|---|
manifest |
What a repository has: the branch production runs, its services, people, worlds, stand-ins and scenarios. See rehearse.yaml. Added in: v0.1.0 |
flow |
A flow: steps by accessible name, from a service’s page or a piece’s canvas. See Flows. Added in: v0.1.0 |
file-scenario |
A file scenario: an input, a run, and the output it writes, compared by its own layout. See File scenarios. Added in: v0.1.0 |
announce |
The scenarios a change expects to change, each with one line saying why. See Announcements. Added in: v0.1.0 |
common.schema.json holds what the others share.
Shared definitions
Section titled “Shared definitions”common.schema.json defines these, and the outputs refer to them. It is not an output on its own.
The contract’s major version. Every output carries it.
Type: 1.
A scenario’s kind. v1 runs piece, flow, call and file; job, agent and plan are reserved for later; a repository may add its own.
Type: open string.
verdict
Section titled “verdict”same: as on the base. said: changed and said so. unsaid: changed without saying so. new: not on the base. fails: fails on the head.
Type: "same" or "said" or "unsaid" or "new" or "fails".
scenarioRef
Section titled “scenarioRef”A scenario, as every output names it.
| Field | Type | What it is |
|---|---|---|
id |
string | The scenario’s id: its file, then # and its name within the file when the file holds more than one. |
kind |
kind | A scenario’s kind. v1 runs piece, flow, call and file; job, agent and plan are reserved for later; a repository may add its own. |
name |
string | What the scenario tries, in plain words. |
file |
string | The file it is written in, relative to its root. |
line |
integer, optional | The line it starts on, when the file holds more than one. |
area |
string, optional | Where it is grouped: its package, or its folder. Its area is its package’s name, else its package’s folder, else its first one or two folders. |
from |
"checkout" or "manifest", optional |
checkout: read from each checkout. manifest: read beside rehearse.yaml, the same on both sides. |
definition |
string, optional | A hash of the scenario’s parsed definition. It changes when the scenario itself is edited. |
checkout
Section titled “checkout”A checkout, as every output names it.
| Field | Type | What it is |
|---|---|---|
path |
string | The checkout’s folder. |
ref |
string or null, optional | The ref it was asked for, when one was. |
commit |
string or null, optional | The commit it holds. |
dirty |
boolean, optional | Whether it holds uncommitted changes. A dirty checkout is never cached. Uncommitted changes are tracked edits, or untracked files other than the overlay’s and Rehearse’s own .rehearse/. |
standin
Section titled “standin”A stand-in a run used, or the real dependency chosen in its place.
| Field | Type | What it is |
|---|---|---|
name |
string | The stand-in’s name. |
replaces |
string | What it stands in for. |
by |
string or null, optional | What plays it. |
fidelity |
open string | How real it is: fake (written by hand), recorded (replays real answers), local (the real thing, run locally). More may come. |
real |
boolean | True when the real dependency was chosen in its place (--real). |
failure
Section titled “failure”One way a scenario failed: the line or step, what was expected and what came back.
| Field | Type | What it is |
|---|---|---|
line |
integer, optional | The line that failed: a call’s assert. |
step |
integer, optional | The step that failed: a flow’s. |
text |
string | The line, assert or step that failed. |
expected |
string or null | What was expected. |
got |
string or null | What came back. |
difference
Section titled “difference”One thing that differs between the base and the head, after what is set aside.
| Field | Type | What it is |
|---|---|---|
path |
string | Where it differs: status, a JSON path with indices folded ($.items[*].name), a column (column 5 “item_quantity”), a step (step 3), or tree. |
base |
string | What the base had there, clipped. |
head |
string | What the head has there, clipped. |
count |
integer | In how many places, rows or items it differs. |
setAside
Section titled “setAside”What was set aside before comparing, by kind and count, so a person can see why two answers matched.
| Field | Type | What it is |
|---|---|---|
ids |
integer, optional | How many generated ids were set aside. |
times |
integer, optional | How many times were set aside. |
opaque |
integer, optional | How many opaque values, such as tokens, were set aside. |
order |
integer, optional | How many lists, compared without their order, came in another order. |
custom |
integer, optional | How many values the setAside keys and values of the manifest or the scenario set aside. |
Only the kinds with a count above 0 appear. The manifest’s setAside adds rules of its own.
refused
Section titled “refused”A scenario file Rehearse could not read, and why.
| Field | Type | What it is |
|---|---|---|
file |
string | The file Rehearse couldn’t read. |
line |
integer, optional | The line it couldn’t read, when it knows it. |
says |
string | Why, in plain words. |
person
Section titled “person”A person’s name, or nobody.
Type: string or null.
Added in: v0.1.0Where the starter manifest was written.
Printed by rehearse init --json. Its schema is schema/v1/init.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
file |
string | The file written. |
replaced |
boolean | Whether it replaced a manifest (--force). |
The sample Rehearse ships, schema/v1/samples/init.json, meets the schema.
{ "v": 1, "file": "/work/acme/rehearse.yaml", "replaced": false}Whether rehearse.yaml reads well, how much it declares, and every scenario file Rehearse couldn’t read. It exits 1 when a file was refused.
Printed by rehearse check --json. Its schema is schema/v1/check.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
ok |
boolean | True when no scenario file was refused. |
manifest |
string | The manifest read. |
checkout |
string | The checkout its scenarios were read from. |
base |
string | The manifest’s base branch. |
services |
integer | How many services it declares. |
people |
integer | How many people it declares. |
worlds |
integer | How many worlds it declares. |
standins |
integer | How many stand-ins it declares. |
scenarios |
map of string to integer | How many scenarios of each kind it read. |
refused |
list of refused | Each scenario file Rehearse couldn’t read. |
The sample Rehearse ships, schema/v1/samples/check.json, meets the schema.
{ "v": 1, "ok": true, "manifest": "/work/acme/rehearse.yaml", "checkout": "/work/acme", "base": "main", "services": 2, "people": 2, "worlds": 2, "standins": 1, "scenarios": { "piece": 12, "flow": 3, "call": 18, "file": 1 }, "refused": []}services
Section titled “services”What can come up, how Rehearse knows it is ready, and what is running now.
Printed by rehearse services --json. Its schema is schema/v1/services.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
services |
list of objects | One entry per service the manifest declares. |
services[].name |
string | Its name. |
services[].describe |
string or null, optional | One line about it. |
services[].up |
string | The command that brings it up, before placeholders are filled. |
services[].cwd |
string or null, optional | Where it runs, relative to the checkout. |
services[].url |
string or null, optional | Where it answers, before placeholders are filled. |
services[].port |
integer or "auto" or null, optional |
Its port, or auto for a free one Rehearse picks. |
services[].ready |
null or {http} or {command} or {log}, optional |
How Rehearse knows it is ready. |
services[].down |
string or null, optional | The command that stops it. |
services[].isolate |
null or {env}, optional |
The variable that gives each copy its own scratch folder. |
services[].drive |
string or null, optional | The service’s own driver for flows and rehearse drive, when it has one. |
services[].standins |
list of strings, optional | The stand-ins that apply to it. |
services[].running |
list of objects | Copies of it up now, one per checkout. |
services[].running[].checkout |
string | The checkout this copy runs in. |
services[].running[].url |
string or null, optional | Where this copy answers. |
services[].running[].port |
integer or null, optional | Its port. |
services[].running[].pid |
integer | The pid of its up command. |
services[].running[].since |
date-time, optional | When it came up. |
The sample Rehearse ships, schema/v1/samples/services.json, meets the schema.
{ "v": 1, "services": [ { "name": "api", "describe": "The API", "up": "pnpm serve --port {{port}}", "cwd": null, "url": "http://127.0.0.1:{{port}}", "port": "auto", "ready": { "http": "http://127.0.0.1:{{port}}/health" }, "down": null, "isolate": null, "drive": null, "standins": [ "ai" ], "running": [ { "checkout": "/work/acme", "url": "http://127.0.0.1:41234", "port": 41234, "pid": 4242, "since": "2026-12-03T14:00:00.000Z" } ] } ]}people
Section titled “people”Who you can sign in as. people keeps the sign-in shape: each signed-in person’s token, with the fields the sign-in gave beside it (each field becomes a <name>_<key> variable). Everyone the manifest declares, signed in or not, is described in about. Tokens appear only with --json, and only when the sign-in ran.
Printed by rehearse people --json. Its schema is schema/v1/people.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
people |
map of string to string or {token} |
Each signed-in person: a token, or token and each field the sign-in gave beside it. |
variables |
map of string to string | Values the sign-in gave beside the people, such as an organization’s id. |
signedIn |
boolean, optional | Whether the sign-in command ran and gave tokens. |
said |
string or null, optional | Why there are no tokens, when there are none. |
about |
map of string to {real, default, describe, signedIn} |
Every person, signed in or not: how real they are, whether scenarios run as them by default, and who they are. |
about.<name>.real |
open string | local (a sign-in the local services trust), stand-in (a fake identity), real (a real account). More may come. |
about.<name>.default |
boolean | Whether scenarios run as them by default. |
about.<name>.describe |
string or null, optional | Who they are. |
about.<name>.signedIn |
boolean | Whether the sign-in gave this person a token. |
Names in people and about match [A-Za-z_][A-Za-z0-9_-]* and are never you, nobody or api.
The sample Rehearse ships, schema/v1/samples/people.json, meets the schema.
{ "v": 1, "people": { "owner": { "token": "eyJ.sample.token", "membershipId": "m-1" } }, "variables": { "organization": "org-1", "owner_membershipId": "m-1" }, "about": { "owner": { "real": "local", "default": true, "describe": "The organisation's owner", "signedIn": true }, "member": { "real": "local", "default": false, "describe": null, "signedIn": false } }, "signedIn": true, "said": null}worlds
Section titled “worlds”The named starting states, each with the chain of worlds it is built from.
Printed by rehearse worlds --json. Its schema is schema/v1/worlds.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
worlds |
list of objects | One entry per world. |
worlds[].name |
string | Its name. |
worlds[].describe |
string or null, optional | What it holds. |
worlds[].extends |
string or null, optional | The world it builds on. |
worlds[].chain |
list of strings | The worlds applied in order, from the root to this one. |
worlds[].add |
string or null, optional | The command that adds this world on top of the one it extends. |
worlds[].default |
boolean | Whether scenarios start from it by default. |
The sample Rehearse ships, schema/v1/samples/worlds.json, meets the schema.
{ "v": 1, "worlds": [ { "name": "empty", "describe": "Nothing but the schema", "extends": null, "chain": [ "empty" ], "add": null, "default": false }, { "name": "one-org", "describe": null, "extends": "empty", "chain": [ "empty", "one-org" ], "add": "node scripts/seed.mjs one-org", "default": true } ]}The scenarios a repository holds, or, with --affected, those a change reaches and why.
Printed by rehearse list --json. Its schema is schema/v1/list.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
by |
open string | all: every scenario. graph: an import graph (Ashlar’s, or the manifest’s affected.graph) with the covering rule. packages: the touched packages and the packages that depend on them. More may come. |
files |
list of strings, optional | The files the change touched, with --affected. |
said |
string or null, optional | Anything the reader should know, such as why Ashlar wasn’t used. |
scenarios |
list of scenarioRef with more fields | Each scenario, with the fields below. |
scenarios[].world |
string or null, optional | The world it starts from. |
scenarios[].person |
person, optional | A person’s name, or nobody. |
scenarios[].service |
string or null, optional | The service it uses. |
scenarios[].reachedBy |
list of strings, optional | With --affected: why the change reaches it, one line per reason. |
refused |
list of refused | Each scenario file Rehearse couldn’t read. |
graph |
string or null, optional | With by graph: the command that gave the graph. |
The sample Rehearse ships, schema/v1/samples/list.json, meets the schema.
{ "v": 1, "by": "packages", "files": [ "apps/api/src/routes/members.ts" ], "said": "No import graph is here (no Ashlar, no affected.graph), so Rehearse took the touched packages and the packages that depend on them. v1 reads workspace links for JavaScript packages only: other languages’ packages count as folders.", "scenarios": [ { "id": "apps/api/src/routes/members.hurl#A member isn't told the directory exists", "kind": "call", "name": "A member isn't told the directory exists", "file": "apps/api/src/routes/members.hurl", "line": 48, "area": "@acme/api", "from": "checkout", "definition": "3f2a9c0d1e2b4a5c", "world": "one-org", "person": "member", "service": "api", "reachedBy": [ "it is in @acme/api, which the change touches" ] } ], "refused": [], "graph": null}The services rehearse up brought up (and left running), or rehearse down stopped.
Printed by rehearse up --json and rehearse down --json. Its schema is schema/v1/up.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
checkout |
string or null | The checkout, or null for rehearse down --all. |
world |
string or null | The world built on them. Always null for down. |
services |
list of objects | One entry per service. |
services[].name |
string | Its name. |
services[].checkout |
string | The checkout it runs in. |
services[].url |
string or null, optional | Where it answers. |
services[].port |
integer or null, optional | Its port. |
services[].pid |
integer | The pid of its up command. |
services[].since |
date-time, optional | When it came up. |
services[].standins |
list of strings, optional | The stand-ins it runs with; name:real when the real one was chosen. |
The sample Rehearse ships, schema/v1/samples/up.json, meets the schema.
{ "v": 1, "checkout": "/work/acme", "world": "one-org", "services": [ { "name": "api", "checkout": "/work/acme", "url": "http://127.0.0.1:41234", "port": 41234, "pid": 4242, "since": "2026-12-03T14:00:00.000Z", "standins": [ "ai" ] } ]}observation
Section titled “observation”One observation: a scenario run once on one checkout, as one person, from one world. Stored raw; what is set aside is applied only when comparing. Tokens are scrubbed.
Printed by rehearse run --json. Its schema is schema/v1/observation.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
ok |
boolean | Whether the scenario ran and its own checks held. false means it fails: a call’s status or assert, a file run that exited non-zero, a flow step that stopped, a piece that threw. |
scenario |
scenarioRef | The scenario. |
checkout |
checkout | Where it ran. |
world |
string or null | The world it started from. |
person |
person | A person’s name, or nobody. |
standins |
list of standin | The stand-ins it ran with. |
failures |
list of failure | How it fails. |
broke |
null or {step, says}, optional |
Set when something around the scenario broke, not the scenario: the checkout wasn’t prepared, a service didn’t come up, the sign-in or the world failed. Such a run is never cached. |
observed |
null or call or file or flow or piece or other | What the kind observes; its shape depends on scenario.kind. null when broke is set and nothing was observed. |
artifacts |
list of {kind, path, label}, optional |
Files the run kept: screenshots, outputs, logs. |
artifacts[].kind |
string | What it is: screenshot, output (a file scenario’s output folder) or input. |
artifacts[].path |
string | Where it is kept. |
artifacts[].label |
string, optional | What the stage calls it, such as step 2 or dark. |
ms |
integer | How long it took, in milliseconds. |
at |
date-time | When it ran. |
rehearse |
string | The Rehearse version that ran it. |
cached |
boolean, optional | True when this observation was read from the baseline cache. |
runner |
string, optional | The kind runner’s version that observed it: part of the cache key. |
cacheKey |
string or null, optional | The key it is cached under, when its checkout is a clean commit. |
broke.step is an open string: prepare, overlay, up, ready, signIn, world, driver, runner. In
observed, failures and broke, Rehearse writes the checkout’s folder as {{checkout}}, so what a scenario saw
doesn’t depend on where its checkout sits. The manifest’s folder is written as its place in the checkout
({{checkout}}/<folder>), or as {{manifest}} when the manifest sits outside the checkout.
observation: call
Section titled “observation: call”What a call observes.
| Field | Type | What it is |
|---|---|---|
kind |
"call" |
Always call. |
request |
string | The method and path, with variables unfilled. |
who |
string | Who it was sent as: a person’s name, nobody, or a token for no one. |
status |
integer or null | The status; null when it got no answer. |
contentType |
string or null, optional | The answer’s content type, without parameters. |
body |
any, optional | The answer’s body: parsed JSON when it is JSON, else its text, clipped. A body that isn’t JSON is clipped to its first 200,000 characters. |
tries |
list of integer or null, optional | Each try’s status, for a call that retries. |
before |
integer, optional | How many earlier calls in its file ran first, for their captures. |
observation: file
Section titled “observation: file”What a file scenario observes.
| Field | Type | What it is |
|---|---|---|
kind |
"file" |
Always file. |
exit |
integer or null | The exit code of its run; null when it didn’t run. |
log |
string, optional | The last lines the run printed. |
outputs |
list of output | Each output it wrote. |
observation: output
Section titled “observation: output”One output a file scenario wrote, read by its layout.
| Field | Type | What it is |
|---|---|---|
file |
string | The output’s file. |
layout |
open string | How it was read: csv, tsv, json, lines, fixed, zip, skip, or missing when nothing was written there. |
columns |
list of strings, optional | The columns of a table layout. |
rows |
list of list of strings, optional | The rows of a table layout. |
lines |
list of strings, optional | The lines, for a lines layout. |
json |
any, optional | The parsed JSON, for a json layout. |
entries |
list of output, optional | The entries of a zip, each read by its own layout. |
A file that isn’t text, or JSON that doesn’t parse, is read as lines.
observation: flow
Section titled “observation: flow”What a flow observes.
| Field | Type | What it is |
|---|---|---|
kind |
"flow" |
Always flow. |
driver |
open string | service: the service’s own driver. browser: Rehearse’s browser. More may come. |
said |
string or null, optional | Anything the driver couldn’t do, such as signing in as a person. |
steps |
list of objects | Each step, from 1. Step 1 opens the page. |
steps[].n |
integer | Its number, from 1. |
steps[].step |
object | The step as written, or {open: <path>} for step 1. |
steps[].ok |
boolean | Whether it did what it says. |
steps[].says |
string or null, optional | What went wrong, when it didn’t. |
steps[].tree |
string or null, optional | The accessibility tree after the step. |
steps[].screenshot |
string or null, optional | Allowed, never written: Rehearse keeps each step’s screenshot in artifacts. |
errors |
list of strings, optional | What the page logged as errors while the flow ran (Rehearse’s browser only). Compared, as a piece’s are. |
observation: piece
Section titled “observation: piece”What a piece observes.
| Field | Type | What it is |
|---|---|---|
kind |
"piece" |
Always piece. |
storyId |
string or null, optional | Its Storybook id, when its title could be read. |
schemes |
map of string to object | For each colour scheme it rendered in, light and, when asked, dark. |
schemes.<name>.tree |
string or null | The accessibility tree. |
schemes.<name>.threw |
string or null, optional | What the story threw while rendering, if it did. |
schemes.<name>.errors |
list of strings | What the page logged as errors. |
schemes.<name>.violations |
list of {id, help, nodes} |
The axe violations. |
schemes.<name>.violations[].id |
string | The axe rule’s id. |
schemes.<name>.violations[].help |
string | What the rule asks for. |
schemes.<name>.violations[].nodes |
integer, optional | How many elements break it. |
schemes.<name>.screenshot |
string or null, optional | Allowed, never written: Rehearse keeps each scheme’s screenshot in artifacts. |
schemes.<name>.pixels |
string or null, optional | A hash of the screenshot, compared only when the manifest asks. |
observation: other
Section titled “observation: other”A later or repository-defined kind.
| Field | Type | What it is |
|---|---|---|
kind |
any | The kind. |
The sample Rehearse ships, schema/v1/samples/observation.json, meets the schema.
{ "v": 1, "ok": false, "scenario": { "id": "apps/api/src/routes/members.hurl#A member isn't told the directory exists", "kind": "call", "name": "A member isn't told the directory exists", "file": "apps/api/src/routes/members.hurl", "line": 48, "area": "@acme/api", "from": "checkout", "definition": "3f2a9c0d1e2b4a5c" }, "checkout": { "path": "/work/acme", "ref": null, "commit": "b4a57d57d0000000000000000000000000000000", "dirty": false }, "world": "one-org", "person": "member", "standins": [ { "name": "ai", "replaces": "The model provider", "by": "test/fixtures/ai-fake.ts", "fidelity": "fake", "real": false } ], "failures": [ { "line": 52, "text": "HTTP 404", "expected": "404", "got": "403" } ], "broke": null, "observed": { "kind": "call", "request": "GET /v1/organizations/{{organization}}/members", "who": "member", "status": 403, "contentType": "application/json", "body": { "error": { "code": "forbidden", "correlationId": "9b2f6a1e-1c1d-4c4e-9a52-0f6b1d2c3e4f" } }, "tries": [] }, "artifacts": [], "ms": 12, "at": "2026-12-03T14:00:00.000Z", "rehearse": "0.1.0", "cached": false, "runner": "call/1", "cacheKey": null}comparison
Section titled “comparison”Scenarios run on a base and on a head, compared after what is set aside, each sorted into one verdict.
Printed by rehearse compare --json. Its schema is schema/v1/comparison.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
ok |
boolean | true when both sides came up, every scenario ran, and nothing fails on the head or changed without saying so. |
base |
side | The base side. |
head |
side | The head side. |
line |
string | The comparison in one line, as a gate shows it. |
counts |
object | How many scenarios got each verdict, and more. |
counts.same |
integer | How many are as on the base. |
counts.said |
integer | How many changed and said so. |
counts.announced |
integer, optional | Of said: announced by the change. |
counts.edited |
integer, optional | Of said: the scenario’s own definition was edited. |
counts.unsaid |
integer | How many changed without saying so. |
counts.new |
integer | How many the base doesn’t have. |
counts.fails |
integer | How many fail on the head. |
counts.failsOnBoth |
integer, optional | Of fails: failing on the base as well, so not this change’s doing. |
counts.gone |
integer | How many the head no longer has. |
counts.notRun |
integer | Scenarios that couldn’t be run on a side, so have no verdict. |
scenarios |
list of objects | One entry per scenario with a verdict. |
scenarios[].scenario |
scenarioRef | The scenario, as the head has it. |
scenarios[].verdict |
verdict | same: as on the base. said: changed and said so. unsaid: changed without saying so. new: not on the base. fails: fails on the head. |
scenarios[].changed |
boolean | Whether its observation differs, after what is set aside. |
scenarios[].said |
"announced" or "edited" or null |
announced when the change announced it (this wins, since it carries why), else edited when its own definition changed, else null. |
scenarios[].why |
string or null, optional | The announcement’s line, when it was announced. |
scenarios[].failsOnBase |
boolean | Whether it fails on the base. |
scenarios[].failsOnHead |
boolean | Whether it fails on the head. |
scenarios[].differences |
list of difference | What differs, after what is set aside. |
scenarios[].setAside |
setAside | What was set aside, by kind and count, counted on the head’s side. |
scenarios[].failures |
list of failure, optional | How it fails on the head. |
scenarios[].baseFailures |
list of failure, optional | How it fails on the base. |
scenarios[].cached |
boolean, optional | Whether the base’s observation came from the cache. |
scenarios[].observations |
{base, head}, optional |
Where the two observations are kept, for the stage. |
scenarios[].observations.base |
string or null, optional | Where the base’s observation is kept; null for a new scenario. |
scenarios[].observations.head |
string or null, optional | Where the head’s observation is kept. |
scenarios[].edited |
boolean, optional | Whether its own definition changed between base and head, whatever said is. |
gone |
list of scenarioRef | Scenarios on the base that the head no longer has. |
announcedUnchanged |
list of {scenario, why} |
Scenarios the change announced that didn’t change: a note for the reader, never a failure. |
announcedUnchanged[].scenario |
string | The scenario the announcement named. |
announcedUnchanged[].why |
string | The announcement’s line. |
byChange |
list of {path, scenarios} |
Changes made without saying so, grouped by what changed: one change in many scenarios is one thing to look at. |
byChange[].path |
string | What changed, such as a JSON path or a column. |
byChange[].scenarios |
list of strings | The ids of the scenarios it changed in, most first. |
standins |
list of standin, optional | The stand-ins the head ran with. |
ms |
integer, optional | How long it took, in milliseconds. |
notRun |
list of {scenario, side, step, says} |
Scenarios that couldn’t be run on one side while the side itself came up: a world, the sign-in or the runner broke for them. They have no verdict. |
notRun[].scenario |
scenarioRef | The scenario. |
notRun[].side |
"base" or "head" |
The side it couldn’t run on. |
notRun[].step |
open string | Where it broke: world, signIn, runner, driver or up. More may come. |
notRun[].says |
string | Why, in plain words. |
refused |
list of refused with more fields, optional | Scenario files Rehearse couldn’t read, on either side. |
refused[].side |
"base" or "head" |
The side whose file Rehearse couldn’t read. |
counts also has three counts that break others down: announced and edited (of said), and failsOnBoth (of
fails: failing on the base as well, so not this change’s doing). notRun counts scenarios, not entries.
When the base doesn’t come up, base.ok is false, line says why (The base didn't come up (prepare): …), and
scenarios is empty.
comparison: side
Section titled “comparison: side”One side of the comparison, the base or the head.
| Field | Type | What it is |
|---|---|---|
checkout |
checkout | The side’s checkout. |
ok |
boolean | false when this side couldn’t be prepared or its services didn’t come up; then no scenario has a verdict. |
step |
string or null, optional | Where the side broke, or null. |
says |
string or null, optional | Why it broke, or null. |
cached |
integer, optional | How many observations came from the cache. |
The sample Rehearse ships, schema/v1/samples/comparison.json, meets the schema.
{ "v": 1, "ok": false, "base": { "checkout": { "path": "/work/acme/.rehearse/checkouts/2d24f5e1", "ref": "main", "commit": "2d24f5e1aaaa0000000000000000000000000000", "dirty": false }, "ok": true, "step": null, "says": null, "cached": 17 }, "head": { "checkout": { "path": "/work/acme", "ref": null, "commit": "b4a57d57d0000000000000000000000000000000", "dirty": true }, "ok": true, "step": null, "says": null, "cached": 0 }, "line": "11 as on the base · 1 new · 1 changed and said so · 4 changed without saying so · 1 fails on the head", "counts": { "same": 11, "said": 1, "announced": 1, "edited": 0, "unsaid": 4, "new": 1, "fails": 1, "failsOnBoth": 0, "gone": 0, "notRun": 0 }, "scenarios": [ { "scenario": { "id": "apps/api/src/routes/members.hurl#The owner sees every member", "kind": "call", "name": "The owner sees every member", "file": "apps/api/src/routes/members.hurl", "line": 6, "area": "@acme/api", "from": "checkout", "definition": "aa11" }, "verdict": "unsaid", "changed": true, "said": null, "why": null, "failsOnBase": false, "failsOnHead": false, "differences": [ { "path": "$.items[*].activeCapabilityCodes", "base": "[\"identity.account_state.manage\",…", "head": "[]", "count": 4 } ], "setAside": { "ids": 6, "times": 2 }, "cached": true, "edited": false } ], "gone": [], "announcedUnchanged": [], "byChange": [ { "path": "$.items[*].activeCapabilityCodes", "scenarios": [ "apps/api/src/routes/members.hurl#The owner sees every member" ] } ], "standins": [], "ms": 2300, "notRun": []}One step’s result, in the drive result shape ({ok, command, ms, file, tree} or {ok: false, command, ms, failure, says}, as Ashlar’s DriveResult reads it), with v and driver added, so a reader of that shape reads it unchanged. Two commands are Rehearse’s own: start (it starts the driver) and fill (it fills a field by its name, in Rehearse’s browser only); a service’s own driver may have neither. Exit codes: 0 done, 1 failed, 2 usage.
Printed by rehearse drive --json. Its schema is schema/v1/drive.schema.json.
When ok is true, it has these fields.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
ok |
true |
The step is done. |
command |
open string | The step: start, click, type, key, fill, snapshot, screenshot, record or stop. |
ms |
integer | How long it took, in milliseconds. |
file |
string or null | The file a screenshot or a recording saved. |
tree |
string or null | The accessibility tree a snapshot printed. |
driver |
open string or null | Which driver did it; null for a stop when nothing was being driven. Known values: service, browser. |
errors |
list of strings, optional | Errors the page logged during the step. |
said |
string or null, optional | Anything the driver couldn’t do, such as signing in as a person. |
When ok is false, it has these fields.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
ok |
false |
The step failed. |
command |
open string or null | The step, even for a usage error, or null when the first word names no step. Known values: start, click, type, key, fill, snapshot, screenshot, record, stop. |
ms |
integer | How long it took, in milliseconds. |
failure |
open string | Why a step failed; more may come. Known values: usage, not_found, ambiguous, not_running, timed_out, crashed. |
says |
string | What went wrong and what to do, in plain words. |
driver |
open string or null | service: the service’s own driver. browser: Rehearse’s browser. More may come. |
Every step answers in one of these two shapes, even a usage error. drive exits 0 when the step is done, 1 when it
failed, and 2 for usage.
The sample Rehearse ships, schema/v1/samples/drive.json, meets the schema.
{ "v": 1, "ok": true, "command": "snapshot", "ms": 41, "file": null, "tree": "- button \"Settings\"", "driver": "browser", "said": null}Where the stage is, once it is up. The command keeps running until it is stopped.
Printed by rehearse stage --json. Its schema is schema/v1/stage.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
url |
string | The stage’s address, on 127.0.0.1 only. |
port |
integer | Its port, from 1 to 65535. |
pid |
integer | The stage’s process: stop it with kill on this. |
The sample Rehearse ships, schema/v1/samples/stage.json, meets the schema.
{ "v": 1, "url": "http://127.0.0.1:4400/", "port": 4400, "pid": 41873}Where a person tries a scenario on the stage.
Printed by rehearse open --json. Its schema is schema/v1/open.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
url |
string | The stage’s address for the scenario. |
scenario |
string | The scenario’s id. |
started |
boolean | Whether this command started the stage. |
The sample Rehearse ships, schema/v1/samples/open.json, meets the schema.
{ "v": 1, "url": "http://127.0.0.1:4400/?s=packages%2Fui%2Fsrc%2FBadge.stories.tsx%23Primary", "scenario": "packages/ui/src/Badge.stories.tsx#Primary", "started": true}What rehearse clean removed.
Printed by rehearse clean --json. Its schema is schema/v1/clean.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
removed |
list of strings | Each folder or file removed. |
The sample Rehearse ships, schema/v1/samples/clean.json, meets the schema.
{ "v": 1, "removed": [ "/work/acme/.rehearse/checkouts/2d24f5e1aaaa" ]}validate
Section titled “validate”Whether a JSON or YAML file meets one of Rehearse’s schemas, and what is wrong where.
Printed by rehearse validate --json. Its schema is schema/v1/validate.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
ok |
boolean | Whether it meets the schema. |
schema |
string | The schema’s name. |
file |
string or null, optional | The file checked, or null for stdin. |
errors |
list of {at, line, says} |
What is wrong. |
errors[].at |
string | Where: the top, or a path such as services.api or scenarios[0]. |
errors[].line |
integer, optional | The line, when the text has more than one. |
errors[].says |
string | What is wrong, in plain words. |
The sample Rehearse ships, schema/v1/samples/validate.json, meets the schema.
{ "v": 1, "ok": false, "schema": "comparison", "file": "compare.json", "errors": [ { "at": "scenarios[0]", "says": "scenarios[0] needs “verdict”." } ]}A line of .rehearse/tries.jsonl: what a person said about a scenario on the stage. It is a person’s evidence for a review.
Its schema is schema/v1/try.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
scenario |
string | The scenario’s id. |
works |
boolean | true for Works, false for Doesn’t. |
note |
string | What the person wrote, up to 4,000 characters. |
world |
string or null, optional | The world they tried it in. |
person |
person, optional | A person’s name, or nobody. |
mode |
open string | What the person was looking at. More may come. Known values: base, head, diff. |
verdict |
verdict or null, optional | same: as on the base. said: changed and said so. unsaid: changed without saying so. new: not on the base. fails: fails on the head. |
base |
string or null, optional | The base commit. |
head |
string or null, optional | The head commit. |
at |
date-time | When they said it. |
The stage appends one line per try, each time a person says Works or Doesn’t.
The sample Rehearse ships, schema/v1/samples/try.json, meets the schema.
{ "v": 1, "scenario": "packages/ui/src/Badge.stories.tsx#Primary", "works": true, "note": "Reads well in dark too.", "world": null, "person": null, "mode": "diff", "verdict": "said", "base": "2d24f5e1aaaa0000000000000000000000000000", "head": null, "at": "2026-12-03T14:05:00.000Z"}What any command prints with --json when it can’t do what it was asked. It exits 2 for a usage error and 1 otherwise.
Its schema is schema/v1/error.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
ok |
false |
Always false. |
error |
{code, says, file, line} |
The refusal. |
error.code |
string | A stable word for the kind of refusal, such as usage, no_manifest, manifest, no_scenario, service, git. |
error.says |
string | What went wrong and what to do, in plain words. |
error.file |
string, optional | The file at fault. |
error.line |
integer, optional | The line at fault. |
Each code is one of these, and new codes may come within v1. Read says to a person; branch on code.
| Code | When |
|---|---|
usage |
A flag, word or value the command doesn’t take, or one it needs. Exit 2. |
no_manifest, manifest, yaml |
No rehearse.yaml was found or read; it doesn’t meet its schema; it isn’t YAML. |
exists |
init found a rehearse.yaml already there. |
no_checkout, git, prepare, overlay |
A checkout isn’t there; git couldn’t do it; prepare failed; an overlay file is missing. |
no_scenario, no_service, no_world, no_real |
A scenario, service or world isn’t declared; a stand-in has no real one. |
service, world, sign_in |
A service didn’t come up; a world didn’t build; the sign-in failed. |
announce, no_browser, piece |
An announcement can’t be read; no Chromium; a piece’s package can’t render. |
stage |
The stage didn’t start, its port is taken, one already runs, or none runs for open --no-start. |
crashed |
Something Rehearse didn’t expect. REHEARSE_DEBUG=1 shows the stack. |
The stage’s API answers its own refusals in this shape too, with codes such as refused (not its own page),
no_world and no_person (a world or person the manifest doesn’t declare), not_run and not_found. See
the stage’s API.
The sample Rehearse ships, schema/v1/samples/error.json, meets the schema.
{ "v": 1, "ok": false, "error": { "code": "manifest", "says": "rehearse.yaml:4: services.api has no field “readdy”.", "file": "/work/acme/rehearse.yaml", "line": 4 }}dependents
Section titled “dependents”What ashlar dependents <files...> --json prints, run at the repository’s root, for rehearse list --affected. Every file given appears either as a key of dependents (with [] when nothing reaches it) or in unknown. Each key lists every file that reaches it through imports, directly or not, the file itself excluded. Paths are relative to the root, with forward slashes. The command exits 0 and prints this one object on stdout; any other exit, or stdout that isn’t this object, is a failure, and Rehearse falls back to packages and says why. v is the version of Rehearse’s contract, not of the tool. Any other import-graph tool may print the same and be named in rehearse.yaml under affected.graph.
Its schema is schema/v1/dependents.schema.json.
| Field | Type | What it is |
|---|---|---|
v |
1 |
The contract’s major version. Every output carries it. |
dependents |
map of string to list of strings | For each file given, every file that reaches it through imports, directly or not, itself excluded: [] when nothing reaches it. |
unknown |
list of strings, optional | Files given that the graph doesn’t hold (not source, or outside what it reads). |
Rehearse reads it for rehearse list --affected and compare --affected. It runs ashlar dependents <files> --json,
or the manifest’s affected.graph with the files and --json appended, at the
checkout’s root. Any import-graph tool that prints this shape can be named there.
The sample Rehearse ships, schema/v1/samples/dependents.json, meets the schema.
{ "v": 1, "dependents": { "packages/ui/src/Badge.tsx": [ "packages/ui/src/Badge.stories.tsx", "apps/web/src/Header.tsx" ] }, "unknown": [ "README.md" ]}