Why I built it
In October 2026 the team behind Google Cloud's Drug Design Engine, since renamed the Open Agentic Science Engine, released version 0.1 as open source and asked for collaborators to pressure-test it. This project is my answer to that: a piece the engine was missing, tested on a real trial.
Google's engine is strict about evidence. Every number an agent cites has to come from a tool that wrote it to disk with a record of how it was made, and a reviewer agent re-runs the analysis to check. QT was the gap: the safety record had a yes/no field for "QTc prolonged" and a free-text note, and when I gave a small local model that record, it called a typed "+18 ms" a confirmed safety concern.
How it works
The engine's tools run in two steps, and the ecg command follows that pattern. ingest reads a study's QT readings and checks each one: the signature, the hash of the ECG it came from, and the sequence number. If any reading was edited, it refuses the whole batch. Missing readings get recorded as gaps. analyze runs offline. It averages the three repeat ECGs at each timepoint, takes the change from before the dose minus the same change on placebo, and gives each drug one of the rule's verdicts: negative, not negative, or insufficient data.
Each shortcut the tool takes is written into its output as a code the agent has to repeat in its report. My statistics are simpler than a regulator's, so every analysis carries a code that says so.
The measurement itself is integer-only C. The reason is re-running: whole-number math gives the same answer to the last bit on any machine, so when the engine's reviewer re-runs a reading it should get exactly the number the agent cited.
The hard part
Before running anything I wrote down pass bars, then tuned on 11 volunteers and scored the other 11. The first scored run failed. On one placebo ECG the code couldn't find the start of the QRS and returned the edge of its search window as if it were a measurement, 116 ms off. That one record shifted every drug's placebo-corrected result for that volunteer. The fix was to make the code refuse instead of guessing, which is also the engine's own rule.
The full trial run passed three of my four bars and failed the one on per-volunteer agreement. The average is right, but each ECG carries about 6 ms of noise, and a placebo-corrected change subtracts four of them. Verapamil sits right at the 10 ms line, so that noise can flip its call. Dropping cells where the three repeat ECGs disagree by more than 20 ms narrowed the spread to −12.6 to +11.3 ms on the held-out volunteers. It still misses ±10.
Verapamil has a second problem I haven't solved. In my numbers QT rises with verapamil's blood concentration about 3.5 times as steeply as in the reference. Verapamil changes heart rate, so my first suspect is the heart-rate correction, but I haven't tested that.

What it doesn't do yet
The trial is in people, while Google's engine is mostly for animal studies before trials, where heart-rate correction works differently. The regulators' rule is for human trials, so the analysis refuses animal data, and I haven't built or tested an animal version. The engine's agents don't call it on their own yet either. That needs a skill file and a permission in their templates, which I haven't written. The command is a patch against the engine's commit c5984eb, not merged.
While testing the engine's existing safety math I also found that its hERG margin divides by the wrong drug exposure when a clinical one is supplied. The reproduction is in the repository.
I built this with Claude Code (Claude Opus 5.5), which wrote the code and the first draft of this write-up. The data sources, code and every number are in the repository.
