Kurvball
Kurvball is a pnpm monorepo: a Tauri desktop app, a Fastify API and a worker. Its local
stack needs Docker and a MinIO image that can no longer be pulled. This example runs Rehearse over a scratch clone of
Kurvball’s main without Docker, compares a change with it, and shows the result on the stage. Nothing is pushed.
Run it
Section titled “Run it”You need:
- Node 22.18 or later, and pnpm 11;
- a clone of Kurvball you can read: set
KURVBALL_REPOto its URL or path. Kurvball’s repository is private, soprove.shhas no default and stops without it; - Rehearse’s own dependencies and its browser, installed once.
Install Rehearse’s dependencies and its browser from Rehearse’s repository.
pnpm install && pnpm buildpnpm exec playwright-core install chromium # the browser pieces and flows run inThen point prove.sh at your clone of Kurvball and run it.
export KURVBALL_REPO=<url or path> # a clone of Kurvball you can readexamples/kurvball/prove.sh # clones Kurvball, adopts Rehearse, makes a head, compares, opens the stageprove.sh works in a new folder under /var/tmp (set REHEARSE_SCRATCH to choose one). It clones KURVBALL_REPO
there and removes the clone’s remote. It commits adopt/ on the clone’s main, as Kurvball would to adopt Rehearse,
makes a head on a branch with head.mjs, installs, and compares.
It keeps the comparison, formatted, in examples/kurvball/compare.json, but only when the comparison happened: compare
exited 0 or 1. Then it opens the stage on it. Ctrl-C stops the stage and everything it brought up.
REHEARSE_NO_STAGE=1 stops after the comparison instead.
The comparison takes about a minute once the packages are in pnpm’s store.
What it compared
Section titled “What it compared”Without --json, rehearse compare prints the comparison in words.
23 as on the base · 1 new · 5 changed and said so (5 announced) · 4 changed without saying so · 1 fails on the head
changed without saying so: The owner sees every member, and the directory is never cached (apps/api/src/routes/v1/organization-members.hurl:6) $.items[*].activeCapabilityCodes: ["identity.account_state.manage","identity.credential.reset","identity.member.p… → [] (3 places) The administrator sees the same directory (apps/api/src/routes/v1/organization-members.hurl:18) $.items[*].activeCapabilityCodes: ["identity.account_state.manage","identity.credential.reset","identity.member.p… → [] (3 places) A page of two leaves a cursor for the rest (apps/api/src/routes/v1/organization-members.hurl:92) $.items[*].activeCapabilityCodes: ["identity.account_state.manage","identity.credential.reset","identity.member.p… → [] (2 places) The next page starts after the cursor (apps/api/src/routes/v1/organization-members.hurl:107) $.items[*].activeCapabilityCodes: ["identity.account_state.manage","identity.credential.reset","identity.member.p… → []
fails on the head: A member isn't told the directory exists (apps/api/src/routes/v1/organization-members.hurl:48) — announced: Same change, for a member. status: 404 → 403 $.error.code: "not_found" → "forbidden" … line 52: HTTP 404 · expected 404, got 403 line 54: jsonpath "$.error.code" == "not_found" · expected "not_found", got "forbidden"
changed and said so: AuthPasswordField · Show And Hide (apps/desktop/src/stories/auth-components-password-field.stories.tsx) — announced: The password field's hint is now a note, so a screen reader reads it as one. light tree line 6: "- paragraph: Use your account password." → "- note: Use your account password." … the password field's two other stories, the password flow, and the creator's call
new: The administrator's search narrows the directory (apps/api/src/routes/v1/organization-members.hurl:27)
unannounced, by what changed: $.items[*].activeCapabilityCodes — in 4 scenarios
57 ids, times and opaque values were set aside before comparing.Stand-ins: identity (fake, for GoTrue, and Postgres's identity tables), directory (fake, for Postgres's member directory and profiles).The head did four things. It told non-administrators plainly that they may not see the member directory (403 instead of the concealed 404), announced it, updated the creator’s call, and forgot the member’s: that call fails on the head. It made the password field’s hint a note, and announced it: its three stories and its flow changed and said so. It added a call for the administrator’s search: new. And it slipped: the directory now sends every member’s capabilities as an empty list. No call asserts on that field, so every assert still passes; only the comparison with the base catches it, in four calls, grouped as one thing to look at.
What each kind is
Section titled “What each kind is”| Kind | Scenario | How it runs |
|---|---|---|
| piece | apps/desktop/src/stories/auth-components-*.stories.tsx (16 stories) |
the desktop’s own Vite and React, with its Storybook preview |
| flow | apps/desktop/src/stories/auth-password.flow.yaml |
the password field’s story, its play function as steps |
| call | apps/api/src/routes/v1/organization-members.hurl (16 calls) |
Kurvball’s real API on its in-memory test runtime |
| file | packages/modules/handoff/rehearse/handoff.rehearse.yaml |
the handoff renderer, its zip read entry by entry |
| job | the worker | later: Rehearse v1 has no job kind |
How it runs without Docker
Section titled “How it runs without Docker”The stand-in adopt/apps/api/rehearse/serve.ts comes from an earlier spike on Kurvball’s calls. It serves Kurvball’s
real Fastify app: every route, schema, validation and safe error, and Kurvball’s real JWT verifier. In place of GoTrue
and Postgres it holds a signing key it makes at start and the seed’s four people in memory, activated. The manifest
names that as two stand-ins, identity and directory, so every result says so:
Stand-ins: identity (fake, for GoTrue, and Postgres's identity tables), directory (fake, for Postgres's member directory and profiles).sign-in.mjs signs a token for each person with that key, the way Kurvball’s own integration tests sign theirs, and
prints them in the shape Rehearse reads. A call is sent as {{owner}}, {{administrator}}, {{creator}} or
{{member}}.
The pieces
Section titled “The pieces”Kurvball’s stories live in apps/desktop/src/stories/. Its preview wraps every story in its theme and query client,
and reads the story’s args with Storybook’s useArgs; Rehearse answers that hook with its own, so the preview runs
unchanged.
The handoff scenario reads its Word files as the archives they are (zip), with their creation times set aside. Its
PDFs carry their render time in ways that can’t be set aside, so only their presence is compared (skip). The
Markdown is compared line by line, and the index as JSON.
The files
Section titled “The files”| File | What it is |
|---|---|
rehearse.yaml |
the manifest, kept outside Kurvball; its checkout is the scratch clone |
adopt/ |
what Kurvball would commit to adopt Rehearse, at the paths it would take |
head.mjs |
the change compared; each edit refuses to apply if Kurvball’s code moved |
announce.yaml |
what the head says it changes |
compare.json |
the comparison prove.sh made last |
prove.sh |
the proof, from a fresh clone |