` is the path relative to the checkout, with forward slashes. For a file read beside the manifest (a glob that starts with `./` or `../`), it is relative to `rehearse.yaml` and starts with `./` or `../`. Ids are the same on the base and on the head, so a comparison pairs them. When two scenarios have the same id, the second is refused.
Each scenario also has an **area**, where `rehearse list` and the stage group it: the name in its package’s `package.json`, else its package’s folder, else the first one or two folders of its path. A package is the nearest folder with `package.json`, `pyproject.toml`, `Cargo.toml` or `go.mod`.
A scenario fails on its own checks. What it observes is compared, and a difference is never a failure on its own.
| Kind | Fails when |
| ------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `piece` | It throws, or doesn’t render within 20 seconds, in a scheme. Its logged errors and axe violations are compared, never failures. |
| `flow` | Its page doesn’t open, or a step stops: nothing has the name, more than one has it, or it didn’t answer in time. |
| `call` | It gets no answer, a status or an assert doesn’t hold, a capture finds nothing, or no one signed in as its person. |
| `file` | `input` or `run` exits non-zero or times out, or an output is missing. |
## Pieces
[Section titled “Pieces”](#pieces)
A piece is one story of a Storybook [CSF](https://storybook.js.org/docs/api/csf) file, beside its component. The following file holds three pieces.
src/Badge.stories.tsx
```tsx
import { fn } from 'storybook/test';
import { Badge } from './Badge';
const meta = { title: 'Pieces/Badge', component: Badge, args: { label: 'New', onSeen: fn() } };
export default meta;
export const Primary = {};
export const Warning = { name: 'A warning', args: { label: 'Low stock', tone: 'warning' } };
export const Dated = {
render: () => Updated {new Date().toISOString().slice(0, 10)}
,
};
```
`rehearse list` shows each story as a piece.
Terminal
```text
$ rehearse list
src
piece src/Badge.stories.tsx#Primary
piece src/Badge.stories.tsx#Warning
piece src/Badge.stories.tsx#Dated
```
`Warning`’s name is `Badge · A warning`; its id stays `src/Badge.stories.tsx#Warning`.
### How a CSF file is read
[Section titled “How a CSF file is read”](#how-a-csf-file-is-read)
Rehearse reads the file as text, without running it.
* **Stories** are the named exports: `export const`, `let` or `var` (each name of `export const A = {}, B = {}`), `export function`, `export class`, and the names in `export { A, B as C }`. Not `default`, not a name that starts with `__`, and not a type: `export type`, `export interface` and `export { type X }` are skipped.
* **`includeStories` and `excludeStories`** in the meta are honoured when written as a list of names or a regular expression.
* **The title** is the meta’s `title` when it is a plain string, in `export default { title }` or in the object the default export names (`const meta = { title }; export default meta`). Otherwise it comes from the path: without a leading `src/` and the extension, and without a last part named `index` or named like its folder.
* **The name** is the story’s own `name: '…'`, else a legacy `Story.storyName = '…'`, else the export’s name in words (`PrimaryButton` becomes `Primary Button`). The scenario’s name is the title’s last part, `·`, then the name.
* **The id** is `#`. It never depends on the title. When the title can be read, the observation also carries Storybook’s own id, `storyId` (`pieces-badge--a-warning`).
* **The definition** that marks a piece edited is its own export’s statement and the meta’s text (the default export, and the object it names). The file’s imports aren’t part of it. Editing one story, or adding an import for a new one, doesn’t mark the others edited.
### How a piece renders
[Section titled “How a piece renders”](#how-a-piece-renders)
* **In its own package.** The package is the nearest folder at or above the story, up to the checkout, that has a `package.json` and resolves both `vite` and `react`. Rehearse starts that package’s own Vite and React on 127.0.0.1. A story with no such package isn’t run, and Rehearse says why (step `runner`).
* **Vite config:** `scenarios.pieces.config`, else `vite.config.*`, else `vitest.config.*` in the package.
* **Styles:** `scenarios.pieces.styles`, else a `.css` file the package exports (`./styles.css`, `./style.css`, `./styles` and `./style` first), else `src/styles.css`, else `src/index.css`.
* **Preview:** `scenarios.pieces.preview`, a Storybook-style preview module relative to the package. Its named exports and its default export are both read: `args`, `argTypes`, `parameters`, `initialGlobals` (or `globals`), `decorators`, `loaders` and `render`.
* **Composition**, as Storybook does it: args are the preview’s, then the meta’s, then the story’s. Decorators wrap the story’s first, then the meta’s, then the preview’s. Loaders (the preview’s, the meta’s, the story’s) run before the story renders and fill `context.loaded`. The render is the story’s, else the meta’s, else the preview’s, else the meta’s `component` with the args. A story that is a function is its own render.
* **`play` functions are not run.**
Storybook’s runtime modules don’t exist outside Storybook, so Rehearse answers these imports with small stand-ins:
| Import | What Rehearse gives |
| ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `storybook/preview-api`, `@storybook/preview-api`, `@storybook/client-api`, `@storybook/addons`, `@storybook/manager-api` | `useArgs` (the args, `updateArgs`, `resetArgs`; updating re-renders), `useGlobals`, `useParameter`, `useStoryContext`, `useChannel`, React’s hooks, an `addons` channel that does nothing, `makeDecorator`, `definePreview`, `composeStory`, `setProjectAnnotations`. |
| `storybook/test`, `@storybook/test` | `fn()`, a mock that records its calls; `spyOn`, `mocked`, `isMockFunction` and the `*AllMocks` helpers; `expect`, `userEvent`, `screen`, `fireEvent`, `within` and `waitFor` as inert stand-ins. |
| `storybook/actions`, `@storybook/addon-actions` | `action()` and `actions()`, which do nothing. |
### What a piece observes
[Section titled “What a piece observes”](#what-a-piece-observes)
Each scheme in `scenarios.pieces.schemes` (default `light`) renders in its own browser context: viewport 1024×768 unless `viewport` says otherwise, reduced motion, and a clock fixed at 2026-01-15T12:00:00Z, so a date on screen reads the same on both sides. Rehearse waits until the piece mounts and its accessibility tree stops changing.
| Observed | What it is |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tree` | The accessibility tree of the story’s root, as Playwright’s ARIA snapshot gives it. |
| `threw` | Why it didn’t render: what it threw, or that it never rendered. `null` when it rendered. |
| `errors` | What the page logged as errors, or threw, while rendering. |
| `violations` | axe-core’s violations of the rules tagged `wcag2a`, `wcag2aa`, `wcag21a`, `wcag21aa` and `wcag22aa`: each rule’s `id`, `help` and how many `nodes`. |
| `pixels` | A hash of the screenshot. The screenshot itself is kept as an artifact. |
`scenarios.pieces.compare` chooses what is compared: `tree`, `errors` and `violations` by default; `screenshot` compares `pixels`, and only when you name it, since pixels differ across machines.
## Flows
[Section titled “Flows”](#flows)
A flow is steps by accessible name, from a service’s page or a piece’s canvas. Rehearse observes the accessibility tree after each step. The following flow opens the member directory and searches it.
flows/members.flow.yaml
```yaml
name: The owner opens the member directory
service: api
start: /members
world: one-org
person: owner
steps:
- click: Members
role: link
- fill: Search
with: creator
- key: Enter
- snapshot: Members
role: table
```
The schema is `schema/v1/flow.schema.json`. A file whose name ends in `.yaml` or `.yml` is read as YAML.
| Field | Type | Default | What it is |
| ---------- | ---------------- | --------------------------------------------------- | ---------------------------------------------------------------------------- |
| `name` | string, required | | What the flow tries, in plain words. Up to 120 characters. |
| `describe` | string | none | More words. |
| `service` | service name | `scenarios.flows.service`, else the default service | The service whose page it opens. |
| `piece` | piece id | none | Or a piece whose canvas it opens, for a screen that renders only as a story. |
| `start` | path | `/` | The path it opens on the service, such as `/settings`. |
| `world` | world name | `defaults.world` | The world it starts from. |
| `person` | person name | `defaults.person` | Who it runs as. |
| `covers` | globs | none | Files whose change reaches it, for `--affected`. |
| `steps` | list, required | | 1 to 60 steps. |
The flow’s id is its file. Its definition (what marks it edited) is its service, piece, start, world, person and steps.
### Steps
[Section titled “Steps”](#steps)
Each step has exactly one verb.
| Step | Also takes | What it does |
| ------------------ | -------------- | ------------------------------------------------------------------------------------- |
| `click: ` | `role` | Clicks the one element with that accessible name. |
| `fill: ` | `with`, `role` | Fills that field with `with`. In Rehearse’s browser only. `with` can use `{{token}}`. |
| `type: ` | | Types the text into whatever has focus. |
| `key: ` | | Presses a key. |
| `snapshot: ` | `role` | Observes the tree of that one element. |
* **A name** is an accessible name, as a screen reader says it, up to 120 characters. It matches when it is the same once spaces are tidied; case counts. When nothing matches, the failure lists up to five names close to it. When more than one matches, add `role`.
* **A role** is an ARIA role, as Playwright’s `getByRole` takes it: `button`, `link`, `textbox`, `heading`, `table`, `switch`, and the rest of the list in the schema.
* **A key** is named as Playwright names it: `Enter`, `Escape`, `Tab`, `Backspace`, `Delete`, `Space`, the arrows (`ArrowUp`…), `Home`, `End`, `PageUp`, `PageDown`, `F1` to `F12`, one lower-case letter or digit, or one of ``, . / ; ' ` [ ] \ = -``. Modifiers come first, joined by `+`: `ControlOrMeta`, `Meta`, `Control`, `Alt`, `Shift`. So `Meta+k` and `ControlOrMeta+Shift+p`.
Each action may take 5 seconds. After each step, Rehearse waits until the page’s tree stops changing (up to 4 seconds), then observes it.
### Reach modules
[Section titled “Reach modules”](#reach-modules)
A reach script is read the same way: a TypeScript or JavaScript module whose default export is a flow, `{ name, steps }`, as Ashlar writes them. Rehearse reads the export as data: it never runs the module. The following module is one flow.
flows/settings.reach.ts
```ts
export default {
name: 'Settings',
service: 'desk',
steps: [
{ click: 'Ask before closing', role: 'switch' },
{ snapshot: 'Ask before closing', role: 'switch' },
],
} as const;
```
* The default export is `export default { … }`, or `const x = { … }; export default x`.
* It holds plain literals only: strings, numbers, booleans, `null`, arrays and objects. Keys are names or strings. Comments are fine.
* After the object, only `satisfies `, `as const`, a semicolon or the end of the line may follow.
* Anything else is code, and refused with its line: a template with `${…}`, a shorthand `{ name }`, a spread, a call, a variable.
* Rehearse reads `name`, `steps`, `service`, `piece`, `start`, `world`, `person` and `covers` from it.
`rehearse check` ends with one line per file it refused, such as this one for a module that holds code.
Terminal
```text
✗ flows/settings.reach.ts: Rehearse reads a flow module’s default export as plain data, and couldn’t: line 3: “name” needs a value after a colon (a shorthand is code, not a literal).
```
### How a flow runs
[Section titled “How a flow runs”](#how-a-flow-runs)
* **In Rehearse’s browser**, a headless Chromium on a clock fixed at 2026-01-15T12:00:00Z. It signs in as the person with their [`browser`](../manifest/#browser) entry: headers, storage and cookies first, then any sign-in steps on the service’s own page. Then it opens `start` on the service’s URL and observes the tree (step 1, `open`), then each step (steps 2 onwards). A screenshot after each step is kept as an artifact.
* **On a piece’s canvas**, when the flow names `piece`. No sign-in steps run there.
* **Through the service’s own driver**, when its service has [`drive`](../manifest/#drive). Rehearse passes each step through and takes a nameless snapshot after each action. `fill` is refused: click the field, then type. The driver can’t sign in as a person, and the result says so. Between flows, Rehearse runs the world’s `before`, brings the app up afresh, then runs the world’s `add`, so each flow starts where its world starts. That needs a `down` command and an `up` that hands over to a daemon; without them, flows share the app, and `said` says so.
A comparison compares the number of steps, whether each step held, each step’s tree, and the errors the page logged (in Rehearse’s browser), after what is set aside.
## Calls
[Section titled “Calls”](#calls)
A call is one HTTP request in Hurl’s plain part, beside its handler. Each call is one scenario. The following file holds three calls.
calls/items.hurl
```hurl
# The owner sees every item
GET {{api}}/items
Authorization: Bearer {{owner}}
[Query]
limit: 10
[Options]
retry: 3
retry-interval: 500
HTTP 200
Content-Type: application/json
[Captures]
first: jsonpath "$.items[0].id"
[Asserts]
jsonpath "$.items" count >= 1
jsonpath "$.items[?(@.name == 'Pen')]" count == 1
jsonpath "$.next" == null
duration < 2000
# One item, by its id
GET {{api}}/items/{{first}}
Authorization: Bearer {{owner}}
HTTP 200
[Asserts]
jsonpath "$.id" == "{{first}}"
jsonpath "$.name" matches /^[A-Z]/
header "Content-Type" startsWith "application/json"
POST {{api}}/items
Authorization: Bearer {{member}}
{"name": "Ink"}
HTTP 403
```
`rehearse list` shows each call by its name, or by its request line when it has none.
Terminal
```text
$ rehearse list
calls
call calls/items.hurl#The owner sees every item
call calls/items.hurl#One item, by its id
call calls/items.hurl#POST {{api}}/items
```
### Names and people
[Section titled “Names and people”](#names-and-people)
* **A call’s name** is the comment on the line just above its request line. Without one, it is the method and URL as written. Two calls with the same name in one file are refused.
* **Its id** is `#`, and its line is the request line.
* **It is sent as** the person its `Authorization` header names: `Authorization: Bearer {{owner}}` sends it as `owner`, with the token the sign-in gave. A call with no `Authorization` is sent as `nobody`. One whose `Authorization` names no variable is sent with “a token for no one”.
* **`--as `** replaces the `Authorization` header with `Bearer {{}}`; `--as nobody` removes it.
* A call sent as a person no one signed in fails, naming who was.
### Variables
[Section titled “Variables”](#variables)
* `{{api}}`: the URL of the calls service (`scenarios.calls.service`, else the default service), without a trailing slash.
* `{{}}`: each signed-in person’s token.
* The sign-in’s variables, including `_`.
* `scenarios.calls.variables`.
* `{{checkout}}`, `{{manifest}}`, `{{url}}`, `{{world}}`, and each running service’s `{{_url}}` and `{{_port}}`.
* Captures from earlier calls in the file.
A variable with no value fails the call: `{{first}} has no value`.
### What is read
[Section titled “What is read”](#what-is-read)
| Part | What Rehearse reads |
| -------------------------------- | ----------------------------------------------------------------------------------------------------- |
| Request line | `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD` or `OPTIONS`, then the URL. |
| Headers | `Name: value` lines after the request line. |
| `[Query]`, `[QueryStringParams]` | `key: value` lines, added to the URL. |
| `[Options]` | `retry: ` (0 to 60) and `retry-interval: ` (or `s`; default 1000 ms). |
| Body | The lines after the headers: JSON or text. Or a fenced block between ` ``` ` lines (` ```json ` too). |
| Response line | `HTTP `, `HTTP/1.1 `, or `HTTP *` for any status. |
| Response headers | `Name: value` lines after it, each checked as `header "Name" == "value"`. |
| `[Captures]` | `name: `. The value is a variable for later calls. |
| `[Asserts]` | ` [not] []`. |
| Query | Gives |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `status` | The status code. |
| `header ""` | That header’s value. |
| `body` | The body as text. |
| `duration` | How long the answer took, in ms. |
| `jsonpath ""` | A value from the JSON body. Paths: `$`, `.key`, `.*`, `[0]` (negative too), `['key']`, `[*]`, and filters `[?(@.key == value)]` or `!=`. Not `..`. |
A query may end with the filter `count`: the number of items in a list.
Predicates: `==`, `!=`, `>`, `>=`, `<`, `<=`, `contains`, `includes`, `startsWith`, `endsWith`, `matches`, `exists`, `isString`, `isInteger`, `isBoolean`, `isCollection`, `isEmpty`, `isUuid`, `isIsoDate`. Values: `"a string"`, `/a regular expression/`, a number, `true`, `false`, `null`, or `{{variable}}`.
### What is refused
[Section titled “What is refused”](#what-is-refused)
Anything beyond the plain part is refused by name, with its line, so you know what to change:
* other sections: `[FormParams]`, `[MultipartFormData]`, `[Cookies]`, `[BasicAuth]` and the rest;
* other options than `retry` and `retry-interval`;
* other queries, such as `xpath`, `cookie` or `sha256`;
* other filters than `count`: `nth`, `regex`, `split`, `replace`, `toInt`, `jsonpath`, `xpath` and the rest;
* predicates it doesn’t know, and values it can’t read;
* `file,`, `base64,`, `hex,`, XML and one-line `` ` `` bodies;
* any line before the first request that isn’t a comment.
`rehearse check` lists each refusal with its file and line, such as these two.
Terminal
```text
✗ calls/items.hurl:5: the filter nth isn’t read by Rehearse
✗ calls/login.hurl:3: [FormParams] isn’t read by Rehearse: it reads Hurl’s plain part
```
### How calls run
[Section titled “How calls run”](#how-calls-run)
* A file’s calls run in order, so captures carry from one to the next. To run one call, every call before it in its file runs first, since its answer can depend on what they did; the observation counts them in `before`.
* Each call may take 15 seconds. Redirects aren’t followed. A body that starts with `{` or `[` is sent as `application/json`, any other as `text/plain`, unless a `Content-Type` header says otherwise.
* With `retry`, a call that fails is tried again after `retry-interval`, up to `retry` more times. `tries` then lists each try’s status.
* A call’s definition (what marks it edited) is its own request, status, asserts, captures and options, and those of the earlier calls whose captures it uses.
A comparison compares the status, the content type, and the body (as text when both bodies are text, else as JSON), after what is set aside. Arrays keep their order unless `scenarios.calls.unordered` is true.
## Files
[Section titled “Files”](#files)
A file scenario is an input, a command that turns it into output, and the output, compared by its layout. The following scenario turns a stock file into the weekly report.
packages/report/weekly.rehearse.yaml
```yaml
name: The weekly stock report lists every item with its price
input:
file: stock.json
run: node packages/report/report.mjs {{input}} {{output}}/weekly.csv
output:
file: weekly.csv
layout: csv
```
The schema is `schema/v1/file-scenario.schema.json`. The scenario’s id is its file.
| Field | Type | Default | What it is |
| ---------- | --------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `name` | string, required | | What it tries, in plain words. |
| `describe` | string | none | More words. |
| `world` | world name | `defaults.world` | The world it starts from. |
| `person` | person name | `defaults.person` | Who it runs as: their token is `{{token}}` and `$REHEARSE_TOKEN`. |
| `services` | service names | none | Services that must be up while it runs. |
| `covers` | globs | none | Files whose change reaches it, for `--affected`. |
| `input` | map | none | `file`: a file beside this one. Or `command`: a command that writes `{{input}}`, and `name`, that file’s name (default `input`). |
| `run` | command, required | | Turns the input into the output. |
| `cwd` | path | the checkout | Where `input.command` and `run` run, relative to the checkout. |
| `env` | map | none | Environment variables. Values take placeholders. |
| `timeout` | seconds | 120 | How long `input.command` and `run` may each take. |
| `output` | one output, or a list | required | What `run` writes, and how to read it. |
| `setAside` | map | none | `columns` never compared; `values`, more regular expressions to set aside; `keep`, columns or JSON paths never set aside. |
Placeholders: `{{input}}` (the input file), `{{output}}` (a scratch folder for the output), `{{here}}` (this file’s folder), `{{checkout}}`, `{{manifest}}`, `{{world}}`, `{{person}}`, `{{token}}`, `{{url}}`, each running service’s `{{_url}}` and `{{_port}}`, and the sign-in’s variables. `input.command` and `run` also get `REHEARSE_INPUT`, `REHEARSE_OUTPUT` and, when the person has a token, `REHEARSE_TOKEN`.
The definition that marks it edited is its parsed YAML and the content of its `input.file`.
### output
[Section titled “output”](#output)
| Field | What it is |
| ----------- | ------------------------------------------------------------------------------------------------------------------------- |
| `file` | Required. The output file, relative to `{{output}}`, unless it is an absolute path such as `{{checkout}}/out/report.csv`. |
| `layout` | Required. `csv`, `tsv`, `json`, `lines`, `fixed` or `zip`. |
| `header` | `csv` and `tsv`: whether the first row names the columns. Default true. |
| `columns` | `csv` and `tsv` without a header: the columns’ names. `fixed`: each column’s `name`, `start` (from 1) and `width`. |
| `unordered` | Compares rows, or array items, without their order. |
| `entries` | `zip`: the layout of each entry, by glob: `csv`, `tsv`, `json`, `lines`, `zip` or `skip`. |
| Layout | How it is read and compared |
| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `csv` | Rows and cells as RFC 4180 reads them: quotes, doubled quotes, line breaks inside quotes. Compared by column name. |
| `tsv` | The same, split on tabs. |
| `fixed` | Each line cut into the named columns, each cell trimmed. Compared by column name. |
| `json` | Parsed, then compared as JSON with what is set aside. Text that isn’t JSON is read as `lines`. |
| `lines` | Each line, compared as text. |
| `zip` | Each entry by the first glob in `entries` that matches its name, else as `lines`. `zip` reads an archive inside the archive, such as a Word file; `skip` compares only that the entry is there, for files that carry their own render time, such as a PDF. |
A file that isn’t text is read as one line with its size and hash. Columns without a header are named `column 1`, `column 2`, and so on. Empty lines are dropped from `csv`, `tsv` and `fixed`. In a zip, an entry of an archive inside the archive is named `!`, and `entries` globs match that name. Rehearse reads stored and deflated entries.
Changes to a table are grouped by column, with a count. `rehearse compare` prints such a change as one line.
Terminal
```text
weekly.csv column 3 "price": "3.5" → "3.50" (2 places)
```
A comparison also compares the exit code, the columns, and the number of rows.
## Announcements
[Section titled “Announcements”](#announcements)
An announcement says which scenarios a change expects to change, each with one line saying why. The following announcement names one call and every story of one file.
.rehearse/announce.yaml
```yaml
changes:
- scenario: 'apps/api/src/routes/members.hurl#A creator is told they may not see the directory'
why: A creator now gets 403 forbidden instead of the concealed 404.
- scenario: 'packages/ui/src/Badge.stories.tsx#*'
why: Badges use the new colour tokens.
```
The schema is `schema/v1/announce.schema.json`. It may be YAML or JSON, and may carry `v: 1`.
| Field | What it is |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `changes` | Required. A list. |
| `changes[].scenario` | A scenario’s id, or a glob over ids: `*` stops at `/`, `**` doesn’t. `packages/ui/src/Badge.stories.tsx#*` covers every story in that file. |
| `changes[].why` | One line: what changes, and why. |
`rehearse compare` reads `.rehearse/announce.yaml` beside `rehearse.yaml` when it is there, or the file `--announce` names. `--said ` announces one more from the command line.
* A scenario that changed and is announced is **changed and said so** (`said: "announced"`, with `why`). An announcement wins over an edited definition, since it carries why.
* An announced scenario that didn’t change is listed under **announced, but as on the base**: a note, never a failure.
* An announcement doesn’t excuse a scenario that fails on the head.
* In a comparison of every scenario, an entry that names no scenario at all (none compared, gone or not run) is listed under `refused`: “The announcement names X, which matches no scenario compared.” It doesn’t change the exit code.
* An announcement that doesn’t meet the schema stops the comparison, naming its line (code `announce`).
# Versions and releases
> What Rehearse promises from one version to the next, what counts as breaking, and how to pin a release.
Rehearse follows [semantic versioning](https://semver.org/spec/v2.0.0.html). A version is `major.minor.patch`:
* a **patch** release fixes something and changes no shape or meaning;
* a **minor** release adds something: a command, a flag, a manifest key, an optional field in an output;
* a **major** release may break what worked, and its changelog section says how.
## What counts as breaking
[Section titled “What counts as breaking”](#what-counts-as-breaking)
Agents, CI gates and other tools read Rehearse only through what it prints, how it exits and the files it reads. So these are Rehearse’s public API. Changing any of them in a way that could break a reader is a major release:
| Public | Breaking |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
| The commands and their flags ([CLI](/reference/cli/)) | a command or flag removed or renamed, or doing something else |
| The exit codes: 0, 1 and 2 ([CLI](/reference/cli/#output-and-exit-codes)) | a code that means something else |
| The JSON outputs, as `schema/v1/*.schema.json` describes them ([JSON contract](/reference/json/)) | a field removed, renamed, or of another type or meaning |
| `rehearse.yaml` ([rehearse.yaml](/reference/manifest/)) | a key removed or renamed, or meaning something else; a file that read before refused |
| The scenario files: `*.flow.yaml`, `*.rehearse.yaml`, announcements ([Scenario files](/reference/scenario-files/)) | the same |
| Scenario ids (`file#name`) and the stage’s address (`?s=`) | an id or a link that named a scenario naming another, or none |
| The package’s exports: `@kurvball/rehearse`, `@kurvball/rehearse/worlds`, `@kurvball/rehearse/schema/v1/*` | a name removed, or of another type |
A new optional field in a JSON output is not breaking: readers ignore what they don’t know. Open string fields (a kind, a driver, a layout) may gain values in a minor release too: a reader treats a value it doesn’t know as unknown, as the [JSON contract](/reference/json/) says.
What a scenario observes can change in any release, when a runner learns to see more: its runner version (such as `call/2`) goes up, and cached baselines run again. That changes verdicts only where the product changed.
### A JSON shape never changes inside its version
[Section titled “A JSON shape never changes inside its version”](#a-json-shape-never-changes-inside-its-version)
Each output has a schema in `schema/v1/` and prints `"v": 1`. A shape that has to change gets a new file in `schema/v2/`, prints `"v": 2`, and ships in a major release. A `schema/v1/` file is never edited to describe another shape, so a tool that validates against v1 never sees v1 change under it. The only edit a v1 schema takes is a new optional field.
### The SDK
[Section titled “The SDK”](#the-sdk)
`@kurvball/rehearse` is the SDK: what a program can use without going through the CLI.
* `runCli(argv, { cwd, env, progress })` runs one command line as `rehearse` would and returns what to print: `{ json, text, code }`, with `refused: true` when its words belong on stderr. It never exits the process: the caller does.
* `bringUp(manifest, service, checkout, options)` brings one service up in a checkout and waits until it is ready. The caller stops it with `bringDown(manifest, running)`.
* A `RehearseError` is a refusal: its `code` is stable, and its `says` is for people.
* `@kurvball/rehearse/worlds` exports `defineWorld` and `worldMain`, to write [worlds](/reference/manifest/#worlds) in TypeScript.
## Pin a release
[Section titled “Pin a release”](#pin-a-release)
Each release is a tag, `vX.Y.Z`, and a GitHub Release on [kurvball/rehearse](https://github.com/kurvball/rehearse/releases) with the package’s tarball attached, `kurvball-rehearse-X.Y.Z.tgz`. The package is `@kurvball/rehearse`, and it isn’t on npm yet, so pin a release by its tarball. The following adds 1.1.0 from its release.
Terminal
```sh
pnpm add -D https://github.com/kurvball/rehearse/releases/download/v1.1.0/kurvball-rehearse-1.1.0.tgz
```
To keep the tarball in your repository instead, download it from the release’s page, or build it from the tag, and add it by its path, such as `./vendor/kurvball-rehearse-1.1.0.tgz`. The following builds it from the tag.
Terminal
```sh
git clone --branch v1.1.0 https://github.com/kurvball/rehearse.git
cd rehearse
pnpm install
pnpm pack
```
Your `package.json` then names that exact tarball, so every install gets that exact version until you change it.
## Where to read what changed
[Section titled “Where to read what changed”](#where-to-read-what-changed)
Every version’s section is in the [changelog](/changelog/), and in the notes of its GitHub Release. A major version also gets an [upgrade guide](/upgrade/). This site documents the version its header shows, and each command, flag and schema in the reference says the version it was added in. [RELEASING.md](https://github.com/kurvball/rehearse/blob/main/RELEASING.md) says how a release and a hotfix are made.
## Related
[Section titled “Related”](#related)
* [CLI](/reference/cli/)
* [JSON contract](/reference/json/)
* [rehearse.yaml](/reference/manifest/)
* [Changelog](/changelog/)
# Upgrade guides
> How to move from one major version of Rehearse to the next. Rehearse 1.x has had no major release since 1.0.0, so there is no guide yet.
Each major version of Rehearse gets one upgrade guide here, written in the pull request that makes its first breaking change. It opens with the one command that upgrades, and gives each breaking change an entry: what it did before, what it does now, a link to its pull request, and what to do.
There is none yet. Rehearse has been on 1.x since 1.0.0, and a 1.x release never breaks what [Versions and releases](/reference/versioning/#what-counts-as-breaking) promises. Versions before 1.0.0 have [changelog](/changelog/) entries and no upgrade guide.
# Agent skill
> Install the agent skill that teaches an agent Rehearse's commands, scenario formats and verdicts, and find the site's llms.txt.
Rehearse ships an agent skill, and this site serves an `llms.txt`. Give either to an agent working in a repository with a `rehearse.yaml`, and it knows how to look, write scenarios, compare, announce, drive and show a person.
## Install the skill
[Section titled “Install the skill”](#install-the-skill)
The skill is one file, `skill/rehearse/SKILL.md`, in the package and in Rehearse’s repository. Copy it into the place your agent reads skills from. For Claude Code, that is `.claude/skills/rehearse/SKILL.md` in the repository, or `~/.claude/skills/rehearse/SKILL.md` for every repository.
The following copies it from the package installed in the repository.
Terminal
```sh
mkdir -p .claude/skills/rehearse
cp node_modules/@kurvball/rehearse/skill/rehearse/SKILL.md .claude/skills/rehearse/SKILL.md
```
Its description tells the agent when to use it: in a repository with a `rehearse.yaml`, or when asked to try, compare, prove or check a change, write scenarios, or drive the running product.
## See what it teaches
[Section titled “See what it teaches”](#see-what-it-teaches)
The skill walks an agent through seven steps:
1. **Look first:** `rehearse check`, `list`, `services`, `people`, `worlds`, each with `--json`.
2. **Find what a change reaches:** `rehearse list --affected`.
3. **Write a scenario** of each kind, beside what it tries.
4. **Run one, then compare,** and read each verdict: what to do about `unsaid` and `fails`, and when `failsOnBase` means it isn’t the change’s doing.
5. **Announce** what the change meant to change, in `.rehearse/announce.yaml`.
6. **Drive** the product one step at a time with `rehearse drive`.
7. **Show a person** with `rehearse open`.
It adds three rules: never print a token from `rehearse people --json`; run one comparison at a time; stop what you start.
## Point an agent at llms.txt
[Section titled “Point an agent at llms.txt”](#point-an-agent-at-llmstxt)
This site’s [`llms.txt`](/llms.txt) is built from its pages at every docs build: a summary of Rehearse and a link to every page, grouped as the sidebar groups them. [`llms-full.txt`](/llms-full.txt) holds every page in full, and [`llms-small.txt`](/llms-small.txt) a shorter version. Point an agent at them when it can read a link but not load a skill.
The package also ships its own `llms.txt`, at its root, for an agent working offline: the commands, the schemas, the kinds and the verdicts, each in a line or two.
## Read the skill in full
[Section titled “Read the skill in full”](#read-the-skill-in-full)
The skill’s text is kept in the repository, at `skill/rehearse/SKILL.md`, and this site serves a copy taken at every build: [`SKILL.md`](/SKILL.md). This page doesn’t repeat it, so the two can’t drift apart.
# Changelog
> Every change to Rehearse a user would notice, by version.
Every change to Rehearse that a user would notice, newest first. Rehearse follows [semantic versioning](https://semver.org/spec/v2.0.0.html). From 1.0.0 on, each version’s entries are the changesets merged since the release before it, under its version and release date, grouped as major, minor and patch changes; see [RELEASING.md](https://github.com/kurvball/rehearse/blob/main/RELEASING.md). Versions up to 0.5.0 follow [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/).
## 1.2.0
[Section titled “1.2.0”](#120)
*Released 2026-12-04.*
### Minor Changes
[Section titled “Minor Changes”](#minor-changes)
* The docs’ home is