Architecture
Glimmer separates three concerns cleanly: the canonical versioned RO-KB file graph, the browser-first Workbench runtime, and verifiable external agent interfaces (MCP).
Core services
| Service | Module | Responsibility |
|---|---|---|
| Workbench Agent & Compute | _services/workbench_agent.py | Resumable SQLite (WAL) threads & working branches, zero-hallucination Local KB engine, AST + OS Seatbelt Python compute runner, SHA-256 auto-capture (glimmer_capture.py), and durable git-backed RO-KB materialization (.glimmer-workbench/kb-repo/). |
| Streamable-HTTP MCP Server | _services/mcp_server.py | Per-study JSON-RPC MCP endpoint exposing get_verified_findings, get_nulls_and_caveats, verify_provenance, and format_citation with live disk SHA-256 re-hashing and strict epistemic separation. |
| AEX / TAP LLM Router | _services/llm_router.py | Routes live LLM completions via AEX best-price clearing (X-AEX-Routing: best-price, X-AEX-Cache-Key) or user TAP enclave key references (X-AEX-Key-Ref), falling back cleanly to Local KB when unconfigured. |
| ORCID Claim & Credits Ledger | _services/orcid_claim.py | ISO 7064 ORCID validation, DOI authorship matching, and idempotent flat +$50 author verification compute grants. |
| Auth Gate & Site Proxy | _services/auth_gate.py, _services/explain_proxy.py | Session/RBAC enforcement for members-only assets and public hub catalog chat (scope: "site"). |
Durable branch-to-graph materialization
Compute / Lab / + Claim
-> stage commit in SQLite (status: staged)
-> Merge in Workbench UI
-> write kb-repo/<study>/<node-id>.md (status: merged)
-> git commit in kb-repo + compute 64-char SHA-256
-> live-injected into /explore/<study>/graph.json & /mcp/<org>/<study>Because verified study aggregates (verified-aggregates.json) are read-only inputs and merged Workbench nodes live in an isolated git repository (kb-repo/), researcher exploration can immediately update the live knowledge graph without ever mutating or contaminating verified study findings.
Multi-tenant study isolation
Each study carries its own project slug, graph manifest, study-aware Compute presets, working branches, and MCP endpoint. Merged nodes and threads are partitioned by project, ensuring zero cross-study bleed across ADS, CLAD, OpenfMRI Haxby, DataLad UCLA CNP, and SciQ.