pgx
AI 에이전트를 위한 경량 Postgres, Rust로 구현, 하나의 런타임에서 수천 개의 격리된 데이터베이스 제공
데이터가 창고에 도달하기 전에 나쁜 데이터를 차단합니다
Stop bad data before it hits your warehouse. Semantic data contracts enforced at ingestion — enums, patterns, ranges, and required fields validated per event, with quarantine and replay.
데이터Rust · TypeScriptGitHub @nightmoose온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
Data contract semantic layer enforcement
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Semantic Contract Enforcement at Ingestion — Patent Pending
Stop bad data before it reaches your warehouse, lakehouse, or ML pipeline.
DataContractGate is a high-performance validation gateway that enforces rich semantic data contracts in real time. Built in Rust for sub-millisecond per-event validation (86k+ events/sec/core), it goes far beyond JSON Schema or basic type checks — ontology, glossary, patterns, enums, computed metrics, and automatic inference.
The same contract can gate what leaves your system. POST /egress/{contract_id} runs the identical engine on any outbound payload — a reverse-ETL row, a notebook export, a state object headed to a decision model. Failing records are blocked, declared PII is masked, and the caller forwards only the returned payload. See docs/egress-validation-reference.md.
Validating LLM output? The same engine powers AISchemaGate (pip install aischemagate / npm install @nightmoose/aischemagate). One-line wrapper over OpenAI / Anthropic / vLLM / Ollama responses — extracts the structured JSON, validates against your contract, optionally re-prompts on violation. Non-streaming only in v1. See docs/llm-output-validation.md, docs/llm-sdk-reference.md, and the copy-paste guides in docs/integrations/ (Vercel AI SDK, structured outputs, LangGraph). Ingest recipes: examples/recipes/.
Live demo → app.datacontractgate.com/stream-demo
https://app.datacontractgate.com/llm-integration.md
https://github.com/nightmoose/contractgate
implement this in my repo
Your agent reads the integration playbook
(source), finds your event shape, infers a contract
from real samples, deploys it, wires your producer to /v1/ingest, and verifies
with a dry run before anything is written. Machine index:
/llms.txt.
MCP (Cursor, Claude Desktop, Windsurf, Copilot, Codex):
{
"mcpServers": {
"contractgate": {
"command": "npx",
"args": ["-y", "@nightmoose/contractgate-mcp-server"],
"env": {
"CONTRACTGATE_API_KEY": "${CONTRACTGATE_API_KEY}"
}
}
}
}
Tools and auth: docs/mcp-reference.md.
Claude Code / Cursor plugin:
/plugin marketplace add nightmoose/contractgate
/plugin install contractgate@contractgate
Redpanda Connect (HTTP processor, no custom plugin): docs/examples/redpanda-connect/.
Zapier — validate the record a Zap just pulled, before the next step writes it. A failure is quarantined and the Zap stops. A pass continues with the payload DataContractGate returned. Setup and the zapier-platform push commands: docs/zapier.md. Source: zapier/.
No Supabase account. No API keys. No sign-up.
git clone https://github.com/nightmoose/contractgate.git
cd contractgate
make demo
Opens at http://localhost:3000 — dashboard pre-loaded with three starter contracts and a live event stream. First build ~3 min, subsequent runs instant (Docker layer cache).
make demo-reset # wipe + reseed (clean slate)
make demo-down # stop and remove volumes
make demo-logs # follow all service logs
Self-Hosted Free (
make demo) runs the real gateway binary with auth off. Unlimited local events, full YAML editor, playground, audit log. Feature comparison below ↓
Auth on, dashboard sign-up, and every paid feature unlocked. From a fresh clone:
git clone https://github.com/nightmoose/contractgate.git
cd contractgate
docker compose -f docker-compose.yml -f docker-compose.selfhost.yml up --build
Sign up at http://localhost:3000/auth/signup, then sign in at http://localhost:3000/auth/login. Mail is not configured; confirmation is automatic. Do not combine this with --profile demo. First boot generates keys and binds ports to 127.0.0.1. Exact steps: docs/self-host-reference.md.
The comparison table below is the zero-auth demo. With CONTRACTGATE_SELF_HOSTED=true the stored plan stays free and paid gates open.
| Capability | Self-Hosted Free | Cloud (Free / Pro / Enterprise) |
|---|---|---|
| Validation engine | ✅ Unlimited (local) | ✅ 100K / 25M / Unlimited events/month |
| Starter contracts | ✅ 3 | ✅ 3 / Unlimited / Unlimited |
| Playground | ✅ | ✅ |
| Audit log | ✅ Local Postgres | ✅ 7 / 90 / Custom days retention |
| Live event stream | ✅ | ✅ |
| Auth & API keys | ❌ | ✅ |
| Multi-tenancy | ❌ Single org | ✅ |
| Visual contract builder | ❌ | ✅ Growth+ |
| AI inference (JSON → YAML) | ❌ | ✅ Growth+ |
| Quarantine + replay | ❌ | ✅ Growth+ |
| PII transform rules | ❌ | ✅ Growth+ |
| Semantic versioning UI | ❌ | ✅ Growth+ |
| GitHub sync | ❌ | ✅ Growth+ |
| Team invites & roles | ❌ | ✅ Growth+ |
| SSO / SAML | ❌ | ✅ Enterprise |
| Managed hosting + SLA | ❌ Self-hosted | ✅ |
→ Full pricing → Talk to sales
Docker (gateway + Postgres only):
docker compose up
Python SDK:
pip install contractgate
from contractgate import Client
client = Client(api_url="http://localhost:8080", api_key="cg_demo_key")
client.validate(contract_id="...", event={"user_id": "u1", "event_type": "click"})
CLI:
cargo install --git https://github.com/nightmoose/contractgate contractgate
contractgate validate --contract examples/nested-order.yaml events.json
GitHub Action (compile every YAML under contracts/ on PRs):
- uses: nightmoose/contractgate/actions/validate@main
with:
path: contracts
pre-commit (same compile, no network):
# .pre-commit-config.yaml
repos:
- repo: https://github.com/nightmoose/contractgate
rev: main # pin to a git sha
hooks:
- id: contractgate-validate
| Layer | Tech |
|---|---|
| Validation engine | Rust + Axum (sub-millisecond per-event, see note) |
| Dashboard | Next.js 15 + TypeScript + Tailwind |
| Storage | Supabase (Postgres + Auth) |
| Connectors | Kafka Connect, HTTP, batch, Python SDK, CLI |
| Observability | Prometheus + Grafana |
Full RFCs and design docs live in docs/rfcs/. For a quick shipped-vs-draft view, see docs/STATUS.md.
| Feature | DataContractGate | Great Expectations | Soda | Monte Carlo | dbt |
|---|---|---|---|---|---|
| Validation timing | At ingestion | Post-hoc / batch | Mix (mostly batch) | Observability | During dbt runs |
| Performance | Sub-ms per-event, 86k+ ev/s (Rust, see note) | Python-based | Varies | Not a validator | Not real-time |
| Semantic depth | Ontology + glossary + metrics | Basic expectations | Checks + rules | No contracts | Basic schema |
| Visual builder | Yes + live YAML | Partial | Limited | No | YAML only |
| Inference from sample data | One-click JSON → YAML | Profiler (basic) | Limited | No | No |
| Quarantine + replay | Built-in | No | No | No | No |
| Versioning | Draft → stable → deprecated | Manual | Basic | No | Basic |
| Self-hosted OSS | Yes (make demo) | Yes | Open core | Commercial | Yes |
| License | MIT | Apache 2.0 | Open core | Commercial | Apache 2.0 |
PRs welcome. See CONTRIBUTING.md and the reference docs in docs/.
Active RFCs: docs/rfcs/ · RFC status index: docs/STATUS.md
MIT — see LICENSE. Free to use, fork, and build on top (commercial use welcome).
The semantic contract enforcement algorithm is the subject of a pending patent.
The patent covers the invention — your right to use, modify, and distribute the
code under the MIT license is unaffected. See NOTICE for details.
Built with ❤️ in Florida by NightMoose