# mahesh-mettireddy/triagepilot architecture

> Architecture diagram of the GitHub repository mahesh-mettireddy/triagepilot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mahesh-mettireddy/triagepilot
- Repository: https://github.com/mahesh-mettireddy/triagepilot

## Overview

TriagePilot is an incident-analysis and evidence-verification product: an analyst submits a ticket, the engine gathers operational and code evidence, verifies citations, grades trust, and produces a verdict and next check for review. Its documented capabilities also include live transfer-app telemetry, parallel specialists, A2A delegation, SSE activity, revision-aware audit persistence, and evaluation. The transfer applications are target systems investigated by the product, not its primary workflow. Some API and engine modules were not excerpted; links to them rely on README statements or SOURCE INDEX references rather than direct source inspection.

Main entry points: [`engine/orchestrator.py`](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/orchestrator.py) (Investigation orchestrator), [`api/main.py`](https://github.com/mahesh-mettireddy/triagepilot/blob/main/api/main.py) (HTTP API), [`engine/adapters/live_adapter.py`](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/adapters/live_adapter.py) (Live telemetry adapter), [`ui/src/screens/CockpitScreen.tsx`](https://github.com/mahesh-mettireddy/triagepilot/blob/main/ui/src/screens/CockpitScreen.tsx) (Investigation cockpit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Analyst experience"]
  node_cockpit["Investigation cockpit<br/>[CockpitScreen.tsx]"]
  node_uiapi["UI API client<br/>[api.ts]"]
  node_evalscreen["Evaluation screen<br/>[EvalScreen.tsx]"]
  node_architecture["Architecture screen"]
end

subgraph group_analysis["Triage engine"]
  node_orchestrator["Investigation orchestrator<br/>[orchestrator.py]"]
  node_masking["Privacy masking<br/>[masking.py]"]
  node_planner["Intake and routing<br/>[planner.py]"]
  node_specialists["Specialist swarm<br/>[specialists.py]"]
  node_schemas["Investigation data models<br/>[schemas.py]"]
  node_report["Verdict synthesis<br/>[report_agent.py]"]
end

subgraph group_evidence["Evidence sources"]
  node_ports["Evidence source ports<br/>[base.py]"]
  node_fixture["Fixture evidence adapter<br/>[fixture_adapter.py]"]
  node_live["Live telemetry adapter<br/>[live_adapter.py]"]
  node_targetapp["Transfer target application"]
end

subgraph group_assurance["Verification and state"]
  node_verifier["Citation verifier<br/>[verifier.py]"]
  node_trust["Trust gate<br/>[trust.py]"]
  node_nextcheck["Next-check selector<br/>[next_check.py]"]
  node_persistence[("Investigation persistence<br/>[persistence.py]")]
  node_audit[("Hash-chain audit<br/>[audit.py]")]
end

subgraph group_capabilities["Interfaces and evaluation"]
  node_api["HTTP API<br/>[main.py]"]
  node_sse["Activity stream<br/>[sse.py]"]
  node_a2a["A2A delegation<br/>[a2a.py]"]
  node_eval["Evaluation suite<br/>[runner.py]"]
end

node_analyst(("Incident analyst"))

node_analyst -->|"submits incident"| node_cockpit
node_cockpit -->|"requests analysis"| node_uiapi
node_uiapi -.->|"calls endpoints"| node_api
node_api -.->|"starts investigation"| node_orchestrator
node_orchestrator -->|"masks intake"| node_masking
node_orchestrator -->|"routes ticket"| node_planner
node_orchestrator -->|"runs specialists"| node_specialists
node_specialists -->|"queries evidence"| node_ports
node_fixture -.->|"implements ports"| node_ports
node_live -->|"implements ports"| node_ports
node_live -->|"executes requests"| node_targetapp
node_orchestrator -->|"selects fixtures"| node_fixture
node_orchestrator -->|"selects live data"| node_live
node_orchestrator -->|"verifies citations"| node_verifier
node_orchestrator -->|"grades evidence"| node_trust
node_orchestrator -->|"selects next check"| node_nextcheck
node_orchestrator -->|"synthesizes verdict"| node_report
node_orchestrator -->|"persists state"| node_persistence
node_orchestrator -->|"seals transitions"| node_audit
node_orchestrator -->|"uses models"| node_schemas
node_api -.->|"streams activity"| node_sse
node_analyst -->|"delegates task"| node_a2a
node_a2a -->|"delegates investigation"| node_orchestrator
node_evalscreen -.->|"runs benchmarks"| node_eval
node_analyst -->|"reviews benchmarks"| node_evalscreen
node_analyst -->|"views architecture"| node_architecture
node_orchestrator -.->|"emits events"| node_sse
node_report -->|"shows verdict"| node_cockpit

click node_cockpit "https://github.com/mahesh-mettireddy/triagepilot/blob/main/ui/src/screens/CockpitScreen.tsx"
click node_uiapi "https://github.com/mahesh-mettireddy/triagepilot/blob/main/ui/src/api.ts"
click node_api "https://github.com/mahesh-mettireddy/triagepilot/blob/main/api/main.py"
click node_orchestrator "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/orchestrator.py"
click node_masking "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/masking.py"
click node_planner "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/planner.py"
click node_specialists "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/agents/specialists.py"
click node_schemas "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/schemas.py"
click node_ports "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/ports/base.py"
click node_fixture "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/adapters/fixture_adapter.py"
click node_live "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/adapters/live_adapter.py"
click node_targetapp "https://github.com/mahesh-mettireddy/triagepilot/tree/main/transfers-demo-app/app"
click node_verifier "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/verifier.py"
click node_trust "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/trust.py"
click node_nextcheck "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/next_check.py"
click node_report "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/agents/report_agent.py"
click node_persistence "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/persistence.py"
click node_audit "https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/audit.py"
click node_sse "https://github.com/mahesh-mettireddy/triagepilot/blob/main/api/sse.py"
click node_a2a "https://github.com/mahesh-mettireddy/triagepilot/blob/main/api/a2a.py"
click node_eval "https://github.com/mahesh-mettireddy/triagepilot/blob/main/eval/runner.py"
click node_evalscreen "https://github.com/mahesh-mettireddy/triagepilot/blob/main/ui/src/screens/EvalScreen.tsx"
click node_architecture "https://github.com/mahesh-mettireddy/triagepilot/blob/main/ui/src/screens/ArchitectureScreen.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cockpit,node_uiapi,node_evalscreen,node_architecture toneBlue
class node_orchestrator,node_masking,node_planner,node_specialists,node_schemas,node_report toneAmber
class node_ports,node_fixture,node_live,node_targetapp toneMint
class node_verifier,node_trust,node_nextcheck,node_persistence,node_audit toneRose
class node_api,node_sse,node_a2a,node_eval,node_analyst toneIndigo
```

## Components

### Analyst experience

- [Investigation cockpit](https://github.com/mahesh-mettireddy/triagepilot/blob/main/ui/src/screens/CockpitScreen.tsx): `ui/src/screens/CockpitScreen.tsx`
- [UI API client](https://github.com/mahesh-mettireddy/triagepilot/blob/main/ui/src/api.ts): `ui/src/api.ts`
- [Evaluation screen](https://github.com/mahesh-mettireddy/triagepilot/blob/main/ui/src/screens/EvalScreen.tsx): `ui/src/screens/EvalScreen.tsx`
- [Architecture screen](https://github.com/mahesh-mettireddy/triagepilot/blob/main/ui/src/screens/ArchitectureScreen.tsx): `ui/src/screens/ArchitectureScreen.tsx`

### Triage engine

- [Investigation orchestrator](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/orchestrator.py): `engine/orchestrator.py`
- [Privacy masking](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/masking.py): `engine/masking.py`
- [Intake and routing](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/planner.py): `engine/planner.py`
- [Specialist swarm](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/agents/specialists.py): `engine/agents/specialists.py`
- [Investigation data models](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/schemas.py): `engine/schemas.py`
- [Verdict synthesis](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/agents/report_agent.py): `engine/agents/report_agent.py`

### Evidence sources

- [Evidence source ports](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/ports/base.py): `engine/ports/base.py`
- [Fixture evidence adapter](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/adapters/fixture_adapter.py): `engine/adapters/fixture_adapter.py`
- [Live telemetry adapter](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/adapters/live_adapter.py): `engine/adapters/live_adapter.py`
- [Transfer target application](https://github.com/mahesh-mettireddy/triagepilot/tree/main/transfers-demo-app/app): `transfers-demo-app/app`

### Verification and state

- [Citation verifier](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/verifier.py): `engine/verifier.py`
- [Trust gate](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/trust.py): `engine/trust.py`
- [Next-check selector](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/next_check.py): `engine/next_check.py`
- [Investigation persistence](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/persistence.py): `engine/persistence.py`
- [Hash-chain audit](https://github.com/mahesh-mettireddy/triagepilot/blob/main/engine/audit.py): `engine/audit.py`

### Interfaces and evaluation

- [HTTP API](https://github.com/mahesh-mettireddy/triagepilot/blob/main/api/main.py): `api/main.py`
- [Activity stream](https://github.com/mahesh-mettireddy/triagepilot/blob/main/api/sse.py): `api/sse.py`
- [A2A delegation](https://github.com/mahesh-mettireddy/triagepilot/blob/main/api/a2a.py): `api/a2a.py`
- [Evaluation suite](https://github.com/mahesh-mettireddy/triagepilot/blob/main/eval/runner.py): `eval/runner.py`

### Other components

- **Incident analyst**

## Connections

- Incident analyst → Investigation cockpit: submits incident
- Investigation cockpit → UI API client: requests analysis (evidence: `ui/src/App.tsx`)
- UI API client → HTTP API: calls endpoints
- HTTP API → Investigation orchestrator: starts investigation
- Investigation orchestrator → Privacy masking: masks intake (evidence: `engine/orchestrator.py`)
- Investigation orchestrator → Intake and routing: routes ticket (evidence: `engine/orchestrator.py`)
- Investigation orchestrator → Specialist swarm: runs specialists (evidence: `engine/orchestrator.py`)
- Specialist swarm → Evidence source ports: queries evidence (evidence: `engine/agents/specialists.py`)
- Fixture evidence adapter → Evidence source ports: implements ports
- Live telemetry adapter → Evidence source ports: implements ports (evidence: `engine/adapters/live_adapter.py`)
- Live telemetry adapter → Transfer target application: executes requests
- Investigation orchestrator → Fixture evidence adapter: selects fixtures (evidence: `engine/orchestrator.py`)
- Investigation orchestrator → Live telemetry adapter: selects live data (evidence: `engine/orchestrator.py`)
- Investigation orchestrator → Citation verifier: verifies citations (evidence: `engine/orchestrator.py`)
- Investigation orchestrator → Trust gate: grades evidence (evidence: `engine/orchestrator.py`)
- Investigation orchestrator → Next-check selector: selects next check
- Investigation orchestrator → Verdict synthesis: synthesizes verdict (evidence: `engine/orchestrator.py`)
- Investigation orchestrator → Investigation persistence: persists state (evidence: `engine/orchestrator.py`)
- Investigation orchestrator → Hash-chain audit: seals transitions (evidence: `engine/orchestrator.py`)
- Investigation orchestrator → Investigation data models: uses models (evidence: `engine/orchestrator.py`)
- HTTP API → Activity stream: streams activity
- Incident analyst → A2A delegation: delegates task
- A2A delegation → Investigation orchestrator: delegates investigation
- Evaluation screen → Evaluation suite: runs benchmarks
- Incident analyst → Evaluation screen: reviews benchmarks
- Incident analyst → Architecture screen: views architecture
- Investigation orchestrator → Activity stream: emits events
- Verdict synthesis → Investigation cockpit: shows verdict
