DoseMirror is a research workbench for finding in-vitro nanotoxicology studies that are experimentally comparable to a target experiment.
It combines structured evidence, hard scientific compatibility gates, a bounded delivered-dose model, calibrated abstention, and budget-aware information acquisition.
The repository includes a live React workbench, a FastAPI service, a Python command line interface, a deterministic 50-episode smoke benchmark, frozen synthetic fixtures, tests, CI, Docker support, and a publication package.
DoseMirror is research infrastructure.
It must not be used for patient care, occupational safety, regulatory decisions, environmental-risk conclusions, or individual exposure advice.
The current benchmark validates software mechanics only. It does not establish biological validity or support the scientific hypotheses in the claims ledger.
- Edit a target experiment and rerank evidence immediately
- Separate direct, translated, incompatible, and unresolved candidates
- Block textually similar studies when material, cell system, or endpoint gates fail
- Estimate delivered mass for supported static well geometries
- Return bounded intervals instead of a fabricated point when uncertainty is material
- Refuse dose translation when hydrodynamic size, effective density, or geometry is missing
- Preserve observed, derived, imputed, missing, and conflicting field states
- Show signed score contributions and study-level exclusion reasons
- Select the next action by expected decision-risk reduction per unit cost
- Export an auditable evidence report as JSON
- Run an offline deterministic NanoCompareBench smoke split
- Serve the same core workflow through FastAPI and the command line
docker compose up --buildOpen the workbench at http://localhost:3000.
Open the API documentation at http://localhost:8000/docs.
Requirements:
- Node.js 22.13 or later
- Python 3.11 or later
Install the workbench:
npm ci
npm run devInstall the research package:
python -m venv .venv
python -m pip install -e ".[dev]"
uvicorn dosemirror.api.main:app --reloaddosemirror ingest --fixture data/fixtures/mini
dosemirror benchmark --config configs/smoke.yaml
dosemirror compare --target examples/target.yaml
dosemirror reproduce --manifest runs/example/manifest.jsonThe default smoke benchmark runs offline and makes no external API calls.
Target experiment
|
v
Candidate retrieval
|
v
Hard scientific gates
|
+---- incompatible
|
v
Dosimetry applicability
|
+---- not identifiable ----> active acquisition or abstention
|
v
Bounded dose translation
|
v
Signed comparability score
|
v
Evidence report and replay manifest
The modules use dependency inversion so retrieval, extraction, dosimetry, compatibility scoring, and acquisition policies can be replaced independently.
dosemirror/
acquisition/ Value-per-cost action policy
api/ FastAPI contracts
benchmark/ Deterministic smoke benchmark
compatibility/ Hard gates and signed assessment
domain/ Immutable versioned scientific schemas
dosimetry/ Reduced-order settling and diffusion
ingestion/ Frozen fixture loader
normalization/ Dimensional unit conversion
retrieval/ BM25 baseline
app/ Live React workbench
configs/ Benchmark and source configuration
data/fixtures/ Legally redistributable synthetic records
docs/ Data, model, dosimetry, and reproducibility cards
paper/ Claims ledger and publication scaffolding
tests/ TypeScript and rendered application tests
tests_py/ Python unit, property, API, and safety tests
Every observed field requires an evidence span.
Every field carries one of these states:
observedderivedimputedmissingconflicting
Missing and conflicting critical variables never become observed values.
Dimensionally invalid unit conversion fails with an error.
Material density never substitutes for effective agglomerate density.
Primary size never substitutes for hydrodynamic size.
Hard incompatibilities cannot be repaired by semantic similarity.
The deployed model combines Stokes settling and Brownian diffusion in a static uniform liquid column.
The absorbed boundary approximation is used at the cell-facing surface.
The model reports:
- Delivered fraction
- Delivered mass per well area
- Uncertainty bounds
- Settling velocity
- Diffusion coefficient
- Peclet number
- Applicability status
The interval varies hydrodynamic diameter, effective density, and liquid height around the supplied values.
This implementation is not a full ISDD model. It does not support convection, dissolution, nonuniform media, complex particle shapes, or dynamic agglomeration.
See docs/dosimetry_card.md for equations, assumptions, limiting cases, and refusal rules.
Candidate assessment follows a strict order.
- Material identity and surface chemistry
- Biological system
- Endpoint construct
- Critical metadata completeness
- Dosimetry applicability
- Delivered-dose overlap
- Signed contribution score
The label meanings are:
| Label | Meaning |
|---|---|
direct |
Core design, geometry, and nominal exposure are aligned |
translated |
Comparison is supported after bounded dose translation |
incompatible |
A hard scientific gate failed |
unresolved |
Critical evidence is missing or conflicting |
The current policy ranks actions by expected decision-risk reduction divided by cost.
Supported actions include:
- Inspect a characterization table
- Search a supplement
- Request a hydrodynamic-size measurement
- Request an effective-density measurement
- Inspect plate geometry
- Retain uncertainty
- Stop or abstain
The policy stops when no permitted action has positive value within budget.
configs/smoke.yaml defines a 50-episode deterministic smoke split.
The fixtures cover:
- A direct comparison
- A defensible dose translation
- A material mismatch
- A biological-system mismatch
- An endpoint mismatch
- Critical missingness
- Conflicting evidence
- A surface-chemistry mismatch
All included records are synthetic and released for software testing.
Smoke benchmark output must be described as engineering validation. It must not be presented as a biological result.
The larger expert-reviewed benchmark remains future work.
Every publication run should record:
- Configuration
- Seed
- Code commit
- Environment lock
- Fixture snapshot
- Source registry version
- Model version
- Action costs
- Raw predictions
- Latency
- Statistical output
The expected run manifest is documented in docs/reproducibility.md.
The claims ledger is in paper/claims/ledger.md.
No result table is prefilled with scientific findings.
Run the complete web suite:
npm testRun Python tests:
pytestRun static checks:
npm run lint
ruff check dosemirror tests_py
mypy dosemirror
bandit -q -r dosemirrorThe test suite covers:
- Immutable scientific schemas
- Evidence requirements
- Geometry validation
- Dimensional consistency
- Analytic transport limits
- Probability bounds
- Retrieval behavior
- Hard incompatibility gates
- Missing-data abstention
- Budget stopping
- API contracts
- Research-use boundaries
- Deterministic benchmark behavior
- Server-rendered application content
The default application uses frozen synthetic fixtures.
Live sources are optional adapters and require explicit confirmation before submission.
Access conditions, redistribution limits, fallback behavior, and snapshot rules are recorded in docs/source_registry.md and configs/sources.yaml.
No external paper, figure, table, dataset, or PDF is included in this repository.
Before a scientific submission:
- Register the hypotheses and statistical plan
- Freeze the source registry and benchmark snapshot
- Obtain expert pairwise labels
- Measure inter-rater agreement
- Run all baselines and ablations
- Save raw per-episode predictions
- Compute paired confidence intervals and effect sizes
- Review failure strata
- Update every claim as supported, unsupported, or inconclusive
- Ask an independent domain collaborator to validate assumptions
Kill criteria are recorded in the claims ledger and must be applied before publication.
Do not upload private, licensed, or personal documents to a public deployment.
The current hosted workbench uses synthetic fixtures and stores no uploaded documents.
See SECURITY.md for reporting and deployment guidance.
Contributions should preserve refusal behavior, provenance, deterministic tests, and the research-use boundary.
See CONTRIBUTING.md.
Code is licensed under Apache License 2.0.
Synthetic fixtures are released under CC0 1.0.