Skip to content

Architecture & scope

What Inspector does NOT do (and why that's the point)

Inspector is governance middleware — it certifies that algorithms are correct. It does not execute them.

Out of Scope Reason
Read patient data (EHR, OMOP, FHIR rows) Execution platform responsibility
Execute scenarios in production Execution platform responsibility
Send clinical alerts Execution platform responsibility
Handle PHI/HIPAA data No patient data in certification

Preflight's optional live plan connects to your own local database for an EXPLAIN only — it reads query-plan metadata (estimated rows, scan types), never patient rows. No data is fetched and no query is executed.

System architecture

┌─────────────────────────────────────────────────────────────────┐
│                     Frontend (Next.js)                          │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌───────────────┐   │
│  │ Generate │→ │ Editor   │→ │ Preview  │→ │    Export     │   │
│  │ (AI)     │  │ (YAML)   │  │ DAG/Tree │  │ Bundle + Word │   │
│  └──────────┘  └──────────┘  └──────────┘  └───────────────┘   │
└────────────────────────────┬────────────────────────────────────┘
                             │ REST API
┌────────────────────────────▼────────────────────────────────────┐
│                     Backend (FastAPI)                           │
│  ┌──────────────┐  ┌──────────────┐  ┌────────────────────┐    │
│  │ /generate    │  │ /validate    │  │ /export/bundle     │    │
│  │ /outline     │  │              │  │ /export/irb-doc    │    │
│  └──────────────┘  └──────────────┘  └────────────────────┘    │
│         │                 │                    │                │
│  ┌──────▼──────┐  ┌───────▼───────┐  ┌────────▼─────────┐      │
│  │  OpenAI /   │  │   psdl-lang   │  │   python-docx    │      │
│  │   Ollama    │  │  (validation) │  │  (Word export)   │      │
│  └─────────────┘  └───────────────┘  └──────────────────┘      │
└─────────────────────────────────────────────────────────────────┘
Component Technology
Frontend Next.js 14, React 18, Tailwind CSS
Editor CodeMirror 6
Visualization ReactFlow, dagre (auto-layout)
Backend FastAPI, Python 3.9+
Validation psdl-lang (latest)
AI Generation OpenAI GPT-4o-mini, Ollama
Document Export python-docx

See ARCHITECTURE_EXECUTION.md for the author → certify → execute chain, and EXECUTION_CONTRACT.md for how execution platforms consume the certified bundle.