# christian-mar/fde_project architecture

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

- Interactive diagram: https://gitdiagram.com/christian-mar/fde_project
- Repository: https://github.com/christian-mar/fde_project

## Overview

UnderCover is a small travel-insurance claim assessment and LLM-evaluation project. Its main workflow loads claims and handler decisions, builds a policy-grounded prompt, obtains a structured model decision through OpenRouter, then compares decisions and payouts with the handler labels. The command-line entry point also explores claims and displays summaries. The README describes only setup; the sampled source documents the runtime workflow and data. The graph omits unsampled capabilities beyond what the files establish.

Main entry points: [`main.py`](https://github.com/christian-mar/fde_project/blob/main/main.py) (CLI entry point), [`undercover/llm.py`](https://github.com/christian-mar/fde_project/blob/main/undercover/llm.py) (Claim decision), [`undercover/data.py`](https://github.com/christian-mar/fde_project/blob/main/undercover/data.py) (Data loader), [`undercover/evaluate.py`](https://github.com/christian-mar/fde_project/blob/main/undercover/evaluate.py) (Evaluation runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI workflow"]
  node_main["CLI entry point<br/>[main.py]"]
end

subgraph group_assessment["Claim assessment"]
  node_prompts["Prompt builder<br/>[prompts.py]"]
  node_schema["Decision schema<br/>[schemas.py]"]
  node_llm["Claim decision<br/>[llm.py]"]
  node_config["API configuration<br/>[config.py]"]
end

subgraph group_data["Data and reference"]
  node_data_loader["Data loader<br/>[data.py]"]
  node_claims["Claims and labels<br/>[claims.json]"]
  node_policies["Policy records<br/>[policies.json]"]
  node_wording["Policy wording<br/>[policy_wording.md]"]
end

subgraph group_evaluation["Exploration and evaluation"]
  node_explore["Claim exploration<br/>[explore.py]"]
  node_evaluate["Evaluation runner<br/>[evaluate.py]"]
end

node_user(("Operator"))
node_openrouter{{"OpenRouter"}}

node_user -->|"runs"| node_main
node_main -->|"loads data"| node_data_loader
node_data_loader -->|"reads claims and labels"| node_claims
node_data_loader -->|"reads records"| node_policies
node_data_loader -->|"reads wording"| node_wording
node_main -->|"displays summaries"| node_explore
node_main -->|"builds example prompt"| node_prompts
node_prompts -->|"loads policy context"| node_data_loader
node_main -->|"requests decision"| node_llm
node_llm -->|"builds messages"| node_prompts
node_llm -->|"sets response format"| node_schema
node_llm -->|"uses client"| node_config
node_llm -->|"sends completion request"| node_openrouter
node_main -->|"runs evaluation"| node_evaluate
node_evaluate -->|"assesses each claim"| node_llm
node_evaluate -.->|"compares handler labels"| node_claims

click node_main "https://github.com/christian-mar/fde_project/blob/main/main.py"
click node_data_loader "https://github.com/christian-mar/fde_project/blob/main/undercover/data.py"
click node_claims "https://github.com/christian-mar/fde_project/blob/main/data/claims.json"
click node_policies "https://github.com/christian-mar/fde_project/blob/main/data/policies.json"
click node_wording "https://github.com/christian-mar/fde_project/blob/main/data/policy_wording.md"
click node_prompts "https://github.com/christian-mar/fde_project/blob/main/undercover/prompts.py"
click node_schema "https://github.com/christian-mar/fde_project/blob/main/undercover/schemas.py"
click node_llm "https://github.com/christian-mar/fde_project/blob/main/undercover/llm.py"
click node_config "https://github.com/christian-mar/fde_project/blob/main/undercover/config.py"
click node_explore "https://github.com/christian-mar/fde_project/blob/main/undercover/explore.py"
click node_evaluate "https://github.com/christian-mar/fde_project/blob/main/undercover/evaluate.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_main toneBlue
class node_prompts,node_schema,node_llm,node_config toneAmber
class node_data_loader,node_claims,node_policies,node_wording,node_openrouter toneMint
class node_explore,node_evaluate toneRose
class node_user toneIndigo
```

## Components

### CLI workflow

- [CLI entry point](https://github.com/christian-mar/fde_project/blob/main/main.py): `main.py`

### Claim assessment

- [Prompt builder](https://github.com/christian-mar/fde_project/blob/main/undercover/prompts.py): `undercover/prompts.py`
- [Decision schema](https://github.com/christian-mar/fde_project/blob/main/undercover/schemas.py): `undercover/schemas.py`
- [Claim decision](https://github.com/christian-mar/fde_project/blob/main/undercover/llm.py): `undercover/llm.py`
- [API configuration](https://github.com/christian-mar/fde_project/blob/main/undercover/config.py): `undercover/config.py`

### Data and reference

- [Data loader](https://github.com/christian-mar/fde_project/blob/main/undercover/data.py): `undercover/data.py`
- [Claims and labels](https://github.com/christian-mar/fde_project/blob/main/data/claims.json): `data/claims.json`
- [Policy records](https://github.com/christian-mar/fde_project/blob/main/data/policies.json): `data/policies.json`
- [Policy wording](https://github.com/christian-mar/fde_project/blob/main/data/policy_wording.md): `data/policy_wording.md`

### Exploration and evaluation

- [Claim exploration](https://github.com/christian-mar/fde_project/blob/main/undercover/explore.py): `undercover/explore.py`
- [Evaluation runner](https://github.com/christian-mar/fde_project/blob/main/undercover/evaluate.py): `undercover/evaluate.py`

### Other components

- **Operator**
- **OpenRouter**

## Connections

- Operator → CLI entry point: runs (evidence: `README.md`)
- CLI entry point → Data loader: loads data (evidence: `main.py`)
- Data loader → Claims and labels: reads claims and labels (evidence: `undercover/data.py`)
- Data loader → Policy records: reads records (evidence: `undercover/data.py`)
- Data loader → Policy wording: reads wording (evidence: `undercover/data.py`)
- CLI entry point → Claim exploration: displays summaries (evidence: `main.py`)
- CLI entry point → Prompt builder: builds example prompt (evidence: `main.py`)
- Prompt builder → Data loader: loads policy context (evidence: `undercover/prompts.py`)
- CLI entry point → Claim decision: requests decision (evidence: `main.py`)
- Claim decision → Prompt builder: builds messages (evidence: `undercover/llm.py`)
- Claim decision → Decision schema: sets response format (evidence: `undercover/llm.py`)
- Claim decision → API configuration: uses client (evidence: `undercover/llm.py`)
- Claim decision → OpenRouter: sends completion request (evidence: `undercover/llm.py`)
- CLI entry point → Evaluation runner: runs evaluation (evidence: `main.py`)
- Evaluation runner → Claim decision: assesses each claim (evidence: `undercover/evaluate.py`)
- Evaluation runner → Claims and labels: compares handler labels
