ForScience
patents are packed with methods, but they’re written like legal mazes.
Core trick
Extracts ordered steps and parameters with units from patent text into JSON, saving each failure as a CI regression fixture.
Description
patents are packed with methods, but they’re written like legal mazes. patent workflow compiler is an open-source tool that compiles patent-style technical text into a structured scientific workflow: ordered steps, extracted parameters with ranges and units, and packaged as json plus a human-readable report and diagram.
for researchers, it turns dense prose into a machine-usable protocol and flags what patents often leave underspecified, like missing units
for developers, it’s a regression-tested extraction pipeline where every new weird pattern becomes a fixture. it generates edge-case packs on demand, runs ci, and uses trace-driven fixes in isolated worktrees so edge cases steadily become permanent regression tests.
it was built in the codex app using parallel agents and worktrees, which made it fast to generate fixtures, debug failures, and merge clean diffs back to main.
README excerpt
# Patent-to-Scientific Workflow Compiler
For scientists, it turns dense patent methods into a usable protocol: ordered steps, parameters with units/ranges, and reproducibility gaps flagged when patents leave things underspecified (missing units, conditions, or fuzzy words), exported as stable JSON plus a readable report/diagram.
For developers, it makes “healing” easy to set up: each new failure can be captured as a fixture, replayed in CI, and fixed with trace-driven patches in isolated worktrees, so edge cases steadily become permanent regression tests.
Built in the Codex app, parallel agents + worktrees speed up fixture generation, debugging, and clean, reviewable merges.
## What it does
Input:
- A granted patent number (preferred) **or** a local fixture.
Output:
1. Ordered workflow steps with evidence snippets
2. Extracted parameters (ranges/units + step association when possible)
3. Reproducibility gaps (missing units, ambiguous quantifiers, missing conditions)
4. A `report.md` summary
Artifacts are written to `./artifacts/<jobId>/`.
## Setup
```bash
npm install
```
Set the PatentsView key (optional, only needed for live API fetches):
```bash
export PATENTSVIEW_API_KEY="your_key_here"
```
## Run the app
```bash
npm run dev
```
Open [http://localhost:3000](http://localhost:3000) and compile by patent number or fixture.
## API
### POST /api/compile
Input:
```json
{ "patentNumber": "12345678" }
```
OR
```json
{ "fixtureName": "fix-enum-001" }
```
Behavior:
- If `