# denisvr/devalcopilot architecture

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

- Interactive diagram: https://gitdiagram.com/denisvr/devalcopilot
- Repository: https://github.com/denisvr/devalcopilot

## Overview

DevalCopilot is a local-first desktop control plane for supervised, role-based agent development. A human initiates a run; the application coordinates planning, challenge, implementation, verification, review, and correction, while maintaining durable run history and allowing human intervention. The frontend calls the local ASP.NET API, and the application layer reads and writes workflow state through its database abstraction. The README documents Git, provider, and GitHub/CI integrations. Some implementation paths are represented by their exact enclosing directories because the supplied excerpts do not expose their internal wiring.

Main entry points: [`src/backend/DevalCopilot.Application/Features/Runs/Commands`](https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Application/Features/Runs/Commands) (Run commands), [`src/backend/DevalCopilot.Api/Features/Runs`](https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Api/Features/Runs) (ASP.NET API), [`src/frontend/DevalCopilot.Frontend/src/features/cockpit`](https://github.com/denisvr/devalcopilot/tree/main/src/frontend/DevalCopilot.Frontend/src/features/cockpit) (Run cockpit), [`src/backend/DevalCopilot.Api/Features/Projects`](https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Api/Features/Projects) (Project operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop cockpit"]
  node_cockpit["Run cockpit<br/>[cockpit]"]
  node_api_client["API clients<br/>[clients.ts]"]
end

subgraph group_workflow["Workflow control"]
  node_api["ASP.NET API<br/>[Runs]"]
  node_environment["Environment readiness"]
  node_run_domain["Run and attempt model<br/>[Run.cs]"]
  node_agent_policy["Agent roles and contracts<br/>[AgentRole.cs]"]
  node_run_queries["Run queries<br/>[Queries]"]
  node_run_commands["Run commands<br/>[Commands]"]
end

subgraph group_project["Workspace and evidence"]
  node_projects_api["Project operations<br/>[Projects]"]
  node_workspace["Workspace and Git evidence<br/>[Projects]"]
  node_verification["Verification and reviews<br/>[Projects]"]
end

subgraph group_runtime["Persistence and integrations"]
  node_db_contract["Persistence contract"]
  node_durable_store[("SQLite workflow state")]
  node_agent_providers["Codex and Claude Code"]
  node_git_ci["Git and GitHub CI"]
end

node_human(("Human operator"))

node_human -->|"supervises runs"| node_cockpit
node_cockpit -.->|"requests actions"| node_api_client
node_api_client -->|"calls endpoints"| node_api
node_api -.->|"dispatches commands"| node_run_commands
node_api -.->|"dispatches queries"| node_run_queries
node_api -.->|"checks readiness"| node_environment
node_run_commands -.->|"advances workflow"| node_run_domain
node_run_domain -->|"constrains attempts"| node_agent_policy
node_run_queries -->|"reads state"| node_db_contract
node_run_commands -.->|"writes state"| node_db_contract
node_db_contract -.->|"persists state"| node_durable_store
node_api -.->|"serves project operations"| node_projects_api
node_projects_api -.->|"requests workspace evidence"| node_workspace
node_projects_api -.->|"manages verification"| node_verification
node_run_commands -.->|"supervises agents"| node_agent_providers
node_run_commands -.->|"coordinates delivery"| node_workspace
node_run_commands -.->|"observes delivery evidence"| node_git_ci
node_verification -.->|"records objective evidence"| node_git_ci
node_cockpit -.->|"presents run state"| node_human

click node_cockpit "https://github.com/denisvr/devalcopilot/tree/main/src/frontend/DevalCopilot.Frontend/src/features/cockpit"
click node_api_client "https://github.com/denisvr/devalcopilot/blob/main/src/frontend/DevalCopilot.Frontend/src/api/clients.ts"
click node_api "https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Api/Features/Runs"
click node_environment "https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Api/Features/EnvironmentReadiness"
click node_run_domain "https://github.com/denisvr/devalcopilot/blob/main/src/backend/DevalCopilot.Domain/Features/Runs/Run.cs"
click node_agent_policy "https://github.com/denisvr/devalcopilot/blob/main/src/backend/DevalCopilot.Domain/Features/Runs/AgentRole.cs"
click node_run_queries "https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Application/Features/Runs/Queries"
click node_run_commands "https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Application/Features/Runs/Commands"
click node_projects_api "https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Api/Features/Projects"
click node_workspace "https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Application/Features/Projects"
click node_verification "https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Api/Features/Projects"
click node_db_contract "https://github.com/denisvr/devalcopilot/blob/main/src/backend/DevalCopilot.Application/Data/IDevalCopilotDbContext.cs"

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_cockpit,node_api_client toneBlue
class node_api,node_environment,node_run_domain,node_agent_policy,node_run_queries,node_run_commands toneAmber
class node_projects_api,node_workspace,node_verification toneMint
class node_db_contract,node_durable_store,node_agent_providers,node_git_ci toneRose
class node_human toneIndigo
```

## Components

### Desktop cockpit

- [Run cockpit](https://github.com/denisvr/devalcopilot/tree/main/src/frontend/DevalCopilot.Frontend/src/features/cockpit): `src/frontend/DevalCopilot.Frontend/src/features/cockpit`
- [API clients](https://github.com/denisvr/devalcopilot/blob/main/src/frontend/DevalCopilot.Frontend/src/api/clients.ts): `src/frontend/DevalCopilot.Frontend/src/api/clients.ts`

### Workflow control

- [ASP.NET API](https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Api/Features/Runs): `src/backend/DevalCopilot.Api/Features/Runs`
- [Environment readiness](https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Api/Features/EnvironmentReadiness): `src/backend/DevalCopilot.Api/Features/EnvironmentReadiness`
- [Run and attempt model](https://github.com/denisvr/devalcopilot/blob/main/src/backend/DevalCopilot.Domain/Features/Runs/Run.cs): `src/backend/DevalCopilot.Domain/Features/Runs/Run.cs`
- [Agent roles and contracts](https://github.com/denisvr/devalcopilot/blob/main/src/backend/DevalCopilot.Domain/Features/Runs/AgentRole.cs): `src/backend/DevalCopilot.Domain/Features/Runs/AgentRole.cs`
- [Run queries](https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Application/Features/Runs/Queries): `src/backend/DevalCopilot.Application/Features/Runs/Queries`
- [Run commands](https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Application/Features/Runs/Commands): `src/backend/DevalCopilot.Application/Features/Runs/Commands`

### Workspace and evidence

- [Project operations](https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Api/Features/Projects): `src/backend/DevalCopilot.Api/Features/Projects`
- [Workspace and Git evidence](https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Application/Features/Projects): `src/backend/DevalCopilot.Application/Features/Projects`
- [Verification and reviews](https://github.com/denisvr/devalcopilot/tree/main/src/backend/DevalCopilot.Api/Features/Projects): `src/backend/DevalCopilot.Api/Features/Projects`

### Persistence and integrations

- [Persistence contract](https://github.com/denisvr/devalcopilot/blob/main/src/backend/DevalCopilot.Application/Data/IDevalCopilotDbContext.cs): `src/backend/DevalCopilot.Application/Data/IDevalCopilotDbContext.cs`
- **SQLite workflow state**
- **Codex and Claude Code**
- **Git and GitHub CI**

### Other components

- **Human operator**

## Connections

- Human operator → Run cockpit: supervises runs (evidence: `README.md`)
- Run cockpit → API clients: requests actions (evidence: `src/frontend/DevalCopilot.Frontend/src/features/cockpit/hooks/useAuthorizeReviewCorrection.ts`)
- API clients → ASP.NET API: calls endpoints (evidence: `src/frontend/DevalCopilot.Frontend/src/api/clients.ts`)
- ASP.NET API → Run commands: dispatches commands
- ASP.NET API → Run queries: dispatches queries
- ASP.NET API → Environment readiness: checks readiness
- Run commands → Run and attempt model: advances workflow
- Run and attempt model → Agent roles and contracts: constrains attempts (evidence: `src/backend/DevalCopilot.Domain/Features/Runs/AgentRole.cs`)
- Run queries → Persistence contract: reads state (evidence: `src/backend/DevalCopilot.Application/Features/Runs/Queries/GetRunCockpit/GetRunCockpitQueryHandler.cs`)
- Run commands → Persistence contract: writes state (evidence: `src/backend/DevalCopilot.Application/Features/Runs/Commands/AuthorizeReviewCorrection/AuthorizeReviewCorrectionCommandHandler.cs`)
- Persistence contract → SQLite workflow state: persists state (evidence: `README.md`)
- ASP.NET API → Project operations: serves project operations
- Project operations → Workspace and Git evidence: requests workspace evidence
- Project operations → Verification and reviews: manages verification
- Run commands → Codex and Claude Code: supervises agents (evidence: `README.md`)
- Run commands → Workspace and Git evidence: coordinates delivery (evidence: `README.md`)
- Run commands → Git and GitHub CI: observes delivery evidence (evidence: `README.md`)
- Verification and reviews → Git and GitHub CI: records objective evidence (evidence: `README.md`)
- Run cockpit → Human operator: presents run state (evidence: `README.md`)
