# junkz3/wrench-board architecture

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

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

## Overview

Wrench Board is a browser-based electronics-repair workbench. A technician supplies a device schematic and boardview; the knowledge pipeline builds a repair pack, while schematic ingestion produces an electrical graph. In a repair session, the diagnostic agent consults those artefacts and technician observations, operates boardview and diagnostic tools, and returns a sanitized diagnosis. The graph also preserves profile, parts-stock, and live pipeline-progress capabilities. Relationships use README statements and indexed imports; unsampled subsystems are represented only where documented, so some internal calls are intentionally omitted.

Main entry points: [`api/agent/runtime_managed.py`](https://github.com/junkz3/wrench-board/blob/main/api/agent/runtime_managed.py) (Diagnostic runtime), [`api/board/router.py`](https://github.com/junkz3/wrench-board/blob/main/api/board/router.py) (Boardview API), [`web/js/features/repair/diagnostic/dashboard.js`](https://github.com/junkz3/wrench-board/blob/main/web/js/features/repair/diagnostic/dashboard.js) (Diagnostic dashboard), [`api/main.py`](https://github.com/junkz3/wrench-board/blob/main/api/main.py) (FastAPI application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Workbench UI"]
  node_browser["Workbench frontend<br/>[main.js]"]
  node_navigation["Repair navigation<br/>[router.js]"]
  node_diagnostic_ui["Diagnostic dashboard<br/>[dashboard.js]"]
  node_progress_ui["Pipeline progress"]
end

subgraph group_http["Application API"]
  node_app["FastAPI application<br/>[main.py]"]
  node_board_api["Boardview API<br/>[router.py]"]
  node_board_parser["Board parsers<br/>[base.py]"]
  node_board_model["Board model<br/>[model.py]"]
  node_board_render["Board rendering<br/>[render.py]"]
  node_profile["Technician profile<br/>[router.py]"]
  node_stock["Parts search<br/>[router.py]"]
end

subgraph group_knowledge["Knowledge Factory"]
  node_pipeline_api["Pipeline routes<br/>[__init__.py]"]
  node_pipeline["Pack generation<br/>[orchestrator.py]"]
  node_pack_storage[("Pack persistence<br/>[pack_storage.py]")]
end

subgraph group_schematic["Schematic Analysis"]
  node_schematic_ingest["Schematic ingestion<br/>[orchestrator.py]"]
  node_schematic_graph["Electrical graph<br/>[schemas.py]"]
end

subgraph group_diagnostics["Repair Diagnostics"]
  node_diagnostic_runtime["Diagnostic runtime<br/>[runtime_managed.py]"]
  node_direct_runtime["Direct runtime<br/>[runtime_direct.py]"]
  node_agent_tools["Agent tools<br/>[manifest.py]"]
  node_sanitizer["Refdes sanitizer<br/>[sanitize.py]"]
  node_simulator["Boot simulator<br/>[simulator.py]"]
  node_hypothesizer["Fault hypothesizer<br/>[hypothesize.py]"]
end

node_technician(("Technician"))
node_anthropic{{"Anthropic models"}}
node_managed_agents{{"Managed Agents"}}

node_technician -->|"uses"| node_browser
node_browser -->|"routes"| node_navigation
node_navigation -->|"opens repair"| node_diagnostic_ui
node_diagnostic_ui -->|"opens diagnostic session"| node_app
node_technician -->|"submits device inputs"| node_pipeline_api
node_pipeline_api -->|"dispatches build"| node_pipeline
node_pipeline -->|"ingests schematic"| node_schematic_ingest
node_schematic_ingest -->|"compiles graph"| node_schematic_graph
node_pipeline -->|"persists pack"| node_pack_storage
node_pipeline_api -->|"streams progress"| node_progress_ui
node_technician -->|"uploads boardview"| node_board_api
node_board_api -->|"parses file"| node_board_parser
node_board_parser -->|"builds board"| node_board_model
node_board_api -->|"requests render"| node_board_render
node_board_render -->|"renders model"| node_board_model
node_app -->|"selects managed runtime"| node_diagnostic_runtime
node_app -.->|"selects fallback runtime"| node_direct_runtime
node_diagnostic_runtime -->|"uses"| node_managed_agents
node_direct_runtime -->|"calls Messages API"| node_anthropic
node_diagnostic_runtime -->|"dispatches tools"| node_agent_tools
node_diagnostic_runtime -->|"sanitizes output"| node_sanitizer
node_diagnostic_runtime -->|"queries diagnosis engine"| node_simulator
node_diagnostic_runtime -->|"queries diagnosis engine"| node_hypothesizer
node_technician -->|"maintains profile"| node_profile
node_technician -->|"searches parts"| node_stock
node_diagnostic_ui -->|"shows boardview"| node_board_api

click node_browser "https://github.com/junkz3/wrench-board/blob/main/web/js/main.js"
click node_navigation "https://github.com/junkz3/wrench-board/blob/main/web/js/router.js"
click node_diagnostic_ui "https://github.com/junkz3/wrench-board/blob/main/web/js/features/repair/diagnostic/dashboard.js"
click node_progress_ui "https://github.com/junkz3/wrench-board/blob/main/web/js/pipeline_progress.js"
click node_app "https://github.com/junkz3/wrench-board/blob/main/api/main.py"
click node_board_api "https://github.com/junkz3/wrench-board/blob/main/api/board/router.py"
click node_board_parser "https://github.com/junkz3/wrench-board/blob/main/api/board/parser/base.py"
click node_board_model "https://github.com/junkz3/wrench-board/blob/main/api/board/model.py"
click node_board_render "https://github.com/junkz3/wrench-board/blob/main/api/board/render.py"
click node_pipeline_api "https://github.com/junkz3/wrench-board/blob/main/api/pipeline/__init__.py"
click node_pipeline "https://github.com/junkz3/wrench-board/blob/main/api/pipeline/orchestrator.py"
click node_pack_storage "https://github.com/junkz3/wrench-board/blob/main/api/pipeline/pack_storage.py"
click node_schematic_ingest "https://github.com/junkz3/wrench-board/blob/main/api/pipeline/schematic/orchestrator.py"
click node_schematic_graph "https://github.com/junkz3/wrench-board/blob/main/api/pipeline/schematic/schemas.py"
click node_profile "https://github.com/junkz3/wrench-board/blob/main/api/profile/router.py"
click node_stock "https://github.com/junkz3/wrench-board/blob/main/api/stock/router.py"
click node_diagnostic_runtime "https://github.com/junkz3/wrench-board/blob/main/api/agent/runtime_managed.py"
click node_direct_runtime "https://github.com/junkz3/wrench-board/blob/main/api/agent/runtime_direct.py"
click node_agent_tools "https://github.com/junkz3/wrench-board/blob/main/api/agent/manifest.py"
click node_sanitizer "https://github.com/junkz3/wrench-board/blob/main/api/agent/sanitize.py"
click node_simulator "https://github.com/junkz3/wrench-board/blob/main/api/pipeline/schematic/simulator.py"
click node_hypothesizer "https://github.com/junkz3/wrench-board/blob/main/api/pipeline/schematic/hypothesize.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_browser,node_navigation,node_diagnostic_ui,node_progress_ui toneBlue
class node_app,node_board_api,node_board_parser,node_board_model,node_board_render,node_profile,node_stock toneAmber
class node_pipeline_api,node_pipeline,node_pack_storage toneMint
class node_schematic_ingest,node_schematic_graph toneRose
class node_diagnostic_runtime,node_direct_runtime,node_agent_tools,node_sanitizer,node_simulator,node_hypothesizer,node_technician,node_anthropic,node_managed_agents toneIndigo
```

## Components

### Workbench UI

- [Workbench frontend](https://github.com/junkz3/wrench-board/blob/main/web/js/main.js): `web/js/main.js`
- [Repair navigation](https://github.com/junkz3/wrench-board/blob/main/web/js/router.js): `web/js/router.js`
- [Diagnostic dashboard](https://github.com/junkz3/wrench-board/blob/main/web/js/features/repair/diagnostic/dashboard.js): `web/js/features/repair/diagnostic/dashboard.js`
- [Pipeline progress](https://github.com/junkz3/wrench-board/blob/main/web/js/pipeline_progress.js): `web/js/pipeline_progress.js`

### Application API

- [FastAPI application](https://github.com/junkz3/wrench-board/blob/main/api/main.py): `api/main.py`
- [Boardview API](https://github.com/junkz3/wrench-board/blob/main/api/board/router.py): `api/board/router.py`
- [Board parsers](https://github.com/junkz3/wrench-board/blob/main/api/board/parser/base.py): `api/board/parser/base.py`
- [Board model](https://github.com/junkz3/wrench-board/blob/main/api/board/model.py): `api/board/model.py`
- [Board rendering](https://github.com/junkz3/wrench-board/blob/main/api/board/render.py): `api/board/render.py`
- [Technician profile](https://github.com/junkz3/wrench-board/blob/main/api/profile/router.py): `api/profile/router.py`
- [Parts search](https://github.com/junkz3/wrench-board/blob/main/api/stock/router.py): `api/stock/router.py`

### Knowledge Factory

- [Pipeline routes](https://github.com/junkz3/wrench-board/blob/main/api/pipeline/__init__.py): `api/pipeline/__init__.py`
- [Pack generation](https://github.com/junkz3/wrench-board/blob/main/api/pipeline/orchestrator.py): `api/pipeline/orchestrator.py`
- [Pack persistence](https://github.com/junkz3/wrench-board/blob/main/api/pipeline/pack_storage.py): `api/pipeline/pack_storage.py`

### Schematic Analysis

- [Schematic ingestion](https://github.com/junkz3/wrench-board/blob/main/api/pipeline/schematic/orchestrator.py): `api/pipeline/schematic/orchestrator.py`
- [Electrical graph](https://github.com/junkz3/wrench-board/blob/main/api/pipeline/schematic/schemas.py): `api/pipeline/schematic/schemas.py`

### Repair Diagnostics

- [Diagnostic runtime](https://github.com/junkz3/wrench-board/blob/main/api/agent/runtime_managed.py): `api/agent/runtime_managed.py`
- [Direct runtime](https://github.com/junkz3/wrench-board/blob/main/api/agent/runtime_direct.py): `api/agent/runtime_direct.py`
- [Agent tools](https://github.com/junkz3/wrench-board/blob/main/api/agent/manifest.py): `api/agent/manifest.py`
- [Refdes sanitizer](https://github.com/junkz3/wrench-board/blob/main/api/agent/sanitize.py): `api/agent/sanitize.py`
- [Boot simulator](https://github.com/junkz3/wrench-board/blob/main/api/pipeline/schematic/simulator.py): `api/pipeline/schematic/simulator.py`
- [Fault hypothesizer](https://github.com/junkz3/wrench-board/blob/main/api/pipeline/schematic/hypothesize.py): `api/pipeline/schematic/hypothesize.py`

### Other components

- **Technician**
- **Anthropic models**
- **Managed Agents**

## Connections

- Technician → Workbench frontend: uses (evidence: `README.md`)
- Workbench frontend → Repair navigation: routes (evidence: `web/js/main.js`)
- Repair navigation → Diagnostic dashboard: opens repair (evidence: `web/js/router.js`)
- Diagnostic dashboard → FastAPI application: opens diagnostic session (evidence: `README.md`)
- Technician → Pipeline routes: submits device inputs (evidence: `README.md`)
- Pipeline routes → Pack generation: dispatches build (evidence: `api/pipeline/__init__.py`)
- Pack generation → Schematic ingestion: ingests schematic (evidence: `api/pipeline/orchestrator.py`)
- Schematic ingestion → Electrical graph: compiles graph (evidence: `api/pipeline/schematic/orchestrator.py`)
- Pack generation → Pack persistence: persists pack (evidence: `README.md`)
- Pipeline routes → Pipeline progress: streams progress (evidence: `README.md`)
- Technician → Boardview API: uploads boardview (evidence: `api/board/router.py`)
- Boardview API → Board parsers: parses file (evidence: `api/board/router.py`)
- Board parsers → Board model: builds board (evidence: `api/board/parser/base.py`)
- Boardview API → Board rendering: requests render (evidence: `api/board/router.py`)
- Board rendering → Board model: renders model (evidence: `api/board/render.py`)
- FastAPI application → Diagnostic runtime: selects managed runtime (evidence: `README.md`)
- FastAPI application → Direct runtime: selects fallback runtime (evidence: `api/main.py`)
- Diagnostic runtime → Managed Agents: uses (evidence: `README.md`)
- Direct runtime → Anthropic models: calls Messages API (evidence: `README.md`)
- Diagnostic runtime → Agent tools: dispatches tools (evidence: `README.md`)
- Diagnostic runtime → Refdes sanitizer: sanitizes output (evidence: `README.md`)
- Diagnostic runtime → Boot simulator: queries diagnosis engine (evidence: `README.md`)
- Diagnostic runtime → Fault hypothesizer: queries diagnosis engine (evidence: `README.md`)
- Technician → Technician profile: maintains profile (evidence: `README.md`)
- Technician → Parts search: searches parts (evidence: `README.md`)
- Diagnostic dashboard → Boardview API: shows boardview (evidence: `README.md`)
