refua-studio
refua-studio is the Refua web control plane for planning and running discovery campaigns.
It provides:
- Mission control UI for planning (
plan), execution (run), and autonomous loops (run-autonomousbehavior) - JSON plan editor with validation and direct execution
- Portfolio ranking UI for disease program prioritization
- Clinical trial management UI (trial CRUD, human/simulated enrollment, outcome capture, simulation refresh)
- Program graph command center (program registry, timeline events, stage-gate approvals/e-signature capture)
- Cross-package orchestration for
refua-data,refua-preclinical(including CMC workflows),refua-bench,refua-wetlab, andrefua-regulatory - Dataset catalog and materialization controls with provenance extraction
- Benchmark gate execution against baselines for release decisions
- Wet-lab protocol validation/compile/run controls with lineage events
- Regulatory evidence bundle build/verify workflows from campaign jobs or direct payloads
- Animated telemetry widgets for running jobs, managed trials, patient counts, promising leads, and tools online
- Built-in objective/plan/portfolio templates loaded from workspace examples
- Ecosystem health panel with cross-product discovery metadata
- ClawCures-native handoff artifact generation and executable command suggestions
- Promising cures section with full ADMET property maps, assessments, and detailed therapeutic review cards
- Persistent background job history (SQLite)
- Job lifecycle operations (filter, cancel queued jobs, clear finished jobs)
- Runtime/tool introspection with graceful fallback when heavy ML deps are unavailable
This project is designed to reuse existing workspace components:
ClawCuresfor planning, policy checks, orchestration, and portfolio rankingrefua-mcpfor tool execution when runtime dependencies are installed
Install
cd path/to/refua-studio
pip install -e .
Run
refua-studio --host 127.0.0.1 --port 8787 --open-browser
Or from source without install:
cd path/to/refua-studio
PYTHONPATH=src python -m refua_studio --host 127.0.0.1 --port 8787
Podman
Build image:
cd path/to/refua-studio
podman build -t refua-studio:local -f Containerfile .
Run container:
podman run --rm -p 8787:8787 \
-e REFUA_CAMPAIGN_OPENCLAW_BASE_URL=http://host.containers.internal:18789 \
-v "$(pwd)/.refua-studio-data:/data" \
-v "$(pwd)/..:/workspace:ro" \
refua-studio:local
Notes:
- The container starts
refua-studioon0.0.0.0:8787. - Mount the monorepo root at
/workspaceso Studio can integrate withClawCures,refua-mcp, and other sibling projects. - Persistent job database lives in
.refua-studio-data/.
Podman Compose
From refua-studio/:
podman compose -f docker-compose.yml up --build
Then open http://127.0.0.1:8787.
Configuration
Studio uses the same OpenClaw-related environment variables as ClawCures:
REFUA_CAMPAIGN_OPENCLAW_BASE_URL(default:http://127.0.0.1:18789)REFUA_CAMPAIGN_OPENCLAW_MODEL(default:openclaw:main)REFUA_CAMPAIGN_TIMEOUT_SECONDS(default:180)OPENCLAW_GATEWAY_TOKENorREFUA_CAMPAIGN_OPENCLAW_TOKEN
CLI flags:
--host--port--data-dir(default:.refua-studio)--workspace-root(defaults to parent workspace)--max-workers(background job concurrency)
API Endpoints
GET /api/healthGET /api/configGET /api/toolsGET /api/examplesGET /api/ecosystemGET /api/command-center/capabilitiesGET /api/program-gates/templatesGET /api/programs?limit=100&stage=lead_optimizationGET /api/programs/{program_id}GET /api/programs/{program_id}/events?limit=200GET /api/programs/{program_id}/approvals?limit=200POST /api/programs/upsertPOST /api/programs/sync-jobsPOST /api/programs/{program_id}/events/addPOST /api/programs/{program_id}/approvePOST /api/programs/{program_id}/gate-evaluateGET /api/data/datasets?tag=admet&limit=60POST /api/data/materializePOST /api/bench/gateGET /api/wetlab/providersPOST /api/wetlab/protocol/validatePOST /api/wetlab/protocol/compilePOST /api/wetlab/runGET /api/wetlab/lms(resource index)GET /api/wetlab/lms/*(mirrorsrefua-wetlabLMS GET resources)POST /api/wetlab/lms/*(mirrorsrefua-wetlabLMS POST resources)GET /api/regulatory/bundles?limit=100POST /api/regulatory/bundle/buildPOST /api/regulatory/bundle/verifyGET /api/drug-portfolio?min_score=50&limit=60GET /api/promising-cures?min_score=50&limit=60GET /api/clinical/trialsGET /api/clinical/trials/{trial_id}GET /api/clinical/trials/{trial_id}/sitesGET /api/clinical/trials/{trial_id}/opsGET /api/preclinical/templatesGET /api/preclinical/cmc/templatesGET /api/jobs?limit=80&status=running,failedGET /api/jobs/{job_id}POST /api/jobs/{job_id}/cancelPOST /api/jobs/clearPOST /api/planPOST /api/runPOST /api/plan/validatePOST /api/plan/executePOST /api/portfolio/rankPOST /api/clawcures/handoffPOST /api/clinical/trials/addPOST /api/clinical/trials/updatePOST /api/clinical/trials/removePOST /api/clinical/trials/enrollPOST /api/clinical/trials/enroll-simulatedPOST /api/clinical/trials/resultPOST /api/clinical/trials/simulatePOST /api/clinical/trials/site/upsertPOST /api/clinical/trials/screenPOST /api/clinical/trials/monitoring/visitPOST /api/clinical/trials/query/addPOST /api/clinical/trials/query/updatePOST /api/clinical/trials/deviation/addPOST /api/clinical/trials/safety/addPOST /api/clinical/trials/milestone/upsertPOST /api/preclinical/planPOST /api/preclinical/schedulePOST /api/preclinical/bioanalysisPOST /api/preclinical/workupPOST /api/preclinical/cmc/planPOST /api/preclinical/cmc/batch-recordPOST /api/preclinical/cmc/stability-planPOST /api/preclinical/cmc/stability-assessPOST /api/preclinical/cmc/release-assess
POST /api/run payload
{
"objective": "Design an initial campaign against KRAS G12D",
"system_prompt": null,
"dry_run": false,
"async_mode": true,
"autonomous": false,
"max_rounds": 3,
"max_calls": 10,
"allow_skip_validate_first": false,
"plan": null
}
POST /api/clawcures/handoff payload
{
"objective": "Design an initial campaign against KRAS G12D",
"system_prompt": null,
"plan": {"calls": []},
"autonomous": false,
"dry_run": true,
"max_calls": 10,
"allow_skip_validate_first": false,
"write_file": true,
"artifact_name": "kras_handoff.json"
}
Returns a normalized handoff artifact plus ready-to-run ClawCures CLI commands.
POST /api/clinical/trials/add payload
{
"trial_id": "studio-clinical-demo",
"status": "planned",
"config": null
}
POST /api/clinical/trials/enroll payload
{
"trial_id": "studio-clinical-demo",
"patient_id": "human-001",
"source": "human",
"arm_id": "control",
"demographics": {"age": 62, "weight": 76},
"baseline": {"endpoint_value": 48.1},
"metadata": {"site_id": "site-01"}
}
POST /api/clinical/trials/simulate payload
{
"trial_id": "studio-clinical-demo",
"replicates": 8,
"seed": 7,
"async_mode": true
}
Background Jobs
Jobs are persisted in SQLite at:
<data-dir>/studio.db
Each job records request payload, status transitions (queued -> running -> completed/failed), result JSON, and error text.
cancelled is also tracked when queued jobs are cancelled before execution.
Runtime Behavior
- If
refua-mcpruntime dependencies are available, Studio executes plans throughRefuaMcpAdapter. - If unavailable, Studio falls back to a static tool list for planning/validation and emits warnings.
- Dry-run workflows and policy validation remain usable even without heavy runtime dependencies.
- Clinical trial endpoints require the scientific stack shipped in package dependencies (
numpy,pandas,scipy,pyyaml). - Command-center integrations require workspace access to sibling repos for bridge imports:
refua-data,refua-preclinical,refua-bench,refua-regulatory, andrefua-wetlab.
Tests
cd path/to/refua-studio
python -m unittest discover -s tests -v
Playwright E2E suite:
cd path/to/refua-studio
npm install
npx playwright install chromium
npm run test:e2e
The E2E runner boots a real Studio server via .venv_release on an isolated
.playwright-data/ directory and exercises mission-control workflows across
command center, planning/jobs, clinical operations, and wet-lab/regulatory flows.
Build
cd path/to/refua-studio
python -m build
Build artifacts are written to dist/ (.tar.gz and .whl).
Project Layout
refua-studio/
Containerfile
docker-compose.yml
src/refua_studio/
app.py
bridge.py
cli.py
config.py
runner.py
storage.py
static/
index.html
app.js
styles.css
tests/
Notes
- The Studio UI is a static single-page app served by the Python server.
- No third-party web framework is required.
- Studio now includes scientific dependencies to support embedded clinical operations alongside campaign orchestration.
Metadata
Release files for refua-studio 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| refua_studio-0.7.1.tar.gz | 88.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| refua_studio-0.7.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 167.0 kB
Release files / refua_studio-0.7.1.tar.gz
| Download URL | refua_studio-0.7.1.tar.gz |
|---|---|
| Size | 88.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f69d4dd818c4fe328336e2511b3d27a84c26f68e20a76de9cb1cd9063019f65
|
|
BLAKE2b-256 checksum How to use checksums |
b46267b5bcf3fe170aa9371e58c08c39e636cbe2f323a6f4909dc23b7777e0c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.14.3 Darwin/25.3.0
|
Release files / refua_studio-0.7.1-py3-none-any.whl
| Download URL | refua_studio-0.7.1-py3-none-any.whl |
|---|---|
| Size | 78.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3434eda1eda883a21dbe3a45e532f69603eef96378716867c518e19cc835cb3
|
|
BLAKE2b-256 checksum How to use checksums |
8088600d133578cdd7d0bc040b1781fafe1a1e7881c9c8edd0268d6e63d7a479
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.14.3 Darwin/25.3.0
|
Security for refua-studio 0.7.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.