Nock
AI coding agents and humans ship SQL DDL that looks fine on staging and demo data and still takes production down.
About the project
AI coding agents and humans ship SQL DDL that looks fine on staging and demo data and still takes production down. Pattern linters only see SQL shape. They don’t know your table sizes or catalogue facts.
Nock is an estate-aware approve/block gate for Postgres DDL. It checks a migration against an estate snapshot — row counts plus columns, constraints, and indexes — and returns the same verdict JSON from the CLI, a GitHub Action, or MCP in Cursor. Agents can check before apply. CI can block before merge. Nock is not a proxy and never applies migrations.
Three ways to feed an estate: bring your own local file; run sync-estate on your runner (optional push to hosted Nock Team on Cloudflare, design partners); or refresh live from DATABASE_URL before each check.
The demo uses Sessionly, a fake session product. A product ticket asks for faster archive search. An agent drafts naive DDL against Supabase. Staging (~200 rows) is green. The same SQL against the live prod estate (~500k) fails via MCP: one rule, the lock reason, and the remediating SQL. The agent rewrites, re-checks, and goes green. Nothing was applied. Without that check the agent could have run the migration on prod and blocked writes.
Impact: stop the outage before any risky DDL. Agents remediate from Nock’s rules instead of guessing. The future is autonomous; what keeps systems reliable is the governance.
Repo: https://github.com/saiyamshah1496/nock
https://www.npmjs.com/package/@nockhq/core
https://www.npmjs.com/package/@nockhq/cli
https://www.npmjs.com/package/@nockhq/mcp

