4 adapters: PubMed, Semantic Scholar, Europe PMC, local fixture. Returns EvidenceCards with provenance + ClaimTriples.
Architecture — system layers and contracts.
The system layers and the contracts between them. How DiscoveryLab is composed end to end.
From any MCP agent to an approved lab job — then a governed improvement proposal.
Eight layers, five MCP servers, eighteen tools, three non-negotiable gates. Every box below is a file you can grep; every arrow is a typed call you can intercept; every gate is enforced in code, not policy. This is the same composite dispatcher peptiter-mcp-stdio binds to stdio, drawn out so you can see the whole system at once.
Claude Code · Anthropic SDK · any newline-JSON-RPC 2.0 client that can spawn a child process. No SaaS round-trip — the host launches the binary as a subprocess and writes one request per line on stdin.
MCPDispatcher routes by tool-name prefix. Every envelope audit-logged. tools/list-version pins the catalog SHA256; --concurrent N opts into a TaskGroup pool with an actor- serialized stdout writer so JSON lines never interleave.
Sub-dirs under --cache-dir: lean/, lab_loop/. peptiter-mcp-cache --evict surgically removes one entry; --prune-cache 7d evicts at startup.
Wraps LeanExternalVerifier. Hash-bound receipt with native_decide proofs + per-path attribution. cachedHash / noCache short-circuits.
V3LabLoopOrchestrator behind a typed surface. cachedFingerprint short-circuit. lab_loop/inspect re-reads cached Trace by fingerprint.
Recursive Discovery Loop proposals. Evaluate, verify, approve, promote, inspect, and rollback artifact changes without rewriting authority boundaries.
Local-model candidate emission. Outputs explicitly self-identify as candidate_unverified — must round-trip through lean/verify before anything downstream.
LiteratureCopilot (4 adapters) · EvidenceCard (Codable + provenance) · ClaimExtractor (typed predicate vocabulary) · EvidenceGraph + EvidenceGraphMechanismBridge.
LeanExternalVerifier · biology_v0 / v1 / v2 / v3 / v3_signed manifests · BiologyV0–V3.lean · PathwayLean.Core · lake build round-trip.
V3LabLoopOrchestrator · AssayPlanDrafter (vehicle / dose-span / plate / risk gates) · LabJobQueue (one-way state machine) · ActiveLearningEngine (Beta α,β).
RecursiveDiscoveryLoopPolicy · ImprovementProposal · ValidationPlan · ImprovementMCPServer · promotion receipts · rollback records.
PeptiterModelMCPServer · BiologySpec emitter · ClaimTriple extractor · MechanismCanvas drafter · ModelTrainingSourceInventory · DeepShitMacModelBundle wiring · BioFoundation scorecard imports.
Every model/* response carries verification.status = candidate_unverified and a caveats array reminding callers to round-trip through lean/verify. Generative breadth is allowed; formal narrowing is required. Nothing the local model emits crosses this line without a hash-bound Lean receipt.
The TensorLang DSL (semiring-einsum, threshold, fixpoint) compiles biology_v* artifacts down to a finite reasoning fragment. The same fragment is encoded in Lean (BiologyV0–V3) with native_decide proofs for every signed-sum and path-count theorem. semantic_hash binds the two — a Lean receipt is only valid against the manifest hash it was produced from. Per-path attribution flows back so reviewers see protective vs risk paths, not just the summed sign.
Drafter encodes safety as code: vehicle present, dose schedule spans 3 orders of magnitude, plate map has no double-assigned wells, risk screen returns no biosecurity / dual-use flags. Pass → .readyForReview. Fail → .rejected with the specific reason. A reviewer never sees an unsafe plan in the queue.
LabJob has a one-way state machine (drafted → approved → queued → running → returned → analyzed). The .approved transition can only fire from a human reviewer in the workbench. No L5+ autonomy is enabled in code — pre-approved experiment classes within budget + safety bounds are scoped for a future SCIENTIST.md milestone, gated on a hardened approval system.
CandidateBelief is a Beta(α, β) conjugate prior. Outcomes flip the next-experiment pick on every assay: positive bumps α, negative bumps β, inconclusive widens without bias. pickNextExperiment chooses the highest-posterior-variance candidate so the loop spends its budget where it learns the most. Trace is persisted via OnDiskCache so cold restarts answer lab_loop/inspect by fingerprint. Returned results, failed gates, and reviewer corrections can then enter improvement/propose.
ImprovementProposal artifacts can change ranking, retrieval, mechanism templates, assay selection, prompts, schemas, and eval harnesses. Proposals that touch safety gates, claim thresholds, wet-lab permissions, or verifier requirements are classified as forbidden and cannot be promoted by the loop.
The improvement server turns wet-lab outcomes, Lean failures, reviewer corrections, eval regressions, counterevidence, and agent self-critiques into auditable proposals. Every proposal names affected artifacts, expected gain, risk class, validation plan, rollback plan, and evidence. Promotion creates a receipt; failure creates a regression case.
PubMed E-utilities · Semantic Scholar Graph API · Europe PMC REST · Reactome (TSV) · Open Targets (Parquet) · BioFoundation provider scorecards. All optional — fail-loud rather than silently fall back to fixtures.
deterministic · TranscriptFormer · Geneformer · scVI · AIDO.Cell · Arc State · AlphaGenome · BioHub ESM contracts emit scorecards with calibration state before graph ingestion.
eval_harness regenerates eval_badge.svg + EVAL.md on every PR · sticky PR comment via marker · check_overlay_sync.py blocks BIOLOGY_OVERLAY drift · pathway-lean.yml runs lake build · regression tests gate merges and prevent previously failed improvement proposals from reappearing.
Box — a typed module (Swift type, MCP tool, or persisted artifact). Every label maps to a file you can grep.
Highlighted box — the single composite dispatcher that fan-outs every agent call.
Dashed gate — an audit or approval boundary the platform refuses to skip. Enforced in code, not in a policy memo.