proef 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. proef/__init__.py +25 -0
  2. proef/acquisition.py +244 -0
  3. proef/ad.py +159 -0
  4. proef/adapters/__init__.py +0 -0
  5. proef/adapters/admet.py +196 -0
  6. proef/adapters/bio/__init__.py +0 -0
  7. proef/adapters/bio/rdkit_ops.py +52 -0
  8. proef/adapters/bio/safety_rules.json +146 -0
  9. proef/adapters/bio/seq_alerts.py +79 -0
  10. proef/adapters/bio/structure_score.py +85 -0
  11. proef/adapters/bio/tox_alerts.py +99 -0
  12. proef/adapters/data/__init__.py +0 -0
  13. proef/adapters/data/admet.py +62 -0
  14. proef/adapters/data/chembl.py +110 -0
  15. proef/adapters/data/frozen/admet/MANIFEST.json +48 -0
  16. proef/adapters/data/frozen/admet/bbb_martins/test.csv +407 -0
  17. proef/adapters/data/frozen/admet/bbb_martins/train_val.csv +1625 -0
  18. proef/adapters/data/frozen/admet/caco2_wang/test.csv +183 -0
  19. proef/adapters/data/frozen/admet/caco2_wang/train_val.csv +729 -0
  20. proef/adapters/data/frozen/admet/hia_hou/test.csv +118 -0
  21. proef/adapters/data/frozen/admet/hia_hou/train_val.csv +462 -0
  22. proef/adapters/data/moleculenet.py +60 -0
  23. proef/adapters/databases/__init__.py +0 -0
  24. proef/adapters/databases/chembl_gates.py +121 -0
  25. proef/adapters/databases/chembl_lookup.py +35 -0
  26. proef/adapters/databases/open_targets.py +102 -0
  27. proef/adapters/databases/pubmed.py +94 -0
  28. proef/adapters/devices/__init__.py +0 -0
  29. proef/adapters/devices/ezo_ph.py +251 -0
  30. proef/adapters/devices/hcs_microscope.py +143 -0
  31. proef/adapters/devices/lcms.py +123 -0
  32. proef/adapters/devices/scheduler.py +84 -0
  33. proef/adapters/devices/sila2.py +134 -0
  34. proef/adapters/genomics/alphagenome.py +146 -0
  35. proef/adapters/lab/__init__.py +0 -0
  36. proef/adapters/lab/bioprocess.py +32 -0
  37. proef/adapters/lab/devices.py +170 -0
  38. proef/adapters/lab/imaging.py +226 -0
  39. proef/adapters/lab/mhs_driver.py +124 -0
  40. proef/adapters/lab/opentrons.py +222 -0
  41. proef/adapters/lab/ot2_sim.py +174 -0
  42. proef/adapters/lab/plate_reader_share.py +108 -0
  43. proef/adapters/lab/protein_design.py +199 -0
  44. proef/adapters/lab/recording.py +119 -0
  45. proef/adapters/lab/replay.py +107 -0
  46. proef/adapters/lab/simulator.py +282 -0
  47. proef/adapters/lab/synthesis.py +92 -0
  48. proef/adapters/models/__init__.py +0 -0
  49. proef/adapters/models/anthropic_provider.py +157 -0
  50. proef/adapters/models/assayloop_ranker.py +67 -0
  51. proef/adapters/models/from_env.py +93 -0
  52. proef/adapters/models/gp_policy.py +93 -0
  53. proef/adapters/models/gp_policy_gp.py +36 -0
  54. proef/adapters/models/llm_policy.py +187 -0
  55. proef/adapters/models/openai_compat.py +150 -0
  56. proef/adapters/models/sklearn_policy.py +65 -0
  57. proef/adapters/retrosynthesis.py +247 -0
  58. proef/adapters/sandbox/__init__.py +20 -0
  59. proef/adapters/sandbox/agentenv.py +145 -0
  60. proef/adapters/sandbox/docker.py +217 -0
  61. proef/adapters/sandbox/local.py +164 -0
  62. proef/adapters/sandbox/opensandbox.py +122 -0
  63. proef/adapters/store/__init__.py +0 -0
  64. proef/adapters/store/sqlite.py +207 -0
  65. proef/adaptive.py +108 -0
  66. proef/advisory.py +76 -0
  67. proef/analysis_profiles/__init__.py +8 -0
  68. proef/analysis_profiles/measurements.py +266 -0
  69. proef/analysis_profiles/plate_assay.py +316 -0
  70. proef/analysis_report.py +195 -0
  71. proef/analysis_store.py +183 -0
  72. proef/anchor.py +154 -0
  73. proef/api/app.py +107 -0
  74. proef/api/launch.py +170 -0
  75. proef/api/v1/__init__.py +29 -0
  76. proef/api/v1/analyses.py +367 -0
  77. proef/api/v1/campaigns.py +802 -0
  78. proef/api/v1/deps.py +10 -0
  79. proef/api/v1/evals.py +16 -0
  80. proef/api/v1/evidence.py +132 -0
  81. proef/api/v1/governance.py +35 -0
  82. proef/api/v1/inbox.py +119 -0
  83. proef/api/v1/lab.py +110 -0
  84. proef/api/v1/pauses.py +77 -0
  85. proef/api/v1/programs.py +397 -0
  86. proef/api/v1/results.py +147 -0
  87. proef/api/v1/schemas.py +932 -0
  88. proef/api/v1/system.py +79 -0
  89. proef/api/v1/trees.py +216 -0
  90. proef/api/wizard_sessions.py +253 -0
  91. proef/approvals.py +102 -0
  92. proef/assays/__init__.py +15 -0
  93. proef/assays/dls.py +114 -0
  94. proef/assays/dsf.py +81 -0
  95. proef/assays/elisa.py +58 -0
  96. proef/assays/properties.py +65 -0
  97. proef/assays/simulate.py +157 -0
  98. proef/audit.py +152 -0
  99. proef/autoloop.py +1620 -0
  100. proef/benchmark.py +442 -0
  101. proef/campaign_fsm.py +151 -0
  102. proef/citations.py +141 -0
  103. proef/cli.py +1249 -0
  104. proef/connect.py +74 -0
  105. proef/core/__init__.py +0 -0
  106. proef/core/contracts/__init__.py +35 -0
  107. proef/core/contracts/analysis.py +100 -0
  108. proef/core/contracts/models.py +395 -0
  109. proef/core/device_card.py +125 -0
  110. proef/core/hypothesis.py +720 -0
  111. proef/core/interfaces.py +164 -0
  112. proef/core/registry.py +123 -0
  113. proef/core/safety.py +324 -0
  114. proef/core/workflow.py +159 -0
  115. proef/critic.py +62 -0
  116. proef/demo.py +164 -0
  117. proef/derivation.py +128 -0
  118. proef/diary.py +301 -0
  119. proef/eln.py +87 -0
  120. proef/evals/__init__.py +1 -0
  121. proef/evals/hallucination.py +86 -0
  122. proef/evals/harness.py +358 -0
  123. proef/evals/orchestration.py +254 -0
  124. proef/evals/tasks.py +1010 -0
  125. proef/evals/toolcalls.py +425 -0
  126. proef/experiment.py +172 -0
  127. proef/experiment_analysis.py +114 -0
  128. proef/experiments/__init__.py +0 -0
  129. proef/experiments/grounding_exp.py +689 -0
  130. proef/figures.py +218 -0
  131. proef/fitting.py +309 -0
  132. proef/fixtures.py +140 -0
  133. proef/flywheel.py +125 -0
  134. proef/followup.py +126 -0
  135. proef/governance.py +290 -0
  136. proef/groundedness.py +361 -0
  137. proef/grounding.py +202 -0
  138. proef/hypothesis_agent.py +369 -0
  139. proef/ingest.py +157 -0
  140. proef/instruments.json +173 -0
  141. proef/interpret.py +95 -0
  142. proef/kinetic.py +102 -0
  143. proef/labread/__init__.py +45 -0
  144. proef/labread/analysis.py +428 -0
  145. proef/labread/common.py +153 -0
  146. proef/labread/formats.py +190 -0
  147. proef/labread/layout.py +168 -0
  148. proef/labread/pubchem.py +179 -0
  149. proef/labselect.py +431 -0
  150. proef/materials.py +140 -0
  151. proef/mcp_instrument.py +396 -0
  152. proef/mcp_server.py +283 -0
  153. proef/modality.py +111 -0
  154. proef/model_guard.py +245 -0
  155. proef/output_blocks.py +183 -0
  156. proef/paths.py +32 -0
  157. proef/physfail.py +55 -0
  158. proef/plan.py +160 -0
  159. proef/plots.py +123 -0
  160. proef/predictors.py +217 -0
  161. proef/probes.py +79 -0
  162. proef/problem_tree.py +581 -0
  163. proef/program.py +308 -0
  164. proef/protocol_design.py +42 -0
  165. proef/proxy.py +78 -0
  166. proef/readiness.py +259 -0
  167. proef/reliability.py +49 -0
  168. proef/report.py +117 -0
  169. proef/reproduce.py +310 -0
  170. proef/reviewer.py +254 -0
  171. proef/sandbox_session.py +247 -0
  172. proef/sandboxd.py +109 -0
  173. proef/scaffold.py +195 -0
  174. proef/series.py +327 -0
  175. proef/skills.py +203 -0
  176. proef/sweep.py +83 -0
  177. proef/taste.py +177 -0
  178. proef/templates/confirmatory-followup.json +34 -0
  179. proef/templates/dose-response-screen.json +39 -0
  180. proef/templates/sar-exploration.json +38 -0
  181. proef/templates.py +124 -0
  182. proef/toolkit.py +433 -0
  183. proef/toolloop.py +133 -0
  184. proef/tools.py +441 -0
  185. proef/tpp.py +185 -0
  186. proef/views/__init__.py +14 -0
  187. proef/views/counts.py +102 -0
  188. proef/views/experiment.py +154 -0
  189. proef/views/ids.py +49 -0
  190. proef/views/narrative.py +294 -0
  191. proef/views/pipeline.py +370 -0
  192. proef/vision.py +165 -0
  193. proef/watch.py +790 -0
  194. proef/wizard_chain.py +25 -0
  195. proef/wizard_store.py +373 -0
  196. proef-0.2.0.dist-info/METADATA +662 -0
  197. proef-0.2.0.dist-info/RECORD +200 -0
  198. proef-0.2.0.dist-info/WHEEL +4 -0
  199. proef-0.2.0.dist-info/entry_points.txt +14 -0
  200. proef-0.2.0.dist-info/licenses/LICENSE +202 -0
@@ -0,0 +1,662 @@
1
+ Metadata-Version: 2.5
2
+ Name: proef
3
+ Version: 0.2.0
4
+ Summary: Framework for agentic drug discovery — pluggable models, bio tools, labs, and sandboxes behind five core interfaces.
5
+ License: Apache-2.0
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: pydantic>=2.5
9
+ Provides-Extra: api
10
+ Requires-Dist: fastapi>=0.115; extra == 'api'
11
+ Requires-Dist: httpx>=0.27; extra == 'api'
12
+ Requires-Dist: python-multipart>=0.0.9; extra == 'api'
13
+ Requires-Dist: uvicorn>=0.30; extra == 'api'
14
+ Provides-Extra: bio-rdkit
15
+ Requires-Dist: rdkit>=2023.9; extra == 'bio-rdkit'
16
+ Provides-Extra: dev
17
+ Requires-Dist: pytest-xdist>=3; extra == 'dev'
18
+ Requires-Dist: pytest>=8; extra == 'dev'
19
+ Provides-Extra: lab-imaging
20
+ Requires-Dist: numpy>=1.24; extra == 'lab-imaging'
21
+ Provides-Extra: lab-xlsx
22
+ Requires-Dist: openpyxl>=3.1; extra == 'lab-xlsx'
23
+ Provides-Extra: mcp-instruments
24
+ Requires-Dist: labmcp>=0.1; extra == 'mcp-instruments'
25
+ Provides-Extra: models-botorch
26
+ Requires-Dist: botorch>=0.13; extra == 'models-botorch'
27
+ Requires-Dist: gpytorch>=1.12; extra == 'models-botorch'
28
+ Requires-Dist: torch>=2.2; extra == 'models-botorch'
29
+ Provides-Extra: models-openai
30
+ Requires-Dist: httpx>=0.27; extra == 'models-openai'
31
+ Provides-Extra: sandbox-agentenv
32
+ Provides-Extra: sandbox-opensandbox
33
+ Requires-Dist: opensandbox>=0.1; extra == 'sandbox-opensandbox'
34
+ Provides-Extra: store-postgres
35
+ Requires-Dist: psycopg[binary]>=3; extra == 'store-postgres'
36
+ Description-Content-Type: text/markdown
37
+
38
+ <p align="center">
39
+ <img src="assets/logo/proef-banner.png" alt="Proef: agentic science framework" width="640">
40
+ </p>
41
+
42
+ <h1 align="center">Proef</h1>
43
+ <p align="center"><b>Agents propose, run and review. A scientist decides. The record proves it.</b></p>
44
+
45
+ [![ci](https://github.com/rbalachandar/proef/actions/workflows/ci.yml/badge.svg)](https://github.com/rbalachandar/proef/actions/workflows/ci.yml)
46
+ [![PyPI](https://img.shields.io/pypi/v/proef)](https://pypi.org/project/proef/)
47
+ [![Python](https://img.shields.io/pypi/pyversions/proef)](https://pypi.org/project/proef/)
48
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
49
+
50
+ Proef is an open-source framework where AI agents propose hypotheses, run experiments and judge the results against criteria
51
+ fixed before the experiment ran. Every claim carries its uncertainty, every decision is on a tamper-evident record, and a person
52
+ stays in control of what reaches the lab.
53
+
54
+ ![Proef workbench demo](assets/demo/proef-ui-demo.gif)
55
+
56
+ *The workbench: review what the agents did, see why a candidate abstained, run a plate by hand and have it judged against the
57
+ gate registered beforehand, and verify the ledger.*
58
+
59
+ ![proef demo](assets/demo/proef-demo.gif)
60
+
61
+ *The same engine from the terminal: `proef demo` runs the abstain-and-refute cascade.* All numbers in both recordings are
62
+ simulated. To try the plate step, drop [`assets/demo/demo-plate.csv`](assets/demo/demo-plate.csv) into **Analyze**.
63
+
64
+ ## What is Proef
65
+
66
+ Given a research problem and its constraints, agents propose a portfolio of hypotheses, select the ones worth testing, design
67
+ experiments, execute them on simulated or real laboratory equipment, observe the results as they arrive, and deliver verdicts
68
+ against criteria that were registered before the experiment ran. A scientist can use it manually, step by step, as a daily
69
+ analysis tool, and hand stages of the loop to an agent as trust grows.
70
+
71
+ Proef is built on three principles:
72
+
73
+ - **Safety enforcement.** The only path from an agent to a lab is the
74
+ gateway: every submission passes a policy engine the agent
75
+ cannot modify or approve itself, and budgets cap what a campaign may
76
+ consume. When experiments declare structures, those are screened against
77
+ versioned toxicophore rules, so a declared covalent warhead can pass while
78
+ an undeclared one does not. Campaigns that name a regulated pathogen or
79
+ toxin are refused, and the refusal is recorded.
80
+ - **Tiered trust.** Deterministic rules hold the floor. A model may add a
81
+ flag or demand a human review, but it can never clear a refusal. Humans
82
+ settle the edge cases, and it is their judgment, not the model's
83
+ confidence, that writes new rules. Citations are checked against PubMed: a
84
+ hypothesis that cites a fake paper ranks below one that cites nothing.
85
+ - **Everything auditable.** The problem, the hypotheses, every decision,
86
+ submission, result and verdict go into a hash-chained provenance store.
87
+ One command renders the whole story as a report. Another seals it with a
88
+ checksum that can be published outside the system's control, so anyone can check
89
+ that the record has not been edited.
90
+
91
+ A campaign also chooses **which experiments to run**: each round's batch can
92
+ be selected by a deterministic, applicability-domain-gated **Bayesian
93
+ expected-improvement** acquisition (with an optional BoTorch/GP posterior),
94
+ scored against naive baselines in CI and sealed to provenance with its
95
+ reasoning.
96
+
97
+ **Contents:** [What is Proef](#what-is-proef) · [How it works](#how-it-works-at-a-glance) · [Installation](#installation) · [CLI](#cli) ·
98
+ [Evals](#evaluation-suite) ·
99
+ [Case studies](#case-studies) ·
100
+ [Using Proef](#using-proef) · [The virtual lab](#the-virtual-lab) ·
101
+ [Five core interfaces](#five-core-interfaces) · [Agent Skills and MCP](#agent-skills-and-mcp) ·
102
+ [Architecture](#architecture) · [Documentation](#documentation) ·
103
+ [Architectural principles](#architectural-principles) · [References](#references--sources)
104
+
105
+ ## How it works at a glance
106
+
107
+ One campaign, from question to verdict. The rule to read this table by: **models propose and advise; code decides and enforces; a
108
+ person approves what reaches the lab.** A model never writes a verdict, never approves its own submission and never moves a gate.
109
+
110
+ | Stage | What happens | Who acts | What it uses |
111
+ |---|---|---|---|
112
+ | **1. Read the field** *(opt-in)* | Before proposing, a model looks up what is already known: literature, target biology, published activities. A second pass can look for evidence for and against each hypothesis family, and every item must trace to something actually retrieved | **Model**, in a loop that is offered only read-only knowledge tools | PubMed, ChEMBL, Open Targets. Queries are checked so nothing identifying the study leaves the machine, and every result is sealed so a replay never touches the network |
113
+ | **2. Propose** | A portfolio of mechanistic, falsifiable hypotheses, each with a refuted-if clause and a predicted outcome. Citations are checked against PubMed | **Model** (one prompt) | Any OpenAI-compatible or Anthropic model; Agent Skills for domain procedure; the flywheel's memory of ruled-out families |
114
+ | **3. Prior predictions** | Optional specialist-model numbers (ADMET, properties) attached to a hypothesis, with their uncertainty and applicability domain. They are priors, never evidence | **Registered prediction tools**, named in a proposal or (opt-in) called by the model while it reads the field | RDKit, local ADMET models, a rule-based synthesis check |
115
+ | **4. Select** | Rank, apply a diversity cap, and optionally choose the batch by applicability-domain-gated Bayesian expected improvement | **Engine** | Deterministic scoring, optional BoTorch/GP |
116
+ | **5. Plan review** | A person sees the plan, the critic model's concerns and the warnings (duplicates, already tested, citations that were not retrieved), removes hypotheses and approves or declines | **A person**, advised by a critic model | The workbench or the CLI |
117
+ | **6. Check, then submit** | Readiness review, safety screening (toxicophores, regulated agents, biosafety level), governance (halt, pause, authorization, budget) | **Engine** and policy code the agent cannot reach | `SafetyEngine`, `HaltSwitch`, budgets |
118
+ | **7. Run** | The assay runs and raw evidence comes back | **Lab adapter** | The simulator, Opentrons, a plate-reader share, or your own `LabAdapter` |
119
+ | **8. Analyze and judge** | A dose-response fit with a confidence interval, quality control, then a verdict against criteria registered **before** the experiment: validated, invalidated, or **abstain** when the interval straddles the gate | **Engine** (deterministic rule) | `labread`, small-n statistics; an orthogonal assay confirms before a result counts as confirmed |
120
+ | **9. Decide what next** | After a round: follow up an abstention, re-plan from the results, run the next round or stop. A model can steer this, always within a list of actions the engine allows | **Model** (opt-in) or the fixed order, validated by the engine; a person decides accept and drop | The same knowledge tools can be read here, once per round |
121
+ | **10. Record and audit** | Every decision, call, result and verdict goes on a hash-chained ledger. A campaign can be replayed from it with no model and no network, and an audit checks its rules over the record | **Provenance store** | SQLite with engine triggers, Merkle anchoring, `proef prove`, `proef audit`, `proef campaign reproduce` |
122
+
123
+ Models are swappable (`PROEF_LLM_PRESET`, `PROEF_LLM_MODEL`); so are labs, sandboxes and tools, behind five small interfaces
124
+ ([below](#five-core-interfaces)). Stages 1 and 9 reading outside knowledge are off by default and set in the campaign
125
+ configuration. For the same flow with the enforcement column, see
126
+ [How a campaign runs](#how-a-campaign-runs-who-acts-and-what-proef-enforces).
127
+
128
+ ## Installation
129
+
130
+ ```sh
131
+ pip install proef # core (pydantic only) + the `proef` CLI
132
+ pip install "proef[api]" # + the REST API (FastAPI). The web workbench UI is
133
+ # not in the wheel yet: run it from a checkout (`make run`)
134
+ pip install "proef[dev]" # + test dependencies
135
+ ```
136
+
137
+ Optional extras: `[api]` (workbench) · `[bio-rdkit]` · `[lab-xlsx]` (read
138
+ `.xlsx` exports) · `[lab-imaging]` · `[models-openai]` · `[models-botorch]`
139
+ (GP posterior for acquisition) · `[mcp-instruments]` · `[sandbox-agentenv]` ·
140
+ `[sandbox-opensandbox]`.
141
+
142
+ From a checkout (this README tracks `main`; the published package may lag it):
143
+
144
+ ```sh
145
+ make install # python package + web deps into ./.venv
146
+ make test # the offline test suite
147
+ make run # workbench on :8000 (API + built SPA)
148
+ ```
149
+
150
+ ## CLI
151
+
152
+ Every capability is a `proef` command; the same functionality is available as a
153
+ Python API (see [Using Proef](#using-proef)).
154
+
155
+ ```sh
156
+ # first run
157
+ proef demo # abstains on a borderline CI and refutes a
158
+ # planted false hit (real machinery,
159
+ # simulated numbers)
160
+
161
+ # analyze data
162
+ proef read results.csv --csv out.csv # auto-analyze an instrument export
163
+ proef read plate.csv --layout map.csv \
164
+ --normalize pct_inhibition # join a plate map; %INH vs the plate's
165
+ # own blank + full-inhibition controls
166
+ proef ingest legacy-eln.csv # institutional memory: pre-Proef kills
167
+ # enter ALREADY RULED OUT + family priors
168
+ proef connect scan <share> # detect instruments writing into a folder
169
+ proef connect describe <device> # interview the operator into an agent-readable device card
170
+ proef watch <outbox> # agent notices device outputs as they land
171
+
172
+ # run campaigns
173
+ proef templates # campaign presets, no JSON needed
174
+ proef campaign auto --template dose-response-screen --field compounds=C1,C2,C3
175
+ proef campaign auto campaign.json --dose-design adaptive # Bayesian sequential dosing
176
+ # (typically 3 wells, not 4)
177
+ proef campaign auto examples/campaign.json --acquisition bo-ei --dry-run
178
+ # EI batch selection: shows the next batch +
179
+ # every refusal (AD vetoes, diversity,
180
+ # budget), submits nothing
181
+ proef campaign select campaign.json # the same what-would-run preview from a
182
+ # config; no state written
183
+ proef campaign plan --objective "potent AND selective AND soluble" \
184
+ --model anthropic --run-budget 20 # decompose into a guarded problem tree
185
+ proef campaign run examples/workflow.yml # tournament + assay on the configured lab
186
+ proef campaign reproduce <branch> # replay a recorded experiment, diff verdicts
187
+ make run # the web workbench on :8000 (API + SPA)
188
+
189
+ # audit and govern
190
+ proef diary <branch> # campaign as a lab-notebook narrative
191
+ proef prove <branch> --html out.html # tamper-evident provenance + shareable report
192
+ proef prove <branch> --eln out.csv # ELN-ready export (Benchling/SISSYO-friendly)
193
+ proef anchor [--publish-cmd CMD] # Merkle-root the store; PUBLISH the root
194
+ # (an unpublished anchor protects nothing)
195
+ proef anchor --verify # does the store still match the anchored root?
196
+ proef halt --engage --reason "spill" # operator stop-condition outside the agent's reach
197
+ proef halt --clear # only a human clears it
198
+ proef sop list # agent-proposed recurring procedures pending sign-off
199
+ proef sop approve <sop-id> --by "lab lead" # sign-off turns a procedure into standing policy
200
+ proef why char-ridge train.csv CCCCCO # attribution panel: per-prediction drivers,
201
+ # caveats + applicability domain
202
+
203
+ # measure and extend
204
+ proef eval --all # scored task suite + leaderboard
205
+ proef eval --suite epistemics,models # run tiers separately
206
+ proef fixtures verify <study-dir> # byte-reproducible case-study data
207
+ proef mcp # MCP server: drive Proef from Claude/Cursor (PROEF_MCP_GATE="ic50_um<=20" allows hypotheses, PROEF_MCP_APPROVED="A,B" allows runs)
208
+ proef new-adapter lab my_robot # scaffold a tested LabAdapter
209
+ proef skills list # discovered Agent Skills (theirs and ours)
210
+ ```
211
+
212
+ ## Case studies
213
+
214
+ Eight studies run the flow on real data. Some results are negative, and they
215
+ are reported as such. Each study's README has the setup, full results and
216
+ limitations.
217
+
218
+ | Study | What it tests | Result |
219
+ |---|---|---|
220
+ | [01](case-studies/01-egfr-blind-reproduction/) · Tyrphostins (1989) | Blind reproduction of a classic paper | **Illustrative only:** the model had already seen the paper. |
221
+ | [02](case-studies/02-az3246-hpk1/) · AZ3246 HPK1 (2025) | Blind hypothesis and potency ranking on a post-cutoff paper | Found the paper's core from structures alone. Ranking is above chance (ρ ≈ +0.5 over 5 runs) but **not significantly better than simple baselines** at n = 21. |
222
+ | [03](case-studies/03-multi-paper/) · Four ChEMBL papers | Does the full flow run on real data? | Chemotype identified 4/4; flow and audit trail intact; **no enrichment claim survives correction**. |
223
+ | [04](case-studies/04-prospective-hit2lead/) · EGFR hit-to-lead | A prospective loop on replayed real data, seven successor drugs hidden | 5 hits (all true), 5 refutations (all true), 2 honest abstentions. |
224
+ | [05](case-studies/05-paper-pilot/) · SARS-CoV 3CLpro screen (2013) | Reproduce a published screening cascade from raw tables | 98.9% agreement on decided calls, 0 false actives, 14 abstentions. |
225
+ | [06](case-studies/06-ncats-deposit/) · NCATS qHTS | Re-analyze a modern deposited screen | **Negative:** our rules don't port to self-normalized data (ρ = 0.107), which led to refusing them. |
226
+ | [07](case-studies/07-proteinbase/) · Proteinbase | Reproduce a protein-design dataset | Hit rates reproduced. Computed confidence picks *worse* than random. A miscalibrated applicability-domain floor was fixed. |
227
+ | [08](case-studies/08-proteinbase-entry/) · PD-L1 binder designs | Does a score separate designs from controls? | Separates the groups (AUC 0.80) but **doesn't rank sequences**: use it as a gate, not a ranking. |
228
+
229
+ ## Evaluation suite
230
+
231
+ `proef eval` runs scored tasks against seeded ground truth, deterministic,
232
+ offline, and run in CI. A score below 1.0 is kept as reported: an honest
233
+ abstention is graded down, not counted as a pass. The latest full run is 25
234
+ tasks, mean 0.947, all passing ([`evals/leaderboard.md`](evals/leaderboard.md));
235
+ CI fails if any score drops below the pass bar.
236
+
237
+ | Tier | Covers | Examples |
238
+ |---|---|---|
239
+ | **epistemics** (15) | reasoning under uncertainty | hit recovery vs truth · verdict honesty (abstain where the CI straddles the gate) · confirmation coverage · falsifiability · adaptive dosing · EI acquisition (must honour the applicability-domain gate) · flywheel memory |
240
+ | **models** (6) | baseline model quality | Lipophilicity, ESOL, HIV, Caco2, HIA, BBB on scaffold folds, frozen in-repo, against a random floor |
241
+ | **reproductions** (2) | published-paper reruns | frozen data fixtures |
242
+ | **agent** (2, opt-in) | end-to-end triage | workflows with one verifiable answer, exact refusal map, no refused compound tested, no wrong confirm, byte-exact reruns; graded deterministically, no LLM judge (`proef eval --suite agent`) |
243
+
244
+ ```
245
+ epistemics, mean 0.969 · 15/15 tasks pass
246
+ hit-recovery 0.833 honest abstains credited 0.5, not 1.0
247
+ acquisition-policy 0.875 EI batch beats gates+randomize on every pool
248
+ adaptive-dose 0.875 3 wells beat 4: a genuine negative result
249
+ verdict-honesty 1.000 must abstain where the CI straddles the gate
250
+ ```
251
+
252
+ The suite has caught real bugs: an observed-max fit bias, confirmation labels
253
+ that overrode the gate, and a Make step that ran before the safety screen.
254
+ Each one is now a permanent regression test. `GET /api/v1/evals` serves the scores
255
+ and flags every passing task below 1.0 as an `honest_deduction`; the workbench
256
+ header shows the live `graded 0.947 · 25 tasks, all pass` badge.
257
+
258
+ ### Trust mechanisms
259
+
260
+ These are modality-agnostic: the loop, the gates and the record work the same
261
+ for a kinase IC50, a plate-reader export or a protein binder's predicted
262
+ confidence. The full table (two dozen rows) is in
263
+ [docs/safety-and-security.md](docs/safety-and-security.md).
264
+
265
+ | Mechanism | What it guarantees |
266
+ |---|---|
267
+ | Uncertainty vetoes certainty | a 95% CI straddling the gate abstains, on any metric |
268
+ | Pre-registered claims | every hypothesis records its predicted and **refuted-if** clauses before data arrives |
269
+ | Molecular safety gate | 18 curated toxicophore rules (versioned); hard classes always refuse; electrophilic warheads pass only with declared covalent intent |
270
+ | Execution governance | enforced in gateway code, outside the agent: an operator halt it cannot lift (`proef halt`), an autonomous / human-approved / never authorization matrix, SOP sign-off for anything recurring |
271
+ | Provenance physics | the hash chain is engine-enforced and recomputed on read; verdict reading is payload-driven, recency-wins |
272
+ | Physical-fault honesty | saturated plates, dark reads and device errors are flagged for inspection, never retried blindly or turned into verdicts |
273
+ | Input trust boundary | junk or adversarial instrument files degrade to "unreadable, no verdicts changed"; injection-shaped sample names cannot reach the gate as instructions |
274
+
275
+ ## Using Proef
276
+
277
+ Proef supports two working styles on the same engine: use it by hand as a
278
+ daily analysis tool, or hand stages of the loop to an agent as trust grows. The
279
+ loop is **modality-agnostic**: the program defines the objective in its own
280
+ terms (any metric, unit, direction), Make words production per modality,
281
+ adapters supply the assay, and Analyze reads the registered metric against its
282
+ gate.
283
+
284
+ ### Analyze an instrument export
285
+
286
+ `proef read` auto-detects long CSV/TSV/XLSX tables, plate grids, kinetic tables
287
+ (Tecan, BioTek) and `.npy` images. IC50 fits carry confidence intervals; Z′ is
288
+ computed only when the plate has both control classes (otherwise it is reported
289
+ as the `Z'~` heuristic); reader, serial and date are kept for provenance.
290
+
291
+ ```sh
292
+ proef campaign auto examples/campaign.json # a campaign drops an export per run
293
+ proef read .data/inbox/<problem-id>/sim-42-001.csv
294
+ # plate: sim-42-001.csv [long] | wells: 14 | controls: 2 | Z'~ 0.959 (control-spread heuristic)
295
+ # compound IC50 (uM) points note
296
+ # C-103 5.30 12 observed-max
297
+
298
+ proef read tests/data/instruments/biotek_1steptimer.csv
299
+ # plate: biotek_1steptimer.csv [kinetic] | wells: 1536 | ... | reader: Synergy HTX (2206293D)
300
+ # (a bare grid: no compound identity, no concentration series, reported as such)
301
+
302
+ proef read tests/data/instruments/tecan_ON1.csv --layout tests/data/instruments/plate_layout_96.csv
303
+ # plate: tecan_ON1.csv [kinetic] | wells: 192 | ... | edge-effect -0.0 (OD600:600)
304
+ # joins well -> sample/concentration from the plate map, fits what it can
305
+
306
+ proef read tests/data/instruments/tecan_ON1.csv --normalize pct_inhibition
307
+ # proef: error: cannot normalize to %inhibition: need >=2 blank AND >=2
308
+ # full-inhibition control wells, raw values kept
309
+ # (the refusal path: this plate has no control-class wells)
310
+ ```
311
+
312
+ `--layout` joins a plate map to exports that carry no compound identity;
313
+ `--normalize pct_inhibition` rescales against the plate's own controls and
314
+ refuses when those are missing. Three genuine vendor exports ship in
315
+ `tests/data/instruments/` to try the parser on real output first.
316
+
317
+ ```python
318
+ from proef.labread import read_plate
319
+ r = read_plate("my_results.csv") # long/grid/xlsx/imaging evidence
320
+ print(r) # IC50 table + Z', no configuration
321
+ svg = r.curve_svg("C-101") # fitted dose–response curve
322
+ ```
323
+
324
+ ![Dose–response curve](docs/images/dose-response.svg)
325
+
326
+ ### Try the virtual lab
327
+
328
+ ```sh
329
+ proef demo # guided first run: abstains on a borderline CI, refutes a planted false hit
330
+ python examples/demo_full_flow.py # one round, end to end: tournament → safety gate → virtual lab → analysis → provenance
331
+ ```
332
+
333
+ ### Hand the full campaign to the agent
334
+
335
+ ```sh
336
+ proef templates # list presets
337
+ proef campaign auto --template dose-response-screen --field compounds=C1,C2,C3
338
+ proef campaign auto campaign.json # or a custom config
339
+ ```
340
+
341
+ <details><summary>campaign.json, an example problem statement</summary>
342
+
343
+ ```json
344
+ {
345
+ "problem": {
346
+ "objective": "Find a confirmed sub-20uM KRAS_G12C binder",
347
+ "constraints": [
348
+ {"name": "potency", "description": "IC50 <= 20 uM", "kind": "hard",
349
+ "limit": 20.0, "unit": "uM"}
350
+ ],
351
+ "success_metric": "orthogonal confirmation"
352
+ },
353
+ "hypotheses": [
354
+ {"statement": "C-101 binds with IC50 <= 20 uM", "candidate": "C-101",
355
+ "assay_type": "binding", "predicted": "IC50 <= 20",
356
+ "predicted_value": 20.0, "rationale": "covalent warhead precedent"}
357
+ ],
358
+ "autonomy": "act"
359
+ }
360
+ ```
361
+ </details>
362
+
363
+ ```
364
+ [22:31:41] lab: 'proef-virtual-lab-0' selected from a pool of 1 (simulated=True); decision sealed
365
+ [22:31:41] round 1: testing ['C-103', 'C-101'] (1 candidates remain)
366
+ [22:31:41] started lab run sim-42-001 for C-103 on simulator (4 doses × 3 replicates)
367
+ [22:31:42] [agent] reading instrument output sim-42-001.csv (device finished the measurement)
368
+ [22:31:42] [agent] hypothesis hyp-92fa273f (C-103): VALIDATED (preliminary, pending orthogonal confirmation), IC50 5.296 uM (95% CI 3.382–6.541) vs threshold 20.0
369
+ [22:31:42] [agent] sending orthogonal confirmation assay for C-103 (safety-approved) -> run sim-42-003
370
+ [22:31:44] [agent] orthogonal confirmation for C-103: primary 5.30 vs secondary 6.37 µM (ratio 1.2x, rule ci-overlap) -> CONFIRMED
371
+ [22:31:44] reviewer: no findings, analysis consistent
372
+ [22:31:44] CAMPAIGN COMPLETE prob-fe6dcecd: C-103=confirmed, C-101=confirmed
373
+ {"problem": "prob-fe6dcecd", "selected": ["C-103", "C-101"],
374
+ "verdicts": {"C-103": "confirmed", "C-101": "confirmed"}}
375
+ ```
376
+
377
+ Abridged output of `proef campaign auto examples/campaign.json`; the simulator is seeded, so reruns reproduce these numbers.
378
+
379
+ ### Let the agent watch the instruments
380
+
381
+ With `proef watch` on an instrument outbox, no files get shuttled: when a reader
382
+ exports a result the agent reads it, updates open hypotheses against their
383
+ pre-registered criteria, and recommends the next step. `proef connect scan` finds
384
+ which instrument writes into a folder.
385
+
386
+ ```sh
387
+ proef connect scan tests/data/instruments
388
+ # scanned 6 files in tests/data/instruments
389
+ # kinetic x3 e.g. biotek_1steptimer.csv
390
+ # grid x1 e.g. plate_layout_96.csv
391
+ # xlsx x1 e.g. tecan_ON1.xlsx
392
+ # → device: plate reader (auto-exporting to this share)
393
+ ```
394
+
395
+ ### Declare the instrument fence
396
+
397
+ The program creator declares a **pool of permitted instruments** (`labs:` in the
398
+ campaign config, by id from `proef/instruments.json` or as inline
399
+ adapter/MCP entries). The matcher then picks **within** that pool from each
400
+ experiment's declared needs (assay types, readouts, BSL ceiling), preferring
401
+ hardware-validated over simulated. Under gate autonomy a real choice between
402
+ instruments is confirmed by a human. The choice, and why each other instrument
403
+ was declined, is sealed into the branch before anything runs; with no capable
404
+ instrument the campaign refuses rather than falling back to simulation
405
+ (`proef.labselect`).
406
+
407
+ ### Configure agent authority and limits
408
+
409
+ | autonomy | agent behavior |
410
+ |---|---|
411
+ | `observe` | reads, fits, recommends, submits nothing |
412
+ | `gate` | proposes everything and waits for an Approve click: the plan (model-proposed hypotheses) or each lab submission (a hand-written candidate list) |
413
+ | `act` | autonomous within the SafetyEngine, including confirmation assays |
414
+
415
+ - **Round breadth** is schedulable: `"k": [4, 2, 1]` screens wide first, then narrows as the flywheel discounts failed families.
416
+ - **Verdicts are uncertainty-aware:** a fitted IC50 whose 95% CI straddles the threshold is `inconclusive`. An orthogonal confirmation verifies the *direction* of the preliminary verdict: agreement confirms hits and refutes non-hits; disagreement on a claimed hit refutes it.
417
+ - **Adaptive dosing** (`--dose-design adaptive`) lets a Bayesian posterior pick each next concentration (3 adaptive wells beat a fixed 4-point series in `proef eval`).
418
+ - **A `ResourceBudget`** (lab runs, hypotheses, confirmations, wall clock) is enforced at submission and generation time. `proef prove <problem-id> --html report.html` renders the whole chain as a shareable audit.
419
+
420
+ ### Start research: a model proposes, a person approves
421
+
422
+ The model proposes families of hypotheses, each with a mechanism, the
423
+ observation that would refute it, its own confidence, a citation check and a designed dose ladder. A second model critiques the
424
+ plan. A person removes hypotheses, approves, or declines.
425
+
426
+ ![Plan review](assets/screenshots/plan-review.png)
427
+
428
+ **The finished campaign: what the model wrote, what was removed, what the rule decided.** One variant was removed from the plan and
429
+ never tested. The rest ran against the gate registered beforehand: one validated, one abstained (the interval crosses the gate, so
430
+ no claim, and the decision is queued for a person), one refuted.
431
+
432
+ ![Research result](assets/screenshots/research-result.png)
433
+
434
+ *A real run (`gpt-6-luna`) against the **simulated** lab. The simulator does not model the proposed chemistry, so the
435
+ outcomes say nothing about real EGFR inhibitors; the example shows the flow and the record, not a scientific result.*
436
+
437
+ A campaign runs one of three ways, chosen in the **New campaign** dialog. The loop is the same code in each. What differs is who proposes the hypotheses and who runs the plate.
438
+
439
+ | | **Start research** | **Candidate list** | **Manual plate run** |
440
+ |---|---|---|---|
441
+ | Hypotheses come from | a language model | a candidate list | a candidate list |
442
+ | Plan review | yes, in "Ask me first" mode | not needed: the list is the plan | not needed |
443
+ | Who runs the experiment | the agent (simulated lab or instruments) | the agent | a person: submits the CSV |
444
+ | Needs | a configured model | nothing: no key, works offline | nothing |
445
+ | Replay | `proef campaign reproduce` replays the plan that was approved, in the same batches and order; the model is not re-asked, so a *fresh* run may propose different hypotheses | `proef campaign reproduce` replays it exactly | n/a |
446
+
447
+ **The model never decides a verdict**: its hypotheses are judged by the same fixed rule, against criteria registered before
448
+ any data. What the model designs is the hypotheses and the assay type; the protocol (doses, replicates, controls) is code.
449
+ "Approvals" is a separate setting: *Ask me first*, *Preview only*, or *Run on its own within the safety gate*.
450
+ Start research works with any of three provider styles, selected from the environment:
451
+
452
+ | `PROEF_LLM_API` | Endpoint | Typical use |
453
+ |---|---|---|
454
+ | `anthropic` (default) | Messages API | Anthropic |
455
+ | `openai` | `/chat/completions` | OpenRouter, vLLM, Ollama (no key needed locally), most gateways |
456
+ | `openai-responses` | `/responses` | GPT-family models on gateways that serve them this way |
457
+
458
+ ```sh
459
+ export PROEF_LLM_MODEL=<model> PROEF_LLM_TOKEN=<key> # Anthropic
460
+ export PROEF_LLM_PRESET=opencode-go PROEF_LLM_MODEL=gpt-6-luna # OpenCode Go: key read from OPENCODE_API_KEY
461
+ proef campaign auto examples/campaign_llm.json --yes # no candidates: the model proposes them
462
+ ```
463
+
464
+ There is no offline stub: with no model configured, a candidate-less launch is refused with a clear message.
465
+ Full configuration, presets, what is recorded, and troubleshooting: [`docs/MODELS.md`](docs/MODELS.md).
466
+
467
+ Also: `proef diary <branch>` writes the record as a static lab-notebook HTML file, and `proef read --csv out.csv` writes standardized results for Excel/GraphPad.
468
+
469
+ ### Programs, experiments and readiness
470
+
471
+ The decision layer is made of first-class objects:
472
+
473
+ - **Target Product Profile**: the program defines winning in its own terms (objective, metric, unit, direction, gate); small-molecule programs can add phased criteria (hit → lead → candidate → clinical) in `proef.tpp`.
474
+ - **Experiment Definition**: the full manifest, covering intervention, biological system, readout capabilities, denominators, expected intermediates.
475
+ - **Readiness Review**: runs *before* the safety gate and can block an experiment that would be unsafe to *interpret* (missing denominator, mimetic vs authentic modification, unmeasured delivery variance).
476
+ - **Program hierarchy**: Program ▸ Problem ▸ Hypothesis ▸ Experiment, with the gate inherited downward.
477
+ - **Flywheel**: every verdict is remembered, so failing mechanistic families are discounted later and the hypothesis agent is shown what the lab already ruled out.
478
+
479
+ External database adapters: ChEMBL, Open Targets, PubMed. Benchmark datasets: MoleculeNet, TDC, DOCKSTRING ([`docs/benchmarks.md`](docs/benchmarks.md)).
480
+
481
+ ### How a campaign runs: who acts, and what Proef enforces
482
+
483
+ When `proef campaign auto` runs, this is what happens to one compound, step by
484
+ step, and which layer is responsible at each point:
485
+
486
+ | Step | Who acts | What happens | What Proef enforces |
487
+ |---|---|---|---|
488
+ | 1. Problem setup | **Problem definition** | Decomposes the objective into constraints | Records problem + constraints as the provenance root |
489
+ | 2. Hypothesis proposal | **Hypothesis agent** using the `rdkit` **skill** | Generates analogs with SAR rationale | Validates schema, dedupes, records rationale; injects skill guidance |
490
+ | 3. Portfolio filter | **Portfolio selector** | Scores + ranks, applies diversity cap | Records every accept/reject with reason |
491
+ | 3b. Plan review | **A person**, after the **critic** agent's concerns | Removes hypotheses, approves or declines the plan. The model also designs each variant's dose ladder, validated and bounded | Seals the decision in the ledger under the decider's name. Approval covers that plan's lab submissions (`covered_by_plan`), and the safety gate still applies |
492
+ | 4. Readiness review | **ExperimentDefinition** | Checks: is the readout capable? denominator present? synthesis feasible? | **Blocks** if the result would be uninterpretable |
493
+ | 5. Safety gate | **SafetyEngine** | Checks reagents, BSL, step count, **toxicophores in sample structures**, dual-use text | **Refuses** with machine-readable reason + rule-set version |
494
+ | 5b. Governance gate | **HaltSwitch + PauseRegistry + AuthorizationMatrix + SOP registry**, code the agent cannot reach | Checks the operator halt, any program or campaign pause (which holds submissions and releases them on resume), the autonomous/human/never column, and SOP sign-off for recurring work | Refuses outside the agent's reach; every decision recorded as provenance |
495
+ | 6. Lab execution | **LabAdapter** (simulator, Opentrons, PlateReaderShare) | Runs the assay, produces raw evidence | Records run ID, parameters, and raw output |
496
+ | 7. Device event | **DeviceMonitor** | Notices the export appeared | Triggers agent analysis automatically |
497
+ | 8. Analysis | **Analysis agent** + `labread` | Fits IC50s, checks QC, flags artifacts | Records measurements + QC flags as provenance |
498
+ | 9. Verdict | **Analysis** against pre-registered criteria | VALIDATED / INVALIDATED / INCONCLUSIVE, a CI straddling the gate or a QC failure abstains | Records the verdict with evidence, criteria and confidence interval |
499
+ | 10. Audit | **ProvenanceStore** | Renders the full chain | `proef prove` verifies the hash chain; `proef anchor` makes it externally checkable |
500
+
501
+ **After a round.** A person follows up on an abstention, accepts it or drops it. With **Re-plan after each round** on, the model proposes the next hypotheses from the results and a person approves them the same way. **Split into sub-problems** lets the model propose a tree of questions (capped by the program's split depth and sub-problem limits). The lab-run budget flows down by priority, each leaf runs as its own campaign, and a parent is achieved only when its required children are.
502
+
503
+ **Division of labor.** The intelligence comes from the models: the LLM derives
504
+ the SAR hypothesis, the QSAR model makes the calibrated prediction. Proef
505
+ is the layer that makes those results executable, bounded, measurable and
506
+ auditable. Skills teach the agent *how* (domain knowledge from Scientific Agent
507
+ Skills or the `proef` skill); tools let it *act* (`run_assay`,
508
+ `propose_hypothesis`, via MCP or direct Python); the gates decide *whether*
509
+ (SafetyEngine, governance, readiness review); provenance records *what
510
+ happened*. Each layer is independently swappable, but they only produce
511
+ trustworthy science when composed through the Proef flow.
512
+
513
+ Four things cut across the steps rather than sitting in one:
514
+
515
+ - **Contamination control**: post-cutoff and never-published-variant probes
516
+ run and are recorded, so a "no prior knowledge" claim is part of the audit
517
+ trail.
518
+ - **Memory**: the flywheel discounts failed mechanistic families in every
519
+ later portfolio, and the hypothesis agent is told what the lab already
520
+ ruled out.
521
+ - **Accountability**: hash-chained provenance plus Merkle anchoring.
522
+ - **Measurement**: `proef eval` is a scored, deterministic task suite in CI (see
523
+ [Evaluation suite](#evaluation-suite)).
524
+
525
+ ## The virtual lab
526
+
527
+ Simulated devices at three fidelity tiers let the whole loop run offline, so
528
+ every layer is testable before hardware is involved:
529
+
530
+ - **Assay simulators**: seeded dose–response truth, replicates, interference artifacts, controls; plus DLS, ELISA, DSF, imaging, synthesis and bioprocess simulators, round-trip tested against the analysis adapters.
531
+ - **Wire-level device simulators**: instrument protocols simulated from the manufacturer's published contract, with teeth: `ot2_sim` refuses header-less clients and wrong multipart fields; the EZO pH simulator reproduces datasheet quirks, and its calibration uncertainty flows into verdicts.
532
+ - **Recording/playback**: real hardware sessions are recorded once and replay identically in CI.
533
+ - **MCP practice mode**: external instrument servers run under `--simulate`, driven by the same adapter that will drive the hardware.
534
+
535
+ Every simulator labels itself in its capabilities, and adapters whose live
536
+ mode doesn't exist refuse rather than serve synthetic readings as instrument
537
+ data. See [`docs/virtual-lab.md`](docs/virtual-lab.md).
538
+
539
+ ## Five core interfaces
540
+
541
+ Everything implements one of five interfaces; adapters are opt-in and
542
+ interchangeable. The contracts are the pydantic models in `proef.core.contracts`.
543
+
544
+ | Interface | Adapters today |
545
+ |---|---|
546
+ | `ModelProvider` | OpenAI-compatible (OpenAI, ollama, vLLM), Anthropic |
547
+ | `LabAdapter` (+ `SafetyEngine`, `LabGateway`) | simulators, imaging, recording/replay, PlateReaderShare, Opentrons OT-2/Flex (contract-tested against a simulated robot; hardware confirmation pending). LC-MS and HCS are simulator-only; the SiLA 2 and scheduler adapters are generic-HTTP templates |
548
+ | `Sandbox` | local, Docker, OpenSandbox, AgentENV |
549
+ | `ProvenanceStore` | SQLite (Postgres and S3-WORM on the roadmap) |
550
+ | `BioTool` | RDKit descriptors, ADMET, AlphaGenome variant scoring |
551
+
552
+ Sandboxing is opt-in (`sandbox: {mode: per_experiment, type: local|docker}`):
553
+ lab calls and tool calls run in one sandbox per experiment, every op is
554
+ provenance-sealed, and the experiment page shows a receipt. Docker mode uses
555
+ `Dockerfile.sandbox` with egress closed by default, verified in CI. Analysis
556
+ fits and the agent/reviewer/MCP registry lanes still run in-process (S-T3 1d/1e
557
+ in [`docs/ROADMAP.md`](docs/ROADMAP.md)).
558
+
559
+ ## Agent Skills and MCP
560
+
561
+ Proef ships as an [Agent Skills](https://agentskills.io/) package
562
+ (`skills/`, `plugin.json`) and exposes its tools over MCP:
563
+
564
+ ```json
565
+ {"proef": {"command": "proef", "args": ["mcp"]}}
566
+ ```
567
+
568
+ It also *consumes* MCP instrument servers through `McpLabAdapter`: typed tool
569
+ schemas, read-only auto-invocation, everything gated. It was tested live
570
+ against two [K-Dense LabMCP](https://github.com/K-Dense-AI/lab-instrument-mcps)
571
+ servers (a Mettler Toledo balance and an IKA hotplate); nothing is
572
+ hardware-validated yet.
573
+
574
+ It composes with [Scientific Agent Skills](https://github.com/K-Dense-AI/scientific-agent-skills):
575
+ those teach an agent *how* to author protocols and query databases; Proef
576
+ decides *whether they run* and records what happened. Skills shipped here:
577
+ `proef` · `proef-labread` · `proef-labwatch` · `proef-campaign` · `proef-opentrons`.
578
+
579
+ ## Architecture
580
+
581
+ People sit above an engine, the engine acts only through gates, and everything lands on one hash-chained ledger. Each
582
+ interface in the middle row is pluggable.
583
+
584
+ ![Architecture](diagrams/architecture.svg)
585
+
586
+ A campaign moves through the steps below. The verdict rule is the same at every step that judges a result.
587
+
588
+ ![How a campaign runs](diagrams/campaign-flow.svg)
589
+
590
+ ![Checks between a plan and a lab run](diagrams/gates.svg)
591
+
592
+ ![The verdict rule](diagrams/verdict-rule.svg)
593
+
594
+ Longer design notes: [`docs/architecture.md`](docs/architecture.md) and [`docs/flows.md`](docs/flows.md). Diagram sources:
595
+ [`scripts/render_diagrams.py`](scripts/render_diagrams.py).
596
+
597
+ ## Documentation
598
+
599
+ | Doc | Contents |
600
+ |---|---|
601
+ | [`docs/QUICKSTART.md`](docs/QUICKSTART.md) | install, scientist path, workflows, campaign commands |
602
+ | [`docs/ADAPTERS.md`](docs/ADAPTERS.md) | authoring adapters (labs, models, tools, stores) |
603
+ | [`docs/safety-and-security.md`](docs/safety-and-security.md) | full mechanism table, safety rules, trust boundaries, threat model, API access |
604
+ | [`docs/virtual-lab.md`](docs/virtual-lab.md) | simulated devices, image-based readouts, QC and failure modes |
605
+ | [`docs/benchmarks.md`](docs/benchmarks.md) | public datasets and benchmark results |
606
+ | [`docs/domain-review.md`](docs/domain-review.md) | flow fidelity review vs. the real drug-discovery cycle |
607
+ | [`docs/stability.md`](docs/stability.md) | versioning, stability tiers, deprecation policy |
608
+ | [`docs/research-landscape.md`](docs/research-landscape.md) | review vs. Google, Anthropic, Isomorphic, Cradle, Lila, FutureHouse, OpenAI Rosalind |
609
+ | [`docs/critical-review.md`](docs/critical-review.md) · [`docs/REVIEW-2026-10.md`](docs/REVIEW-2026-10.md) | independent critical reviews: strengths and failure modes |
610
+ | [`docs/UX.md`](docs/UX.md) · [`docs/BRAND.md`](docs/BRAND.md) | workbench UX principles and brand system |
611
+ | [`docs/MODELS.md`](docs/MODELS.md) | where a language model is (and isn't) used, providers, presets, examples |
612
+ | [`docs/PLAN.md`](docs/PLAN.md) | build plan, principles, guardrails |
613
+ | [`docs/ROADMAP.md`](docs/ROADMAP.md) | the live plan: open work, status boxes, remediation log |
614
+ | [`docs/architecture.md`](docs/architecture.md) · [`docs/flows.md`](docs/flows.md) | layers, gates, interfaces, and the campaign sequences |
615
+ | [`case-studies/`](case-studies/) | blind reproduction studies on real published data |
616
+ | [`diagrams/`](diagrams/) | the README diagrams (SVG, generated by `scripts/render_diagrams.py`) |
617
+
618
+ ## Architectural principles
619
+
620
+ 1. **Contract-first integration**: blocks communicate only through five versioned
621
+ schemas; nothing else couples them.
622
+ 2. **Hardware behind an abstraction**: agents see the Instrument Abstraction Layer
623
+ (IAL) only; a Virtual Lab Simulator is a drop-in stand-in for real robots.
624
+ 3. **State is snapshot-able**: every experiment branch runs in a sandbox that can be
625
+ forked, paused at review gates, and replayed for audits.
626
+ 4. **Provenance is immutable**: every artifact carries full lineage (inputs, model
627
+ versions, prompts, instrument run IDs) in WORM storage.
628
+ 5. **Safety is non-bypassable**: a policy engine sits in the physical-action path,
629
+ outside any agent's trust boundary.
630
+ 6. **Claims are measured**: every capability claim has a scored eval task behind
631
+ it; uncertainty is reported, not rounded away.
632
+ 7. **AI can only tighten the gate**: deterministic rules hold the safety floor,
633
+ model judgment may add flags or demand review but never clear a refusal,
634
+ and humans, not the model, promote adjudications into rules.
635
+
636
+ ## Contributing
637
+
638
+ Start with [`docs/ADAPTERS.md`](docs/ADAPTERS.md) and
639
+ `proef new-adapter` scaffolds an adapter, and every scaffold is born with a passing test.
640
+ Interface changes go through an ADR; see
641
+ [`docs/stability.md`](docs/stability.md). Apache-2.0.
642
+
643
+ ## References & Sources
644
+
645
+ The architecture draws on published work from teams operating in this space. The
646
+ full review, what each system does, how it compares, and which learnings were
647
+ folded into this design, is in [`docs/research-landscape.md`](docs/research-landscape.md).
648
+
649
+ **Key sources:**
650
+
651
+ - Google: [AI co-scientist](https://research.google/blog/accelerating-scientific-breakthroughs-with-an-ai-co-scientist/) ([paper](https://arxiv.org/abs/2502.18864)) · [AlphaFold 3](https://www.nature.com/articles/s41586-024-07487-w) · [Isomorphic Labs Drug Design Engine](https://www.isomorphiclabs.com/articles/the-isomorphic-labs-drug-design-engine-unlocks-a-new-frontier) · [Bioresilience approach](https://www.isomorphiclabs.com/articles/our-approach-to-bioresilience)
652
+ - Anthropic: [Claude for Life Sciences](https://www.anthropic.com/news/claude-for-life-sciences) · [Model Hardware Standard](https://www.anthropic.com/news/model-hardware-standard-research-preview)
653
+ - Cradle Bio: [Platform](https://www.cradle.bio/platform) · [Series B / wet-lab expansion](https://techcrunch.com/2024/11/26/cradle-builds-out-its-protein-design-ai-platform-and-wet-lab-with-73m-in-new-funding/)
654
+ - FutureHouse: [Robin multi-agent system](https://www.futurehouse.org/research-announcements)
655
+ - Lila Sciences: [Agent-driven science on NVIDIA BioNeMo](https://www.lilasciences.com/news/building-the-agent-driven-era-of-science-with-nvidia-bionemo-agent-toolkit)
656
+ - Helical: [Virtual AI lab / Helix-mRNA FM](https://www.helical.bio/)
657
+ - Coscientist (CMU): [Autonomous chemical research with LLMs + robotics, Nature 2023](https://www.nature.com/articles/s41586-023-06792-0)
658
+ - OpenAI + Retro Biosciences: [GPT-4b micro protein engineering, MIT Tech Review](https://www.technologyreview.com/2024/12/09/1108188/openai-model-for-protein-engineering-gpt-4b-micro-retro-biosciences/)
659
+ - Chai Discovery: [chai-1/chai-2 structure & antibody models](https://www.chaidiscovery.com/)
660
+ - OpenSandbox: [production sandbox runtime](https://github.com/opensandbox-group/OpenSandbox), supported Sandbox adapter target (gVisor/Kata/Firecracker, egress control, K8s)
661
+ - Scientific Agent Skills (K-Dense): [163 validated scientific agent skills](https://github.com/K-Dense-AI/scientific-agent-skills), complementary knowledge layer; Proef tools are exposed via MCP and the Agent Skills standard · [LabMCP](https://github.com/K-Dense-AI/lab-instrument-mcps), 32 lab-instrument MCP servers (Opentrons, SiLA 2, balances, pumps, spectrometers…) each manual-derived with a simulator for every instrument and a community hardware-verification program; the candidate device-transport layer for ROADMAP S-T4 (Proef keeps governance; per-instrument manuals stay upstream)
662
+ - OpenAI: [GPT-Rosalind & Rosalind Workbench](https://openai.com/gpt-rosalind/) ([announcement](https://developers.openai.com/blog/rosalind-workbench)), closed vertical competitor; see [positioning analysis](docs/research-landscape.md#rosalind-what-it-changes-and-where-proef-stands)