Your migrations, verbatim
Loaded into a fresh, pinned PostgreSQL 18.6.
Run npx -y viberaven race --example to see which two-user statement orders break a booking limit on offline PostgreSQL 18.6. For your own database rule, supply a race spec and SQL, then replay the failing order with the same inputs.
npx -y viberaven race --exampleFree and open source. Runs on your machine.
122 of 124 PostgreSQL isolation specs pass. Native PostgreSQL scores 200/200 and 1,500/1,500 on the same hidden sets. Replays match down to the protocol bytes, and 60 isolation cases leaked nothing between sessions.
Commands and replay requirements checked 2026-11-24.
Loaded into a fresh, pinned PostgreSQL 18.6.
Independent PostgreSQL backends in one WebAssembly process, with real locks.
Statement orders are enumerated and checked against your rule.
The broken order replays byte for byte, so a fix can be confirmed.
Find repository risks before launch.
npx -y viberaven checkWrite viberaven.race.json: setup, two requests and the SQL that must stay true. Start the CLI on Node.js 20, 22 or 24. On 20 and 22, npm prepares the Node 24 race engine.
npx -y viberaven raceUse the replay command from the result. Keep the test in the repo.
$ npx -y viberaven race --example
At most 2 bookings per event: 60 orders, 24 broken, 0 waiting
read committed 12/20 broken
repeatable read 12/20 broken
serializable 0/20 broken
First broken order 001101 (read committed)
COMMIT A=true, B=true
✓ Replay record is byte-identical.One rule at a time. The local CLI race needs no VibeRaven account.
npx -y viberaven raceUse race_two_users from a connected MCP client. The copied request includes the SQL and race spec for a bounded offline PostgreSQL test.
https://viberaven.dev/mcp?src=siteCall race_two_users with these exact arguments:
{
"sql": "create table public.bookings (id integer primary key, seat_id integer not null, user_id text not null);",
"spec": {
"format": 1,
"rule": "Each seat allows at most one booking",
"setup": "",
"requests": [
{
"id": "A",
"role": "postgres",
"statements": [
"insert into public.bookings values (1, 7, 'A')"
]
},
{
"id": "B",
"role": "postgres",
"statements": [
"insert into public.bookings values (2, 7, 'B')"
]
}
],
"invariant": "select count(*) <= 1 from public.bookings where seat_id = 7",
"evidence": "select id, seat_id, user_id from public.bookings order by id",
"isolation": [
"read committed"
]
}
}
Return the shortest broken order and its exact replay.Several real PostgreSQL 18.6 sessions in one PGlite WebAssembly instance. PostgreSQL handles transactions and locks; you control the statement order.
npm install @viberaven/[email protected]Node 24+ with --experimental-wasm-jspi, or a Chrome Worker with JSPI. Apache-2.0. API and example ↗
import { createHost } from '@viberaven/sessions';
const db = await createHost({ children: [43, 44] });
await db.query(42, 'CREATE TABLE ticket (id int PRIMARY KEY, claimed_by text); INSERT INTO ticket VALUES (1, NULL)');
await db.query(43, "BEGIN; UPDATE ticket SET claimed_by = 'A' WHERE id = 1 AND claimed_by IS NULL");
const second = db.query(44, "BEGIN; UPDATE ticket SET claimed_by = 'B' WHERE id = 1 AND claimed_by IS NULL");
await db.waitUntilParked(44); console.log('B waits for A');
await db.query(43, 'COMMIT'); await second;
await db.query(44, 'COMMIT');
console.log((await db.query(42, 'SELECT claimed_by FROM ticket')).results.at(-1).rows);
await db.close();// output
B waits for A
[ [ 'A' ] ]postgres. Review role and claims.deadlock-parallel completion order and insert-conflict lock introspection, which native PostgreSQL also fails through the judge. The hidden miss is async-notify queue usage.CLI and MCP: MIT. Sessions: Apache-2.0, with PostgreSQL and third-party notices. Package notices ↗