# ivanchernykh/codespace architecture

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

- Interactive diagram: https://gitdiagram.com/ivanchernykh/codespace
- Repository: https://github.com/ivanchernykh/codespace

## Overview

CodeSpace is a local-first repository intelligence engine. The core workflow indexes a repository into a semantic graph, then searches that graph or compiles a token-bounded context pack with Context Cell knowledge and redaction; impact analysis and decision history provide adjacent workflows. CLI, MCP, REST, and the embedded dashboard expose these capabilities, with workspace, settings, skills, events, and export support. Edges below are limited to explicit README relationships or references visible in sampled source; some documented subsystems have no verified internal wiring in the excerpts.

Main entry points: [`src/application.rs`](https://github.com/ivanchernykh/codespace/blob/main/src/application.rs) (Action registry), [`src/server.rs`](https://github.com/ivanchernykh/codespace/blob/main/src/server.rs) (Local daemon), [`src/indexer.rs`](https://github.com/ivanchernykh/codespace/blob/main/src/indexer.rs) (Code indexer), [`src/context.rs`](https://github.com/ivanchernykh/codespace/blob/main/src/context.rs) (Context packs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_index["Repository index"]
  node_indexer["Code indexer<br/>[indexer.rs]"]
  node_parser["Language parsers<br/>[parser.rs]"]
  node_graph["Semantic graph model<br/>[model.rs]"]
  node_storage[("Index storage<br/>[storage.rs]")]
end

subgraph group_intelligence["Context and analysis"]
  node_search["Symbol search<br/>[search.rs]"]
  node_context_cells["Context Cells<br/>[context_cells.rs]"]
  node_context["Context packs<br/>[context.rs]"]
  node_impact["Git impact analysis<br/>[impact.rs]"]
  node_memory["Decision memory<br/>[memory.rs]"]
  node_export["Graph export<br/>[export.rs]"]
  node_secret["Secret redaction<br/>[secret.rs]"]
end

subgraph group_interfaces["User interfaces"]
  node_cli["CLI actions<br/>[cli.rs]"]
  node_server["Local daemon<br/>[server.rs]"]
  node_dashboard_api["Dashboard client<br/>[api.ts]"]
  node_dashboard_ui["Dashboard UI<br/>[main.ts]"]
  node_mcp["MCP tools<br/>[mcp.rs]"]
  node_rest["REST API<br/>[rest.rs]"]
  node_actions["Action registry<br/>[application.rs]"]
end

subgraph group_operations["Local operations"]
  node_workspace["Workspace manager<br/>[workspace.rs]"]
  node_settings["Settings<br/>[settings.rs]"]
  node_skills["Skills platform<br/>[skills.rs]"]
  node_events["Event bus<br/>[events.rs]"]
  node_tasks["Task management<br/>[tasks.rs]"]
  node_mcp_manager["External MCP manager<br/>[mcp_manager.rs]"]
  node_github["GitHub integration"]
end

node_user(("Engineer"))
node_repo["Project repository"]

node_user -->|"runs actions"| node_cli
node_user -->|"uses dashboard"| node_dashboard_ui
node_repo -->|"indexes source"| node_indexer
node_indexer -->|"parses languages"| node_parser
node_indexer -->|"persists graph"| node_storage
node_indexer -->|"builds graph"| node_graph
node_storage -->|"loads and saves"| node_graph
node_cli -.->|"dispatches"| node_actions
node_server -->|"dispatches"| node_actions
node_dashboard_ui -.->|"requests data"| node_dashboard_api
node_dashboard_api -->|"calls REST"| node_server
node_mcp -.->|"exposes actions"| node_actions
node_rest -.->|"exposes actions"| node_actions
node_actions -->|"updates index"| node_indexer
node_actions -->|"initializes and saves"| node_storage
node_actions -->|"finds symbols"| node_search
node_actions -->|"builds packs"| node_context
node_actions -->|"analyzes changes"| node_impact
node_actions -->|"records decisions"| node_memory
node_actions -->|"exports graph"| node_export
node_context -->|"ranks symbols"| node_search
node_context -->|"uses cell evidence"| node_context_cells
node_context -->|"redacts content"| node_secret
node_search -->|"queries graph"| node_graph
node_impact -.->|"traverses relationships"| node_graph
node_memory -.->|"persists decisions"| node_storage
node_server -->|"manages workspaces"| node_workspace
node_server -->|"publishes updates"| node_events
node_server -->|"manages servers"| node_mcp_manager
node_server -->|"serves skills"| node_skills
node_server -->|"serves settings"| node_settings
node_server -->|"serves tasks"| node_tasks
node_server -->|"serves GitHub features"| node_github
node_user -->|"connects MCP client"| node_mcp
node_user -->|"calls REST"| node_rest

click node_cli "https://github.com/ivanchernykh/codespace/blob/main/src/cli.rs"
click node_server "https://github.com/ivanchernykh/codespace/blob/main/src/server.rs"
click node_dashboard_api "https://github.com/ivanchernykh/codespace/blob/main/dashboard/src/api.ts"
click node_dashboard_ui "https://github.com/ivanchernykh/codespace/blob/main/dashboard/src/main.ts"
click node_mcp "https://github.com/ivanchernykh/codespace/blob/main/src/mcp.rs"
click node_rest "https://github.com/ivanchernykh/codespace/blob/main/src/rest.rs"
click node_actions "https://github.com/ivanchernykh/codespace/blob/main/src/application.rs"
click node_indexer "https://github.com/ivanchernykh/codespace/blob/main/src/indexer.rs"
click node_parser "https://github.com/ivanchernykh/codespace/blob/main/src/parser.rs"
click node_graph "https://github.com/ivanchernykh/codespace/blob/main/src/model.rs"
click node_storage "https://github.com/ivanchernykh/codespace/blob/main/src/storage.rs"
click node_search "https://github.com/ivanchernykh/codespace/blob/main/src/search.rs"
click node_context_cells "https://github.com/ivanchernykh/codespace/blob/main/src/context_cells.rs"
click node_context "https://github.com/ivanchernykh/codespace/blob/main/src/context.rs"
click node_impact "https://github.com/ivanchernykh/codespace/blob/main/src/impact.rs"
click node_memory "https://github.com/ivanchernykh/codespace/blob/main/src/memory.rs"
click node_export "https://github.com/ivanchernykh/codespace/blob/main/src/export.rs"
click node_secret "https://github.com/ivanchernykh/codespace/blob/main/src/secret.rs"
click node_workspace "https://github.com/ivanchernykh/codespace/blob/main/src/workspace.rs"
click node_settings "https://github.com/ivanchernykh/codespace/blob/main/src/settings.rs"
click node_skills "https://github.com/ivanchernykh/codespace/blob/main/src/skills.rs"
click node_events "https://github.com/ivanchernykh/codespace/blob/main/src/events.rs"
click node_tasks "https://github.com/ivanchernykh/codespace/blob/main/src/tasks.rs"
click node_mcp_manager "https://github.com/ivanchernykh/codespace/blob/main/src/mcp_manager.rs"
click node_github "https://github.com/ivanchernykh/codespace/blob/main/src/github_integration.rs"

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_indexer,node_parser,node_graph,node_storage toneBlue
class node_search,node_context_cells,node_context,node_impact,node_memory,node_export,node_secret toneAmber
class node_cli,node_server,node_dashboard_api,node_dashboard_ui,node_mcp,node_rest,node_actions toneMint
class node_workspace,node_settings,node_skills,node_events,node_tasks,node_mcp_manager,node_github toneRose
class node_user,node_repo toneIndigo
```

## Components

### Repository index

- [Code indexer](https://github.com/ivanchernykh/codespace/blob/main/src/indexer.rs): `src/indexer.rs`
- [Language parsers](https://github.com/ivanchernykh/codespace/blob/main/src/parser.rs): `src/parser.rs`
- [Semantic graph model](https://github.com/ivanchernykh/codespace/blob/main/src/model.rs): `src/model.rs`
- [Index storage](https://github.com/ivanchernykh/codespace/blob/main/src/storage.rs): `src/storage.rs`

### Context and analysis

- [Symbol search](https://github.com/ivanchernykh/codespace/blob/main/src/search.rs): `src/search.rs`
- [Context Cells](https://github.com/ivanchernykh/codespace/blob/main/src/context_cells.rs): `src/context_cells.rs`
- [Context packs](https://github.com/ivanchernykh/codespace/blob/main/src/context.rs): `src/context.rs`
- [Git impact analysis](https://github.com/ivanchernykh/codespace/blob/main/src/impact.rs): `src/impact.rs`
- [Decision memory](https://github.com/ivanchernykh/codespace/blob/main/src/memory.rs): `src/memory.rs`
- [Graph export](https://github.com/ivanchernykh/codespace/blob/main/src/export.rs): `src/export.rs`
- [Secret redaction](https://github.com/ivanchernykh/codespace/blob/main/src/secret.rs): `src/secret.rs`

### User interfaces

- [CLI actions](https://github.com/ivanchernykh/codespace/blob/main/src/cli.rs): `src/cli.rs`
- [Local daemon](https://github.com/ivanchernykh/codespace/blob/main/src/server.rs): `src/server.rs`
- [Dashboard client](https://github.com/ivanchernykh/codespace/blob/main/dashboard/src/api.ts): `dashboard/src/api.ts`
- [Dashboard UI](https://github.com/ivanchernykh/codespace/blob/main/dashboard/src/main.ts): `dashboard/src/main.ts`
- [MCP tools](https://github.com/ivanchernykh/codespace/blob/main/src/mcp.rs): `src/mcp.rs`
- [REST API](https://github.com/ivanchernykh/codespace/blob/main/src/rest.rs): `src/rest.rs`
- [Action registry](https://github.com/ivanchernykh/codespace/blob/main/src/application.rs): `src/application.rs`

### Local operations

- [Workspace manager](https://github.com/ivanchernykh/codespace/blob/main/src/workspace.rs): `src/workspace.rs`
- [Settings](https://github.com/ivanchernykh/codespace/blob/main/src/settings.rs): `src/settings.rs`
- [Skills platform](https://github.com/ivanchernykh/codespace/blob/main/src/skills.rs): `src/skills.rs`
- [Event bus](https://github.com/ivanchernykh/codespace/blob/main/src/events.rs): `src/events.rs`
- [Task management](https://github.com/ivanchernykh/codespace/blob/main/src/tasks.rs): `src/tasks.rs`
- [External MCP manager](https://github.com/ivanchernykh/codespace/blob/main/src/mcp_manager.rs): `src/mcp_manager.rs`
- [GitHub integration](https://github.com/ivanchernykh/codespace/blob/main/src/github_integration.rs): `src/github_integration.rs`

### Other components

- **Engineer**
- **Project repository**

## Connections

- Engineer → CLI actions: runs actions (evidence: `README.md`)
- Engineer → Dashboard UI: uses dashboard (evidence: `README.md`)
- Project repository → Code indexer: indexes source (evidence: `README.md`)
- Code indexer → Language parsers: parses languages (evidence: `src/indexer.rs`)
- Code indexer → Index storage: persists graph (evidence: `src/indexer.rs`)
- Code indexer → Semantic graph model: builds graph (evidence: `src/indexer.rs`)
- Index storage → Semantic graph model: loads and saves (evidence: `src/storage.rs`)
- CLI actions → Action registry: dispatches
- Local daemon → Action registry: dispatches (evidence: `src/server.rs`)
- Dashboard UI → Dashboard client: requests data
- Dashboard client → Local daemon: calls REST (evidence: `dashboard/src/api.ts`)
- MCP tools → Action registry: exposes actions
- REST API → Action registry: exposes actions
- Action registry → Code indexer: updates index (evidence: `src/application.rs`)
- Action registry → Index storage: initializes and saves (evidence: `src/application.rs`)
- Action registry → Symbol search: finds symbols (evidence: `src/application.rs`)
- Action registry → Context packs: builds packs (evidence: `src/application.rs`)
- Action registry → Git impact analysis: analyzes changes (evidence: `src/application.rs`)
- Action registry → Decision memory: records decisions (evidence: `src/application.rs`)
- Action registry → Graph export: exports graph (evidence: `src/application.rs`)
- Context packs → Symbol search: ranks symbols (evidence: `src/context.rs`)
- Context packs → Context Cells: uses cell evidence (evidence: `src/context.rs`)
- Context packs → Secret redaction: redacts content (evidence: `src/context.rs`)
- Symbol search → Semantic graph model: queries graph (evidence: `src/search.rs`)
- Git impact analysis → Semantic graph model: traverses relationships (evidence: `src/impact.rs`)
- Decision memory → Index storage: persists decisions
- Local daemon → Workspace manager: manages workspaces (evidence: `src/server.rs`)
- Local daemon → Event bus: publishes updates (evidence: `src/server.rs`)
- Local daemon → External MCP manager: manages servers (evidence: `src/server.rs`)
- Local daemon → Skills platform: serves skills (evidence: `src/server.rs`)
- Local daemon → Settings: serves settings (evidence: `src/server.rs`)
- Local daemon → Task management: serves tasks (evidence: `src/server.rs`)
- Local daemon → GitHub integration: serves GitHub features (evidence: `src/server.rs`)
- Engineer → MCP tools: connects MCP client (evidence: `README.md`)
- Engineer → REST API: calls REST (evidence: `README.md`)
