gate MCP Server
README.md
---
title: scientia-finita-gate
colorFrom: gray
colorTo: blue
sdk: docker
app_port: 7860
pinned: false
license: mit
short_description: Truth gate, stateless MCP v2, RLS & GitHub App
---
# gate · *Flipping a Coin in the Dark*
[](https://github.com/Scientia-finita/gate/actions/workflows/ci.yml)
**Part of [Scientia Finita](https://github.com/Scientia-finita)** · **Live API & MCP v2:** `https://zuhalsicim-scientia-finita-gate.hf.space` · **Author:** [Zuhal Karadavut](https://zuhalsicimkaradavut.com)
### The Question
Suppose you compress a model to make it twice as fast, ask it 5 (or 200) test questions, and see almost no mistakes. Did it stay just as smart—or did you simply flip a coin in the dark too few times to see what broke?
And what if a fast neural surrogate passes every average-error threshold on your test set, yet quietly predicts that heating a mould makes the metal freeze *faster*—violating the Second Law of Thermodynamics?
`Scientia-finita/gate` is the epistemic truth gate and production service of **Scientia Finita**. It refuses to guess when evidence is underpowered and refuses to let an unverified surrogate answer escape to a user or AI agent:
1. **Exact Rational ($\mathbb{Q}$) Dimensional Algebra (`finitum-core`):** Derives dimensionless Buckingham $\Pi$-groups (`Fo`, `Bi`, `Ste`) via exact `fractions.Fraction` Gauss-Jordan RREF (`0` SVD rounding error) and computes exact dyadic IEEE-754 stagnation thresholds and Landauer bit-erasure heat ($k_B T \ln 2$).
2. **Finite-Sample Power, Tango Non-Inferiority & Certified Fallback (`finitum-gate`, zero third-party deps):**
- Proves why a 200-question eval on 1,034 Spider questions (`85` differing, `33` net loss) has only **26.9% power** (`668` questions required for **80.0% power**), returning `"cannot_tell"` on underpowered smoke tests (`total=5, lost=0, gained=0`).
- Wraps any fast surrogate in `CertifiedPredictor`: out-of-box inputs or Second-Law / maximum-principle / conservation violations automatically fall back to the exact reference solver (**`0` untrusted surrogate escapes**).
3. **Evolutionary Dimensionless-Law Discovery & GPU Fleet Calibration (`finitum-discover`):**
- Canonicalizes candidate expression ASTs by SHA-256 (`79` duplicate AST evaluations skipped), discovering `0.934033 * (1 / Bi + 0.46) * log(0.5 + theta_0)` with **1.46% OOD RMSE across 4x wall-thickness scaling** (vs **70.13%** for raw dimensional formulas), verified in [`results/discovery_run.json`](results/discovery_run.json).
4. **Multi-Tenant RLS, Crash-Resilient Budgets, Stateless `MCP v2` & GitHub App (`finitum-platform`):**
- `PostgreSQL 17 FORCE ROW LEVEL SECURITY` DDL + SQLite `set_authorizer` runtime tenant isolation (`0` cross-tenant leaks across read/write/DML bypass attempts).
- Crash-resilient `DurableEvalRunner` with integer-microdollar `HardBudget` reservations (`0` duplicate bills and `0` overspend across simulated mid-run worker crashes).
- Stateless **MCP v2** endpoint (`POST /mcp`), structure-aware Markdown table chunking, ISO-13616 Mod-97 IBAN PII roundtrip masking, and **`@scientia-finita-gate[bot]`** (`POST /webhooks/github`) posting inline PR Check Run annotations.
---
### Reproduce Locally
```sh
uv sync
uv run pytest
uv run lint-imports
```
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues