pen-stack 0.1.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 (259) hide show
  1. pen_stack/__init__.py +2 -0
  2. pen_stack/_resources.py +34 -0
  3. pen_stack/active/__init__.py +20 -0
  4. pen_stack/active/acquire.py +165 -0
  5. pen_stack/active/brains.py +74 -0
  6. pen_stack/active/campaign.py +109 -0
  7. pen_stack/active/design.py +66 -0
  8. pen_stack/active/validate.py +104 -0
  9. pen_stack/adapt/__init__.py +14 -0
  10. pen_stack/adapt/finetune.py +33 -0
  11. pen_stack/adapt/ingest.py +86 -0
  12. pen_stack/adapt/pipeline.py +101 -0
  13. pen_stack/adapt/recalibrate.py +58 -0
  14. pen_stack/adapt/report.py +130 -0
  15. pen_stack/agent/__init__.py +1 -0
  16. pen_stack/agent/cite.py +175 -0
  17. pen_stack/agent/co_scientist.py +262 -0
  18. pen_stack/agent/epistemic.py +102 -0
  19. pen_stack/agent/guardrails.py +67 -0
  20. pen_stack/agent/mcp_server.py +215 -0
  21. pen_stack/agent/orchestrator.py +112 -0
  22. pen_stack/agent/orchestrator_live.py +56 -0
  23. pen_stack/agent/pen_agent.py +242 -0
  24. pen_stack/agent/scope.py +60 -0
  25. pen_stack/agent/tools.py +130 -0
  26. pen_stack/api/__init__.py +12 -0
  27. pen_stack/api/manifest.py +160 -0
  28. pen_stack/atlas/__init__.py +1 -0
  29. pen_stack/atlas/atlas.parquet +0 -0
  30. pen_stack/atlas/build_wtkb.py +80 -0
  31. pen_stack/atlas/crosslink.py +179 -0
  32. pen_stack/atlas/expand.py +190 -0
  33. pen_stack/atlas/guide_design.py +178 -0
  34. pen_stack/atlas/schema.py +59 -0
  35. pen_stack/atlas/scorecard.py +134 -0
  36. pen_stack/atlas/scorecard_v3.parquet +0 -0
  37. pen_stack/atlas/universe.py +75 -0
  38. pen_stack/atlas/universe_v3.parquet +0 -0
  39. pen_stack/atlas/variant_propose.py +155 -0
  40. pen_stack/atlas/writer_efficiency.py +184 -0
  41. pen_stack/atlas/writer_predict.py +229 -0
  42. pen_stack/atlas/writer_recommend.py +170 -0
  43. pen_stack/atlas/writer_verify.py +167 -0
  44. pen_stack/atlas/wtkb.parquet +0 -0
  45. pen_stack/bridge/__init__.py +1 -0
  46. pen_stack/bridge/activity.py +52 -0
  47. pen_stack/bridge/cli.py +65 -0
  48. pen_stack/bridge/fold_qc.py +53 -0
  49. pen_stack/bridge/guide_qc.py +87 -0
  50. pen_stack/bridge/ingest.py +139 -0
  51. pen_stack/bridge/offtarget.py +191 -0
  52. pen_stack/bridge/offtarget_energetics.py +105 -0
  53. pen_stack/bridge/ortholog_screen.py +73 -0
  54. pen_stack/bridge/pipeline.py +83 -0
  55. pen_stack/build/__init__.py +16 -0
  56. pen_stack/build/cloudlab.py +74 -0
  57. pen_stack/build/ingest.py +47 -0
  58. pen_stack/build/protocol.py +82 -0
  59. pen_stack/build/simlab.py +30 -0
  60. pen_stack/cli.py +126 -0
  61. pen_stack/data/__init__.py +1 -0
  62. pen_stack/data/encode.py +84 -0
  63. pen_stack/data/genome.py +71 -0
  64. pen_stack/data/ingest_chromatin.py +119 -0
  65. pen_stack/data/ingest_integration.py +112 -0
  66. pen_stack/data/ingest_safety_annot.py +201 -0
  67. pen_stack/data/ingest_trip.py +76 -0
  68. pen_stack/design/__init__.py +14 -0
  69. pen_stack/design/capsid_generate.py +62 -0
  70. pen_stack/design/generate.py +70 -0
  71. pen_stack/design/pareto.py +70 -0
  72. pen_stack/design/space.py +137 -0
  73. pen_stack/design/writer_variants.py +121 -0
  74. pen_stack/env/__init__.py +1 -0
  75. pen_stack/env/genome_writing_env.py +248 -0
  76. pen_stack/env/policies.py +94 -0
  77. pen_stack/graph/__init__.py +21 -0
  78. pen_stack/graph/build.py +133 -0
  79. pen_stack/graph/cell_types.py +58 -0
  80. pen_stack/graph/ingest.py +132 -0
  81. pen_stack/graph/query.py +148 -0
  82. pen_stack/graph/schema.py +100 -0
  83. pen_stack/loop/__init__.py +15 -0
  84. pen_stack/loop/continual.py +61 -0
  85. pen_stack/loop/cycle.py +84 -0
  86. pen_stack/loop/drift.py +41 -0
  87. pen_stack/mech/__init__.py +1 -0
  88. pen_stack/mech/classify_atlas.py +71 -0
  89. pen_stack/mech/pfam_whitelist.yaml +247 -0
  90. pen_stack/mech/whitelist.py +66 -0
  91. pen_stack/monitor/__init__.py +1 -0
  92. pen_stack/monitor/europepmc.py +32 -0
  93. pen_stack/monitor/run.py +57 -0
  94. pen_stack/monitor/triage.py +63 -0
  95. pen_stack/oracles/__init__.py +65 -0
  96. pen_stack/oracles/affinity.py +116 -0
  97. pen_stack/oracles/cache.py +53 -0
  98. pen_stack/oracles/energetics.py +33 -0
  99. pen_stack/oracles/genome.py +167 -0
  100. pen_stack/oracles/protein_design.py +136 -0
  101. pen_stack/oracles/reliability.py +64 -0
  102. pen_stack/oracles/rna.py +28 -0
  103. pen_stack/oracles/schema.py +77 -0
  104. pen_stack/oracles/status.py +123 -0
  105. pen_stack/oracles/structure.py +42 -0
  106. pen_stack/oracles/structure_run.py +76 -0
  107. pen_stack/oracles/vcell.py +74 -0
  108. pen_stack/planner/__init__.py +1 -0
  109. pen_stack/planner/ada_risk.py +64 -0
  110. pen_stack/planner/antipeg_oracle.py +75 -0
  111. pen_stack/planner/capsid_epitope_oracle.py +135 -0
  112. pen_stack/planner/cargo.py +56 -0
  113. pen_stack/planner/cargo_polish.py +146 -0
  114. pen_stack/planner/chromosome.py +106 -0
  115. pen_stack/planner/delivery.py +55 -0
  116. pen_stack/planner/delivery_constraints.py +110 -0
  117. pen_stack/planner/delivery_immune.py +61 -0
  118. pen_stack/planner/delivery_immunology.py +222 -0
  119. pen_stack/planner/delivery_predict.py +196 -0
  120. pen_stack/planner/delivery_vehicles.py +37 -0
  121. pen_stack/planner/genotoxicity_oracle.py +112 -0
  122. pen_stack/planner/immune_mhc2.py +154 -0
  123. pen_stack/planner/immune_profile.py +292 -0
  124. pen_stack/planner/innate_sensing.py +135 -0
  125. pen_stack/planner/multiplex.py +110 -0
  126. pen_stack/planner/optimize.py +278 -0
  127. pen_stack/planner/pipeline.py +87 -0
  128. pen_stack/planner/report.py +26 -0
  129. pen_stack/planner/router.py +57 -0
  130. pen_stack/planner/seroprevalence_oracle.py +92 -0
  131. pen_stack/planner/target_site.py +118 -0
  132. pen_stack/rag/__init__.py +1 -0
  133. pen_stack/rag/corpus.py +133 -0
  134. pen_stack/rag/embed.py +98 -0
  135. pen_stack/rag/ground.py +131 -0
  136. pen_stack/rag/index.py +53 -0
  137. pen_stack/rag/llm.py +215 -0
  138. pen_stack/rag/qa.py +105 -0
  139. pen_stack/rag/retrieve.py +48 -0
  140. pen_stack/rules/__init__.py +9 -0
  141. pen_stack/rules/evaluators.py +318 -0
  142. pen_stack/rules/loader.py +31 -0
  143. pen_stack/rules/schema.py +99 -0
  144. pen_stack/rules/solver.py +43 -0
  145. pen_stack/rules/spec.py +78 -0
  146. pen_stack/safety/__init__.py +21 -0
  147. pen_stack/safety/audit.py +90 -0
  148. pen_stack/safety/gate.py +58 -0
  149. pen_stack/safety/pfam_scan.py +157 -0
  150. pen_stack/safety/policy.py +69 -0
  151. pen_stack/safety/redteam.py +71 -0
  152. pen_stack/safety/registry.py +255 -0
  153. pen_stack/safety/screen.py +59 -0
  154. pen_stack/safety/standards.py +141 -0
  155. pen_stack/score/__init__.py +1 -0
  156. pen_stack/score/recalibrate.py +77 -0
  157. pen_stack/score/therapeutic.py +85 -0
  158. pen_stack/server/__init__.py +1 -0
  159. pen_stack/server/api.py +647 -0
  160. pen_stack/spec/__init__.py +18 -0
  161. pen_stack/spec/clarify.py +42 -0
  162. pen_stack/spec/extract.py +406 -0
  163. pen_stack/spec/resolvers/__init__.py +17 -0
  164. pen_stack/spec/resolvers/cell.py +51 -0
  165. pen_stack/spec/resolvers/chem.py +32 -0
  166. pen_stack/spec/resolvers/feature.py +36 -0
  167. pen_stack/spec/resolvers/gene.py +43 -0
  168. pen_stack/spec/resolvers/locus.py +29 -0
  169. pen_stack/spec/resolvers/phenotype.py +37 -0
  170. pen_stack/spec/satisfy.py +114 -0
  171. pen_stack/spec/service.py +33 -0
  172. pen_stack/spec/writespec.py +252 -0
  173. pen_stack/twin/__init__.py +14 -0
  174. pen_stack/twin/calibrate.py +61 -0
  175. pen_stack/twin/data/__init__.py +12 -0
  176. pen_stack/twin/data/position_effect.py +245 -0
  177. pen_stack/twin/mechanistic.py +147 -0
  178. pen_stack/twin/outcome.py +132 -0
  179. pen_stack/twin/position_effect.py +454 -0
  180. pen_stack/ui/__init__.py +1 -0
  181. pen_stack/ui/app.py +713 -0
  182. pen_stack/validate/__init__.py +1 -0
  183. pen_stack/validate/adapt_demo.py +69 -0
  184. pen_stack/validate/agent_eval.py +117 -0
  185. pen_stack/validate/bench_adversarial_tasks.py +118 -0
  186. pen_stack/validate/bench_coscientist_tasks.py +60 -0
  187. pen_stack/validate/bench_graph_tasks.py +64 -0
  188. pen_stack/validate/bench_rule_tasks.py +84 -0
  189. pen_stack/validate/bench_trust_tasks.py +92 -0
  190. pen_stack/validate/bench_writetype_tasks.py +101 -0
  191. pen_stack/validate/blind_gsh_discovery.py +261 -0
  192. pen_stack/validate/cargo_directionality.py +57 -0
  193. pen_stack/validate/closed_loop.py +63 -0
  194. pen_stack/validate/durability_baselines.py +185 -0
  195. pen_stack/validate/experiment_design.py +65 -0
  196. pen_stack/validate/expr_controls.py +39 -0
  197. pen_stack/validate/forward_hypotheses.py +104 -0
  198. pen_stack/validate/generative_design.py +62 -0
  199. pen_stack/validate/guide_qc_demo.py +69 -0
  200. pen_stack/validate/heldout_celltype_expr.py +32 -0
  201. pen_stack/validate/immune_calibration.py +133 -0
  202. pen_stack/validate/intent_specification.py +82 -0
  203. pen_stack/validate/known_biology_expr.py +38 -0
  204. pen_stack/validate/offtarget_energetics_eval.py +144 -0
  205. pen_stack/validate/out_of_scope_refusal.py +82 -0
  206. pen_stack/validate/outcome_calibration.py +194 -0
  207. pen_stack/validate/outcome_prediction.py +76 -0
  208. pen_stack/validate/paper3_benchmark.py +165 -0
  209. pen_stack/validate/paper4_real_validation.py +144 -0
  210. pen_stack/validate/paper4_validation.py +82 -0
  211. pen_stack/validate/protocol_safety.py +62 -0
  212. pen_stack/validate/safety_screening.py +72 -0
  213. pen_stack/validate/selective_prediction.py +104 -0
  214. pen_stack/validate/seq_vs_measured.py +134 -0
  215. pen_stack/validate/target_site_controls.py +65 -0
  216. pen_stack/validate/uncertainty_eval.py +244 -0
  217. pen_stack/validate/ungrounded_baseline.py +234 -0
  218. pen_stack/validate/within_locus_ranking.py +84 -0
  219. pen_stack/validate/writer_recovery.py +91 -0
  220. pen_stack/verify/__init__.py +5 -0
  221. pen_stack/verify/proof.py +206 -0
  222. pen_stack/verify/schema.py +53 -0
  223. pen_stack/verify/service.py +191 -0
  224. pen_stack/web/__init__.py +18 -0
  225. pen_stack/web/guide.py +110 -0
  226. pen_stack/web/llm.py +393 -0
  227. pen_stack/web/llm_provider.py +119 -0
  228. pen_stack/web/router.py +119 -0
  229. pen_stack/web/server.py +96 -0
  230. pen_stack/web/tools.py +197 -0
  231. pen_stack/wgenome/__init__.py +1 -0
  232. pen_stack/wgenome/chromatin_seq.py +83 -0
  233. pen_stack/wgenome/durability.py +108 -0
  234. pen_stack/wgenome/export_tracks.py +52 -0
  235. pen_stack/wgenome/features.py +82 -0
  236. pen_stack/wgenome/genotoxic_blocklist.py +88 -0
  237. pen_stack/wgenome/gsh_baseline.py +154 -0
  238. pen_stack/wgenome/mesh_features.py +61 -0
  239. pen_stack/wgenome/offtarget_assay.py +80 -0
  240. pen_stack/wgenome/offtarget_bridge.py +47 -0
  241. pen_stack/wgenome/offtarget_cast.py +97 -0
  242. pen_stack/wgenome/offtarget_data.py +148 -0
  243. pen_stack/wgenome/offtarget_enumerate.py +274 -0
  244. pen_stack/wgenome/offtarget_integrase.py +155 -0
  245. pen_stack/wgenome/offtarget_nuclease.py +123 -0
  246. pen_stack/wgenome/offtarget_paste.py +41 -0
  247. pen_stack/wgenome/offtarget_predict.py +282 -0
  248. pen_stack/wgenome/ood.py +135 -0
  249. pen_stack/wgenome/providers.py +278 -0
  250. pen_stack/wgenome/safety.py +69 -0
  251. pen_stack/wgenome/structure3d.py +212 -0
  252. pen_stack/wgenome/uncertainty.py +250 -0
  253. pen_stack/wgenome/writability.py +72 -0
  254. pen_stack-0.1.0.dist-info/METADATA +401 -0
  255. pen_stack-0.1.0.dist-info/RECORD +259 -0
  256. pen_stack-0.1.0.dist-info/WHEEL +5 -0
  257. pen_stack-0.1.0.dist-info/entry_points.txt +3 -0
  258. pen_stack-0.1.0.dist-info/licenses/LICENSE +21 -0
  259. pen_stack-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,401 @@
1
+ Metadata-Version: 2.4
2
+ Name: pen-stack
3
+ Version: 0.1.0
4
+ Summary: Open infrastructure for genome writing: the Writable Genome atlas, the Writer Atlas, and the Write Planner.
5
+ Author-email: Anees Ahmed Mahaboob Ali <ahmedaneesm@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/ahmedanees-m/pen-stack
8
+ Project-URL: Repository, https://github.com/ahmedanees-m/pen-stack
9
+ Project-URL: Documentation, https://github.com/ahmedanees-m/pen-stack/tree/main/docs
10
+ Project-URL: Issues, https://github.com/ahmedanees-m/pen-stack/issues
11
+ Project-URL: Benchmark, https://github.com/ahmedanees-m/pen-stack/tree/main/benchmarks/genome_writing_bench
12
+ Keywords: genome-writing,genome-editing,bridge-recombinase,safe-harbor,writable-genome,writer-atlas,write-planner,bioinformatics
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Intended Audience :: Science/Research
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Requires-Python: >=3.11
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: numpy>=1.26
26
+ Requires-Dist: pandas>=2.2
27
+ Requires-Dist: pyarrow>=16
28
+ Requires-Dist: scipy>=1.13
29
+ Requires-Dist: scikit-learn>=1.5
30
+ Requires-Dist: lightgbm>=4.5
31
+ Requires-Dist: pydantic>=2.8
32
+ Requires-Dist: pyyaml>=6.0
33
+ Requires-Dist: click>=8.1
34
+ Requires-Dist: requests>=2.32
35
+ Requires-Dist: tqdm>=4.66
36
+ Requires-Dist: pyhmmer>=0.10
37
+ Provides-Extra: models
38
+ Requires-Dist: xgboost>=2.1; extra == "models"
39
+ Requires-Dist: torch>=2.3; extra == "models"
40
+ Requires-Dist: statsmodels>=0.14; extra == "models"
41
+ Provides-Extra: bio
42
+ Requires-Dist: biopython>=1.84; extra == "bio"
43
+ Requires-Dist: pysam>=0.22; extra == "bio"
44
+ Requires-Dist: pyBigWig>=0.3; extra == "bio"
45
+ Requires-Dist: pybedtools>=0.10; extra == "bio"
46
+ Requires-Dist: ViennaRNA>=2.6; extra == "bio"
47
+ Provides-Extra: bridge
48
+ Requires-Dist: bridgernadesigner>=0.1.1; extra == "bridge"
49
+ Requires-Dist: ViennaRNA>=2.6; extra == "bridge"
50
+ Requires-Dist: pysam>=0.22; extra == "bridge"
51
+ Provides-Extra: server
52
+ Requires-Dist: fastapi>=0.111; extra == "server"
53
+ Requires-Dist: uvicorn>=0.30; extra == "server"
54
+ Provides-Extra: services
55
+ Requires-Dist: litellm>=1.44; extra == "services"
56
+ Requires-Dist: paper-qa>=5.10; extra == "services"
57
+ Requires-Dist: streamlit>=1.37; extra == "services"
58
+ Requires-Dist: plotly>=5; extra == "services"
59
+ Requires-Dist: fastmcp>=2.3; extra == "services"
60
+ Requires-Dist: beautifulsoup4>=4.12; extra == "services"
61
+ Provides-Extra: orchestrate
62
+ Requires-Dist: paramiko>=3.4; extra == "orchestrate"
63
+ Requires-Dist: scp>=0.15; extra == "orchestrate"
64
+ Requires-Dist: rich>=13.7; extra == "orchestrate"
65
+ Requires-Dist: python-dotenv>=1.0; extra == "orchestrate"
66
+ Provides-Extra: docs
67
+ Requires-Dist: mkdocs>=1.6; extra == "docs"
68
+ Requires-Dist: mkdocs-material>=9.5; extra == "docs"
69
+ Provides-Extra: env
70
+ Requires-Dist: gymnasium>=0.29; extra == "env"
71
+ Provides-Extra: spec
72
+ Requires-Dist: sbol3>=1.1; extra == "spec"
73
+ Provides-Extra: dev
74
+ Requires-Dist: pytest>=8; extra == "dev"
75
+ Requires-Dist: ruff>=0.5; extra == "dev"
76
+ Requires-Dist: pytest-cov>=5; extra == "dev"
77
+ Requires-Dist: fastapi>=0.111; extra == "dev"
78
+ Requires-Dist: uvicorn>=0.30; extra == "dev"
79
+ Requires-Dist: httpx>=0.27; extra == "dev"
80
+ Requires-Dist: fastmcp>=2.3; extra == "dev"
81
+ Requires-Dist: gymnasium>=0.29; extra == "dev"
82
+ Requires-Dist: sbol3>=1.1; extra == "dev"
83
+ Requires-Dist: biopython>=1.84; extra == "dev"
84
+ Dynamic: license-file
85
+
86
+ <div align="center">
87
+
88
+ # PEN-STACK
89
+
90
+ ### A verification and grounding layer for genome-writing AI
91
+
92
+ Foundation models generate candidate edits; PEN-STACK checks them. It tells you where in the genome a write can be made safely and durably, which enzyme can make it, and how to design the write end to end. Every design is checked against rule-grounded mechanism, returned with calibrated confidence and its provenance, and marked "out of scope" rather than guessed. Numbers come from validated tools, not from a language model.
93
+
94
+ [![PyPI](https://img.shields.io/pypi/v/pen-stack.svg)](https://pypi.org/project/pen-stack/)
95
+ [![CI](https://github.com/ahmedanees-m/pen-stack/actions/workflows/ci.yml/badge.svg)](https://github.com/ahmedanees-m/pen-stack/actions/workflows/ci.yml)
96
+ [![Publish](https://github.com/ahmedanees-m/pen-stack/actions/workflows/publish.yml/badge.svg)](https://github.com/ahmedanees-m/pen-stack/actions/workflows/publish.yml)
97
+ [![codecov](https://codecov.io/gh/ahmedanees-m/pen-stack/branch/main/graph/badge.svg)](https://codecov.io/gh/ahmedanees-m/pen-stack)
98
+ [![License: MIT](https://img.shields.io/badge/License-MIT-informational.svg)](LICENSE)
99
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/)
100
+ [![Docker](https://img.shields.io/badge/runtime-docker-2496ED.svg)](docker/)
101
+
102
+ </div>
103
+
104
+ ## Overview
105
+
106
+ PEN-STACK is an installable Python package and service for the genome-*writing* era, the modality that installs new information into a genome (inserting genes, flipping or excising kilobases, placing programmable landing pads) rather than editing a base in place. Writing is harder and less tooled than editing, and it is gated by questions that have no canonical answer: where can you write, what can write there, and how should the write be designed.
107
+
108
+ The package consolidates five earlier research projects into one citable stack and adds the maps and the design engine the field was missing: a genome-wide Writable-Genome atlas, a cross-family Writer Atlas, an inverse-design Write Planner, a per-mechanism off-target engine, a design-stage biosecurity gate, immunogenicity and delivery profiling, a calibrated digital twin, and a grounded agent that drives them end to end. All of it runs under one engineered invariant: every reported quantity comes from a validated tool or an out-of-distribution-gated oracle, never from a language model, and anything out of scope is returned as a known-unknown rather than guessed. It runs on a single GPU, uses bulk-downloadable public data, and is validated against pre-registered baselines with the negatives reported in full.
109
+
110
+ See [docs/](docs/) for the full documentation.
111
+
112
+ ## What it addresses
113
+
114
+ | Question | The situation today | What PEN-STACK provides |
115
+ |---|---|---|
116
+ | Where can you write? | Labs re-derive ad-hoc "safe harbour" shortlists from inconsistent criteria; published lists range from thousands of sites to a few dozen, rarely predict expression durability, and usually cover one cell type. | The Writable Genome: a learned, cell-type-aware, writer-aware atlas scoring every locus for safety (genotoxicity risk), durability (whether a cassette stays expressed), and reachability (which enzyme can engage it). |
117
+ | What can write there, and how well? | Enzyme capabilities are scattered across papers, with no catalogue placing the genome-writing families on common measured axes with their targeting requirements. | The Writer Atlas: 33,370 enzyme systems across 8 families on common measured axes, joined to the Writable Genome by a bidirectional cross-link. |
118
+ | How do I design the write? | Destination, enzyme, cargo, and delivery are interdependent and goal-dependent, and no tool optimises them together. | The Write Planner: inverse design that, given a goal and an edit intent, returns ranked, traceable site, writer, cargo, and delivery plans. |
119
+ | Where might the write go off-target? | Off-target behaviour differs by writer mechanism, and most writer classes had no genome-wide screening tool. | A per-mechanism off-target engine across five writer classes (RNA-guided nuclease, serine integrase, prime-editing integrase, CAST, and bridge recombinase). It behaves like established nuclease tools where genome-wide assay data exists and reports a truthful mechanism-based screen, with its validation status, where it does not. |
120
+ | Can I trust the outputs? | LLM design assistants produce fluent but unsourced quantities, and large-cargo design is dual-use. | A no-fabrication invariant (every number traces to a validated tool) that we verify with the model live, and a design-stage biosecurity gate that screens function, family, taxon, and raw sequence before any protocol can be emitted. |
121
+
122
+ ## Architecture
123
+
124
+ A goal enters through one of the interfaces. The agent layer turns it into candidate designs. Every candidate passes through the verifier, the central gate: it runs a biosecurity screen first, checks the design against the rule base, attaches a calibrated confidence and a per-axis immune-risk profile, and discards anything that is unsafe, illegal, or uncalibrated. The reference layers and the oracle mesh supply the grounded answers the verifier and planner rely on, and everything rests on public data. No value is reported without a traceable source, and no value comes from a language model.
125
+
126
+ ```text
127
+ Interfaces
128
+ CLI | REST API | MCP server | Web app
129
+ |
130
+ v
131
+ Agent layer
132
+ Co-scientist | Write Planner | Experiment Designer
133
+ (goal -> typed WriteSpec -> ranked site / writer / cargo / delivery plan)
134
+ |
135
+ v
136
+ +===========================================================+
137
+ | VERIFIER (the central gate, runs on every design) |
138
+ | 1. biosecurity screen 2. legality rules |
139
+ | 3. calibrated confidence 4. per-axis immune-risk |
140
+ | unsafe / illegal / uncalibrated designs are rejected |
141
+ +===========================================================+
142
+ |
143
+ v
144
+ Reference and model layers
145
+ +-------------------+ +----------------+ +-------------------+
146
+ | Writable Genome | | Writer Atlas | | Oracle mesh |
147
+ | per-locus safety, | | 33,370 enzyme | | AlphaFold3, Evo2, |
148
+ | durability, | | systems, 8 | | AlphaGenome, |
149
+ | expression- | | families, on | | ESM3, RFdiffusion,|
150
+ | robustness, | | common axes, | | ProteinMPNN under |
151
+ | reachability, | | cross-linked | | one OracleResult |
152
+ | per-mechanism | | to every locus | | contract (scope- |
153
+ | off-target | | | | gated, provenance)|
154
+ +-------------------+ +----------------+ +-------------------+
155
+ |
156
+ v
157
+ Public data: hg38, ENCODE / Roadmap chromatin, TRIP, CancerMine (CC0),
158
+ DepMap, VISDB, UniProt, Pfam / InterPro, Europe PMC, Perry 2025 bridge data
159
+ ```
160
+
161
+ ## Components
162
+
163
+ | Component | Module | What it does |
164
+ |---|---|---|
165
+ | Writable Genome | `pen_stack.wgenome` | Learned per-locus safety (genotoxicity risk), expression-robustness (durability), and writer reachability; a 3D structural-risk axis; and a per-mechanism off-target engine across five writer classes with per-class validation status. |
166
+ | Writer Atlas | `pen_stack.atlas`, `.mech`, `.score` | Cross-family enzyme catalogue and Writer-Targeting knowledge base, cross-linked to loci. |
167
+ | Write Planner | `pen_stack.planner` | Inverse design conditioned on an edit intent, including the delivery palette and the delivery-immunology profile. |
168
+ | Verifier | `pen_stack.verify`, `pen_stack.rules` | `verify(design)` returns legality, biosecurity verdict, calibrated confidence, and the immune-risk profile as distinct axes. |
169
+ | Biosecurity gate | `pen_stack.safety` | A dual-use screening gate that runs first in `verify()`, screening declared function, family, and taxon signatures and translating a raw cargo sequence against curated Pfam toxin-family profiles; a refusal short-circuits scoring, with a tamper-evident audit trail. It reads hazard content only from declared fields (`cargo_function`, `function_annotation`, `goal_function`, `source_taxon`, `organism`, `host_taxon`, `cargo_seq`, `cargo_sequence`); content in `edit_intent` or other framing fields is not screened, so a verdict with `declared_signal=False` means "nothing screenable was declared", not "screened and safe" (see [`docs/biosecurity.md`](docs/biosecurity.md)). |
170
+ | Oracle mesh | `pen_stack.oracles` | One `OracleResult` contract over the biomolecular foundation models, with provenance, native uncertainty, and a scope card; generated output is a candidate, out-of-distribution inputs are flagged. |
171
+ | World-model graph | `pen_stack.graph` | A typed, provenanced knowledge graph with a gated, propose-only update loop. |
172
+ | Generative designer | `pen_stack.design` | Proposes candidate writing systems and keeps only those that pass safety, legality, and calibration, returning a Pareto frontier. |
173
+ | Digital twin | `pen_stack.twin` | Calibrated, out-of-distribution-gated outcome prediction, bounded at phenotype. |
174
+ | Experiment designer | `pen_stack.active` | Active learning by expected information gain, with a retrospective active-versus-random evaluation. |
175
+ | Build interface | `pen_stack.build` | Safety-gated protocol export (draft only, never auto-run) and gated ingestion of results, with a cloud-lab connector that runs the biosecurity gate before any submission. |
176
+ | Closed loop | `pen_stack.loop`, `pen_stack.active` | A gated design, build, test, learn loop with drift detection and versioned, reversible recalibration; an SDL-brain benchmark and a validation-campaign engine that orders the most-informative next measurements by expected information gain. |
177
+ | Write intent (WriteSpec) | `pen_stack.spec` | A typed, ontology-backed `WriteRequest` (an SBOL3 profile) with a grounded extractor that resolves free text to verified ontology ids, asks clarifying questions on ambiguity, and runs a SAT feasibility check. |
178
+ | Agent, co-scientist, and chat | `pen_stack.agent`, `pen_stack.web`, `pen_stack.rag` | Goal to cited, auditable plan; MCP server; the co-scientist that drives the loop; and the grounded conversational chat (four lanes: design, explain, meta, general; provenance-tagged retrieval; a swappable LLM provider). |
179
+ | Bridge off-target engine | `pen_stack.bridge` | The measured-data-validated off-target engine for bridge recombinases (IS110/IS621): candidate-site nomination, ranking, and guide QC, validated on the Perry 2025 data. |
180
+ | Immunogenicity and delivery | `pen_stack.planner` | Per-writer T-cell immunogenicity profiling (NetMHCpan / NetMHCIIpan) with a human-albumin self-control, a delivery-vehicle palette, and anti-drug-antibody and anti-PEG proxies, each labelled by validation status. |
181
+ | Interfaces | `pen_stack.server`, `pen_stack.web`, `pen_stack.ui`, `pen_stack.cli` | REST API, web application, and command-line tools. |
182
+
183
+ ## Key results
184
+
185
+ All results are blind and pre-registered (success criteria, baselines, and held-out sets are SHA-locked in [`prereg/`](prereg/) before any model sees the test data). Estimates are reported with their sample size and confidence interval.
186
+
187
+ - **Expression-robustness axis (the headline result).** A per-locus prediction of whether an integrated cassette stays expressed rather than being positionally silenced. On measured human K562 position-effect data (Leemans 2019) the axis reaches a held-out Spearman rho of 0.571 (0.558 on an independent held-out variant), and it is empirically *distinct* from ePRIDICT's chromatin prediction of prime-editing efficiency (rho 0.212, R-squared 0.041 across 7,295 loci): a complementary signal, not a restatement of one. It is validated at exact-site resolution; the deployment commonly serves coarse 1-kb features, at which the axis reaches rho about 0.16, and that gap is reported as a result rather than claimed away. See [`benchmarks/position_effect_human/`](benchmarks/position_effect_human/).
188
+ - **Writable Genome and the integrated safety filter.** A genome-wide atlas of 3,031,030 loci across three cell types (K562, HepG2, CD34+ HSPC) recovers experimentally validated safe harbours as highly writable and clinical genotoxic loci as non-writable, blind. The three-way integrated score (safety x durability x reachability) is characterised as a *reject-known-bad safety filter*: against oncogene-distance and accessibility-matched controls it reaches AUROC 0.679 (95% CI 0.536 to 0.825) versus a safety-only baseline of 0.51, with real false negatives on documented clinical genotoxic loci reported in full; it is not a calibrated genotoxicity predictor.
189
+ - **Writer Atlas.** 33,370 enzyme systems across 8 families on common measured axes; the mechanism classifier agrees with the audited labels on the curated core (1.00); the cross-link to loci is validated on AAVS1. Writer-family recovery at rank 1 is 0.86 against a prevalence of 0.29.
190
+ - **Per-mechanism off-target engine.** The RNA-guided nuclease path *wraps* the published CRISOT scorer (which beats naive homology, CRISOT's own result, stated plainly). The serine-integrase path, on the Chalberg 115-site human genomic pseudo-attP set, reaches AUROC 0.637 and AUPRC 0.215, beating a palindrome baseline (CI excludes zero) and matching an attP-similarity baseline on AUROC while beating it on AUPRC: an informative two-stage result, reported as such. The bridge path (Perry 2025, 6,856 measured off-targets) ranks real off-targets above core-disrupted decoys at AUROC 0.77 versus 0.62 for Hamming distance. The bridge and CAST paths are mechanism-based screens, not per-site risk calculators, and are labelled as such.
191
+ - **No fabrication, measured with the model live.** Given no tools, an ungrounded LLM fabricates 91 to 99 percent of the tool-only planning quantities (writability, safety, durability, off-target count, structural risk, coordinate) under a naive prompt, across three model families spanning a small local model to hosted-frontier models; the same models driving the validated tools as an agent fabricate none, every number audited to a direct tool call. Anti-fabrication prompting is an uneven guardrail; grounding is not. See [`benchmarks/grounding_llm_on/`](benchmarks/grounding_llm_on/) and [`benchmarks/agentic_baseline/`](benchmarks/agentic_baseline/).
192
+
193
+ ## Installation
194
+
195
+ From PyPI (the library, CLI, agent, and pure-logic tools):
196
+
197
+ ```bash
198
+ pip install pen-stack # core
199
+ pip install "pen-stack[models,bio,bridge,server,services]" # full stack
200
+ ```
201
+
202
+ The wheel ships the importable package and the command-line tools. The full data pipeline (the multi-million-row atlases, BigWig tracks, and curated configs) is distributed via the cloned repository and Zenodo. Most users who want the whole pipeline clone the repository:
203
+
204
+ ```bash
205
+ git clone https://github.com/ahmedanees-m/pen-stack.git && cd pen-stack
206
+ pip install -e ".[dev]" # core and tests
207
+ pip install -e ".[models,bio,bridge,server,services]" # full stack
208
+ pytest -q
209
+ pen-stack info # stack status
210
+ python bench/run.py --agent # run the Genome-Writing Bench
211
+ ```
212
+
213
+ `pen-stack` and its dependencies install from wheels on Linux, macOS, and Windows (Python >= 3.11). One
214
+ system library is not pip-installable: LightGBM needs the OpenMP runtime, which standard Linux, conda, and
215
+ macOS environments (and the CI image) already provide. On a minimal Debian base image only, install it once
216
+ with `apt-get install -y libgomp1`.
217
+
218
+ A committed **1-chromosome demo atlas** (`data/demo/atlas_k562.parquet`, chr19) lets a fresh clone run the
219
+ safe-harbour quickstart immediately - chr19 carries the canonical AAVS1 safe harbour. Point `PEN_ATLAS_DIR`
220
+ at it, or fetch the full genome-wide release from Zenodo:
221
+
222
+ ```bash
223
+ PEN_ATLAS_DIR=data/demo pen-stack writable --gene AAVS1 --ct k562 # runs on the committed chr19 demo
224
+ ZENODO_DOI=<deposit DOI> bash scripts/fetch_artifacts.sh # full atlas -> data/out/ (all cell types)
225
+ ```
226
+
227
+ ## Quick start
228
+
229
+ Query the stack from the command line:
230
+
231
+ ```bash
232
+ pen-stack info # stack status
233
+ pen-stack atlas --coverage # Writer Atlas coverage (33,370 systems, 8 families)
234
+ pen-bridge design --target ACGTGTCTACGTGA --donor TTGCATCTAGGCAC
235
+ ```
236
+
237
+ The locus queries read a writability atlas. A fresh clone already ships the 1-chromosome demo atlas (chr19),
238
+ which covers the canonical AAVS1 safe harbour:
239
+
240
+ ```bash
241
+ export PEN_ATLAS_DIR=data/demo # committed chr19 demo atlas
242
+ pen-stack writable --gene AAVS1 --ct k562 # rank writable loci near a gene
243
+ pen-stack crosslink --chrom chr19 --bin 55117 # which writers reach that locus
244
+ pen-stack plan --gene AAVS1 --intent knock_in_with_disruption --cargo-bp 2000
245
+ ```
246
+
247
+ Genome-wide queries (any gene, all cell types) need the full atlas from the Zenodo deposit:
248
+
249
+ ```bash
250
+ ZENODO_DOI=<deposit DOI> bash scripts/fetch_artifacts.sh # installs data/out/ + models/
251
+ pen-stack writable --gene CCR5 --ct k562
252
+ ```
253
+
254
+ Self-host the whole platform (API, web app, agent, MCP, LLM) with one command:
255
+
256
+ ```bash
257
+ docker compose up -d
258
+ docker compose exec ollama ollama pull qwen2.5:7b-instruct # first run only (local fallback model)
259
+ # Web app on :8501, API on :8000, MCP on :8765 (see docs/DEPLOY.md)
260
+ ```
261
+
262
+ The LLM backend is optional and non-load-bearing: it narrates and routes, but every number and citation comes from a validated tool, so the core scientific compute runs with no language model at all. See [docs/DEPLOY.md](docs/DEPLOY.md).
263
+
264
+ ## Benchmarks
265
+
266
+ The Genome-Writing Bench is a one-command, SHA-locked benchmark for the writing side of genome engineering: where to write, what writer to use, how to design the cargo, and what off-target or structural risk a write carries. Each task has a deterministic scorer and a documented ground-truth source, and no task is scored against a circular label.
267
+
268
+ ```bash
269
+ python bench/run.py --agent
270
+ docker compose run --rm bench python bench/run.py --agent # on the clean image
271
+ ```
272
+
273
+ The deterministic planner beats the naive baselines on the grounded tasks; a tool-using LLM agent reaches the planner's numbers only by grounding every value (zero fabricated), while the same models with no tools fabricate the tool-only fields. See [`benchmarks/genome_writing_bench/`](benchmarks/genome_writing_bench/). The held-out public leaderboard is the [Genome-Writing Challenge](benchmarks/genome_writing_challenge/).
274
+
275
+ Every benchmark ships a frozen split with a SHA-256 lock and a committed `metrics.json`, so a fresh clone reproduces the central numbers with no download and no API key:
276
+
277
+ ```bash
278
+ make repro # demo-atlas quickstart, grounding eval, agentic baseline, and the recomputed headline result
279
+ make repro-human # recompute the headline human K562 expression-robustness result (rho=0.571) from source data
280
+ make repro-full # the above plus the genome-wide atlas benchmarks (needs 'make fetch' with ZENODO_DOI)
281
+ ```
282
+
283
+ `make repro` also re-hashes every SHA-locked pre-registration against the committed bytes (`scripts/prereg_manifest.py`, which emits the full manifest `prereg/PREREG_MANIFEST.md`) and asserts it in continuous integration, so a live lock cannot silently drift from the file it fixes. The ten claims in the honesty ledger each cite a committed pre-registration verifiable from a bare clone with `sha256sum prereg/<file>`; the full eighty-lock manifest is in `prereg/PREREG_MANIFEST.md`.
284
+
285
+ The headline expression-robustness result is **recomputed from source, not read from a stored number**:
286
+ `scripts/p2_build_human_head.py` (run by `make repro-human`, and folded into `make repro`) trains the shipped
287
+ twin on the committed Leemans K562 features table, holds out chromosomes 3/8/12 exactly as the sealed
288
+ pre-registration specifies, and asserts the recomputed held-out Spearman correlation (0.5711) matches the
289
+ committed metrics. The three headline analyses each ship their metrics: the human K562 expression-robustness
290
+ head ([`benchmarks/position_effect_human/`](benchmarks/position_effect_human/)), the integrase off-target set
291
+ ([`benchmarks/offtarget/integrase_chalberg/`](benchmarks/offtarget/integrase_chalberg/)), and the clinical
292
+ genotoxicity panel ([`benchmarks/genotox_panel/`](benchmarks/genotox_panel/)).
293
+
294
+ ## Built on prior repositories
295
+
296
+ PEN-STACK consolidates and re-grounds five earlier projects. Their reusable assets are imported here; the originals are archived read-only for provenance and DOI stability.
297
+
298
+ | Repository | Pinned version | What is reused | What changed |
299
+ |---|---|---|---|
300
+ | [genome-atlas](https://github.com/ahmedanees-m/genome-atlas) | v0.7.2 | The audited 18-family Pfam backbone behind the knowledge base and the at-scale mechanism classifier. | The GraphSAGE link-prediction framing was retired. |
301
+ | [mech-class](https://github.com/ahmedanees-m/mech-class) | v0.5.4 | The mechanism classifier (Pfam, RHEA, CRISPRcasdb, UniProt). | Reused as the family and mechanism caller. |
302
+ | [pen-score](https://github.com/ahmedanees-m/pen-score) | v0.1.3 | The scoring axes (delivery, immunogenicity, cargo, and others). | The cargo and programmability axes were re-grounded; hand-set overrides removed. |
303
+ | [pen-assemble](https://github.com/ahmedanees-m/pen-assemble) | v0.5.2 | The ortholog sequence set. | De-novo chimera generation was replaced by DMS-grounded point-variant proposal. |
304
+ | [pen-compare](https://github.com/ahmedanees-m/pen-compare) | v0.1.0 | The 1,058-entity universe, scorecard scaffold, and tests. | The circular five-gate certification became a descriptive scorecard with blind concordance. |
305
+
306
+ A single assembly path (`pen_stack/atlas/universe.py`) feeds the classifier, the scorer, and the scorecard the same metadata, so cross-module inconsistencies cannot recur.
307
+
308
+ ## Repository structure
309
+
310
+ ```
311
+ pen-stack/
312
+ README.md LICENSE CITATION.cff project front matter (MIT; cite-this-repository)
313
+ pyproject.toml Makefile packaging; one-command reproduction targets
314
+ DATA_SOURCES.md DATA_LICENSES.md data provenance index and the open-data licensing policy
315
+ pen_stack/ the installable package
316
+ spec/ WriteSpec: typed SBOL3-profile intent layer, grounded extractor, ontology resolvers, SAT feasibility
317
+ wgenome/ Writable Genome: features, safety, durability, writability, uncertainty, structure3d, off-target nomination
318
+ atlas/ Writer Atlas, knowledge base, cross-link, variant proposal, canonical universe, writer-efficiency predictor
319
+ mech/ score/ mechanism classification at scale; re-grounded therapeutic-readiness axes
320
+ planner/ Write Planner: optimisation, cargo, routing, delivery palette, delivery immunology, capsid fitness
321
+ bridge/ bridge off-target engine and guide QC
322
+ oracles/ oracle mesh: the OracleResult contract and adapters over the foundation models, with binding-affinity and per-oracle reliability
323
+ graph/ living world-model knowledge graph (gated, propose-only)
324
+ rules/ verify/ machine-readable rule base, the verify(design) service, and the proof-object with repair hints
325
+ safety/ the biosecurity and dual-use gate, with standards concordance
326
+ design/ twin/ generative designer; calibrated digital twin with a learned position-effect model
327
+ active/ build/ experiment designer with the SDL-brain benchmark and validation-campaign engine; safety-gated build interface and cloud-lab connector
328
+ loop/ the gated design-build-test-learn loop
329
+ rag/ provenance-tagged retrieval corpus, embedder, and four-branch ground router (social, cited, general, abstained)
330
+ agent/ agent platform, co-scientist, MCP server
331
+ api/ web/ server/ ui/ cli.py AI integration surface, web platform with the grounded chat and swappable LLM provider, REST API, CLI
332
+ benchmarks/ SHA-locked benchmarks, each with a harness, a frozen split, and a committed metrics file:
333
+ genome_writing_bench/ genome_writing_challenge/ the bench and the public held-out leaderboard
334
+ position_effect/ position_effect_human/ expression-robustness axis; human K562 external validation (rho=0.571)
335
+ offtarget/ genotox_panel/ per-mechanism off-target; clinical insertional-oncogenesis panel
336
+ grounding_llm_on/ agentic_baseline/ model-live no-fabrication eval; tool-driving agentic baseline
337
+ chat_grounding/ chat_safety/ chat_routing/ chat_headtohead/ grounded-chat probe sets
338
+ verify/ writespec/ delivery/ immuno/ loop/ oracle/ writer_efficiency/ priorart/ per-stage benchmarks and prior-art positioning
339
+ scripts/ reproducible pipeline drivers (fetch_artifacts.sh installs the Zenodo release)
340
+ bench/ the benchmark runner (bench/run.py; also the compose `bench` service)
341
+ tools/ developer command-line helper (penctl.py)
342
+ examples/ worked integration examples (external agent, MCP client, agent tool specs)
343
+ schemas/ JSON schema for the typed WriteSpec intent layer
344
+ Makefile one-command reproduction (make fetch, make repro)
345
+ configs/ pinned datasets, thresholds, curation, and the provider-agnostic LLM switch (YAML)
346
+ prereg/ SHA-locked pre-registered success criteria
347
+ data/
348
+ curated/ small committed tables (gene_coords, ...)
349
+ demo/ committed 1-chromosome demo atlas (chr19) for clean-clone reproduction
350
+ llm_bench_cache/ committed model-live transcripts for the grounding eval (replay offline, no key needed)
351
+ priorart/ offtarget/ alphagenome_cache/ committed derived products backing the sealed benchmarks
352
+ tests/ unit, regression, and blind-validation suite
353
+ docs/ documentation site (tutorials, method cards, deployment)
354
+ docker/ container images and pinned requirements
355
+ model_servers/ self-hosted model-server images (ProteinMPNN, ESM3, RFdiffusion)
356
+ oracle_cache/ committed oracle responses so cached oracle paths replay offline
357
+ web/ React single-page frontend for the web platform
358
+ docker-compose.yml one-command self-hostable platform (API, MCP, web, LLM)
359
+ ```
360
+
361
+ Large artifacts (multi-million-row atlases, BigWig tracks, trained models) and any third-party copyrighted data are not committed. They are released via Zenodo or fetched from the original source with `scripts/fetch_artifacts.sh`, and are reproducible by re-running the pipeline. Only small curated tables, the demo atlas, committed benchmark metrics, and derived products live in git, so a fresh clone can run the quickstart and replay every benchmark offline.
362
+
363
+ ## Data sources
364
+
365
+ All public, and license-clean by policy. Genome and annotation: hg38 (UCSC), GENCODE v46. Chromatin: ENCODE and Roadmap (ATAC/DNase and histone marks for K562, HepG2, CD34+ progenitor, and mouse ES-Bruce4). Position-effect: TRIP (Akhtar 2013, GEO GSE49806/GSE49807) and the Leemans 2019 K562 TRIP data, which is the external validation of the expression-robustness axis. Safety: **CancerMine (CC0)** is the default oncogene and tumour-suppressor source; DepMap Public 26Q1 essentiality; LaFave 2014 MLV integrations; VISDB. Enzymes: UniProt orthologs, Pfam and InterPro. Off-target: the Perry 2025 bridge-recombinase off-target and DMS data (copyrighted, kept local, only derived products released) and the Chalberg 2006 genomic pseudo-attP set. Literature and reagents: Europe PMC, Addgene.
366
+
367
+ License-restricted sources (COSMIC Cancer Gene Census, OncoKB) are **never committed and never used as training data**; they are optional, local-only enrichers a registered user pulls under their own license, and a CI test fails if a restricted source appears as a shipped derived-data source. Every accession and DOI is pinned in [`configs/datasets.yaml`](configs/datasets.yaml) and indexed in [`DATA_SOURCES.md`](DATA_SOURCES.md); the full open-data policy is in [`DATA_LICENSES.md`](DATA_LICENSES.md).
368
+
369
+ ## Validation approach
370
+
371
+ - Pre-register before training: success criteria, baselines, and held-out sets are SHA-locked in `prereg/` before any model sees the test data.
372
+ - Always report a baseline: a safety-only far-from-oncogene prior and CancerMine oncogene distance for the integrated score; a learned lamina-associated-domain chromatin baseline and ePRIDICT for the expression-robustness axis; intent-blind ranking for the planner; and attP-similarity, palindrome, or Hamming-distance baselines for the per-mechanism off-target paths.
373
+ - Guard against circularity: the expression-robustness axis is validated with lamina and heterochromatin features removed, so it cannot restate a chromatin baseline, and no task is scored against a label derived from the model's own features (asserted by a dedicated de-circularization test).
374
+ - Blind external concordance: recover validated safe harbours, clinical genotoxic loci, documented writes, and measured off-targets the model never trained on.
375
+ - Report failure: cross-cell-type degradation, the exact-site-versus-served-resolution gap, small benchmark sizes, and the limits of sequence-only off-target magnitude prediction are reported as results, not footnotes.
376
+ - Every estimate carries its sample size and confidence interval. The validated gold sets are small, and statistical power is a stated limitation; scaling them is the top priority for turning the proof of concept into an adopted resource.
377
+ - Grounded services: every quantitative answer comes from a validated tool call, never a language model, verified with the model live; the living database never auto-edits the atlas; clinical directives are refused.
378
+
379
+ ## Citation
380
+
381
+ ```bibtex
382
+ @software{penstack2026,
383
+ author = {Mahaboob Ali, Anees Ahmed},
384
+ title = {PEN-STACK: open infrastructure for genome writing (The Writable Genome)},
385
+ year = {2026},
386
+ version = {0.1.0},
387
+ url = {https://github.com/ahmedanees-m/pen-stack}
388
+ }
389
+ ```
390
+
391
+ Author: Anees Ahmed Mahaboob Ali, VIT University, Vellore. MIT licensed.
392
+
393
+ ## API stability
394
+
395
+ 0.1.0 is the first public release. It establishes the committed public API: the SDK functions, the REST
396
+ endpoints, and the twenty-two MCP tools. These follow semantic versioning, with a one-minor-version
397
+ deprecation warning before any breaking change. Stable surfaces carry calibrated uncertainty and an explicit
398
+ validation status. The mechanism-based off-target paths (serine-integrase, bridge, and CAST) are marked
399
+ experimental and may change as measured data becomes available.
400
+
401
+ Decision-support, not a clinical directive. Every score is traceable to public data and a pre-registered model.