Skip to content
ohad6kPublic

About

Reproduce PostgreSQL race conditions such as double bookings. Check Supabase migrations for missing RLS and Data API grants.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

65 stars

Watchers

4 watching

Forks

Latest commit

 

History

190 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VibeRaven: the raven mark and the PostgreSQL elephant. Two users at once, on real PostgreSQL.

VibeRaven

VibeRaven checks your repository for Supabase access and Stripe webhook problems before you ship. It can also replay duplicate webhook events or test what happens when two users book the last seat at the same time.

Start with the repository check: npx -y viberaven check.

Run the synthetic booking example in an empty folder with Node 24 or later:

npx -y [email protected] race --example

The unguarded example oversold the last seat in 24 of 60 tested statement orders and exits with code 1. The booking fixture shows the guard-row fix and how to rerun the assertion.

Recorded booking race: two users book the last seat at once. The broken statement order replays exactly.

Use with Claude Code, Codex or Cursor · Check your Supabase migrations · Connect an MCP client

npm version MIT license GitHub stars

Website · Engine · Connect your chat · Docs · Discord

In your repo

npx -y [email protected] check   # what is risky before launch
npx -y [email protected] race    # what breaks when two users act at once
  1. check reviews Supabase migrations, application code and configuration. Findings include the file and line when available. Use check --replay to test supported Stripe handlers locally with repeated or out-of-order events.
  2. race runs the rule in your viberaven.race.json: setup, two requests and the SQL that must stay true. Spec template.
  3. Fix, run race again, and replay the reported order. Exit 0: no order broke. Exit 1: broken. Exit 2: incomplete.

race needs Node 24+ (the CLI enables JSPI). check runs on Node 20+.

Current release · VibeRaven 1.20.2 on npm · Changelog · GitHub Releases

Version 1.20.2 fixes npm configuration in the feedback workflow generated by init --github. It includes the 1.20.1 fix that sets up the local race engine automatically on a cold install when a race check needs it.

Proof

Frozen-engine check Result
PostgreSQL isolation specs 122/124
Hidden new statement orders 199/200, native PostgreSQL 200/200
Hidden real-app interleavings 1,500/1,500, native PostgreSQL 1,500/1,500
Byte-equal replays 80/80
Leaks between sessions 0 in 60 isolation cases

Method and limitations

How it works

  1. Your supabase/migrations load verbatim into a fresh, pinned PostgreSQL 18.6.
  2. Two independent sessions run in one PGlite WebAssembly instance, with real locks.
  3. Bounded statement orders are enumerated and checked against your rule.
  4. A broken order replays byte for byte, so a fix can be confirmed.

The engine is @viberaven/sessions.

Use with Claude Code, Codex or Cursor

From the root of your app, run the row for your agent to add project instructions. Append --dry-run to preview the changes.

Agent Setup
Claude Code npx -y [email protected] init --agents claude
Codex npx -y [email protected] init --agents codex
Cursor npx -y [email protected] init --agents cursor

Then ask: “Review my Supabase migration files for missing RLS and Data API grants. Show the relevant file and line, and tell me what I should verify against my deployed project.”

For ChatGPT, Claude or another remote MCP client, add https://viberaven.dev/mcp. The hosted server can review supplied migration SQL or migrations in a supported public GitHub repo. Local MCP tools are available via npx -y @viberaven/[email protected]. See the agent hub for setup and scope.

Building an agent that answers provider errors? The AI SDK provider-context example adds search_guides and recent_provider_changes from the hosted MCP endpoint.

Local Studio

npx -y [email protected] opens the local Studio: chat with your coding agent, the provider board, versions and diffs, and a Race test tab that runs race and replays a broken order.

VibeRaven local Studio

Packages

Package Purpose License
viberaven The npx entry MIT
@viberaven/cli Studio, check and race MIT
@viberaven/mcp Local repository tools over MCP stdio MIT
@viberaven/sessions Several PostgreSQL sessions in one process Apache-2.0

Limitations

  • By default, check uses repository evidence. With --db, it can compare live schema metadata with your migrations. A clear result covers the checks that ran.
  • race covers the SQL, inputs and bounded statement orders you supply. Rules beyond a simple count limit need an explicit spec. Omitted roles run as postgres.
  • An incomplete run is not a pass. Replay needs the same migrations, spec, options and runtime.
  • Cloud Auth, HTTP and external I/O are outside the test. Run only SQL you trust; the engine is not a security sandbox.
  • No universal PostgreSQL compatibility, and no advantage over a plain coding agent in bug finding, is claimed.

License

CLI and MCP: MIT. @viberaven/sessions: Apache-2.0, with PostgreSQL and third-party notices. Contributing · Security · Changelog

Gemini CLI

gemini extensions install https://github.com/ohad6k/VibeRaven --ref v1.20.2

Run /viberaven-check in your repo to review a migration change with the pinned local CLI. For a public GitHub repo URL, use the hosted VibeRaven MCP check from the same command.

About

Reproduce PostgreSQL race conditions such as double bookings. Check Supabase migrations for missing RLS and Data API grants.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

65 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages