# robotics-hackathon/robotics_hackathon architecture

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

- Interactive diagram: https://gitdiagram.com/robotics-hackathon/robotics_hackathon
- Repository: https://github.com/robotics-hackathon/robotics_hackathon

## Overview

This repository combines a mock CAPTCHA website, a screenshot-based vision solver, and software for operating a stylus-equipped robot arm. The principal workflow is: the robot captures and rectifies the screen, identifies the page, requests tile choices from the solver, taps and verifies selections, then submits the challenge. The graph preserves the website’s documented grid, slider, checkbox, and training capabilities. Some unsampled subsystems and wiring are shown only where the README documents them; their edges cite that documentation.

Main entry points: [`touch/run_captcha.py`](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/run_captcha.py) (Robot solve loop), [`touch/tap.py`](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/tap.py) (Tap execution), [`captcha/src/data/image-challenges.ts`](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captcha/src/data/image-challenges.ts) (Challenge site), [`captchasolver/src/captchasolver/client.py`](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captchasolver/src/captchasolver/client.py) (Workers AI client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_demo["Mock CAPTCHA site"]
  node_challenge_site["Challenge site"]
  node_image_data["Image puzzles"]
  node_slider_data["Slider puzzles"]
  node_training["Training catalog"]
  node_training_overlay["Training overlay"]
  node_slider_logic["Slider challenge logic"]
end

subgraph group_solver["Vision solver"]
  node_solver_api["Solver API<br/>[api.py]"]
  node_screen_solver["Dialog detection<br/>[screen.py]"]
  node_grid_solver["Tile recognition<br/>[grid.py]"]
  node_ai_client["Workers AI client<br/>[client.py]"]
  node_solver_ui["Solver web UI<br/>[web.py]"]
  node_model_compare["Model comparison<br/>[compare.py]"]
end

subgraph group_robot_vision["Screen perception"]
  node_capture["Screen capture<br/>[see.py]"]
  node_markers["Screen markers<br/>[markers.js]"]
  node_page_state["Page recognition<br/>[pagestate.py]"]
  node_layout_learning["Page layout learning<br/>[learn_layout.py]"]
end

subgraph group_robot_control["Arm control"]
  node_calibration["Tap calibration model<br/>[common.py]"]
  node_tap_control["Tap execution<br/>[tap.py]"]
  node_correction["Learned correction<br/>[correction.py]"]
  node_tip_vision["Stylus tip vision<br/>[tipvision.py]"]
end

subgraph group_orchestration["Solve workflow"]
  node_captcha_runner["Robot solve loop<br/>[run_captcha.py]"]
  node_solver_client["Solver client<br/>[solve.py]"]
  node_selection_check["Selection verification"]
end

node_user(("User"))
node_workers_ai["Workers AI"]
node_arm["Robot arm"]

node_user -->|"opens challenge"| node_challenge_site
node_challenge_site -.->|"serves grids"| node_image_data
node_challenge_site -.->|"serves sliders"| node_slider_data
node_training -->|"catalogs puzzles"| node_image_data
node_training -->|"catalogs puzzles"| node_slider_data
node_training_overlay -.->|"supports sessions"| node_training
node_slider_logic -->|"uses challenges"| node_slider_data
node_challenge_site -->|"shows markers"| node_markers
node_capture -->|"provides screenshot"| node_page_state
node_markers -->|"rectifies screen"| node_capture
node_captcha_runner -->|"requests view"| node_capture
node_captcha_runner -->|"checks page"| node_page_state
node_captcha_runner -->|"requests tile choices"| node_solver_client
node_solver_client -->|"sends screenshot"| node_solver_api
node_solver_api -->|"locates dialog"| node_screen_solver
node_screen_solver -->|"solves tiles"| node_grid_solver
node_screen_solver -->|"queries banner"| node_ai_client
node_grid_solver -->|"queries tiles"| node_ai_client
node_ai_client -->|"calls inference"| node_workers_ai
node_solver_api -->|"serves interface"| node_solver_ui
node_model_compare -->|"benchmarks models"| node_ai_client
node_captcha_runner -->|"checks selected tiles"| node_selection_check
node_captcha_runner -->|"executes taps"| node_tap_control
node_tap_control -->|"plans motion"| node_calibration
node_tap_control -->|"applies correction"| node_correction
node_tap_control -->|"tracks stylus"| node_tip_vision
node_tap_control -->|"moves joints"| node_arm
node_arm -->|"touches screen"| node_challenge_site
node_captcha_runner -->|"uses taught pages"| node_layout_learning

click node_challenge_site "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captcha/src/data/image-challenges.ts"
click node_image_data "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captcha/src/data/image-challenges.ts"
click node_slider_data "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captcha/src/data/slider-challenges.ts"
click node_training "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captcha/src/data/training-catalog.ts"
click node_training_overlay "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captcha/src/lib/training-overlay.ts"
click node_slider_logic "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captcha/src/lib/slider-challenge.ts"
click node_capture "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/see.py"
click node_markers "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/markers.js"
click node_page_state "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/pagestate.py"
click node_layout_learning "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/learn_layout.py"
click node_solver_api "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captchasolver/src/captchasolver/server/api.py"
click node_screen_solver "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captchasolver/src/captchasolver/screen.py"
click node_grid_solver "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captchasolver/src/captchasolver/grid.py"
click node_ai_client "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captchasolver/src/captchasolver/client.py"
click node_solver_ui "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captchasolver/src/captchasolver/web.py"
click node_model_compare "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captchasolver/src/captchasolver/compare.py"
click node_captcha_runner "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/run_captcha.py"
click node_solver_client "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/solve.py"
click node_selection_check "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/verify_selection.py"
click node_calibration "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/common.py"
click node_tap_control "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/tap.py"
click node_correction "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/correction.py"
click node_tip_vision "https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/tipvision.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_challenge_site,node_image_data,node_slider_data,node_training,node_training_overlay,node_slider_logic,node_user toneBlue
class node_solver_api,node_screen_solver,node_grid_solver,node_ai_client,node_solver_ui,node_model_compare toneAmber
class node_capture,node_markers,node_page_state,node_layout_learning toneMint
class node_calibration,node_tap_control,node_correction,node_tip_vision,node_workers_ai toneRose
class node_captcha_runner,node_solver_client,node_selection_check,node_arm toneIndigo
```

## Components

### Mock CAPTCHA site

- [Challenge site](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captcha/src/data/image-challenges.ts): `captcha/src/data/image-challenges.ts`
- [Image puzzles](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captcha/src/data/image-challenges.ts): `captcha/src/data/image-challenges.ts`
- [Slider puzzles](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captcha/src/data/slider-challenges.ts): `captcha/src/data/slider-challenges.ts`
- [Training catalog](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captcha/src/data/training-catalog.ts): `captcha/src/data/training-catalog.ts`
- [Training overlay](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captcha/src/lib/training-overlay.ts): `captcha/src/lib/training-overlay.ts`
- [Slider challenge logic](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captcha/src/lib/slider-challenge.ts): `captcha/src/lib/slider-challenge.ts`

### Vision solver

- [Solver API](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captchasolver/src/captchasolver/server/api.py): `captchasolver/src/captchasolver/server/api.py`
- [Dialog detection](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captchasolver/src/captchasolver/screen.py): `captchasolver/src/captchasolver/screen.py`
- [Tile recognition](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captchasolver/src/captchasolver/grid.py): `captchasolver/src/captchasolver/grid.py`
- [Workers AI client](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captchasolver/src/captchasolver/client.py): `captchasolver/src/captchasolver/client.py`
- [Solver web UI](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captchasolver/src/captchasolver/web.py): `captchasolver/src/captchasolver/web.py`
- [Model comparison](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/captchasolver/src/captchasolver/compare.py): `captchasolver/src/captchasolver/compare.py`

### Screen perception

- [Screen capture](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/see.py): `touch/see.py`
- [Screen markers](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/markers.js): `touch/markers.js`
- [Page recognition](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/pagestate.py): `touch/pagestate.py`
- [Page layout learning](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/learn_layout.py): `touch/learn_layout.py`

### Arm control

- [Tap calibration model](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/common.py): `touch/common.py`
- [Tap execution](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/tap.py): `touch/tap.py`
- [Learned correction](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/correction.py): `touch/correction.py`
- [Stylus tip vision](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/tipvision.py): `touch/tipvision.py`

### Solve workflow

- [Robot solve loop](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/run_captcha.py): `touch/run_captcha.py`
- [Solver client](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/solve.py): `touch/solve.py`
- [Selection verification](https://github.com/robotics-hackathon/robotics_hackathon/blob/main/touch/verify_selection.py): `touch/verify_selection.py`

### Other components

- **User**
- **Workers AI**
- **Robot arm**

## Connections

- User → Challenge site: opens challenge (evidence: `README.md`)
- Challenge site → Image puzzles: serves grids (evidence: `captcha/src/data/image-challenges.ts`)
- Challenge site → Slider puzzles: serves sliders
- Training catalog → Image puzzles: catalogs puzzles (evidence: `captcha/src/data/training-catalog.ts`)
- Training catalog → Slider puzzles: catalogs puzzles (evidence: `captcha/src/data/training-catalog.ts`)
- Training overlay → Training catalog: supports sessions
- Slider challenge logic → Slider puzzles: uses challenges (evidence: `captcha/src/lib/slider-challenge.ts`)
- Challenge site → Screen markers: shows markers (evidence: `README.md`)
- Screen capture → Page recognition: provides screenshot (evidence: `README.md`)
- Screen markers → Screen capture: rectifies screen (evidence: `README.md`)
- Robot solve loop → Screen capture: requests view (evidence: `touch/run_captcha.py`)
- Robot solve loop → Page recognition: checks page (evidence: `touch/run_captcha.py`)
- Robot solve loop → Solver client: requests tile choices (evidence: `README.md`)
- Solver client → Solver API: sends screenshot (evidence: `README.md`)
- Solver API → Dialog detection: locates dialog (evidence: `captchasolver/src/captchasolver/server/api.py`)
- Dialog detection → Tile recognition: solves tiles (evidence: `captchasolver/src/captchasolver/screen.py`)
- Dialog detection → Workers AI client: queries banner (evidence: `captchasolver/src/captchasolver/screen.py`)
- Tile recognition → Workers AI client: queries tiles (evidence: `captchasolver/src/captchasolver/grid.py`)
- Workers AI client → Workers AI: calls inference (evidence: `captchasolver/src/captchasolver/client.py`)
- Solver API → Solver web UI: serves interface (evidence: `captchasolver/src/captchasolver/server/api.py`)
- Model comparison → Workers AI client: benchmarks models (evidence: `captchasolver/src/captchasolver/compare.py`)
- Robot solve loop → Selection verification: checks selected tiles (evidence: `touch/run_captcha.py`)
- Robot solve loop → Tap execution: executes taps (evidence: `touch/run_captcha.py`)
- Tap execution → Tap calibration model: plans motion (evidence: `touch/tap.py`)
- Tap execution → Learned correction: applies correction (evidence: `touch/tap.py`)
- Tap execution → Stylus tip vision: tracks stylus (evidence: `touch/tap.py`)
- Tap execution → Robot arm: moves joints (evidence: `README.md`)
- Robot arm → Challenge site: touches screen (evidence: `README.md`)
- Robot solve loop → Page layout learning: uses taught pages (evidence: `touch/run_captcha.py`)
