# shriya-sai/flybreak architecture

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

- Interactive diagram: https://gitdiagram.com/shriya-sai/flybreak
- Repository: https://github.com/shriya-sai/flybreak

## Overview

FlyBreak is a browser-based neural-network strategy game: players inspect a live route from LC4 to DNg108, intervene with cuts or jams, and try to contain the signal while preserving protected outputs. The README identifies the shared graph engine, derived MaleCNS level data, replay, and computed bot comparisons as product capabilities. Source excerpts do not include the browser implementation, so the game-level breakdown and links rely on README statements rather than inspected internals.

Main entry points: [`dist/graph-engine.js`](https://github.com/shriya-sai/flybreak/blob/main/dist/graph-engine.js) (Graph Engine), [`dist/game.js`](https://github.com/shriya-sai/flybreak/blob/main/dist/game.js) (Game Interface), [`data/derived/malecns_lc4_dng108.json`](https://github.com/shriya-sai/flybreak/blob/main/data/derived/malecns_lc4_dng108.json) (Curated Level Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Live Gameplay"]
  node_game["Game Interface<br/>[game.js]"]
  node_interventions["Cut &amp; Jam<br/>[game.js]"]
  node_rerouting["Live Rerouting<br/>[game.js]"]
  node_outcomes["Containment &amp; Collateral<br/>[game.js]"]
end

subgraph group_engine["Graph Rules"]
  node_engine["Graph Engine<br/>[graph-engine.js]"]
  node_route_rules["Path &amp; Capacity Rules<br/>[graph-engine.js]"]
end

subgraph group_analysis["Replay &amp; Comparisons"]
  node_replay["Intervention Replay<br/>[game.js]"]
  node_bots["Bot Baselines<br/>[game.js]"]
end

subgraph group_level["Connectome Level"]
  node_level["Curated Level Data"]
end

node_player(("Player"))
node_male_cns[("MaleCNS Dataset")]

node_player -->|"plays"| node_game
node_game -->|"loads"| node_level
node_game -->|"uses"| node_engine
node_interventions -->|"apply rules"| node_engine
node_rerouting -->|"recompute routes"| node_engine
node_outcomes -->|"compute metrics"| node_engine
node_engine -->|"enumerates paths"| node_route_rules
node_replay -->|"replays with"| node_engine
node_bots -->|"compares with"| node_engine
node_male_cns -->|"derived from"| node_level

click node_game "https://github.com/shriya-sai/flybreak/blob/main/dist/game.js"
click node_interventions "https://github.com/shriya-sai/flybreak/blob/main/dist/game.js"
click node_rerouting "https://github.com/shriya-sai/flybreak/blob/main/dist/game.js"
click node_outcomes "https://github.com/shriya-sai/flybreak/blob/main/dist/game.js"
click node_engine "https://github.com/shriya-sai/flybreak/blob/main/dist/graph-engine.js"
click node_route_rules "https://github.com/shriya-sai/flybreak/blob/main/dist/graph-engine.js"
click node_replay "https://github.com/shriya-sai/flybreak/blob/main/dist/game.js"
click node_bots "https://github.com/shriya-sai/flybreak/blob/main/dist/game.js"
click node_level "https://github.com/shriya-sai/flybreak/blob/main/data/derived/malecns_lc4_dng108.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_game,node_interventions,node_rerouting,node_outcomes toneBlue
class node_engine,node_route_rules,node_male_cns toneAmber
class node_replay,node_bots toneMint
class node_level toneRose
class node_player toneIndigo
```

## Components

### Live Gameplay

- [Game Interface](https://github.com/shriya-sai/flybreak/blob/main/dist/game.js): `dist/game.js`
- [Cut & Jam](https://github.com/shriya-sai/flybreak/blob/main/dist/game.js): `dist/game.js`
- [Live Rerouting](https://github.com/shriya-sai/flybreak/blob/main/dist/game.js): `dist/game.js`
- [Containment & Collateral](https://github.com/shriya-sai/flybreak/blob/main/dist/game.js): `dist/game.js`

### Graph Rules

- [Graph Engine](https://github.com/shriya-sai/flybreak/blob/main/dist/graph-engine.js): `dist/graph-engine.js`
- [Path & Capacity Rules](https://github.com/shriya-sai/flybreak/blob/main/dist/graph-engine.js): `dist/graph-engine.js`

### Replay & Comparisons

- [Intervention Replay](https://github.com/shriya-sai/flybreak/blob/main/dist/game.js): `dist/game.js`
- [Bot Baselines](https://github.com/shriya-sai/flybreak/blob/main/dist/game.js): `dist/game.js`

### Connectome Level

- [Curated Level Data](https://github.com/shriya-sai/flybreak/blob/main/data/derived/malecns_lc4_dng108.json): `data/derived/malecns_lc4_dng108.json`

### Other components

- **Player**
- **MaleCNS Dataset**

## Connections

- Player → Game Interface: plays (evidence: `README.md`)
- Game Interface → Curated Level Data: loads (evidence: `README.md`)
- Game Interface → Graph Engine: uses (evidence: `README.md`)
- Cut & Jam → Graph Engine: apply rules (evidence: `README.md`)
- Live Rerouting → Graph Engine: recompute routes (evidence: `README.md`)
- Containment & Collateral → Graph Engine: compute metrics (evidence: `README.md`)
- Graph Engine → Path & Capacity Rules: enumerates paths (evidence: `README.md`)
- Intervention Replay → Graph Engine: replays with (evidence: `README.md`)
- Bot Baselines → Graph Engine: compares with (evidence: `README.md`)
- MaleCNS Dataset → Curated Level Data: derived from (evidence: `README.md`)
