Web control plane for ClawCures campaign orchestration and scientific execution.
Project description
clawcures-ui
clawcures-ui is the ClawCures web control plane for planning and running discovery campaigns across the Refua workspace.
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/clawcures-ui
python3.13 -m venv .venv
source .venv/bin/activate
pip install -e .
Use Python >=3.11,<3.14. Live execution depends on refua-mcp, which does not
support Python 3.14+.
Run
clawcures-ui --host 127.0.0.1 --port 8787 --open-browser
Or from source without install:
cd path/to/clawcures-ui
PYTHONPATH=src python -m clawcures_ui --host 127.0.0.1 --port 8787
Legacy compatibility is still shipped for existing automation:
refua-studioremains as a console-script aliaspython -m refua_studiostill works- legacy
REFUA_STUDIO_*auth token env vars are still accepted
Podman
Build image:
cd path/to/clawcures-ui
podman build -t clawcures-ui:local -f Containerfile .
Run container:
podman run --rm -p 8787:8787 \
-e REFUA_CAMPAIGN_OPENCLAW_BASE_URL=http://host.containers.internal:18789 \
-v "$(pwd)/.clawcures-ui-data:/data" \
-v "$(pwd)/..:/workspace:ro" \
clawcures-ui:local
Notes:
- The container starts
clawcures-uion0.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
.clawcures-ui-data/.
Podman Compose
From clawcures-ui/:
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:.clawcures-ui, with fallback to.refua-studiowhen present)--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/clawcures-ui
python -m unittest discover -s tests -v
Playwright E2E suite:
cd path/to/clawcures-ui
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.
Create .venv_release with Python 3.11-3.13, not 3.14+.
Build
cd path/to/clawcures-ui
python -m build
Build artifacts are written to dist/ (.tar.gz and .whl).
Project Layout
clawcures-ui/
Containerfile
docker-compose.yml
src/clawcures_ui/
app.py
bridge.py
cli.py
config.py
runner.py
storage.py
static/
index.html
app.js
styles.css
src/refua_studio/
...
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clawcures_ui-0.8.1.tar.gz.
File metadata
- Download URL: clawcures_ui-0.8.1.tar.gz
- Upload date:
- Size: 71.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.4 CPython/3.14.4 Darwin/25.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc83556c390b99acee5284c04bccaa6d76068aa9478933600fd6e56e3392ae52
|
|
| MD5 |
c73fb0707762de54bd1a299e8c12c1ed
|
|
| BLAKE2b-256 |
503fae52b7a3b2128b6dd18ff3d26018de2d3d8bca98b03b77dac76a26c20a90
|
File details
Details for the file clawcures_ui-0.8.1-py3-none-any.whl.
File metadata
- Download URL: clawcures_ui-0.8.1-py3-none-any.whl
- Upload date:
- Size: 102.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.4 CPython/3.14.4 Darwin/25.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fd65a746afc914eaaf880202d9795c258b1fc9fabe83bb63fa53930be6a9761
|
|
| MD5 |
802f215e10f88a7c79d791e56bff6162
|
|
| BLAKE2b-256 |
3a8e2e0cc3e0f031d2cd327a3c00d2630e51bc797aff6e138eed5ff4e0298bae
|