Freeze two saves. Release them on purpose.
Dead Heat contains no selectors and no browser automation of its own. Kane CLI drives both users from the English in the race file. Dead Heat adds the one thing a single test runner cannot do alone: it controls the instant at which two users’ requests reach the server.
One lane per user.
Each user gets their own Chrome and their own port on the proxy. Separate cookies, separate sessions, and Dead Heat always knows whose request is whose. Reads pass straight through; only the save is frozen.
- SetupKane CLI brings both users to the point where the old state is on their screen, for example logged in with the edit form open.
- Both actKane CLI performs each user’s action. When a save reaches the proxy it is frozen, and the first user waits until the second user’s save arrives too.
- The releaseBoth saves reach your app together, or one after the other in either order. In all three cases both users had already read the old state.
- The checkKane CLI reloads each browser and verifies, in your own words, that this user’s work is still there.
Three orders, replayed from the real run.
Every bar below is a timestamp from the Kanboard reports: when each save was frozen, the release, and what the app answered. Pick an order, then compare Kanboard as released with Kanboard after the agent’s fix.
Times are seconds since that order’s run started. Each order is a separate run with the data restored and the app restarted first.
How each user is judged.
After the reload, Kane CLI’s kept sentence passes or fails, and the refused sentence says whether the app turned that user down honestly. A user who was told yes and whose work is gone has been silently lost.
- kept
Their work is there after a reload.
- refused
Their work is not there, and the app told them so. This is correct behaviour.
- silently lost
Their work is not there, and the app never said. This is the bug.
- crashed
Their work is not there, and the app answered the save with a server error (5xx). A failure, but not a silent one, so it is reported separately.
- cannot be judged
A save reached the app again after the release (Kane CLI repeated the action), which can repair a lost update before it is checked. The order is reported as an error, never as clean.
A save the app answered with a client error such as 409 Conflict counts as refused even if Kane CLI did not spot the message on screen, unless the page told that user the save had worked.
A retried click while a save is frozen is held as well, and a request the browser abandoned never reaches your app, so an impatient browser cannot fake a clean result. If the two saves were never frozen together, the verdict is “no race happened”, never a false “clean”.
A race is two users and a few sentences.
deadheat init writes a deadheat.json. This is the real Kanboard race file from examples/kanboard.
| Field | What it is |
|---|---|
app.url | Where your app listens. It must be plain HTTP, which a local app is. |
app.start, app.reset | Optional shell commands. Dead Heat restores the data and restarts the app before every order, so each race starts from the same state. |
hold | The save request to freeze: a method and a path, with * as a wildcard. Leave it out to freeze the first request that is not a read. |
setup | Optional. Gets the user to where the old state is on screen. |
do | The action that ends in the save. |
kept | What must be true after a reload if this user’s work survived. |
refused | What the screen says if the app turned this user down honestly. Required: without it, an honest “sorry, taken” could not be told apart from a silent loss. |
invariant | Optional, per race. Something that must hold for everyone afterwards, such as “stock is not below zero”. |
The loop with your coding agent.
deadheat fix --with "your-agent {brief}" races every order. If a user silently lost, it writes a brief and runs your agent’s command with it, then restores the data, restarts the app and races every order again. It stops when every order is clean or after --max attempts.
- Race every ordertogether, Manvith then Sudeep, Sudeep then Manvith
- Write the briefwhat each user was told, which requests were frozen, what Kane CLI saw after the reload
- Your agent changes the appthe command you passed with
--with - Restore and restartthe data is reset and the app restarted before the next race
The agent has to fix the app, not the test: if the race file changes during an attempt, Dead Heat restores it and stops.
| Exit code | Meaning |
|---|---|
0 | Every order was clean. |
1 | A user silently lost, a save crashed the app, or the invariant broke. |
2 | The race could not be run (Kane CLI error, or the two saves were never frozen together). |
What Kane CLI does here.
Agents can also drive Dead Heat themselves: deadheat race --agent prints one JSON object per line, and the last line carries every verdict. A skill file teaches a coding agent when a handler needs a race, how to write one, and how to read the result.
- Performs every user’s setup and action from the English in the race file, in a Chrome that Dead Heat opened for that user (
--cdp-endpoint). - Reads what the app told each user, in a separate look at the page once the app has answered both saves.
- Decides the outcome: the
keptandinvariantsentences are Kane CLI assertions, and their pass or fail is the verdict. - Supplies the evidence: the share links of each user’s action and check runs are in the report next to that user.
Limits
- Two users per race.
- The app must be reachable over plain HTTP, and the save must be an ordinary HTTP request. WebSocket traffic passes through but is not frozen.
- A full race of three orders is 18 Kane CLI runs, or 24 when the users have a setup step: roughly 200 credits on a small page and 350 on a real app.
- The frozen moment is a few seconds long, so this finds lost updates and check-then-act bugs. It is not a load test.