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.

ManvithKane CLIChrome lane 4801 SudeepKane CLIChrome lane 4802 Dead Heat proxy your app

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.

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.

FieldWhat it is
app.urlWhere your app listens. It must be plain HTTP, which a local app is.
app.start, app.resetOptional shell commands. Dead Heat restores the data and restarts the app before every order, so each race starts from the same state.
holdThe 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.
setupOptional. Gets the user to where the old state is on screen.
doThe action that ends in the save.
keptWhat must be true after a reload if this user’s work survived.
refusedWhat 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.
invariantOptional, 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
every order cleanor --max attempts

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 codeMeaning
0Every order was clean.
1A user silently lost, a save crashed the app, or the invariant broke.
2The 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.

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.