# mazzyy/product-eng-curser architecture

> Architecture diagram of the GitHub repository mazzyy/product-eng-curser, 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/mazzyy/product-eng-curser
- Repository: https://github.com/mazzyy/product-eng-curser

## Overview

TAKT is a production-engineering decision-support prototype: line and shift information is turned into signals, causes and priorities, then into containment, method-change and maintenance decisions presented to engineers. Its documented workflow and README describe capabilities beyond the sampled excerpts, so the graph includes those documented stages but leaves uncertain implementation wiring out. The repository also contains a distinct Gigafactory tablet-monitor application, shown as a separate optional WebSocket-connected branch.

Main entry points: [`station_db.py`](https://github.com/mazzyy/product-eng-curser/blob/master/station_db.py) (Station Data Access), [`cause_finder.py`](https://github.com/mazzyy/product-eng-curser/blob/master/cause_finder.py) (Cause Finder), [`app.py`](https://github.com/mazzyy/product-eng-curser/blob/master/app.py) (TAKT API), [`live.py`](https://github.com/mazzyy/product-eng-curser/blob/master/live.py) (Live Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Line Inputs"]
  node_simulator["Line Simulator<br/>[generate_data.py]"]
  node_stationdb[("Station Data Access<br/>[station_db.py]")]
  node_floor["Shift Notes Reader<br/>[floor_listener.py]"]
end

subgraph group_analysis["Detection And Analysis"]
  node_signal["Signal Checker<br/>[train_model.py]"]
  node_people["People Model"]
  node_cause["Cause Finder<br/>[cause_finder.py]"]
  node_method["Method Checker<br/>[method_checker.py]"]
  node_impact["Impact Ranker<br/>[impact_ranker.py]"]
end

subgraph group_decisions["Operational Decisions"]
  node_containment["Containment<br/>[containment.py]"]
  node_changes[("Change Manager<br/>[change_manager.py]")]
  node_maintenance["Maintenance Predictor<br/>[maintenance.py]"]
  node_live["Live Engine<br/>[live.py]"]
end

subgraph group_experience["Engineer Experience"]
  node_backend["TAKT API<br/>[app.py]"]
  node_agent["Copilot Agent<br/>[agent.py]"]
  node_tools["Copilot Tools<br/>[agent_tools.py]"]
  node_web["Engineer Interface<br/>[main.js]"]
end

subgraph group_tablet["Tablet Monitor"]
  node_tabletapp["Tablet Alert App<br/>[App.tsx]"]
  node_alertstore[("Alert Store<br/>[alertStore.ts]")]
  node_alertstream["Alert Stream<br/>[alertStream.ts]"]
end

node_line(("Production Line"))
node_engineer(("Production Engineer"))

node_line -->|"produces data"| node_stationdb
node_simulator -->|"generates data"| node_stationdb
node_stationdb -->|"supplies station data"| node_signal
node_stationdb -->|"supplies work data"| node_people
node_floor -->|"records extracted facts"| node_stationdb
node_signal -->|"provides signals"| node_cause
node_people -->|"provides patterns"| node_cause
node_method -->|"checks proposals"| node_changes
node_cause -->|"informs priority"| node_impact
node_impact -->|"informs response"| node_containment
node_cause -->|"informs scope"| node_containment
node_stationdb -->|"supplies history"| node_maintenance
node_stationdb -->|"supplies method records"| node_changes
node_stationdb -->|"serves product data"| node_backend
node_live -->|"serves live state"| node_backend
node_backend -->|"creates copilot"| node_agent
node_agent -->|"dispatches queries"| node_tools
node_tools -->|"reads operational data"| node_stationdb
node_backend -->|"serves API responses"| node_web
node_web -->|"presents decisions"| node_engineer
node_live -.->|"streams alerts"| node_alertstream
node_alertstream -.->|"delivers alerts"| node_tabletapp
node_tabletapp -->|"updates alert state"| node_alertstore

click node_simulator "https://github.com/mazzyy/product-eng-curser/blob/master/generate_data.py"
click node_stationdb "https://github.com/mazzyy/product-eng-curser/blob/master/station_db.py"
click node_floor "https://github.com/mazzyy/product-eng-curser/blob/master/floor_listener.py"
click node_signal "https://github.com/mazzyy/product-eng-curser/blob/master/train_model.py"
click node_people "https://github.com/mazzyy/product-eng-curser/blob/master/train_people_model.py"
click node_cause "https://github.com/mazzyy/product-eng-curser/blob/master/cause_finder.py"
click node_method "https://github.com/mazzyy/product-eng-curser/blob/master/method_checker.py"
click node_impact "https://github.com/mazzyy/product-eng-curser/blob/master/impact_ranker.py"
click node_containment "https://github.com/mazzyy/product-eng-curser/blob/master/containment.py"
click node_changes "https://github.com/mazzyy/product-eng-curser/blob/master/change_manager.py"
click node_maintenance "https://github.com/mazzyy/product-eng-curser/blob/master/maintenance.py"
click node_live "https://github.com/mazzyy/product-eng-curser/blob/master/live.py"
click node_backend "https://github.com/mazzyy/product-eng-curser/blob/master/app.py"
click node_agent "https://github.com/mazzyy/product-eng-curser/blob/master/agent.py"
click node_tools "https://github.com/mazzyy/product-eng-curser/blob/master/agent_tools.py"
click node_web "https://github.com/mazzyy/product-eng-curser/blob/master/frontend/js/main.js"
click node_tabletapp "https://github.com/mazzyy/product-eng-curser/blob/master/gigafactory-monitor/src/App.tsx"
click node_alertstore "https://github.com/mazzyy/product-eng-curser/blob/master/gigafactory-monitor/src/services/alertStore.ts"
click node_alertstream "https://github.com/mazzyy/product-eng-curser/blob/master/gigafactory-monitor/src/services/alertStream.ts"

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_simulator,node_stationdb,node_floor toneBlue
class node_signal,node_people,node_cause,node_method,node_impact toneAmber
class node_containment,node_changes,node_maintenance,node_live toneMint
class node_backend,node_agent,node_tools,node_web toneRose
class node_tabletapp,node_alertstore,node_alertstream,node_line,node_engineer toneIndigo
```

## Components

### Line Inputs

- [Line Simulator](https://github.com/mazzyy/product-eng-curser/blob/master/generate_data.py): `generate_data.py`
- [Station Data Access](https://github.com/mazzyy/product-eng-curser/blob/master/station_db.py): `station_db.py`
- [Shift Notes Reader](https://github.com/mazzyy/product-eng-curser/blob/master/floor_listener.py): `floor_listener.py`

### Detection And Analysis

- [Signal Checker](https://github.com/mazzyy/product-eng-curser/blob/master/train_model.py): `train_model.py`
- [People Model](https://github.com/mazzyy/product-eng-curser/blob/master/train_people_model.py): `train_people_model.py`
- [Cause Finder](https://github.com/mazzyy/product-eng-curser/blob/master/cause_finder.py): `cause_finder.py`
- [Method Checker](https://github.com/mazzyy/product-eng-curser/blob/master/method_checker.py): `method_checker.py`
- [Impact Ranker](https://github.com/mazzyy/product-eng-curser/blob/master/impact_ranker.py): `impact_ranker.py`

### Operational Decisions

- [Containment](https://github.com/mazzyy/product-eng-curser/blob/master/containment.py): `containment.py`
- [Change Manager](https://github.com/mazzyy/product-eng-curser/blob/master/change_manager.py): `change_manager.py`
- [Maintenance Predictor](https://github.com/mazzyy/product-eng-curser/blob/master/maintenance.py): `maintenance.py`
- [Live Engine](https://github.com/mazzyy/product-eng-curser/blob/master/live.py): `live.py`

### Engineer Experience

- [TAKT API](https://github.com/mazzyy/product-eng-curser/blob/master/app.py): `app.py`
- [Copilot Agent](https://github.com/mazzyy/product-eng-curser/blob/master/agent.py): `agent.py`
- [Copilot Tools](https://github.com/mazzyy/product-eng-curser/blob/master/agent_tools.py): `agent_tools.py`
- [Engineer Interface](https://github.com/mazzyy/product-eng-curser/blob/master/frontend/js/main.js): `frontend/js/main.js`

### Tablet Monitor

- [Tablet Alert App](https://github.com/mazzyy/product-eng-curser/blob/master/gigafactory-monitor/src/App.tsx): `gigafactory-monitor/src/App.tsx`
- [Alert Store](https://github.com/mazzyy/product-eng-curser/blob/master/gigafactory-monitor/src/services/alertStore.ts): `gigafactory-monitor/src/services/alertStore.ts`
- [Alert Stream](https://github.com/mazzyy/product-eng-curser/blob/master/gigafactory-monitor/src/services/alertStream.ts): `gigafactory-monitor/src/services/alertStream.ts`

### Other components

- **Production Line**
- **Production Engineer**

## Connections

- Production Line → Station Data Access: produces data
- Line Simulator → Station Data Access: generates data
- Station Data Access → Signal Checker: supplies station data
- Station Data Access → People Model: supplies work data
- Shift Notes Reader → Station Data Access: records extracted facts
- Signal Checker → Cause Finder: provides signals
- People Model → Cause Finder: provides patterns
- Method Checker → Change Manager: checks proposals
- Cause Finder → Impact Ranker: informs priority
- Impact Ranker → Containment: informs response
- Cause Finder → Containment: informs scope
- Station Data Access → Maintenance Predictor: supplies history
- Station Data Access → Change Manager: supplies method records
- Station Data Access → TAKT API: serves product data
- Live Engine → TAKT API: serves live state
- TAKT API → Copilot Agent: creates copilot
- Copilot Agent → Copilot Tools: dispatches queries
- Copilot Tools → Station Data Access: reads operational data
- TAKT API → Engineer Interface: serves API responses
- Engineer Interface → Production Engineer: presents decisions
- Live Engine → Alert Stream: streams alerts
- Alert Stream → Tablet Alert App: delivers alerts
- Tablet Alert App → Alert Store: updates alert state
