mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-07-31 03:05:21 +00:00
Adds automated guardrails so mathematical rigor is enforced by tooling instead of by convention. See docs/math-first-tooling.md for the full contract. Schemas + registry: - shared-data/schemas/deepseek-review-receipt.schema.json Draft 2020-12 schema for the existing ollama_deepseek_review_receipt_v1 and ollama_deepseek_review_continuation_receipt_v1 receipt formats. Pins sha256:<hex> hashes, non-negative token counts, repo-relative POSIX paths, and rejects additional fields. - shared-data/schemas/claims-registry.schema.json Schema for claims.yaml. Requires review_receipts when status is verified-by-ai and a lean source when status is formally-proven. - claims.yaml Initial registry entry: prime-gap-entropy-collapse (verified-by-ai) linked to the two existing receipts under shared-data/artifacts/deepseek_review/. Validators (scripts/math-first/): - validate_deepseek_receipts.py: validates tracked or passed receipts against the JSON Schema; shared by pre-commit and CI. - test_validate_deepseek_receipts.py: positive + 7 negative fixtures asserting exit-code behaviour. - validate_claims_registry.py: schema check + unique id check + on-disk existence check for every referenced repo-relative path. - require_math_evidence.py: gate that requires a DeepSeek receipt, a Lean change, or a claims.yaml update alongside edits to math-track surfaces (Lean Semantics kernels, ArithmeticSpec docs, stack solidification receipts). Pre-commit (.pre-commit-config.yaml): - check-json, check-yaml, end-of-file-fixer, trim trailing whitespace, detect-private-key (scoped to math-first files only per AGENTS.md Do Not Sweep). - Local hooks wiring all three math-first validators above. CI (.github/workflows/math-check.yml): - validate-schemas: compiles every schema, runs both validators, runs the validator self-tests, then re-invokes the canonical Ollama emitter in --verify-only mode against every tracked receipt to re-check answer_sha256 against the answer-file bytes on disk. - require-evidence: enforces the math-track evidence rule at PR scope. - pre-commit: runs all pre-commit hooks against the PR diff so the contract holds even for contributors who skip installing hooks locally. MCP (.mcp.json): - filesystem, sympy, wolfram-alpha, lean, deepseek-review entries pointing at off-the-shelf upstream servers and at the canonical ollama_deepseek_review_emitter.py. Secrets stay in the runtime env (WOLFRAM_ALPHA_APPID, OLLAMA_API_KEY) and are never embedded. Docs (docs/math-first-tooling.md): - Philosophy, surfaces, schema reference, registry workflow, hook catalogue, CI catalogue, MCP catalogue, end-to-end verify command. shared-data/schemas/*.schema.json and claims.yaml live under paths the top-level .gitignore would normally exclude; they are force-added via git add -f the same way existing promoted receipts under shared-data/artifacts/deepseek_review/ are tracked (per AGENTS.md). Co-Authored-By: Allaun Silverfox <bigdataiscoming+9i37y6j2@protonmail.com>
60 lines
2.5 KiB
JSON
60 lines
2.5 KiB
JSON
{
|
|
"$schema": "https://modelcontextprotocol.io/schemas/2025-03-26/client-config.json",
|
|
"_comment": "Math-first MCP server declarations for Research Stack. Each server below is gated on a runtime environment variable so the config never embeds secrets and so contributors who have not provisioned a given backend simply skip it. See docs/math-first-tooling.md for setup instructions.",
|
|
"mcpServers": {
|
|
"filesystem": {
|
|
"_comment": "Read/write proof artifacts, Lean kernels, and DeepSeek receipts. Scope is the repository root so review tooling cannot escape the project tree.",
|
|
"command": "npx",
|
|
"args": [
|
|
"-y",
|
|
"@modelcontextprotocol/server-filesystem",
|
|
"."
|
|
],
|
|
"env": {}
|
|
},
|
|
"sympy": {
|
|
"_comment": "Local SymPy bridge for symbolic verification of arithmetic claims that appear in distilled docs and ArithmeticSpec. Backed by sympy-mcp upstream; see https://github.com/sdiehl/sympy-mcp.",
|
|
"command": "uv",
|
|
"args": [
|
|
"tool",
|
|
"run",
|
|
"--from",
|
|
"sympy-mcp",
|
|
"sympy-mcp"
|
|
],
|
|
"env": {}
|
|
},
|
|
"wolfram-alpha": {
|
|
"_comment": "Wolfram Alpha symbolic verification. Required to discharge the `Verified with Wolfram Alpha` comments enforced by .github/workflows/wolfram-verification.yml. Provide a Short Answers API key via WOLFRAM_ALPHA_APPID at runtime; the server is otherwise dormant.",
|
|
"command": "npx",
|
|
"args": [
|
|
"-y",
|
|
"@wolfram-alpha/mcp-server"
|
|
],
|
|
"env": {
|
|
"WOLFRAM_ALPHA_APPID": "${WOLFRAM_ALPHA_APPID}"
|
|
}
|
|
},
|
|
"lean": {
|
|
"_comment": "Lean 4 / Mathlib typecheck bridge. Targets 0-Core-Formalism/lean/Semantics/ via the existing lakefile. Requires `elan` on PATH; see GETTING_STARTED.md for the lean-toolchain pin (leanprover/lean4:v4.30.0-rc2).",
|
|
"command": "uvx",
|
|
"args": [
|
|
"lean-mcp",
|
|
"--lakefile",
|
|
"0-Core-Formalism/lean/Semantics/lakefile.toml"
|
|
],
|
|
"env": {}
|
|
},
|
|
"deepseek-review": {
|
|
"_comment": "Wraps the canonical Ollama/DeepSeek review emitter so AI assistants can request a fresh review and receive a receipt path back. The emitter handles SHA-256 integrity gating; this MCP layer just exposes it as a tool. Requires OLLAMA_API_KEY at runtime.",
|
|
"command": "python3",
|
|
"args": [
|
|
"5-Applications/tools-scripts/llm/ollama_deepseek_review_emitter.py",
|
|
"--mcp"
|
|
],
|
|
"env": {
|
|
"OLLAMA_API_KEY": "${OLLAMA_API_KEY}"
|
|
}
|
|
}
|
|
}
|
|
}
|