# ameya5006/aletheia architecture

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

- Interactive diagram: https://gitdiagram.com/ameya5006/aletheia
- Repository: https://github.com/ameya5006/aletheia

## Overview

Aletheia is an explainable-AI auditor for high-stakes tabular models, centered on hospital readmission risk and a secondary credit benchmark. Its supervisor workflow starts with an authenticated, empty workspace, accepts manual case inputs, runs a frozen model, and presents version-bound prediction and explanation evidence. Saving adds the result to analysis history; running also records an immutable audit snapshot. Separate research and evidence views cover model reliability, review, audit history, and release details. Relationships for unsampled backend routes are limited to README-documented behavior; source excerpts do not expose the full API implementation.

Main entry points: [`src/aletheia/application/api.py`](https://github.com/ameya5006/aletheia/blob/main/src/aletheia/application/api.py) (Application API), [`src/aletheia/domains/healthcare/audit.py`](https://github.com/ameya5006/aletheia/blob/main/src/aletheia/domains/healthcare/audit.py) (Healthcare audit), [`frontend/src/pages/Analyses.tsx`](https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/Analyses.tsx) (Analysis workflow), [`src/aletheia/application/release.py`](https://github.com/ameya5006/aletheia/blob/main/src/aletheia/application/release.py) (Frozen release)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Supervisor workspace"]
  node_analysis_ui["Analysis workflow<br/>[Analyses.tsx]"]
  node_overview_ui["Overview<br/>[Overview.tsx]"]
  node_session["Identity session<br/>[session.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
  node_review_ui["Review<br/>[Review.tsx]"]
  node_evidence_ui["Evidence views<br/>[Explanation.tsx]"]
  node_reliability_ui["Reliability views<br/>[Reliability.tsx]"]
  node_audit_ui["Audit history<br/>[AuditTrail.tsx]"]
  node_model_ui["Model and release<br/>[ModelCard.tsx]"]
end

subgraph group_service["Application service"]
  node_api["Application API<br/>[api.py]"]
  node_case_input["Case input rules<br/>[case_input.py]"]
  node_release["Frozen release<br/>[release.py]"]
  node_store[("Analysis store<br/>[store.py]")]
end

subgraph group_research["Model research"]
  node_health_experiment["Healthcare experiment<br/>[experiment.py]"]
  node_health_audit["Healthcare audit<br/>[audit.py]"]
  node_explanation["Explanation methods<br/>[explain.py]"]
  node_research_evidence["Fairness and stability"]
end

subgraph group_foundations["Data foundations"]
  node_data_foundation["Dataset preparation"]
  node_credit_baseline["Credit baseline<br/>[baseline.py]"]
  node_manifest["Experiment manifest<br/>[manifest.py]"]
  node_artifact_store["Run artifacts<br/>[artifacts.py]"]
end

node_supervisor(("Supervisor"))

node_supervisor -->|"enters workflow"| node_analysis_ui
node_analysis_ui -->|"uses identity"| node_session
node_analysis_ui -->|"requests analysis"| node_api_client
node_api_client -->|"sends requests"| node_api
node_api -.->|"validates inputs"| node_case_input
node_api -->|"runs prediction"| node_release
node_api -->|"saves history"| node_store
node_api -->|"records snapshot"| node_health_audit
node_release -->|"checks fields"| node_case_input
node_release -->|"uses explanation"| node_explanation
node_release -->|"uses audit logic"| node_health_audit
node_analysis_ui -.->|"returns to overview"| node_overview_ui
node_supervisor -->|"reviews prediction"| node_review_ui
node_supervisor -->|"opens evidence"| node_evidence_ui
node_supervisor -->|"opens reliability"| node_reliability_ui
node_supervisor -->|"opens audit history"| node_audit_ui
node_supervisor -->|"opens model details"| node_model_ui
node_health_audit -->|"checks experiment"| node_health_experiment
node_health_audit -->|"uses explanation"| node_explanation
node_health_audit -->|"assembles evidence"| node_research_evidence
node_health_experiment -.->|"records run"| node_manifest
node_data_foundation -->|"supplies dataset"| node_credit_baseline
node_credit_baseline -->|"builds manifest"| node_manifest
node_credit_baseline -->|"publishes artifacts"| node_artifact_store
node_manifest -->|"describes run"| node_artifact_store

click node_analysis_ui "https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/Analyses.tsx"
click node_overview_ui "https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/Overview.tsx"
click node_session "https://github.com/ameya5006/aletheia/blob/main/frontend/src/auth/session.tsx"
click node_api_client "https://github.com/ameya5006/aletheia/blob/main/frontend/src/api/client.ts"
click node_review_ui "https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/Review.tsx"
click node_evidence_ui "https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/Explanation.tsx"
click node_reliability_ui "https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/Reliability.tsx"
click node_audit_ui "https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/AuditTrail.tsx"
click node_model_ui "https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/ModelCard.tsx"
click node_api "https://github.com/ameya5006/aletheia/blob/main/src/aletheia/application/api.py"
click node_case_input "https://github.com/ameya5006/aletheia/blob/main/src/aletheia/application/case_input.py"
click node_release "https://github.com/ameya5006/aletheia/blob/main/src/aletheia/application/release.py"
click node_store "https://github.com/ameya5006/aletheia/blob/main/src/aletheia/application/store.py"
click node_health_experiment "https://github.com/ameya5006/aletheia/blob/main/src/aletheia/domains/healthcare/experiment.py"
click node_health_audit "https://github.com/ameya5006/aletheia/blob/main/src/aletheia/domains/healthcare/audit.py"
click node_explanation "https://github.com/ameya5006/aletheia/blob/main/src/aletheia/domains/healthcare/explain.py"
click node_research_evidence "https://github.com/ameya5006/aletheia/tree/main/src/aletheia/domains/healthcare"
click node_data_foundation "https://github.com/ameya5006/aletheia/tree/main/src/aletheia/data"
click node_credit_baseline "https://github.com/ameya5006/aletheia/blob/main/src/aletheia/ml/baseline.py"
click node_manifest "https://github.com/ameya5006/aletheia/blob/main/src/aletheia/experiments/manifest.py"
click node_artifact_store "https://github.com/ameya5006/aletheia/blob/main/src/aletheia/experiments/artifacts.py"

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_analysis_ui,node_overview_ui,node_session,node_api_client,node_review_ui,node_evidence_ui,node_reliability_ui,node_audit_ui,node_model_ui toneBlue
class node_api,node_case_input,node_release,node_store toneAmber
class node_health_experiment,node_health_audit,node_explanation,node_research_evidence toneMint
class node_data_foundation,node_credit_baseline,node_manifest,node_artifact_store toneRose
class node_supervisor toneIndigo
```

## Components

### Supervisor workspace

- [Analysis workflow](https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/Analyses.tsx): `frontend/src/pages/Analyses.tsx`
- [Overview](https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/Overview.tsx): `frontend/src/pages/Overview.tsx`
- [Identity session](https://github.com/ameya5006/aletheia/blob/main/frontend/src/auth/session.tsx): `frontend/src/auth/session.tsx`
- [API client](https://github.com/ameya5006/aletheia/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Review](https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/Review.tsx): `frontend/src/pages/Review.tsx`
- [Evidence views](https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/Explanation.tsx): `frontend/src/pages/Explanation.tsx`
- [Reliability views](https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/Reliability.tsx): `frontend/src/pages/Reliability.tsx`
- [Audit history](https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/AuditTrail.tsx): `frontend/src/pages/AuditTrail.tsx`
- [Model and release](https://github.com/ameya5006/aletheia/blob/main/frontend/src/pages/ModelCard.tsx): `frontend/src/pages/ModelCard.tsx`

### Application service

- [Application API](https://github.com/ameya5006/aletheia/blob/main/src/aletheia/application/api.py): `src/aletheia/application/api.py`
- [Case input rules](https://github.com/ameya5006/aletheia/blob/main/src/aletheia/application/case_input.py): `src/aletheia/application/case_input.py`
- [Frozen release](https://github.com/ameya5006/aletheia/blob/main/src/aletheia/application/release.py): `src/aletheia/application/release.py`
- [Analysis store](https://github.com/ameya5006/aletheia/blob/main/src/aletheia/application/store.py): `src/aletheia/application/store.py`

### Model research

- [Healthcare experiment](https://github.com/ameya5006/aletheia/blob/main/src/aletheia/domains/healthcare/experiment.py): `src/aletheia/domains/healthcare/experiment.py`
- [Healthcare audit](https://github.com/ameya5006/aletheia/blob/main/src/aletheia/domains/healthcare/audit.py): `src/aletheia/domains/healthcare/audit.py`
- [Explanation methods](https://github.com/ameya5006/aletheia/blob/main/src/aletheia/domains/healthcare/explain.py): `src/aletheia/domains/healthcare/explain.py`
- [Fairness and stability](https://github.com/ameya5006/aletheia/tree/main/src/aletheia/domains/healthcare): `src/aletheia/domains/healthcare`

### Data foundations

- [Dataset preparation](https://github.com/ameya5006/aletheia/tree/main/src/aletheia/data): `src/aletheia/data`
- [Credit baseline](https://github.com/ameya5006/aletheia/blob/main/src/aletheia/ml/baseline.py): `src/aletheia/ml/baseline.py`
- [Experiment manifest](https://github.com/ameya5006/aletheia/blob/main/src/aletheia/experiments/manifest.py): `src/aletheia/experiments/manifest.py`
- [Run artifacts](https://github.com/ameya5006/aletheia/blob/main/src/aletheia/experiments/artifacts.py): `src/aletheia/experiments/artifacts.py`

### Other components

- **Supervisor**

## Connections

- Supervisor → Analysis workflow: enters workflow
- Analysis workflow → Identity session: uses identity (evidence: `frontend/src/pages/Analyses.tsx`)
- Analysis workflow → API client: requests analysis (evidence: `frontend/src/pages/Analyses.tsx`)
- API client → Application API: sends requests
- Application API → Case input rules: validates inputs
- Application API → Frozen release: runs prediction
- Application API → Analysis store: saves history
- Application API → Healthcare audit: records snapshot
- Frozen release → Case input rules: checks fields (evidence: `src/aletheia/application/release.py`)
- Frozen release → Explanation methods: uses explanation (evidence: `src/aletheia/application/release.py`)
- Frozen release → Healthcare audit: uses audit logic (evidence: `src/aletheia/application/release.py`)
- Analysis workflow → Overview: returns to overview
- Supervisor → Review: reviews prediction
- Supervisor → Evidence views: opens evidence
- Supervisor → Reliability views: opens reliability
- Supervisor → Audit history: opens audit history
- Supervisor → Model and release: opens model details
- Healthcare audit → Healthcare experiment: checks experiment (evidence: `src/aletheia/domains/healthcare/audit.py`)
- Healthcare audit → Explanation methods: uses explanation (evidence: `src/aletheia/domains/healthcare/audit.py`)
- Healthcare audit → Fairness and stability: assembles evidence (evidence: `src/aletheia/domains/healthcare/audit.py`)
- Healthcare experiment → Experiment manifest: records run
- Dataset preparation → Credit baseline: supplies dataset (evidence: `src/aletheia/ml/baseline.py`)
- Credit baseline → Experiment manifest: builds manifest (evidence: `src/aletheia/ml/baseline.py`)
- Credit baseline → Run artifacts: publishes artifacts (evidence: `src/aletheia/ml/baseline.py`)
- Experiment manifest → Run artifacts: describes run (evidence: `src/aletheia/experiments/artifacts.py`)
