# bsrikumar855-dot/grademind-reloded architecture

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

- Interactive diagram: https://gitdiagram.com/bsrikumar855-dot/grademind-reloded
- Repository: https://github.com/bsrikumar855-dot/grademind-reloded

## Overview

GradeMIND-Reloded is an OCR evaluation spike: page images are processed by alternative OCR engines, their outputs are compared with transcriptions, and quality and operational results are summarized in reports. Engine C specifically recognizes line crops using Engine B detections. The source index supports several internal helper relationships, but the README contains no product overview; unsampled modules are represented only where their purpose is clear from names or indexed references, and unsupported connections are omitted.

Main entry points: [`data`](https://github.com/bsrikumar855-dot/grademind-reloded/tree/main/data) (Page images), [`spike/score.py`](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/score.py) (OCR scorer), [`spike/engine_a/run_engine_a.py`](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/engine_a/run_engine_a.py) (Engine A OCR), [`spike/engine_b/run_engine_b.py`](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/engine_b/run_engine_b.py) (Engine B OCR)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ocr["OCR engines"]
  node_engine_a["Engine A OCR<br/>[run_engine_a.py]"]
  node_engine_a_vllm["Engine A vLLM"]
  node_degenerate["Degenerate checks<br/>[degenerate.py]"]
  node_engine_b["Engine B OCR<br/>[run_engine_b.py]"]
  node_engine_c["Line HTR<br/>[run_line_htr.py]"]
  node_resolved["Config fingerprints<br/>[resolved.py]"]
end

subgraph group_analysis["Evaluation"]
  node_score["OCR scorer<br/>[score.py]"]
  node_line_quality["Line quality<br/>[line_quality.py]"]
  node_gate_metrics["Review gate metrics<br/>[gate_metrics.py]"]
  node_proxy["Proxy metrics<br/>[proxy_0b.py]"]
  node_stats["Interval statistics<br/>[stats.py]"]
  node_report["Phase 0b report<br/>[report_0b.py]"]
  node_summarize["Run summary<br/>[summarize.py]"]
end

subgraph group_prep["Image preparation"]
  node_preprocess_variants["Image variants<br/>[variants.py]"]
  node_show_through["Show-through preprocessing<br/>[show_through.py]"]
  node_pad_aspect["Aspect padding<br/>[pad_aspect.py]"]
  node_redact["Data redaction<br/>[redact.py]"]
end

subgraph group_review["Review tools"]
  node_verify_ui["Transcription verification UI<br/>[serve.py]"]
end

node_user(("Researcher"))
node_pages["Page images"]
node_transcriptions["Transcriptions"]

node_user -.->|"supplies"| node_pages
node_pages -.->|"processes pages"| node_engine_a
node_pages -.->|"processes pages"| node_engine_a_vllm
node_pages -.->|"processes pages"| node_engine_b
node_pages -.->|"processes pages"| node_engine_c
node_engine_a -->|"checks output"| node_degenerate
node_engine_a_vllm -->|"checks output"| node_degenerate
node_engine_a -->|"uses config checks"| node_resolved
node_engine_b -->|"uses config checks"| node_resolved
node_engine_c -->|"uses config checks"| node_resolved
node_engine_b -->|"provides detections"| node_engine_c
node_engine_a -.->|"writes OCR results"| node_score
node_engine_b -.->|"writes OCR results"| node_score
node_engine_c -.->|"writes OCR results"| node_score
node_transcriptions -->|"provides ground truth"| node_score
node_score -->|"shares line parsing"| node_line_quality
node_score -->|"shares scoring methods"| node_gate_metrics
node_score -->|"provides scoring helpers"| node_proxy
node_score -->|"computes engine scores"| node_report
node_stats -->|"formats intervals"| node_report
node_degenerate -->|"flags run output"| node_summarize
node_pages -.->|"supplies images"| node_preprocess_variants
node_pages -.->|"supplies images"| node_show_through
node_pages -.->|"supplies images"| node_pad_aspect
node_pages -.->|"supplies images"| node_redact
node_user -.->|"reviews transcriptions"| node_verify_ui

click node_pages "https://github.com/bsrikumar855-dot/grademind-reloded/tree/main/data"
click node_engine_a "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/engine_a/run_engine_a.py"
click node_engine_a_vllm "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/engine_a/run_engine_a_vllm.py"
click node_degenerate "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/engine_a/degenerate.py"
click node_engine_b "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/engine_b/run_engine_b.py"
click node_engine_c "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/engine_c/run_line_htr.py"
click node_resolved "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/resolved.py"
click node_score "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/score.py"
click node_line_quality "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/line_quality.py"
click node_gate_metrics "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/gate_metrics.py"
click node_proxy "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/proxy_0b.py"
click node_stats "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/stats.py"
click node_report "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/report_0b.py"
click node_summarize "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/summarize.py"
click node_transcriptions "https://github.com/bsrikumar855-dot/grademind-reloded/tree/main/data/transcriptions"
click node_preprocess_variants "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/preprocess/variants.py"
click node_show_through "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/preprocess/show_through.py"
click node_pad_aspect "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/pad_aspect.py"
click node_redact "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/redact.py"
click node_verify_ui "https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/verify_ui/serve.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_engine_a,node_engine_a_vllm,node_degenerate,node_engine_b,node_engine_c,node_resolved toneBlue
class node_score,node_line_quality,node_gate_metrics,node_proxy,node_stats,node_report,node_summarize toneAmber
class node_preprocess_variants,node_show_through,node_pad_aspect,node_redact toneMint
class node_verify_ui toneRose
class node_user toneIndigo
class node_pages,node_transcriptions toneTeal
```

## Components

### OCR engines

- [Engine A OCR](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/engine_a/run_engine_a.py): `spike/engine_a/run_engine_a.py`
- [Engine A vLLM](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/engine_a/run_engine_a_vllm.py): `spike/engine_a/run_engine_a_vllm.py`
- [Degenerate checks](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/engine_a/degenerate.py): `spike/engine_a/degenerate.py`
- [Engine B OCR](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/engine_b/run_engine_b.py): `spike/engine_b/run_engine_b.py`
- [Line HTR](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/engine_c/run_line_htr.py): `spike/engine_c/run_line_htr.py`
- [Config fingerprints](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/resolved.py): `spike/resolved.py`

### Evaluation

- [OCR scorer](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/score.py): `spike/score.py`
- [Line quality](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/line_quality.py): `spike/line_quality.py`
- [Review gate metrics](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/gate_metrics.py): `spike/gate_metrics.py`
- [Proxy metrics](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/proxy_0b.py): `spike/proxy_0b.py`
- [Interval statistics](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/stats.py): `spike/stats.py`
- [Phase 0b report](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/report_0b.py): `spike/report_0b.py`
- [Run summary](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/summarize.py): `spike/summarize.py`

### Image preparation

- [Image variants](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/preprocess/variants.py): `spike/preprocess/variants.py`
- [Show-through preprocessing](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/preprocess/show_through.py): `spike/preprocess/show_through.py`
- [Aspect padding](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/pad_aspect.py): `spike/pad_aspect.py`
- [Data redaction](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/redact.py): `spike/redact.py`

### Review tools

- [Transcription verification UI](https://github.com/bsrikumar855-dot/grademind-reloded/blob/main/spike/verify_ui/serve.py): `spike/verify_ui/serve.py`

### Other components

- **Researcher**
- [Page images](https://github.com/bsrikumar855-dot/grademind-reloded/tree/main/data): `data`
- [Transcriptions](https://github.com/bsrikumar855-dot/grademind-reloded/tree/main/data/transcriptions): `data/transcriptions`

## Connections

- Researcher → Page images: supplies
- Page images → Engine A OCR: processes pages
- Page images → Engine A vLLM: processes pages
- Page images → Engine B OCR: processes pages
- Page images → Line HTR: processes pages
- Engine A OCR → Degenerate checks: checks output (evidence: `spike/engine_a/run_engine_a.py`)
- Engine A vLLM → Degenerate checks: checks output (evidence: `spike/engine_a/run_engine_a_vllm.py`)
- Engine A OCR → Config fingerprints: uses config checks (evidence: `spike/engine_a/run_engine_a.py`)
- Engine B OCR → Config fingerprints: uses config checks (evidence: `spike/engine_b/run_engine_b.py`)
- Line HTR → Config fingerprints: uses config checks (evidence: `spike/engine_c/run_line_htr.py`)
- Engine B OCR → Line HTR: provides detections (evidence: `spike/engine_c/run_line_htr.py`)
- Engine A OCR → OCR scorer: writes OCR results
- Engine B OCR → OCR scorer: writes OCR results
- Line HTR → OCR scorer: writes OCR results
- Transcriptions → OCR scorer: provides ground truth (evidence: `spike/score.py`)
- OCR scorer → Line quality: shares line parsing (evidence: `spike/line_quality.py`)
- OCR scorer → Review gate metrics: shares scoring methods (evidence: `spike/gate_metrics.py`)
- OCR scorer → Proxy metrics: provides scoring helpers (evidence: `spike/proxy_0b.py`)
- OCR scorer → Phase 0b report: computes engine scores (evidence: `spike/report_0b.py`)
- Interval statistics → Phase 0b report: formats intervals (evidence: `spike/report_0b.py`)
- Degenerate checks → Run summary: flags run output (evidence: `spike/summarize.py`)
- Page images → Image variants: supplies images
- Page images → Show-through preprocessing: supplies images
- Page images → Aspect padding: supplies images
- Page images → Data redaction: supplies images
- Researcher → Transcription verification UI: reviews transcriptions
