# mudadlapranay12/ace.x architecture

> Architecture diagram of the GitHub repository mudadlapranay12/ace.x, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mudadlapranay12/ace.x
- Repository: https://github.com/mudadlapranay12/ace.x

## Overview

Ace.X pairs a VS Code developer companion (robot-brain) with an Electron robot (robot-body). Its main workflow observes workspace activity, filters events, interprets them, makes deterministic assistance decisions, and expresses the result through the companion. The README also documents teaching and learning, debugging history, attention, optional Gemini explanations, and a separate VS Code robot view. The graph follows documented flows and excerpted wiring; unsampled subsystem internals are represented at their documented directory paths.

Main entry points: [`robot-brain/src/pipeline/companionLoop.ts`](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/pipeline/companionLoop.ts) (Companion Loop), [`robot-brain/src/pipeline/pipeline.ts`](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/pipeline/pipeline.ts) (Pipeline), [`robot-brain/src/perception/perceptionEngine.ts`](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/perception/perceptionEngine.ts) (Perception Engine), [`robot-body/behaviour/behaviourController.js`](https://github.com/mudadlapranay12/ace.x/blob/main/robot-body/behaviour/behaviourController.js) (Body Behaviour)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_brain["Workspace Brain"]
  node_sensors["Workspace Sensors"]
  node_filter["Event Filter<br/>[eventFilter.ts]"]
  node_pipeline["Pipeline<br/>[pipeline.ts]"]
  node_perception["Perception Engine"]
  node_context["Context Engine<br/>[contextEngine.ts]"]
  node_decision["Decision Engine<br/>[decisionEngine.ts]"]
end

subgraph group_companion["Teaching Companion"]
  node_companion_loop["Companion Loop<br/>[companionLoop.ts]"]
  node_teaching["Teaching Ladder<br/>[teachingEngine.ts]"]
  node_struggle["Struggle Analysis"]
  node_learning[("Learning Profile<br/>[skillProfile.ts]")]
  node_attention["Attention Target<br/>[attentionTarget.ts]"]
  node_timeline[("Debug Timeline<br/>[timelineBuffer.ts]")]
  node_gemini["Gemini Explanations<br/>[gemini.ts]"]
end

subgraph group_actuation["Robot Expression"]
  node_behaviour["Behaviour Controller"]
  node_motion_planner["Motion Planner<br/>[motionPlanner.ts]"]
  node_motion_controller["Motion Controller"]
  node_websocket["Brain WebSocket<br/>[websocketServer.ts]"]
  node_body_client["Body WebSocket Client<br/>[wsClient.js]"]
  node_parser["Message Parser<br/>[messageParser.js]"]
  node_body_behaviour["Body Behaviour"]
  node_animation["Animation Controller"]
  node_face["Face Controller<br/>[faceController.js]"]
  node_three["Three.js Renderer<br/>[renderer.js]"]
end

subgraph group_surfaces["User Interfaces"]
  node_robot_ui["VS Code Robot View"]
  node_commands["Companion Commands<br/>[commandRouter.ts]"]
end

node_developer(("Developer"))
node_vscode["VS Code Workspace"]

node_developer -->|"edits code"| node_vscode
node_vscode -->|"workspace activity"| node_sensors
node_sensors -->|"emit events"| node_filter
node_filter -->|"filtered events"| node_perception
node_perception -->|"observations"| node_context
node_context -->|"contexts"| node_decision
node_perception -->|"observations"| node_companion_loop
node_decision -->|"decisions"| node_companion_loop
node_companion_loop -->|"selects rung"| node_teaching
node_companion_loop -->|"assesses difficulty"| node_struggle
node_companion_loop -->|"reads and updates"| node_learning
node_companion_loop -->|"sets target"| node_attention
node_companion_loop -->|"records history"| node_timeline
node_companion_loop -->|"gates explanations"| node_gemini
node_pipeline -->|"wires pipeline"| node_perception
node_pipeline -->|"builds context"| node_context
node_pipeline -->|"wires decisions"| node_decision
node_pipeline -->|"routes decisions"| node_behaviour
node_pipeline -->|"plans motion"| node_motion_planner
node_pipeline -->|"executes plans"| node_motion_controller
node_pipeline -->|"requests diagnostics"| node_gemini
node_behaviour -->|"sends expression"| node_websocket
node_body_client -->|"connects to"| node_websocket
node_body_client -->|"validates messages"| node_parser
node_parser -->|"maps actions"| node_body_behaviour
node_body_behaviour -->|"drives animation"| node_animation
node_body_behaviour -->|"drives face"| node_face
node_animation -->|"renders motion"| node_three
node_face -->|"renders expression"| node_three
node_developer -->|"requests help"| node_commands
node_developer -->|"views companion"| node_robot_ui

click node_sensors "https://github.com/mudadlapranay12/ace.x/tree/main/robot-brain/src/sensors"
click node_filter "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/eventFilter/eventFilter.ts"
click node_pipeline "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/pipeline/pipeline.ts"
click node_perception "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/perception/perceptionEngine.ts"
click node_context "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/context/contextEngine.ts"
click node_decision "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/decision/decisionEngine.ts"
click node_companion_loop "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/pipeline/companionLoop.ts"
click node_teaching "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/teaching/teachingEngine.ts"
click node_struggle "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/struggle/struggleDetector.ts"
click node_learning "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/learning/skillProfile.ts"
click node_attention "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/attention/attentionTarget.ts"
click node_timeline "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/timeline/timelineBuffer.ts"
click node_gemini "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/ai/gemini.ts"
click node_behaviour "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/behaviour/behaviourController.ts"
click node_motion_planner "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/motion/motionPlanner.ts"
click node_motion_controller "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/motionController/motionController.ts"
click node_websocket "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/utils/websocketServer.ts"
click node_body_client "https://github.com/mudadlapranay12/ace.x/blob/main/robot-body/wsClient.js"
click node_parser "https://github.com/mudadlapranay12/ace.x/blob/main/robot-body/messageParser.js"
click node_body_behaviour "https://github.com/mudadlapranay12/ace.x/blob/main/robot-body/behaviour/behaviourController.js"
click node_animation "https://github.com/mudadlapranay12/ace.x/blob/main/robot-body/behaviour/animationController.js"
click node_face "https://github.com/mudadlapranay12/ace.x/blob/main/robot-body/behaviour/faceController.js"
click node_three "https://github.com/mudadlapranay12/ace.x/blob/main/robot-body/renderer.js"
click node_robot_ui "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/ui/robotViewManager.ts"
click node_commands "https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/commands/commandRouter.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_sensors,node_filter,node_pipeline,node_perception,node_context,node_decision toneBlue
class node_companion_loop,node_teaching,node_struggle,node_learning,node_attention,node_timeline,node_gemini toneAmber
class node_behaviour,node_motion_planner,node_motion_controller,node_websocket,node_body_client,node_parser,node_body_behaviour,node_animation,node_face,node_three toneMint
class node_robot_ui,node_commands toneRose
class node_developer,node_vscode toneIndigo
```

## Components

### Workspace Brain

- [Workspace Sensors](https://github.com/mudadlapranay12/ace.x/tree/main/robot-brain/src/sensors): `robot-brain/src/sensors`
- [Event Filter](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/eventFilter/eventFilter.ts): `robot-brain/src/eventFilter/eventFilter.ts`
- [Pipeline](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/pipeline/pipeline.ts): `robot-brain/src/pipeline/pipeline.ts`
- [Perception Engine](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/perception/perceptionEngine.ts): `robot-brain/src/perception/perceptionEngine.ts`
- [Context Engine](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/context/contextEngine.ts): `robot-brain/src/context/contextEngine.ts`
- [Decision Engine](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/decision/decisionEngine.ts): `robot-brain/src/decision/decisionEngine.ts`

### Teaching Companion

- [Companion Loop](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/pipeline/companionLoop.ts): `robot-brain/src/pipeline/companionLoop.ts`
- [Teaching Ladder](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/teaching/teachingEngine.ts): `robot-brain/src/teaching/teachingEngine.ts`
- [Struggle Analysis](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/struggle/struggleDetector.ts): `robot-brain/src/struggle/struggleDetector.ts`
- [Learning Profile](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/learning/skillProfile.ts): `robot-brain/src/learning/skillProfile.ts`
- [Attention Target](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/attention/attentionTarget.ts): `robot-brain/src/attention/attentionTarget.ts`
- [Debug Timeline](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/timeline/timelineBuffer.ts): `robot-brain/src/timeline/timelineBuffer.ts`
- [Gemini Explanations](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/ai/gemini.ts): `robot-brain/src/ai/gemini.ts`

### Robot Expression

- [Behaviour Controller](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/behaviour/behaviourController.ts): `robot-brain/src/behaviour/behaviourController.ts`
- [Motion Planner](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/motion/motionPlanner.ts): `robot-brain/src/motion/motionPlanner.ts`
- [Motion Controller](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/motionController/motionController.ts): `robot-brain/src/motionController/motionController.ts`
- [Brain WebSocket](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/utils/websocketServer.ts): `robot-brain/src/utils/websocketServer.ts`
- [Body WebSocket Client](https://github.com/mudadlapranay12/ace.x/blob/main/robot-body/wsClient.js): `robot-body/wsClient.js`
- [Message Parser](https://github.com/mudadlapranay12/ace.x/blob/main/robot-body/messageParser.js): `robot-body/messageParser.js`
- [Body Behaviour](https://github.com/mudadlapranay12/ace.x/blob/main/robot-body/behaviour/behaviourController.js): `robot-body/behaviour/behaviourController.js`
- [Animation Controller](https://github.com/mudadlapranay12/ace.x/blob/main/robot-body/behaviour/animationController.js): `robot-body/behaviour/animationController.js`
- [Face Controller](https://github.com/mudadlapranay12/ace.x/blob/main/robot-body/behaviour/faceController.js): `robot-body/behaviour/faceController.js`
- [Three.js Renderer](https://github.com/mudadlapranay12/ace.x/blob/main/robot-body/renderer.js): `robot-body/renderer.js`

### User Interfaces

- [VS Code Robot View](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/ui/robotViewManager.ts): `robot-brain/src/ui/robotViewManager.ts`
- [Companion Commands](https://github.com/mudadlapranay12/ace.x/blob/main/robot-brain/src/commands/commandRouter.ts): `robot-brain/src/commands/commandRouter.ts`

### Other components

- **Developer**
- **VS Code Workspace**

## Connections

- Developer → VS Code Workspace: edits code (evidence: `README.md`)
- VS Code Workspace → Workspace Sensors: workspace activity (evidence: `README.md`)
- Workspace Sensors → Event Filter: emit events (evidence: `README.md`)
- Event Filter → Perception Engine: filtered events (evidence: `README.md`)
- Perception Engine → Context Engine: observations (evidence: `README.md`)
- Context Engine → Decision Engine: contexts (evidence: `README.md`)
- Perception Engine → Companion Loop: observations (evidence: `README.md`)
- Decision Engine → Companion Loop: decisions (evidence: `README.md`)
- Companion Loop → Teaching Ladder: selects rung (evidence: `README.md`)
- Companion Loop → Struggle Analysis: assesses difficulty (evidence: `README.md`)
- Companion Loop → Learning Profile: reads and updates (evidence: `README.md`)
- Companion Loop → Attention Target: sets target (evidence: `README.md`)
- Companion Loop → Debug Timeline: records history (evidence: `README.md`)
- Companion Loop → Gemini Explanations: gates explanations (evidence: `README.md`)
- Pipeline → Perception Engine: wires pipeline (evidence: `robot-brain/src/pipeline/pipeline.ts`)
- Pipeline → Context Engine: builds context (evidence: `robot-brain/src/pipeline/pipeline.ts`)
- Pipeline → Decision Engine: wires decisions (evidence: `robot-brain/src/pipeline/pipeline.ts`)
- Pipeline → Behaviour Controller: routes decisions (evidence: `robot-brain/src/pipeline/pipeline.ts`)
- Pipeline → Motion Planner: plans motion (evidence: `robot-brain/src/pipeline/pipeline.ts`)
- Pipeline → Motion Controller: executes plans (evidence: `robot-brain/src/pipeline/pipeline.ts`)
- Pipeline → Gemini Explanations: requests diagnostics (evidence: `robot-brain/src/pipeline/pipeline.ts`)
- Behaviour Controller → Brain WebSocket: sends expression (evidence: `robot-brain/src/behaviour/behaviourController.ts`)
- Body WebSocket Client → Brain WebSocket: connects to (evidence: `robot-body/wsClient.js`)
- Body WebSocket Client → Message Parser: validates messages (evidence: `robot-body/wsClient.js`)
- Message Parser → Body Behaviour: maps actions (evidence: `README.md`)
- Body Behaviour → Animation Controller: drives animation (evidence: `README.md`)
- Body Behaviour → Face Controller: drives face (evidence: `README.md`)
- Animation Controller → Three.js Renderer: renders motion (evidence: `README.md`)
- Face Controller → Three.js Renderer: renders expression (evidence: `README.md`)
- Developer → Companion Commands: requests help (evidence: `README.md`)
- Developer → VS Code Robot View: views companion (evidence: `robot-brain/src/ui/robotViewManager.ts`)
