# gagan7350/bytesized architecture

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

- Interactive diagram: https://gitdiagram.com/gagan7350/bytesized
- Repository: https://github.com/gagan7350/bytesized

## Overview

SiliconBob is an IDE copilot for Verilog/SystemVerilog RTL: developers invoke analysis from the editor, receive lint diagnostics and an optimized-code diff, and can initiate a collaboration-room workflow. The sampled backend implements regex-based RTL checks and fixes, rather than the README’s described AST parser; its room manager stores room text in memory and broadcasts updates. The extension currently constructs and displays a WebSocket URL but does not open a socket, so live collaboration wiring from the extension is not established by the sampled code.

Main entry points: [`extension/src/extension.ts`](https://github.com/gagan7350/bytesized/blob/main/extension/src/extension.ts) (Extension commands), [`backend/main.py`](https://github.com/gagan7350/bytesized/blob/main/backend/main.py) (Optimization API), [`extension/package.json`](https://github.com/gagan7350/bytesized/blob/main/extension/package.json) (Backend URL setting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ide["IDE Copilot"]
  node_editor["VS Code / Bob editor"]
  node_extension["Extension commands<br/>[extension.ts]"]
  node_diagnostics["Editor diagnostics<br/>[extension.ts]"]
  node_diff["Optimized RTL diff<br/>[extension.ts]"]
  node_settings["Backend URL setting<br/>[package.json]"]
end

subgraph group_rtl["RTL Analysis"]
  node_api["Optimization API<br/>[main.py]"]
  node_rules["RTL lint and fixes<br/>[main.py]"]
end

subgraph group_collab["Collaboration"]
  node_room_api["WebSocket endpoint<br/>[main.py]"]
  node_room_manager["Room manager<br/>[main.py]"]
  node_room_state[("In-memory room documents<br/>[main.py]")]
end

node_engineer(("Hardware engineer"))
node_designers(("Room participants"))

node_engineer -->|"opens RTL"| node_editor
node_editor -->|"invokes command"| node_extension
node_extension -->|"reads URL"| node_settings
node_extension -->|"posts Verilog"| node_api
node_api -->|"runs checks"| node_rules
node_rules -->|"returns issues and fixes"| node_api
node_api -->|"returns results"| node_extension
node_extension -->|"sets squiggles"| node_diagnostics
node_extension -->|"opens comparison"| node_diff
node_engineer -->|"requests room"| node_extension
node_designers -->|"connect and send"| node_room_api
node_room_api -->|"dispatches messages"| node_room_manager
node_room_manager -->|"reads and writes"| node_room_state
node_room_manager -->|"broadcasts updates"| node_designers

click node_extension "https://github.com/gagan7350/bytesized/blob/main/extension/src/extension.ts"
click node_diagnostics "https://github.com/gagan7350/bytesized/blob/main/extension/src/extension.ts"
click node_diff "https://github.com/gagan7350/bytesized/blob/main/extension/src/extension.ts"
click node_settings "https://github.com/gagan7350/bytesized/blob/main/extension/package.json"
click node_api "https://github.com/gagan7350/bytesized/blob/main/backend/main.py"
click node_rules "https://github.com/gagan7350/bytesized/blob/main/backend/main.py"
click node_room_api "https://github.com/gagan7350/bytesized/blob/main/backend/main.py"
click node_room_manager "https://github.com/gagan7350/bytesized/blob/main/backend/main.py"
click node_room_state "https://github.com/gagan7350/bytesized/blob/main/backend/main.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_editor,node_extension,node_diagnostics,node_diff,node_settings toneBlue
class node_api,node_rules toneAmber
class node_room_api,node_room_manager,node_room_state toneMint
class node_engineer,node_designers toneIndigo
```

## Components

### IDE Copilot

- **VS Code / Bob editor**
- [Extension commands](https://github.com/gagan7350/bytesized/blob/main/extension/src/extension.ts): `extension/src/extension.ts`
- [Editor diagnostics](https://github.com/gagan7350/bytesized/blob/main/extension/src/extension.ts): `extension/src/extension.ts`
- [Optimized RTL diff](https://github.com/gagan7350/bytesized/blob/main/extension/src/extension.ts): `extension/src/extension.ts`
- [Backend URL setting](https://github.com/gagan7350/bytesized/blob/main/extension/package.json): `extension/package.json`

### RTL Analysis

- [Optimization API](https://github.com/gagan7350/bytesized/blob/main/backend/main.py): `backend/main.py`
- [RTL lint and fixes](https://github.com/gagan7350/bytesized/blob/main/backend/main.py): `backend/main.py`

### Collaboration

- [WebSocket endpoint](https://github.com/gagan7350/bytesized/blob/main/backend/main.py): `backend/main.py`
- [Room manager](https://github.com/gagan7350/bytesized/blob/main/backend/main.py): `backend/main.py`
- [In-memory room documents](https://github.com/gagan7350/bytesized/blob/main/backend/main.py): `backend/main.py`

### Other components

- **Hardware engineer**
- **Room participants**

## Connections

- Hardware engineer → VS Code / Bob editor: opens RTL
- VS Code / Bob editor → Extension commands: invokes command
- Extension commands → Backend URL setting: reads URL
- Extension commands → Optimization API: posts Verilog
- Optimization API → RTL lint and fixes: runs checks
- RTL lint and fixes → Optimization API: returns issues and fixes
- Optimization API → Extension commands: returns results
- Extension commands → Editor diagnostics: sets squiggles
- Extension commands → Optimized RTL diff: opens comparison
- Hardware engineer → Extension commands: requests room
- Room participants → WebSocket endpoint: connect and send
- WebSocket endpoint → Room manager: dispatches messages
- Room manager → In-memory room documents: reads and writes
- Room manager → Room participants: broadcasts updates
