physproof-site
README.md
# PhysProof Monograph & Exhibition (`physproof-site` v2.0.0)
[](https://github.com/mischa-thisness/physproof-site/releases)
[](https://github.com/mischa-thisness/physproof-site/actions/workflows/ci.yml)
[](LICENSE)
[](#quick-start)
[](#ai-agent--mcp-integration)
[](#architecture--exhibition-surfaces)
[](https://physproof.thisness.us)
A **Swiss Architectural Monograph**, static research exhibition, and **AI-native MCP / REST / OpenAPI / SSE control plane** for the archived `PhysProof-early` Lean 4 corpus (`1,062` formal-verification sessions, `1,367` Lean 4 modules, `79,627` scanned declarations at `99.22%` purity, `650` closed targets, `376` empirical benchmarks, a `42,334`-node 2D Proof Atlas, and the 3D Argon WebGL2 cosmos) — live at **[https://physproof.thisness.us](https://physproof.thisness.us)**.
[Highlights](#highlights) · [AI Agent & MCP](#ai-agent--mcp-integration) · [Architecture](#architecture--exhibition-surfaces) · [Repository Layout](#repository-layout) · [Quick Start](#quick-start) · [Configuration](#configuration--data-pipelines) · [Security Model](#security-model) · [Documentation](#documentation)
Licensed under the [MIT License](LICENSE). Sibling pure Lean 4 library: **[mischa-thisness/PhysProof](https://github.com/mischa-thisness/PhysProof)**.
---
## Highlights
- **AI-Native Read & Write MCP Control (Zero Dependencies):**
- **Universal Stdio & Streamable HTTP MCP (`mcp/physproof_site_mcp.py`):** Pure Python 3.9+ stdlib server (zero `pip` packages) supporting both stdio (`python3 mcp/physproof_site_mcp.py`) and Streamable HTTP (`http://127.0.0.1:18436/mcp`, protocol versions `2024-11-05`..`2026-01-26`).
- **10 Intent-Shaped Tools + 4 Resources + 3 Prompts:** Inspect live site metrics and the Honest Ledger, search across all `1,367` Lean modules and `987` session logs, read full Lean 4 module sources directly from the 32 sharded chunks, author or update Flagship Papers and Era Journal chapters with strict Zod-matching frontmatter validation & `dry_run` preview, run full link/KaTeX/JSON-shard audits, and trigger `npm run build`.
- **Local REST API v1 + OpenAPI 3.1 + Live SSE + Web `llms.txt`:** Exposes `/api/v1/*`, `/openapi.json`, `/.well-known/agent.json`, and `/api/v1/events` locally, plus publishes **[`https://physproof.thisness.us/llms.txt`](https://physproof.thisness.us/llms.txt)** and repo-root [llms.txt](llms.txt) + [skills/physproof-site/SKILL.md](skills/physproof-site/SKILL.md).
- **Built-In Security Guardrails:** Loopback-only (`127.0.0.1`) default, browser `Origin:` CSRF/DNS-rebinding block (`403`), `Cache-Control: no-store`, optional constant-time Bearer token (`PHYSPROOF_SITE_MCP_TOKEN`), master kill switch (`PHYSPROOF_SITE_MCP_ENABLED=false`), and strict content-directory path sandboxing.
- **Curated Swiss Monograph & Honest-Count Exhibition (`https://physproof.thisness.us`):**
- **8 Distilled Flagship Papers (`/papers/*`):** KaTeX-typeset longform editions covering *AWARENESS A1–A4*, *Constructive Yang–Mills & the 3×3 Vault*, *Proof Indigestion*, *Tegmark Vericoding*, *P vs NP*, *Language of Thought (PNAS 2026)*, *376 Empirical Benchmarks*, and *It from Bit* — each with an explicit Honest Debt Manifest, clickable Lean 4 source anchors, and 1-click BibTeX citation export.
- **30 Legacy Manuscripts Archive (`/papers/archive`):** Complete audited manifest catalog of all historical `Papers/` directories.
- **10 Era Journal Chapters + Searchable 987-Session Chronicle (`/journal/*`) & 1,062-Session Playback Scrubber (`/live`):** Synchronized growth curves, honest-audit resets, and milestone replay running purely on static JSON.
- **Three Observatory Scales (`/explore`, `/atlas`, `/argon`):** Instant 1,367-module explorer with static Lean source drawer, GPU-accelerated 2D Proof Atlas (`42,334` nodes / `177,746` edges), and 3D Argon WebGL2 + WebAssembly cosmos — all served with zero runtime Workers, zero KV, and zero external CDNs.
---
## AI Agent & MCP Integration
Connect any MCP-compatible coding agent (**Claude Code, Claude Desktop, Antigravity, Cursor, Codex, VS Code, Windsurf, or OpenAI Agents**) directly to this repository to inspect the formal Lean 4 corpus, verify Honest-Count claims, author new MDX papers/chapters, and run static builds.
### 1-Step MCP Connection
**Option A — Stdio MCP (Recommended · Zero Dependencies, No Background Server):**
```json
{
"mcpServers": {
"physproof-site": {
"command": "python3",
"args": ["/path/to/physproof-site/mcp/physproof_site_mcp.py"]
}
}
}
```
**Option B — Streamable HTTP MCP (`--http --port 18436`):**
```bash
python3 mcp/physproof_site_mcp.py --http --port 18436
```
```json
{
"mcpServers": {
"physproof-site": {
"url": "http://127.0.0.1:18436/mcp"
}
}
}
```
For **VS Code** (`.vscode/mcp.json`), use `"servers": { "physproof-site": { "type": "http", "url": "http://127.0.0.1:18436/mcp" } }`, or print any client config automatically:
```bash
python3 mcp/physproof_site_mcp.py --print-config [http|stdio|claude|cursor|antigravity|codex|vscode]
```
### MCP Tools, Resources & Prompts
| Tool | Read-Only | Capabilities |
|---|---|---|
| `site_status` | Yes | Site metadata, live URL, content & Lean shard counts, build status, MCP status |
| `site_ledger` | Yes | Authoritative Honest Ledger metrics, epistemic breakdown, benchmarks, landmarks & dead ends |
| `site_search_corpus` | Yes | Fast search across 1,367 Lean modules/symbols, 987 sessions, papers, journal, or full Lean source |
| `site_read_lean_module` | Yes | Fetch full or line-sliced Lean 4 source & import/audit metadata from `public/data/lean-chunks/*.json` |
| `site_list_content` | Yes | List all Flagship Papers, Era Journal chapters, 30 Archive manuscripts, and all Astro routes |
| `site_read_content` | Yes | Read parsed YAML frontmatter, MDX body, heading outline, and Lean anchor links |
| `site_write_paper` | No | Create or update a Flagship MDX paper (`src/content/papers/`) with schema validation, KaTeX check & `dry_run` |
| `site_write_journal_chapter` | No | Create or update an Era Journal MDX chapter (`src/content/journal/`) with schema validation & `dry_run` |
| `site_validate_content` | Yes | Validate all MDX frontmatter, internal & Lean links, line bounds, KaTeX math balance, and 32+ JSON shards |
| `site_build` | No | Execute `npm run build` (or `extract` / `visualizers` / `all`) with structured exit code & logs |
- **4 Live Resources (`resources/read`):** `physproof-site://status`, `physproof-site://ledger`, `physproof-site://papers`, `physproof-site://journal`.
- **3 Built-In Prompts (`prompts/get`):** `draft-flagship-paper`, `audit-monograph-honesty`, `explore-lean-corpus`.
### What Your AI Agent Can Do (Example Prompts)
- **Verify Honest-Count claims against static Lean 4 shards (Read):** *"Cross-check our Yang–Mills flagship paper's line citations against `PhysProof.Targets.YangMillsMassGap` and verify the exact epistemic breakdown in the Honest Ledger."* → calls `site_read_content`, `site_read_lean_module`, and `site_ledger(section="epistemic")`.
- **Search across 1,367 Lean modules & 987 session logs (Read):** *"Find every session log and Lean declaration mentioning Strong Subadditivity or proof indigestion across the archive."* → calls `site_search_corpus`.
- **Author or revise a Flagship Paper with schema preview (Write + Guardrail):** *"Draft an updated MDX paper with KaTeX equations and Honest Debt Manifest, preview it with `dry_run: true`, then write it once Zod frontmatter and math balance pass."* → calls `site_write_paper(dry_run=true)` → `site_write_paper(dry_run=false)` (strict slug & content-directory sandbox prevents escaping `src/content/papers/`).
- **Publish an Era Journal chapter (Write):** *"Add a new Era Journal dispatch summarizing sessions 1050–1062 and link the corresponding Lean source anchors."* → calls `site_write_journal_chapter`.
- **Audit every link, KaTeX block & shard, then build `dist/` (Read + Write):** *"Validate all 18 MDX files, internal links, line bounds, and 32 Lean JSON chunks, then run a clean production `npm run build`."* → calls `site_validate_content` followed by `site_build`.
### Local REST API v1, OpenAPI 3.1 & Real-Time SSE
When running `--http --port 18436`, every capability is also available over standard JSON HTTP:
- **Discovery & Live Stream:** `GET /.well-known/agent.json`, `GET /openapi.json`, `GET /api/v1/status`, `GET /api/v1/ledger`, `GET /api/v1/search`, `GET /api/v1/lean`, `GET /api/v1/content`, `GET /api/v1/content/<collection>/<slug>`, `GET /api/v1/validate`, `GET /api/v1/events` (`text/event-stream` SSE).
- **Write & Build (`POST`):** `/api/v1/papers`, `/api/v1/journal`, `/api/v1/build`, `/api/v1/tool/<tool_name>`.
```bash
# Inspect site status & Honest Ledger epistemic counts
curl -s http://127.0.0.1:18436/api/v1/status
curl -s "http://127.0.0.1:18436/api/v1/ledger?section=epistemic"
# Read Lean 4 source directly from static CDN shards
curl -s "http://127.0.0.1:18436/api/v1/lean?module=PhysProof.Targets.YangMillsMassGap&start_line=520&end_line=555"
# Validate all 18 MDX files + 32 Lean chunks + /api/* JSON shards
curl -s http://127.0.0.1:18436/api/v1/validate
# Subscribe to live write & build SSE events
curl -N http://127.0.0.1:18436/api/v1/events
```
See [mcp/README.md](mcp/README.md) for full schemas, Bearer auth, and self-test instructions (`python3 mcp/physproof_site_mcp.py --self-test`).
---
## Architecture & Exhibition Surfaces
`physproof-site` builds to **100% static files (`dist/`)** deployed on Cloudflare Pages Free (`$0/mo`) — zero KV, zero Durable Objects, zero runtime Workers:
| Route | Surface | Backing Data |
|---|---|---|
| `/` | Swiss Monograph Home & Honest Ledger | `public/data/ledger.json` |
| `/papers`, `/papers/<slug>` | 8 Distilled Flagship Editions (MDX + KaTeX + BibTeX) | `src/content/papers/*.mdx` |
| `/papers/archive` | 30 Archived Legacy Manuscript Manifests | `public/data/papers-archive.json` |
| `/journal`, `/journal/<slug>` | 10 Era Chapters + 987-Session Searchable Chronicle | `src/content/journal/*.mdx` + `timeline-1062.json` |
| `/live` | 1,062-Session Static Playback Scrubber | `public/data/timeline-1062.json` |
| `/explore` | 1,367-Module Explorer + Static Lean Source Drawer | `modules-index.json` + 32 `lean-chunks/chunk-XX.json` |
| `/atlas` | 2D Polar Proof Atlas (`42,334` nodes, `177,746` edges) | `public/vendor/atlas.js` + `/api/atlas/*` + `static-api-shim.js` |
| `/argon` | 3D Argon WebGL2 + WebAssembly Verification Cosmos | `public/vendor/argon.js` + `/api/state` + `static-api-shim.js` |
| `/llms.txt`, `/sitemap.xml` | Web AI Agent Discovery & Search Indexing | `public/llms.txt`, `src/pages/sitemap.xml.ts` |
---
## Repository Layout
```text
physproof-site/
├── src/
│ ├── content.config.ts # Strict Zod schemas for papers & journal MDX collections
│ ├── content/papers/ # 8 distilled Flagship Papers (*.mdx)
│ ├── content/journal/ # 10 Era Journal chapters & prover dispatches (*.mdx)
│ ├── components/ # React 19 islands (ExplorerApp, LiveReplayApp, CommandSearch, CitationBox)
│ ├── layouts/ # MonographLayout.astro (OpenGraph, theme toggle, self-hosted fonts)
│ ├── lib/ledger.ts # Typed loaders for ledger.json & papers-archive.json
│ ├── pages/ # Static Astro routes + sitemap.xml.ts
│ └── styles/global.css # Tailwind CSS v4 Swiss editorial typography & tokens
├── public/
│ ├── data/ # ledger.json, modules-index.json, timeline-1062.json, 32 lean-chunks/*.json
│ ├── api/ # Pre-built static /api/atlas/*, state, events, intelligence, unified-validation
│ ├── atlas/ & argon/ # Harmonized static HTML shells for 2D Atlas & 3D Argon
│ ├── vendor/ # Bundled atlas.js, argon.js & zero-KV static-api-shim.js
│ ├── fonts/ # Self-hosted Crimson Pro, Source Sans 3 & JetBrains Mono woff2
│ ├── llms.txt # Live web AI discovery index (https://physproof.thisness.us/llms.txt)
│ └── _headers # Cloudflare Pages Content-Type, immutable caching & security headers
├── mcp/
│ ├── physproof_site_mcp.py # Zero-dependency Python 3.9+ stdlib Stdio/HTTP MCP + REST + OpenAPI + SSE
│ └── README.md # MCP setup, schemas, curl recipes & guardrails
├── skills/
│ └── physproof-site/SKILL.md # Portable cross-agent skill definition
├── scripts/
│ ├── extract-early.py # Optional read-only extractor (PhysProof-early -> public/)
│ └── build-visualizers.mjs # Optional esbuild bundler for 2D Atlas & 3D Argon
├── .github/workflows/
│ ├── ci.yml # Automated build, MCP self-test & zero-PII path check
│ └── deploy.yml # Automated Cloudflare Pages production deploy
├── llms.txt # Repo-root AI discovery index
├── AGENTS.md # Coding-agent quick orientation
├── SECURITY.md # Threat model & vulnerability reporting
├── CONTRIBUTING.md # Editorial honesty standards & PR checklist
└── LICENSE # MIT License (Copyright (c) 2026 Mischa Gentry)
```
---
## Quick Start
### Prerequisites
- **Node.js 20+ / 22 LTS** (for Astro 5 static build and dev server)
- **Python 3.9+** (optional, zero `pip` packages — for the MCP server, self-test, and optional data re-extraction)
### Build & Run Locally
```bash
git clone https://github.com/mischa-thisness/physproof-site.git
cd physproof-site
# Install dependencies
npm ci
# Start local Astro dev server (http://localhost:4321)
npm run dev
# Run isolated MCP & content validation self-test (zero mutation)
python3 mcp/physproof_site_mcp.py --self-test
# Build full static exhibition -> dist/
npm run build
# Preview production build locally
npm run preview
```
---
## Configuration & Data Pipelines
All static data shards in `public/data/` and `public/api/` are pre-generated and checked in so `npm run build` works completely standalone with no external corpus required.
If you also hold a local checkout of the archived `PhysProof-early` corpus and want to regenerate shards or re-bundle the visualizers, configure paths via environment variables (portable relative defaults are used if unset):
| Environment Variable | Default | Purpose |
|---|---|---|
| `PHYSPROOF_SITE_DIR` | Repository root | Target `physproof-site` checkout for scripts and MCP server |
| `PHYSPROOF_EARLY_DIR` | `../PhysProof-early` | Read-only archived corpus directory for `extract-early.py` & `build-visualizers.mjs` |
| `PHYSPROOF_KV_BACKUP_DIR` | *(unset / optional)* | Optional directory containing archived `current-state.json` snapshot |
| `PHYSPROOF_SITE_MCP_TOKEN` | *(unset / loopback-only)* | Optional Bearer token required for remote HTTP MCP/REST clients |
| `PHYSPROOF_SITE_MCP_ENABLED` | `true` | Master kill switch (`false` returns `503 mcp_disabled`) |
| `PHYSPROOF_SITE_MCP_URL` | *(unset / direct local)* | Optional HTTP MCP URL to proxy to when running in stdio mode |
```bash
# Optional: re-extract static JSON & Lean chunks (strictly read-only on PhysProof-early)
PHYSPROOF_EARLY_DIR=../PhysProof-early python3 scripts/extract-early.py
# Optional: re-bundle 2D Proof Atlas & 3D Argon visualizers
PHYSPROOF_EARLY_DIR=../PhysProof-early node scripts/build-visualizers.mjs
```
---
## Security Model
- **100% Static Production Site:** `https://physproof.thisness.us` runs zero server-side code, zero cookies, and zero runtime databases, with `X-Content-Type-Options: nosniff` and `Referrer-Policy: strict-origin-when-cross-origin` enforced via `public/_headers`.
- **Loopback-Only Local MCP Server:** `mcp/physproof_site_mcp.py --http` binds strictly to `127.0.0.1:18436` by default and refuses non-loopback binds unless `PHYSPROOF_SITE_MCP_TOKEN` (or `--token`) is configured.
- **Browser CSRF / DNS-Rebinding Defense:** All HTTP MCP, REST, and SSE endpoints reject any request carrying a browser `Origin:` header (`403 browser_origin_forbidden`) and return `Cache-Control: no-store`.
- **Strict Content Sandbox & Constant-Time Auth:** Write tools validate slugs against `^[a-z0-9][a-z0-9-]{0,80}$` and verify resolved paths stay inside `src/content/papers/` or `src/content/journal/`. Token verification uses `hmac.compare_digest`, and secrets are automatically redacted from JSON payloads.
---
## AI Authorship & Provenance
- **Website, Monograph & AI-Native MCP Server (`physproof-site`):** The Astro 5 static exhibition, Swiss Architectural Monograph design system, distilled flagship papers, 32-shard Lean reader, static 2D/3D visualizer bundles, `/llms.txt`, and MCP/REST/OpenAPI/SSE corpus server were generated and built by **Gemini 4 Neon (Extra High / XHigh reasoning effort)** in **Google Antigravity**, under the direction and review of Mischa Gentry.
- **Exhibited Research Corpus ([`PhysProof-early`](https://github.com/mischa-thisness/PhysProof-early), Sessions 001–1062, 9,773 commits):** Unlike the standalone apps in this portfolio, the underlying `PhysProof-early` Lean 4 corpus was built collaboratively across **four AI agent lineages** under human direction by Mischa Gentry (March–November 2026):
| Collaborator / Model Family | Exact Model Versions & Context Observed | Harness / Surface | Recorded Reasoning Effort | Verified Footprint in `PhysProof-early` |
| :--- | :--- | :--- | :--- | :--- |
| **Anthropic Claude Opus** | `Claude Opus 4.6` (`1M context`: 899; standard: 6) · `Claude Opus 4.7` (`1M context`: 799; standard: 165) · `Claude Opus 4.8` (`1M context`: 400; standard: 129) · `Claude Opus 5` (`1M context`: 507) · `Claude Opus 5.5` (623; `1M context`: 279) | Claude Code CLI & autonomous workflow fleets | `high` for finder/synthesis waves; `xhigh` for verifiers & deep audit fleets; `1M context` window *(per-commit effort not logged in git trailers)* | **3,807 co-authored commits** (2026-03-12 → 2026-11-19); primary theorem formalizer, integrator, honesty/verification infrastructure, `Claude.Nature.md`. |
| **Anthropic Claude Fable** | `Claude Fable 5` (537) · `Claude Fable 5.1` (142) · `Claude Fable 5.2` (23) | Claude Code CLI (`claude-fable-5`, sub-agent & synthesis default from s711) | `--effort high` in synthesis & briefing pipelines (`scripts/llm-narrative-synthesis.py`, `docs/BRIEFING-SYSTEM.md`); `high` / `xhigh` in workflow fleets (`low\|medium\|high\|xhigh\|max` scale) | **702 co-authored commits** (2026-06-10 → 2026-11-12); core proof waves, multi-branch Gemini/Codex integration, narrative & paper synthesis. |
| **Anthropic Claude Sonnet** | `Claude Sonnet 4.6` (4) + 3 unversioned `Claude` trailers | Claude Code CLI | Not logged per-commit | **7 co-authored commits** (early 2026-03-18; later superseded by Opus/Fable-only proof policy). |
| **OpenAI Codex / GPT-6 Astra** | `GPT-6 Astra` / `OpenAI Codex` (`Codex Desktop` & `codex_work_desktop`) | Codex CLI & Codex Desktop (Mac satellite & Linux) | Not logged per-commit in git trailers *(high-reasoning formalization & verification sessions)* | **16 `Co-Authored-By: Codex` trailers** + **307 Codex/Astra-attributed commits & merges** (2026-09-19 → 2026-11-09); `GPT-6-Astra.Nature.md`, Lean 4.36 RC2 migration, Borel/spectral calculus, publication receipts (`verify-state-sync.py`), shared SQLite agent mailbox. |
| **Google Gemini** | `Gemini 3.1 Pro` (`models/gemini-3.1-pro-preview`) · `Gemini 3 Flash` (`models/gemini-3-flash-preview`) · `Gemini 4 Argon` (`gemini-4-argon`) · `Gemini 4 Neon` (post-s1062 GitHub migration & cleanup) | Google AI Studio (Mar–Apr 2026), Gemini CLI (`0.33.0`), Google Antigravity IDE & CLI | `Gemini 3.1 Pro` / `3 Flash`: AI Studio sessions *(effort not logged per-turn)*; `Gemini 4 Argon`: Antigravity high-reasoning formalization & benchmark runs; `Gemini 4 Neon`: **Extra High (XHigh)** | **127 Gemini/Argon/Antigravity-attributed commits & merges** (2026-03-16 → 2026-11-13) + 20 archived AI Studio / Antigravity / Gemini CLI sessions; early architecture audits (s023–035), WebGL2+WASM 3D Atlas **PhysProof-Argon** (`/argon`), `TheoPhysEval` paper, AxiomMath/Stacks linters, Spin(10)/SU(2) CG retirement, `/labs` observatory, SourceHut→GitHub migration. |
| **Muse** | `Muse` *(standalone external agent; exact underlying checkpoint not exposed in chat export)* | Muse desktop/chat workspace | Not logged in export | Independent adversarial audit of `PhysProof-alpha` and its Yang–Mills claim (2026-10-12; 30-message audit archived in `META/migrated-context/muse/`). |
*Commits without a `Co-Authored-By:` trailer include principal human commits by Mischa Gentry, automated loop/heartbeat/state-sync commits, and cross-seat merge receipts. Where a harness did not record per-commit reasoning effort in git metadata, this table states so explicitly rather than inferring values.*
---
## Documentation
- [mcp/README.md](mcp/README.md) — MCP stdio & Streamable HTTP setup, 10 tools, 4 resources, 3 prompts, REST/SSE API, and guardrails.
- [llms.txt](llms.txt) & [public/llms.txt](public/llms.txt) — Machine-readable discovery indices for coding agents and web LLMs.
- [AGENTS.md](AGENTS.md) — Concise workspace reference for autonomous coding agents.
- [skills/physproof-site/SKILL.md](skills/physproof-site/SKILL.md) — Drop-in portable AI agent skill.
- [SECURITY.md](SECURITY.md) — Security policy, trust boundaries, and vulnerability reporting.
- [CONTRIBUTING.md](CONTRIBUTING.md) — Honest-Count editorial standards and contribution checklist.
- [LICENSE](LICENSE) — MIT License.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues