Skip to content

TypeSafe Migration Guard

Next.js service with a POST /api/migration-guard endpoint that asks Jev a SAFE or DANGER choice about a SQL statement plus target environment, returning HTTP 403 to halt a CI step or HTTP 200 to let Prisma migrations proceed against Postgres.

Stars
2
Language
TypeScript
Published by
Community
Author
opaielsheikh
Last verified
Oct 2026

About this project

Typesafe Migration Guard is an automated, deterministic safety gatekeeper that intercepts database migrations in continuous integration (CI/CD) pipelines and production deployment runners. Powered by the TypeSafe AI SDK and its machine-native Jev System One model, it evaluates DDL statements in real-time, blocking destructive operations (such as DROP TABLE, DROP COLUMN, and unindexed truncation) with an HTTP 403 Forbidden status code before any migration touches your live Supabase PostgreSQL database.

Quoted from the project's README. Read the full README.

Highlights

  • One request body with sqlCommand and environment; the response carries verdict, blocked, latencyMs, model, confidence and a probability distribution.
  • A GitHub Actions workflow runs a migration-safety-gate job on every pull request and main commit and gates deployment behind it.
  • npm run guard:check scans pending migrations or a single named migration directory, so the gate runs locally too.
  • deploy-ec2.sh does a pre-flight guard check, prisma migrate deploy, a PM2 cluster reload and a health-check rollback, with a --simulate dry run.

Watch out

The latency figures are the README's own, not a measurement you can rerun: its comparison table puts this project's calls at roughly 240 to 300 ms, regex linters near 10 ms and conversational models at 3,500 to 6,000 ms, with no harness or dataset in the repository behind them. Configuration is Supabase-shaped, with DIRECT_URL for migrations and DATABASE_URL through Supavisor, though a local Postgres also works. The clone command in the README still says your-org, so expect to fix the URL. Prerequisites are Node 20 or 22, a TypeSafe key and a Postgres database, and you must run npm run prisma:generate before the dev server. Only two migrations ship as fixtures, one CREATE TABLE and one DROP TABLE CASCADE. Copy reviewed against the repository README on 2026-10-04, not from running it.

Questions about this entry

Short answers drawn from the linked project or page.

More Jev resources like this

35GitHub stars
Diff-aware test selector that sends the git diff to Jev with one question per test, then prints the native filter flags and hands them to vitest, jest, node, bun, Playwright, cargo, or go test.
Jev Agents & MCP#community#jevbest#catalog-import
15GitHub stars
Node CLI that lints a file tree against fuzzy natural-language rules in one Markdown file, judging each matched file with a swappable TypeSafe-backed judge.
Jev Agents & MCP#community#jevbest#catalog-import
10GitHub stars
Pi context extension that folds repeated reads, filters long command logs through Jev, and retrieves saved originals as searchable verbatim chunks.
Jev Agents & MCP#community#jevbest#catalog-import
One-file Mastra input processor that screens the last user message with Jev instead of an LLM verdict: a typed yes/no gate plus a log-only category label, in a single request that fails open behind a circuit breaker.
Jev Agents & MCP#community#jevbest#catalog-import
1GitHub stars
A Claude Code plugin that verifies every tool call before it runs, asking Jev five parallel questions about the plan, scope, prior action and stated intent, then allowing, asking or blocking. Fresh installs ship in audit mode.
Jev Agents & MCP#community#jevbest#catalog-import
16GitHub stars
Single-command harness that turns a plain-language stack description into synced docs plus blocking hooks for Claude Code, Codex, and Pi, with deterministic presets or one Jev chooser call.
Jev Agents & MCP#community#jevbest#catalog-import
Back to all resources

From the Jev community

Posts from builders shipping with Jev right now.

Follow @typesafeai