# ryukzak/wrench architecture

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

- Interactive diagram: https://gitdiagram.com/ryukzak/wrench
- Repository: https://github.com/ryukzak/wrench

## Overview

Wrench is a teaching platform whose main workflow takes assembly and optional YAML configuration through translation and simulation, then presents reports/assertions. The README also documents five supported ISAs, an assembly formatter, and a coursework grading service. Internal Haskell call relationships were not sampled, so those links are omitted rather than inferred; the graph shows only README-supported relationships.

Main entry points: [`src/wrench/Main.hs`](https://github.com/ryukzak/wrench/blob/master/src/wrench/Main.hs) (Wrench CLI), [`src/wrench-serv/WrenchServ/Simulation.hs`](https://github.com/ryukzak/wrench/blob/master/src/wrench-serv/WrenchServ/Simulation.hs) (Grading Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_users["Users"]
  node_student(("Student"))
  node_coursework_user(("Coursework Submitter"))
end

subgraph group_toolchain["Assembler Simulator"]
  node_wrench["Wrench CLI<br/>[Main.hs]"]
  node_translator["Translator<br/>[Parser.hs]"]
  node_machine["Simulator<br/>[Machine.hs]"]
  node_reports["Reports<br/>[Report.hs]"]
  node_formatter["Assembly Formatter<br/>[Fmt.hs]"]
end

subgraph group_architectures["CPU Architectures"]
  node_acc32["Acc32 ISA<br/>[Acc32.hs]"]
  node_f32a["F32a ISA<br/>[F32a.hs]"]
  node_risciv["RISC-IV ISA<br/>[RiscIv.hs]"]
  node_m68k["M68k ISA<br/>[M68k.hs]"]
  node_vliwiv["VLIW-IV ISA<br/>[VliwIv.hs]"]
end

subgraph group_coursework["Coursework Service"]
  node_grading["Grading Service<br/>[Simulation.hs]"]
  node_service_config["Service Config<br/>[Config.hs]"]
  node_service_stats["Usage Statistics<br/>[Statistics.hs]"]
end

node_assembly["Assembly Source"]
node_config["YAML Config"]
node_result["Run Results"]

node_student -->|"runs"| node_wrench
node_assembly -->|"provides source"| node_wrench
node_config -->|"provides settings"| node_wrench
node_wrench -->|"prints results"| node_result
node_coursework_user -->|"submits work"| node_grading
node_grading -->|"returns results"| node_result

click node_wrench "https://github.com/ryukzak/wrench/blob/master/src/wrench/Main.hs"
click node_translator "https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Translator/Parser.hs"
click node_machine "https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Machine.hs"
click node_reports "https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Report.hs"
click node_formatter "https://github.com/ryukzak/wrench/blob/master/app/Fmt.hs"
click node_acc32 "https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Isa/Acc32.hs"
click node_f32a "https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Isa/F32a.hs"
click node_risciv "https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Isa/RiscIv.hs"
click node_m68k "https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Isa/M68k.hs"
click node_vliwiv "https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Isa/VliwIv.hs"
click node_grading "https://github.com/ryukzak/wrench/blob/master/src/wrench-serv/WrenchServ/Simulation.hs"
click node_service_config "https://github.com/ryukzak/wrench/blob/master/src/wrench-serv/WrenchServ/Config.hs"
click node_service_stats "https://github.com/ryukzak/wrench/blob/master/src/wrench-serv/WrenchServ/Statistics.hs"

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_student,node_coursework_user toneBlue
class node_wrench,node_translator,node_machine,node_reports,node_formatter toneAmber
class node_acc32,node_f32a,node_risciv,node_m68k,node_vliwiv toneMint
class node_grading,node_service_config,node_service_stats toneRose
class node_assembly,node_config,node_result toneIndigo
```

## Components

### Users

- **Student**
- **Coursework Submitter**

### Assembler Simulator

- [Wrench CLI](https://github.com/ryukzak/wrench/blob/master/src/wrench/Main.hs): `src/wrench/Main.hs`
- [Translator](https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Translator/Parser.hs): `src/wrench/Wrench/Translator/Parser.hs`
- [Simulator](https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Machine.hs): `src/wrench/Wrench/Machine.hs`
- [Reports](https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Report.hs): `src/wrench/Wrench/Report.hs`
- [Assembly Formatter](https://github.com/ryukzak/wrench/blob/master/app/Fmt.hs): `app/Fmt.hs`

### CPU Architectures

- [Acc32 ISA](https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Isa/Acc32.hs): `src/wrench/Wrench/Isa/Acc32.hs`
- [F32a ISA](https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Isa/F32a.hs): `src/wrench/Wrench/Isa/F32a.hs`
- [RISC-IV ISA](https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Isa/RiscIv.hs): `src/wrench/Wrench/Isa/RiscIv.hs`
- [M68k ISA](https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Isa/M68k.hs): `src/wrench/Wrench/Isa/M68k.hs`
- [VLIW-IV ISA](https://github.com/ryukzak/wrench/blob/master/src/wrench/Wrench/Isa/VliwIv.hs): `src/wrench/Wrench/Isa/VliwIv.hs`

### Coursework Service

- [Grading Service](https://github.com/ryukzak/wrench/blob/master/src/wrench-serv/WrenchServ/Simulation.hs): `src/wrench-serv/WrenchServ/Simulation.hs`
- [Service Config](https://github.com/ryukzak/wrench/blob/master/src/wrench-serv/WrenchServ/Config.hs): `src/wrench-serv/WrenchServ/Config.hs`
- [Usage Statistics](https://github.com/ryukzak/wrench/blob/master/src/wrench-serv/WrenchServ/Statistics.hs): `src/wrench-serv/WrenchServ/Statistics.hs`

### Other components

- **Assembly Source**
- **YAML Config**
- **Run Results**

## Connections

- Student → Wrench CLI: runs (evidence: `README.md`)
- Assembly Source → Wrench CLI: provides source (evidence: `README.md`)
- YAML Config → Wrench CLI: provides settings (evidence: `README.md`)
- Wrench CLI → Run Results: prints results (evidence: `README.md`)
- Coursework Submitter → Grading Service: submits work (evidence: `README.md`)
- Grading Service → Run Results: returns results (evidence: `README.md`)
