# wdobry/laya-playground architecture

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

- Interactive diagram: https://gitdiagram.com/wdobry/laya-playground
- Repository: https://github.com/wdobry/laya-playground

## Overview

Laya Playground presents recorded examples and three model-driven games, offers an editor for typed questions, and can run locally against Laya’s checkpoints. The main live workflow is a visitor editing a state and questions or playing a game; the browser sends predictions to the loopback server, which validates and routes the request before returning probabilities. Separate branches expose the Laya-versus-Jev benchmark and the agent integration skill. The README documents these capabilities; some browser wiring and server internals were not sampled, so uncertain links are omitted.

Main entry points: [`server.py`](https://github.com/wdobry/laya-playground/blob/main/server.py) (Local API server), [`static/app.js`](https://github.com/wdobry/laya-playground/blob/main/static/app.js) (Landing renderer), [`eval/run_eval.py`](https://github.com/wdobry/laya-playground/blob/main/eval/run_eval.py) (Evaluation runner), [`static/playground.js`](https://github.com/wdobry/laya-playground/blob/main/static/playground.js) (Question editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_landing["Landing page<br/>[index.html]"]
  node_playground["Playground page<br/>[playground.html]"]
  node_about["About page<br/>[about.html]"]
  node_landing_app["Landing renderer<br/>[app.js]"]
  node_playground_ui["Question editor<br/>[playground.js]"]
  node_browser_ui["UI helpers<br/>[ui.js]"]
  node_result_cards["Result cards<br/>[cards.js]"]
  node_recorded_data[("Recorded examples")]
end

subgraph group_inference["Local inference"]
  node_server["Local API server<br/>[server.py]"]
  node_router["Model routing<br/>[poc.py]"]
  node_laya["Laya checkpoints"]
  node_health["Model health<br/>[health.js]"]
end

subgraph group_games["Decision games"]
  node_game_registry["Demo registry<br/>[index.js]"]
  node_game_modules["Game simulations"]
  node_game_runtime["Game runtime<br/>[live.js]"]
  node_game_records[("Game recordings")]
end

subgraph group_benchmark["Benchmark"]
  node_eval_tasks["Benchmark tasks<br/>[tasks.json]"]
  node_dataset_builder["Dataset builder<br/>[build_dataset.py]"]
  node_eval_runner["Evaluation runner<br/>[run_eval.py]"]
  node_benchmark_results["Benchmark results<br/>[versus.json]"]
end

subgraph group_skill["Agent guidance"]
  node_skill_doc["Integration skill<br/>[SKILL.md]"]
end

node_visitor(("Visitor"))
node_jev["Jev API"]

node_visitor -->|"opens"| node_landing
node_visitor -->|"edits questions"| node_playground
node_visitor -->|"opens"| node_about
node_landing_app -->|"reads examples"| node_recorded_data
node_landing_app -->|"renders answers"| node_result_cards
node_landing_app -->|"loads skill"| node_skill_doc
node_playground_ui -->|"uses prediction"| node_browser_ui
node_playground_ui -->|"renders results"| node_result_cards
node_playground_ui -->|"checks readiness"| node_health
node_browser_ui -->|"posts predictions"| node_server
node_server -->|"routes request"| node_router
node_server -->|"loads and queries"| node_laya
node_health -->|"reads status"| node_server
node_game_runtime -->|"selects demos"| node_game_registry
node_game_registry -->|"imports games"| node_game_modules
node_game_runtime -->|"requests predictions"| node_browser_ui
node_game_runtime -.->|"replays decisions"| node_game_records
node_dataset_builder -->|"uses task definitions"| node_eval_tasks
node_eval_runner -->|"loads tasks"| node_eval_tasks
node_eval_runner -->|"measures Laya"| node_server
node_eval_runner -->|"measures Jev"| node_jev
node_eval_runner -->|"writes report"| node_benchmark_results
node_landing_app -->|"renders metrics"| node_benchmark_results

click node_landing "https://github.com/wdobry/laya-playground/blob/main/index.html"
click node_playground "https://github.com/wdobry/laya-playground/blob/main/playground.html"
click node_about "https://github.com/wdobry/laya-playground/blob/main/about.html"
click node_landing_app "https://github.com/wdobry/laya-playground/blob/main/static/app.js"
click node_playground_ui "https://github.com/wdobry/laya-playground/blob/main/static/playground.js"
click node_browser_ui "https://github.com/wdobry/laya-playground/blob/main/static/ui.js"
click node_result_cards "https://github.com/wdobry/laya-playground/blob/main/static/cards.js"
click node_recorded_data "https://github.com/wdobry/laya-playground/tree/main/static/data"
click node_skill_doc "https://github.com/wdobry/laya-playground/blob/main/skills/laya-integration/SKILL.md"
click node_server "https://github.com/wdobry/laya-playground/blob/main/server.py"
click node_router "https://github.com/wdobry/laya-playground/blob/main/poc.py"
click node_health "https://github.com/wdobry/laya-playground/blob/main/static/health.js"
click node_game_registry "https://github.com/wdobry/laya-playground/blob/main/static/demos/index.js"
click node_game_modules "https://github.com/wdobry/laya-playground/tree/main/static/demos"
click node_game_runtime "https://github.com/wdobry/laya-playground/blob/main/static/live.js"
click node_game_records "https://github.com/wdobry/laya-playground/tree/main/static/data"
click node_eval_tasks "https://github.com/wdobry/laya-playground/blob/main/eval/tasks.json"
click node_dataset_builder "https://github.com/wdobry/laya-playground/blob/main/eval/build_dataset.py"
click node_eval_runner "https://github.com/wdobry/laya-playground/blob/main/eval/run_eval.py"
click node_benchmark_results "https://github.com/wdobry/laya-playground/blob/main/static/data/versus.json"

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_landing,node_playground,node_about,node_landing_app,node_playground_ui,node_browser_ui,node_result_cards,node_recorded_data toneBlue
class node_server,node_router,node_laya,node_health toneAmber
class node_game_registry,node_game_modules,node_game_runtime,node_game_records,node_jev toneMint
class node_eval_tasks,node_dataset_builder,node_eval_runner,node_benchmark_results toneRose
class node_skill_doc,node_visitor toneIndigo
```

## Components

### Web experience

- [Landing page](https://github.com/wdobry/laya-playground/blob/main/index.html): `index.html`
- [Playground page](https://github.com/wdobry/laya-playground/blob/main/playground.html): `playground.html`
- [About page](https://github.com/wdobry/laya-playground/blob/main/about.html): `about.html`
- [Landing renderer](https://github.com/wdobry/laya-playground/blob/main/static/app.js): `static/app.js`
- [Question editor](https://github.com/wdobry/laya-playground/blob/main/static/playground.js): `static/playground.js`
- [UI helpers](https://github.com/wdobry/laya-playground/blob/main/static/ui.js): `static/ui.js`
- [Result cards](https://github.com/wdobry/laya-playground/blob/main/static/cards.js): `static/cards.js`
- [Recorded examples](https://github.com/wdobry/laya-playground/tree/main/static/data): `static/data`

### Local inference

- [Local API server](https://github.com/wdobry/laya-playground/blob/main/server.py): `server.py`
- [Model routing](https://github.com/wdobry/laya-playground/blob/main/poc.py): `poc.py`
- **Laya checkpoints**
- [Model health](https://github.com/wdobry/laya-playground/blob/main/static/health.js): `static/health.js`

### Decision games

- [Demo registry](https://github.com/wdobry/laya-playground/blob/main/static/demos/index.js): `static/demos/index.js`
- [Game simulations](https://github.com/wdobry/laya-playground/tree/main/static/demos): `static/demos`
- [Game runtime](https://github.com/wdobry/laya-playground/blob/main/static/live.js): `static/live.js`
- [Game recordings](https://github.com/wdobry/laya-playground/tree/main/static/data): `static/data`

### Benchmark

- [Benchmark tasks](https://github.com/wdobry/laya-playground/blob/main/eval/tasks.json): `eval/tasks.json`
- [Dataset builder](https://github.com/wdobry/laya-playground/blob/main/eval/build_dataset.py): `eval/build_dataset.py`
- [Evaluation runner](https://github.com/wdobry/laya-playground/blob/main/eval/run_eval.py): `eval/run_eval.py`
- [Benchmark results](https://github.com/wdobry/laya-playground/blob/main/static/data/versus.json): `static/data/versus.json`

### Agent guidance

- [Integration skill](https://github.com/wdobry/laya-playground/blob/main/skills/laya-integration/SKILL.md): `skills/laya-integration/SKILL.md`

### Other components

- **Visitor**
- **Jev API**

## Connections

- Visitor → Landing page: opens
- Visitor → Playground page: edits questions
- Visitor → About page: opens
- Landing renderer → Recorded examples: reads examples
- Landing renderer → Result cards: renders answers
- Landing renderer → Integration skill: loads skill
- Question editor → UI helpers: uses prediction
- Question editor → Result cards: renders results
- Question editor → Model health: checks readiness
- UI helpers → Local API server: posts predictions
- Local API server → Model routing: routes request
- Local API server → Laya checkpoints: loads and queries
- Model health → Local API server: reads status
- Game runtime → Demo registry: selects demos
- Demo registry → Game simulations: imports games
- Game runtime → UI helpers: requests predictions
- Game runtime → Game recordings: replays decisions
- Dataset builder → Benchmark tasks: uses task definitions
- Evaluation runner → Benchmark tasks: loads tasks
- Evaluation runner → Local API server: measures Laya
- Evaluation runner → Jev API: measures Jev
- Evaluation runner → Benchmark results: writes report
- Landing renderer → Benchmark results: renders metrics
