Architecture

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

ServiceModuleResponsibility
Workbench Agent & Compute_services/workbench_agent.pyResumable 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.pyPer-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.pyRoutes 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.pyISO 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.pySession/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.