Repository navigation
DriftGuard v0.1.0
First public release of DriftGuard: an MCP server + CLI that lets AI assistants safely inspect, plan and prove PostgreSQL migrations. The LLM proposes; deterministic code decides.
What's included
- Schema drift detection (pg_catalog introspection + pure diff with severities)
- Data verification with chunked checksums, and bisection down to the exact differing rows
- Lock-impact analyzer built on PostgreSQL's own parser (libpg-query)
- Safe-rewrite engine: CONCURRENTLY, NOT VALID + VALIDATE, expand/contract, batched backfills
- Guarded LLM planner (Ollama / Gemini) with a validator and rules-only fallback
- Shadow runs in a disposable Postgres container, reversibility tags + rollback SQL, hashed receipts
- MCP server with 6 read-only tools for Claude Code, Cursor and other MCP clients
Measured results (see evals/)
- Drift detection: 100% precision / 100% recall on 21 seeded scenarios
- Bisection found every seeded row change reading 311 of 6,079,997 rows
- Lock modes: 30/30 predictions match
pg_locks; table rewrites: 29/29 matchrelfilenode - App stall on a 1M-row table: CREATE INDEX 901 ms -> 37 ms, ALTER COLUMN TYPE 8.9 s -> 174 ms
- Rules-only plans verified by shadow runs: 17/17
Get started
See the Quickstart and the MCP setup guide.