# ragntune/llm-crossword architecture

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

- Interactive diagram: https://gitdiagram.com/ragntune/llm-crossword
- Repository: https://github.com/ragntune/llm-crossword

## Overview

This repository is a crossword challenge scaffold, not a completed LLM solver. Its runnable example loads and edits a puzzle and makes a separate Azure OpenAI greeting call; puzzle parsing, grid state, puzzle authoring, and Guardian puzzle downloading are implemented as distinct paths. The README describes the intended clue-answering and conflict-resolution workflow and four puzzle levels, but no solver implementation is shown. Edges are limited to excerpted calls and documented inputs; the downloader’s external fetch relationship is shown as unverified.

Main entry points: [`src/crossword/crossword.py`](https://github.com/ragntune/llm-crossword/blob/main/src/crossword/crossword.py) (Grid and Clue State), [`main.py`](https://github.com/ragntune/llm-crossword/blob/main/main.py) (Interactive Demo), [`src/crossword/utils.py`](https://github.com/ragntune/llm-crossword/blob/main/src/crossword/utils.py) (Puzzle Loader), [`src/create.py`](https://github.com/ragntune/llm-crossword/blob/main/src/create.py) (Puzzle Creator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_example["Runnable Example"]
  node_main["Interactive Demo<br/>[main.py]"]
end

subgraph group_puzzle["Puzzle Model"]
  node_loader["Puzzle Loader<br/>[utils.py]"]
  node_state["Grid and Clue State<br/>[crossword.py]"]
  node_types["Puzzle Types<br/>[types.py]"]
  node_errors["Puzzle Errors<br/>[exceptions.py]"]
end

subgraph group_sources["Puzzle Sources"]
  node_creator["Puzzle Creator<br/>[create.py]"]
  node_datasets["Sample Puzzles"]
  node_downloader["Guardian Fetch and Export<br/>[download.py]"]
end

node_user(("Developer"))
node_azure{{"Azure OpenAI"}}
node_guardian{{"Guardian Website"}}

node_user -->|"runs"| node_main
node_main -->|"loads puzzle"| node_loader
node_loader -->|"creates or validates"| node_state
node_state -->|"uses models"| node_types
node_state -->|"raises"| node_errors
node_loader -->|"reads JSON"| node_datasets
node_creator -->|"builds entries"| node_types
node_creator -->|"constructs puzzle"| node_state
node_downloader -.->|"fetches clues"| node_guardian
node_main -->|"requests greeting"| node_azure

click node_main "https://github.com/ragntune/llm-crossword/blob/main/main.py"
click node_loader "https://github.com/ragntune/llm-crossword/blob/main/src/crossword/utils.py"
click node_state "https://github.com/ragntune/llm-crossword/blob/main/src/crossword/crossword.py"
click node_types "https://github.com/ragntune/llm-crossword/blob/main/src/crossword/types.py"
click node_errors "https://github.com/ragntune/llm-crossword/blob/main/src/crossword/exceptions.py"
click node_creator "https://github.com/ragntune/llm-crossword/blob/main/src/create.py"
click node_datasets "https://github.com/ragntune/llm-crossword/tree/main/data"
click node_downloader "https://github.com/ragntune/llm-crossword/blob/main/src/download.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_loader,node_state,node_types,node_errors toneAmber
class node_creator,node_datasets,node_downloader toneMint
class node_user,node_azure,node_guardian toneIndigo
```

## Components

### Runnable Example

- [Interactive Demo](https://github.com/ragntune/llm-crossword/blob/main/main.py): `main.py`

### Puzzle Model

- [Puzzle Loader](https://github.com/ragntune/llm-crossword/blob/main/src/crossword/utils.py): `src/crossword/utils.py`
- [Grid and Clue State](https://github.com/ragntune/llm-crossword/blob/main/src/crossword/crossword.py): `src/crossword/crossword.py`
- [Puzzle Types](https://github.com/ragntune/llm-crossword/blob/main/src/crossword/types.py): `src/crossword/types.py`
- [Puzzle Errors](https://github.com/ragntune/llm-crossword/blob/main/src/crossword/exceptions.py): `src/crossword/exceptions.py`

### Puzzle Sources

- [Puzzle Creator](https://github.com/ragntune/llm-crossword/blob/main/src/create.py): `src/create.py`
- [Sample Puzzles](https://github.com/ragntune/llm-crossword/tree/main/data): `data`
- [Guardian Fetch and Export](https://github.com/ragntune/llm-crossword/blob/main/src/download.py): `src/download.py`

### Other components

- **Developer**
- **Azure OpenAI**
- **Guardian Website**

## Connections

- Developer → Interactive Demo: runs (evidence: `README.md`)
- Interactive Demo → Puzzle Loader: loads puzzle (evidence: `main.py`)
- Puzzle Loader → Grid and Clue State: creates or validates (evidence: `src/crossword/utils.py`)
- Grid and Clue State → Puzzle Types: uses models (evidence: `src/crossword/crossword.py`)
- Grid and Clue State → Puzzle Errors: raises (evidence: `src/crossword/crossword.py`)
- Puzzle Loader → Sample Puzzles: reads JSON (evidence: `src/crossword/utils.py`)
- Puzzle Creator → Puzzle Types: builds entries (evidence: `src/create.py`)
- Puzzle Creator → Grid and Clue State: constructs puzzle (evidence: `src/create.py`)
- Guardian Fetch and Export → Guardian Website: fetches clues (evidence: `src/download.py`)
- Interactive Demo → Azure OpenAI: requests greeting (evidence: `main.py`)
