// sibling project of PHOSPHOR · not yet complete
PHOSPHOR MCCP
Multiscale Computational Comprehension Platform
See how a real program's execution actually happens — grounded in trace evidence, not guesses.
What's on this page describes the current, unfinished state — not a finished product. Expect gaps, rough edges, and frequent changes.
目前專案尚未完成,持續更新中。這頁描述的是現在、還沒做完的狀態,不是成品——會有缺口、粗糙的地方,而且會常常改動。
What it is
PHOSPHOR MCCP traces a real running program (Python first), builds a computational
graph of what actually happened — functions, files, network calls, processes, never
one node per call instance — and lets you click any part of it for an AI explanation
that cites the exact trace events behind every claim. Every claim is tagged
observed / inferred / hypothesized / verified —
the platform never asserts behavior it didn't actually see.
PHOSPHOR MCCP 會追蹤一支真實在跑的程式(先做 Python),把實際發生的事建成一張計算圖——函式、檔案、
網路呼叫、行程,不是每次呼叫都算一個節點——點圖上任何一個節點,都能拿到一段引用真實追蹤事件佐證的 AI 解釋。
每一句話都標著 observed/inferred/hypothesized/verified
——這個平台不會宣稱它沒有真的觀察到的行為。
Relationship to PHOSPHOR
This is a different codebase from the PHOSPHOR you're looking at right now
(which includes EML-VM-16/64/BASIC and a real WebAssembly target). They share a name
and a thesis lineage — Φ : M × CTS → V, generalized here from a toy VM to real
running programs on real operating systems — not a repository.
這跟你現在看的這個 PHOSPHOR 是不同的程式庫(包含 EML-VM-16/64/BASIC 與真實 WebAssembly 目標)。兩者共用一個名字跟同一條理論脈絡——Φ : M × CTS → V,
在這裡從一個玩具 VM 推廣到真實作業系統上跑的真實程式——但不共用同一個程式庫。
Install / 安裝與使用
Download and extract the MCCP source, then open that folder. In the full source bundle, use packages/mccp. Python ≥ 3.12.
python -m venv .venv .venv/Scripts/python.exe -m pip install -e ".[dev]" .venv/Scripts/phosphor.exe run demo_targets/hello_trace.py --trace-id demo1 .venv/Scripts/python.exe -m uvicorn phosphor_api.app:app --host 127.0.0.1 --port 8000
On Linux/macOS, use .venv/bin/python and .venv/bin/phosphor. Open http://127.0.0.1:8000/. Tracing and graph inspection need no API key. AI explanations require your own ANTHROPIC_API_KEY and transmit selected trace evidence to the configured model. The optional raw timeline uses Perfetto's external viewer.
追蹤與圖形檢視不需要 AI 金鑰。AI 解釋會把選定的追蹤證據傳給模型;原始追蹤可能包含檔案路徑及程式資料,請保留於本地。原始時間線採用外部 Perfetto viewer。
Current status
- done — trace a Python script (function/line, real HTTP, file I/O, SQLite queries), build a bounded computational graph with real caller/callee/database edges (never one node per call), macro/meso projection, a Complexity Lens (per-node/edge cost breakdown) and a Bug Lens (real error findings + traffic-explosion hotspots), real background memory profiling (peak/mean process RSS), a minimal API + UI with every lens wired in. 106 tests, all real (no mocked pipeline internals).
- done — live AI-explanation output verified against a real model, not just offline. Every claim is checked in code (not just prompted): a claim marked "observed" that cites evidence it wasn't actually shown gets caught and downgraded automatically. A real run against a heavily-recursive function surfaced and fixed a real bug — its evidence overflowed the model's context limit — then the fix was generalized into a five-gate adaptive pipeline: score events by real significance (errors, latency outliers), guarantee every part of the evidence keeps at least some representation, hard-cap the total regardless of how large or adversarial the trace is. Re-verified live against the same model after the redesign.
- open — Perfetto's embedded raw-timeline view completes its handshake but the actual visual render has never been confirmed with a screenshot.
- open — async task tracing and dedicated Process/Thread graph nodes (blocked on a schema decision for how to express "runs in process/thread").
- open — everything past this: multi-file/service tracing, non-Python targets, Intent Preservation Mode, semantic zoom to source-line/bytecode level, auth/hosting.