# gouthamx67/project_victo architecture

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

- Interactive diagram: https://gitdiagram.com/gouthamx67/project_victo
- Repository: https://github.com/gouthamx67/project_victo

## Overview

Regulatory Safety Reporting turns uploaded CSV safety data into deterministic metrics and a draft report, optionally adding an LLM-written narrative. The main workflow is upload and validation, normalization, analysis, report generation, then evidence review and human approval before finalization. The graph includes the UI, API orchestration, analysis and grounding layers, and review/artifact support. README documents the user workflow; source-index references support many internal dependencies, but unsampled implementation details are not inferred.

Main entry points: [`src/report_pipeline.py`](https://github.com/gouthamx67/project_victo/blob/main/src/report_pipeline.py) (Report pipeline), [`src/analysis_framework.py`](https://github.com/gouthamx67/project_victo/blob/main/src/analysis_framework.py) (Analysis registry), [`src/api.py`](https://github.com/gouthamx67/project_victo/blob/main/src/api.py) (HTTP API), [`src/llm_provider.py`](https://github.com/gouthamx67/project_victo/blob/main/src/llm_provider.py) (Narrative providers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_frontend["Report workspace<br/>[App.tsx]"]
  node_api["HTTP API<br/>[api.py]"]
end

subgraph group_processing["Data processing"]
  node_ingest["CSV validation<br/>[ingest.py]"]
  node_normalize["Data normalization<br/>[normalize.py]"]
  node_framework["Analysis registry"]
  node_core_analyses["Core metrics<br/>[core.py]"]
  node_reaction_analyses["Reaction metrics<br/>[reactions.py]"]
  node_reporting_analyses["Reporting metrics<br/>[reporting.py]"]
  node_trend_analyses["Trend metrics<br/>[trends.py]"]
end

subgraph group_generation["Report generation"]
  node_pipeline["Report pipeline<br/>[report_pipeline.py]"]
  node_config["Report configuration<br/>[report_config.py]"]
  node_section_context["Section context<br/>[section_context.py]"]
  node_llm_contract["Narrative contract<br/>[llm_contract.py]"]
  node_llm_provider["Narrative providers<br/>[llm_provider.py]"]
  node_renderer["Report renderer<br/>[report_renderer.py]"]
end

subgraph group_assurance["Evidence and review"]
  node_evidence["Evidence trace<br/>[evidence_trace.py]"]
  node_metric_slots["Metric slots<br/>[metric_slots.py]"]
  node_grounding["Grounding checks"]
  node_review["Section reviews<br/>[review.py]"]
  node_finalization["Review finalization<br/>[report_review.py]"]
  node_artifacts["Run artifacts<br/>[run_artifacts.py]"]
  node_manifest["Run manifest<br/>[run_manifest.py]"]
end

node_user(("Report user"))
node_external_llm(("LLM service"))

node_user -->|"uploads and reviews"| node_frontend
node_frontend -.->|"requests report"| node_api
node_api -->|"runs report"| node_pipeline
node_api -->|"handles review"| node_finalization
node_api -->|"manages artifacts"| node_artifacts
node_pipeline -->|"validates CSV"| node_ingest
node_pipeline -->|"normalizes data"| node_normalize
node_pipeline -->|"runs analyses"| node_framework
node_framework -->|"registers metrics"| node_core_analyses
node_framework -->|"registers metrics"| node_reaction_analyses
node_framework -->|"registers metrics"| node_reporting_analyses
node_framework -->|"registers metrics"| node_trend_analyses
node_pipeline -->|"uses settings"| node_config
node_pipeline -->|"builds context"| node_section_context
node_section_context -->|"creates context"| node_llm_contract
node_pipeline -->|"requests narrative"| node_llm_provider
node_llm_provider -.->|"calls provider"| node_external_llm
node_llm_provider -->|"uses contract"| node_llm_contract
node_pipeline -->|"checks narrative"| node_grounding
node_grounding -->|"validates slots"| node_metric_slots
node_grounding -->|"checks metrics"| node_framework
node_pipeline -->|"renders draft"| node_renderer
node_pipeline -->|"records evidence"| node_evidence
node_finalization -->|"validates approvals"| node_review
node_finalization -->|"updates status"| node_pipeline
node_pipeline -->|"hashes inputs"| node_manifest
node_artifacts -->|"uses manifest"| node_manifest

click node_frontend "https://github.com/gouthamx67/project_victo/blob/main/frontend/src/App.tsx"
click node_api "https://github.com/gouthamx67/project_victo/blob/main/src/api.py"
click node_ingest "https://github.com/gouthamx67/project_victo/blob/main/src/ingest.py"
click node_normalize "https://github.com/gouthamx67/project_victo/blob/main/src/normalize.py"
click node_framework "https://github.com/gouthamx67/project_victo/blob/main/src/analysis_framework.py"
click node_core_analyses "https://github.com/gouthamx67/project_victo/blob/main/src/analyses/core.py"
click node_reaction_analyses "https://github.com/gouthamx67/project_victo/blob/main/src/analyses/reactions.py"
click node_reporting_analyses "https://github.com/gouthamx67/project_victo/blob/main/src/analyses/reporting.py"
click node_trend_analyses "https://github.com/gouthamx67/project_victo/blob/main/src/analyses/trends.py"
click node_pipeline "https://github.com/gouthamx67/project_victo/blob/main/src/report_pipeline.py"
click node_config "https://github.com/gouthamx67/project_victo/blob/main/src/report_config.py"
click node_section_context "https://github.com/gouthamx67/project_victo/blob/main/src/section_context.py"
click node_llm_contract "https://github.com/gouthamx67/project_victo/blob/main/src/llm_contract.py"
click node_llm_provider "https://github.com/gouthamx67/project_victo/blob/main/src/llm_provider.py"
click node_renderer "https://github.com/gouthamx67/project_victo/blob/main/src/report_renderer.py"
click node_evidence "https://github.com/gouthamx67/project_victo/blob/main/src/evidence_trace.py"
click node_metric_slots "https://github.com/gouthamx67/project_victo/blob/main/src/metric_slots.py"
click node_grounding "https://github.com/gouthamx67/project_victo/blob/main/src/grounding_validator.py"
click node_review "https://github.com/gouthamx67/project_victo/blob/main/src/review.py"
click node_finalization "https://github.com/gouthamx67/project_victo/blob/main/src/report_review.py"
click node_artifacts "https://github.com/gouthamx67/project_victo/blob/main/src/run_artifacts.py"
click node_manifest "https://github.com/gouthamx67/project_victo/blob/main/src/run_manifest.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_frontend,node_api,node_user toneBlue
class node_ingest,node_normalize,node_framework,node_core_analyses,node_reaction_analyses,node_reporting_analyses,node_trend_analyses toneAmber
class node_pipeline,node_config,node_section_context,node_llm_contract,node_llm_provider,node_renderer toneMint
class node_evidence,node_metric_slots,node_grounding,node_review,node_finalization,node_artifacts,node_manifest toneRose
class node_external_llm toneIndigo
```

## Components

### User interface

- [Report workspace](https://github.com/gouthamx67/project_victo/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [HTTP API](https://github.com/gouthamx67/project_victo/blob/main/src/api.py): `src/api.py`

### Data processing

- [CSV validation](https://github.com/gouthamx67/project_victo/blob/main/src/ingest.py): `src/ingest.py`
- [Data normalization](https://github.com/gouthamx67/project_victo/blob/main/src/normalize.py): `src/normalize.py`
- [Analysis registry](https://github.com/gouthamx67/project_victo/blob/main/src/analysis_framework.py): `src/analysis_framework.py`
- [Core metrics](https://github.com/gouthamx67/project_victo/blob/main/src/analyses/core.py): `src/analyses/core.py`
- [Reaction metrics](https://github.com/gouthamx67/project_victo/blob/main/src/analyses/reactions.py): `src/analyses/reactions.py`
- [Reporting metrics](https://github.com/gouthamx67/project_victo/blob/main/src/analyses/reporting.py): `src/analyses/reporting.py`
- [Trend metrics](https://github.com/gouthamx67/project_victo/blob/main/src/analyses/trends.py): `src/analyses/trends.py`

### Report generation

- [Report pipeline](https://github.com/gouthamx67/project_victo/blob/main/src/report_pipeline.py): `src/report_pipeline.py`
- [Report configuration](https://github.com/gouthamx67/project_victo/blob/main/src/report_config.py): `src/report_config.py`
- [Section context](https://github.com/gouthamx67/project_victo/blob/main/src/section_context.py): `src/section_context.py`
- [Narrative contract](https://github.com/gouthamx67/project_victo/blob/main/src/llm_contract.py): `src/llm_contract.py`
- [Narrative providers](https://github.com/gouthamx67/project_victo/blob/main/src/llm_provider.py): `src/llm_provider.py`
- [Report renderer](https://github.com/gouthamx67/project_victo/blob/main/src/report_renderer.py): `src/report_renderer.py`

### Evidence and review

- [Evidence trace](https://github.com/gouthamx67/project_victo/blob/main/src/evidence_trace.py): `src/evidence_trace.py`
- [Metric slots](https://github.com/gouthamx67/project_victo/blob/main/src/metric_slots.py): `src/metric_slots.py`
- [Grounding checks](https://github.com/gouthamx67/project_victo/blob/main/src/grounding_validator.py): `src/grounding_validator.py`
- [Section reviews](https://github.com/gouthamx67/project_victo/blob/main/src/review.py): `src/review.py`
- [Review finalization](https://github.com/gouthamx67/project_victo/blob/main/src/report_review.py): `src/report_review.py`
- [Run artifacts](https://github.com/gouthamx67/project_victo/blob/main/src/run_artifacts.py): `src/run_artifacts.py`
- [Run manifest](https://github.com/gouthamx67/project_victo/blob/main/src/run_manifest.py): `src/run_manifest.py`

### Other components

- **Report user**
- **LLM service**

## Connections

- Report user → Report workspace: uploads and reviews (evidence: `README.md`)
- Report workspace → HTTP API: requests report
- HTTP API → Report pipeline: runs report (evidence: `src/api.py`)
- HTTP API → Review finalization: handles review (evidence: `src/api.py`)
- HTTP API → Run artifacts: manages artifacts (evidence: `src/api.py`)
- Report pipeline → CSV validation: validates CSV (evidence: `src/report_pipeline.py`)
- Report pipeline → Data normalization: normalizes data (evidence: `src/report_pipeline.py`)
- Report pipeline → Analysis registry: runs analyses (evidence: `src/report_pipeline.py`)
- Analysis registry → Core metrics: registers metrics (evidence: `src/analyses/core.py`)
- Analysis registry → Reaction metrics: registers metrics (evidence: `src/analyses/reactions.py`)
- Analysis registry → Reporting metrics: registers metrics (evidence: `src/analyses/reporting.py`)
- Analysis registry → Trend metrics: registers metrics (evidence: `src/analyses/trends.py`)
- Report pipeline → Report configuration: uses settings (evidence: `src/report_pipeline.py`)
- Report pipeline → Section context: builds context (evidence: `src/report_pipeline.py`)
- Section context → Narrative contract: creates context (evidence: `src/section_context.py`)
- Report pipeline → Narrative providers: requests narrative (evidence: `src/report_pipeline.py`)
- Narrative providers → LLM service: calls provider
- Narrative providers → Narrative contract: uses contract (evidence: `src/llm_provider.py`)
- Report pipeline → Grounding checks: checks narrative (evidence: `src/report_pipeline.py`)
- Grounding checks → Metric slots: validates slots (evidence: `src/grounding_validator.py`)
- Grounding checks → Analysis registry: checks metrics (evidence: `src/grounding_validator.py`)
- Report pipeline → Report renderer: renders draft (evidence: `src/report_pipeline.py`)
- Report pipeline → Evidence trace: records evidence (evidence: `src/report_pipeline.py`)
- Review finalization → Section reviews: validates approvals (evidence: `src/report_review.py`)
- Review finalization → Report pipeline: updates status (evidence: `src/report_review.py`)
- Report pipeline → Run manifest: hashes inputs (evidence: `src/report_pipeline.py`)
- Run artifacts → Run manifest: uses manifest (evidence: `src/run_artifacts.py`)
