# dhrupad-05/visual-task-factory architecture

> Architecture diagram of the GitHub repository dhrupad-05/visual-task-factory, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dhrupad-05/visual-task-factory
- Repository: https://github.com/dhrupad-05/visual-task-factory

## Overview

Visual Task Factory builds validated synthetic chart-forensics tasks, then benchmarks policies or multimodal models and presents results in a web UI. The documented workflow runs from seeded scene generation through rendering, question construction and independent validation, followed by evaluation, failure analysis and API/web consumption. The graph includes major documented capabilities such as minimal pairs, provider credentials, and human spot-check validation. Source evidence is partial; unverified details are omitted or shown as dashed.

Main entry points: [`backend/vtf/pipeline.py`](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/pipeline.py) (Build and benchmark), [`backend/vtf/eval/experiments.py`](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/eval/experiments.py) (Experiment runner), [`backend/vtf/scene/generator.py`](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/scene/generator.py) (Scene generator), [`backend/vtf/api.py`](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/api.py) (FastAPI service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Task generation"]
  node_scene["Scene generator<br/>[generator.py]"]
  node_pairs["Minimal pairs<br/>[pairs.py]"]
  node_render["Chart renderer<br/>[charts.py]"]
  node_questions["Questions and answers<br/>[templates.py]"]
  node_answers["Pure answers<br/>[answers.py]"]
  node_contracts["Task contracts<br/>[schemas.py]"]
end

subgraph group_quality["Validation"]
  node_validation["Validation orchestrator<br/>[pipeline.py]"]
  node_reextract["Pixel re-extraction<br/>[reextract.py]"]
  node_pixel["Pixel extraction<br/>[pixel.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_experiments["Experiment runner<br/>[experiments.py]"]
  node_adapters["Model adapters<br/>[adapters.py]"]
  node_provider_settings["Provider credentials"]
  node_scorer["Answer scorer<br/>[scorer.py]"]
  node_cache[("Response cache<br/>[cache.py]")]
  node_run_store[("Experiment store<br/>[storage.py]")]
  node_pipeline["Build and benchmark<br/>[pipeline.py]"]
end

subgraph group_serving["API and web"]
  node_api["FastAPI service<br/>[api.py]"]
  node_client["Web API client<br/>[client.ts]"]
  node_app["Web application<br/>[App.tsx]"]
  node_pages["Research views"]
end

subgraph group_analysis["Analysis"]
  node_classifier["Failure classifier<br/>[classify.py]"]
  node_severity["Severity weighting<br/>[severity.py]"]
end

node_user(("Researcher"))
node_provider{{"Model providers"}}

node_user -->|"uses"| node_app
node_scene -->|"creates specs"| node_contracts
node_pairs -->|"creates variants"| node_contracts
node_render -->|"renders"| node_scene
node_questions -->|"uses answers"| node_answers
node_questions -->|"uses scene"| node_scene
node_pipeline -->|"generates"| node_scene
node_pipeline -->|"renders"| node_render
node_pipeline -->|"builds tasks"| node_questions
node_pipeline -->|"validates tasks"| node_validation
node_validation -->|"checks answers"| node_reextract
node_pixel -->|"reads geometry"| node_render
node_pipeline -->|"runs evaluation"| node_experiments
node_experiments -->|"calls models"| node_adapters
node_experiments -->|"uses cache"| node_cache
node_experiments -->|"persists runs"| node_run_store
node_experiments -.->|"loads credentials"| node_provider_settings
node_adapters -.->|"sends requests"| node_provider
node_pipeline -->|"scores answers"| node_scorer
node_pipeline -->|"classifies failures"| node_classifier
node_classifier -->|"scores prediction"| node_scorer
node_pipeline -->|"weights severity"| node_severity
node_api -->|"serves analysis"| node_classifier
node_client -->|"requests data"| node_api
node_app -->|"loads data"| node_client
node_app -->|"routes views"| node_pages
node_api -.->|"reads artifacts"| node_pipeline

click node_scene "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/scene/generator.py"
click node_pairs "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/scene/pairs.py"
click node_render "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/render/charts.py"
click node_questions "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/questions/templates.py"
click node_answers "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/questions/answers.py"
click node_contracts "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/schemas.py"
click node_validation "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/validate/pipeline.py"
click node_reextract "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/validate/reextract.py"
click node_pixel "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/validate/pixel.py"
click node_experiments "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/eval/experiments.py"
click node_adapters "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/eval/adapters.py"
click node_provider_settings "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/provider_settings.py"
click node_scorer "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/eval/scorer.py"
click node_cache "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/eval/cache.py"
click node_run_store "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/eval/storage.py"
click node_pipeline "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/pipeline.py"
click node_classifier "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/analyze/classify.py"
click node_severity "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/eval/severity.py"
click node_api "https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/api.py"
click node_client "https://github.com/dhrupad-05/visual-task-factory/blob/main/frontend/src/api/client.ts"
click node_app "https://github.com/dhrupad-05/visual-task-factory/blob/main/frontend/src/App.tsx"
click node_pages "https://github.com/dhrupad-05/visual-task-factory/tree/main/frontend/src/pages"

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_scene,node_pairs,node_render,node_questions,node_answers,node_contracts toneBlue
class node_validation,node_reextract,node_pixel toneAmber
class node_experiments,node_adapters,node_provider_settings,node_scorer,node_cache,node_run_store,node_pipeline toneMint
class node_api,node_client,node_app,node_pages toneRose
class node_classifier,node_severity,node_user,node_provider toneIndigo
```

## Components

### Task generation

- [Scene generator](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/scene/generator.py): `backend/vtf/scene/generator.py`
- [Minimal pairs](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/scene/pairs.py): `backend/vtf/scene/pairs.py`
- [Chart renderer](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/render/charts.py): `backend/vtf/render/charts.py`
- [Questions and answers](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/questions/templates.py): `backend/vtf/questions/templates.py`
- [Pure answers](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/questions/answers.py): `backend/vtf/questions/answers.py`
- [Task contracts](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/schemas.py): `backend/vtf/schemas.py`

### Validation

- [Validation orchestrator](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/validate/pipeline.py): `backend/vtf/validate/pipeline.py`
- [Pixel re-extraction](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/validate/reextract.py): `backend/vtf/validate/reextract.py`
- [Pixel extraction](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/validate/pixel.py): `backend/vtf/validate/pixel.py`

### Evaluation

- [Experiment runner](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/eval/experiments.py): `backend/vtf/eval/experiments.py`
- [Model adapters](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/eval/adapters.py): `backend/vtf/eval/adapters.py`
- [Provider credentials](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/provider_settings.py): `backend/vtf/provider_settings.py`
- [Answer scorer](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/eval/scorer.py): `backend/vtf/eval/scorer.py`
- [Response cache](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/eval/cache.py): `backend/vtf/eval/cache.py`
- [Experiment store](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/eval/storage.py): `backend/vtf/eval/storage.py`
- [Build and benchmark](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/pipeline.py): `backend/vtf/pipeline.py`

### API and web

- [FastAPI service](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/api.py): `backend/vtf/api.py`
- [Web API client](https://github.com/dhrupad-05/visual-task-factory/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Web application](https://github.com/dhrupad-05/visual-task-factory/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Research views](https://github.com/dhrupad-05/visual-task-factory/tree/main/frontend/src/pages): `frontend/src/pages`

### Analysis

- [Failure classifier](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/analyze/classify.py): `backend/vtf/analyze/classify.py`
- [Severity weighting](https://github.com/dhrupad-05/visual-task-factory/blob/main/backend/vtf/eval/severity.py): `backend/vtf/eval/severity.py`

### Other components

- **Researcher**
- **Model providers**

## Connections

- Researcher → Web application: uses (evidence: `README.md`)
- Scene generator → Task contracts: creates specs (evidence: `backend/vtf/scene/generator.py`)
- Minimal pairs → Task contracts: creates variants (evidence: `backend/vtf/scene/pairs.py`)
- Chart renderer → Scene generator: renders (evidence: `backend/vtf/render/charts.py`)
- Questions and answers → Pure answers: uses answers (evidence: `backend/vtf/questions/templates.py`)
- Questions and answers → Scene generator: uses scene (evidence: `backend/vtf/questions/templates.py`)
- Build and benchmark → Scene generator: generates (evidence: `backend/vtf/pipeline.py`)
- Build and benchmark → Chart renderer: renders (evidence: `backend/vtf/pipeline.py`)
- Build and benchmark → Questions and answers: builds tasks (evidence: `backend/vtf/pipeline.py`)
- Build and benchmark → Validation orchestrator: validates tasks (evidence: `backend/vtf/pipeline.py`)
- Validation orchestrator → Pixel re-extraction: checks answers (evidence: `backend/vtf/validate/pipeline.py`)
- Pixel extraction → Chart renderer: reads geometry (evidence: `backend/vtf/validate/pixel.py`)
- Build and benchmark → Experiment runner: runs evaluation (evidence: `backend/vtf/pipeline.py`)
- Experiment runner → Model adapters: calls models (evidence: `backend/vtf/eval/experiments.py`)
- Experiment runner → Response cache: uses cache (evidence: `backend/vtf/eval/experiments.py`)
- Experiment runner → Experiment store: persists runs (evidence: `backend/vtf/eval/experiments.py`)
- Experiment runner → Provider credentials: loads credentials
- Model adapters → Model providers: sends requests
- Build and benchmark → Answer scorer: scores answers (evidence: `backend/vtf/pipeline.py`)
- Build and benchmark → Failure classifier: classifies failures (evidence: `backend/vtf/pipeline.py`)
- Failure classifier → Answer scorer: scores prediction (evidence: `backend/vtf/analyze/classify.py`)
- Build and benchmark → Severity weighting: weights severity (evidence: `backend/vtf/pipeline.py`)
- FastAPI service → Failure classifier: serves analysis (evidence: `backend/vtf/api.py`)
- Web API client → FastAPI service: requests data (evidence: `README.md`)
- Web application → Web API client: loads data (evidence: `frontend/src/App.tsx`)
- Web application → Research views: routes views (evidence: `frontend/src/App.tsx`)
- FastAPI service → Build and benchmark: reads artifacts
