# devasish009/cyvora architecture

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

- Interactive diagram: https://gitdiagram.com/devasish009/cyvora
- Repository: https://github.com/devasish009/cyvora

## Overview

CYVORA is an autonomous software repair system: users submit or select a project and error, the backend starts a repair session, analyzes the project and fault, investigates and generates a patch, then validates and applies a verified fix. The frontend exposes project, error, repair, test-result, activity, and Hindsight views. The graph also includes session/task/event state, security, persistence, and live telemetry. Arrows follow excerpts, SOURCE INDEX references, or README claims; several documented subsystems have directory-level paths because their implementation was not sampled.

Main entry points: [`engine/core/orchestrator/engine_orchestrator.py`](https://github.com/devasish009/cyvora/blob/main/engine/core/orchestrator/engine_orchestrator.py) (Repair orchestrator), [`apps/backend/main.py`](https://github.com/devasish009/cyvora/blob/main/apps/backend/main.py) (REST and WebSocket API), [`engine/core/event_system/event_bus.py`](https://github.com/devasish009/cyvora/blob/main/engine/core/event_system/event_bus.py) (Event bus), [`engine/sandbox/sandbox_executor.py`](https://github.com/devasish009/cyvora/blob/main/engine/sandbox/sandbox_executor.py) (Isolated execution)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_frontend["Control center<br/>[App.jsx]"]
end

subgraph group_service["API and orchestration"]
  node_backend["REST and WebSocket API<br/>[main.py]"]
  node_orchestrator["Repair orchestrator"]
end

subgraph group_repair["Analysis and repair"]
  node_project_scan["Project scanning<br/>[project_scanner.py]"]
  node_code_analysis["Code and dependency analysis<br/>[code_analyzer.py]"]
  node_context["Code context<br/>[context_builder.py]"]
  node_fault["Fault localization<br/>[fault_localizer.py]"]
  node_investigation["Error investigation"]
  node_root_cause["Root cause analysis"]
  node_repair_agent["Repair planning<br/>[repair_agent.py]"]
  node_patch_generation["Patch generation"]
  node_patch_manager["Patch lifecycle<br/>[patch_manager.py]"]
  node_diff["Unified diffs<br/>[diff_engine.py]"]
  node_sandbox["Isolated execution"]
  node_validation["Fix verification"]
end

subgraph group_platform["State and safeguards"]
  node_database[("Project records<br/>[database.py]")]
  node_memory[("Hindsight memory")]
  node_session_state["Session state<br/>[state_manager.py]"]
  node_task_manager["Task coordination<br/>[task_manager.py]"]
  node_workflow["Workflow engine<br/>[workflow_engine.py]"]
  node_events["Event bus<br/>[event_bus.py]"]
  node_security["Security policy<br/>[security_policy.py]"]
end

node_user(("Engineer"))

node_user -->|"starts analysis"| node_frontend
node_frontend -.->|"uses API"| node_backend
node_backend -->|"stores records"| node_database
node_backend -->|"starts repair"| node_orchestrator
node_orchestrator -->|"creates session"| node_session_state
node_orchestrator -->|"checks access"| node_security
node_orchestrator -->|"scans project"| node_project_scan
node_orchestrator -->|"analyzes code"| node_code_analysis
node_orchestrator -->|"builds context"| node_context
node_orchestrator -->|"localizes fault"| node_fault
node_orchestrator -->|"investigates error"| node_investigation
node_orchestrator -->|"analyzes cause"| node_root_cause
node_orchestrator -->|"plans repair"| node_repair_agent
node_repair_agent -.->|"synthesizes patch"| node_patch_generation
node_orchestrator -->|"manages patches"| node_patch_manager
node_patch_manager -->|"applies or rolls back"| node_diff
node_orchestrator -->|"validates candidate"| node_sandbox
node_sandbox -->|"checks execution"| node_security
node_orchestrator -->|"verifies evidence"| node_validation
node_validation -->|"runs checks"| node_sandbox
node_orchestrator -->|"records repair"| node_memory
node_orchestrator -->|"publishes progress"| node_events
node_task_manager -->|"publishes task events"| node_events
node_workflow -->|"publishes step events"| node_events
node_backend -.->|"streams telemetry"| node_events

click node_frontend "https://github.com/devasish009/cyvora/blob/main/apps/frontend/src/App.jsx"
click node_backend "https://github.com/devasish009/cyvora/blob/main/apps/backend/main.py"
click node_database "https://github.com/devasish009/cyvora/blob/main/infrastructure/database/database.py"
click node_orchestrator "https://github.com/devasish009/cyvora/blob/main/engine/core/orchestrator/engine_orchestrator.py"
click node_project_scan "https://github.com/devasish009/cyvora/blob/main/engine/analyzers/project_analyzer/project_scanner.py"
click node_code_analysis "https://github.com/devasish009/cyvora/blob/main/engine/analyzers/code_analyzer/code_analyzer.py"
click node_context "https://github.com/devasish009/cyvora/blob/main/engine/context/context_builder/context_builder.py"
click node_fault "https://github.com/devasish009/cyvora/blob/main/engine/analyzers/error_analyzer/fault_localizer.py"
click node_investigation "https://github.com/devasish009/cyvora/blob/main/engine/agents/investigation_agent/investigation_agent.py"
click node_root_cause "https://github.com/devasish009/cyvora/blob/main/engine/agents/root_cause_agent/root_cause_agent.py"
click node_repair_agent "https://github.com/devasish009/cyvora/blob/main/engine/agents/repair_agent/repair_agent.py"
click node_patch_generation "https://github.com/devasish009/cyvora/blob/main/engine/repair/patch_generator/candidate_synthesizer.py"
click node_patch_manager "https://github.com/devasish009/cyvora/blob/main/engine/repair/patch_manager/patch_manager.py"
click node_diff "https://github.com/devasish009/cyvora/blob/main/engine/repair/diff_engine/diff_engine.py"
click node_sandbox "https://github.com/devasish009/cyvora/blob/main/engine/sandbox/sandbox_executor.py"
click node_validation "https://github.com/devasish009/cyvora/blob/main/engine/validation/evidence_verifier.py"
click node_memory "https://github.com/devasish009/cyvora/blob/main/engine/memory/hindsight/hindsight_memory.py"
click node_session_state "https://github.com/devasish009/cyvora/blob/main/engine/core/state_manager/state_manager.py"
click node_task_manager "https://github.com/devasish009/cyvora/blob/main/engine/core/task_manager/task_manager.py"
click node_workflow "https://github.com/devasish009/cyvora/blob/main/engine/core/workflow/workflow_engine.py"
click node_events "https://github.com/devasish009/cyvora/blob/main/engine/core/event_system/event_bus.py"
click node_security "https://github.com/devasish009/cyvora/blob/main/security/security_policy.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_frontend toneBlue
class node_backend,node_orchestrator toneAmber
class node_project_scan,node_code_analysis,node_context,node_fault,node_investigation,node_root_cause,node_repair_agent,node_patch_generation,node_patch_manager,node_diff,node_sandbox,node_validation toneMint
class node_database,node_memory,node_session_state,node_task_manager,node_workflow,node_events,node_security toneRose
class node_user toneIndigo
```

## Components

### User interface

- [Control center](https://github.com/devasish009/cyvora/blob/main/apps/frontend/src/App.jsx): `apps/frontend/src/App.jsx`

### API and orchestration

- [REST and WebSocket API](https://github.com/devasish009/cyvora/blob/main/apps/backend/main.py): `apps/backend/main.py`
- [Repair orchestrator](https://github.com/devasish009/cyvora/blob/main/engine/core/orchestrator/engine_orchestrator.py): `engine/core/orchestrator/engine_orchestrator.py`

### Analysis and repair

- [Project scanning](https://github.com/devasish009/cyvora/blob/main/engine/analyzers/project_analyzer/project_scanner.py): `engine/analyzers/project_analyzer/project_scanner.py`
- [Code and dependency analysis](https://github.com/devasish009/cyvora/blob/main/engine/analyzers/code_analyzer/code_analyzer.py): `engine/analyzers/code_analyzer/code_analyzer.py`
- [Code context](https://github.com/devasish009/cyvora/blob/main/engine/context/context_builder/context_builder.py): `engine/context/context_builder/context_builder.py`
- [Fault localization](https://github.com/devasish009/cyvora/blob/main/engine/analyzers/error_analyzer/fault_localizer.py): `engine/analyzers/error_analyzer/fault_localizer.py`
- [Error investigation](https://github.com/devasish009/cyvora/blob/main/engine/agents/investigation_agent/investigation_agent.py): `engine/agents/investigation_agent/investigation_agent.py`
- [Root cause analysis](https://github.com/devasish009/cyvora/blob/main/engine/agents/root_cause_agent/root_cause_agent.py): `engine/agents/root_cause_agent/root_cause_agent.py`
- [Repair planning](https://github.com/devasish009/cyvora/blob/main/engine/agents/repair_agent/repair_agent.py): `engine/agents/repair_agent/repair_agent.py`
- [Patch generation](https://github.com/devasish009/cyvora/blob/main/engine/repair/patch_generator/candidate_synthesizer.py): `engine/repair/patch_generator/candidate_synthesizer.py`
- [Patch lifecycle](https://github.com/devasish009/cyvora/blob/main/engine/repair/patch_manager/patch_manager.py): `engine/repair/patch_manager/patch_manager.py`
- [Unified diffs](https://github.com/devasish009/cyvora/blob/main/engine/repair/diff_engine/diff_engine.py): `engine/repair/diff_engine/diff_engine.py`
- [Isolated execution](https://github.com/devasish009/cyvora/blob/main/engine/sandbox/sandbox_executor.py): `engine/sandbox/sandbox_executor.py`
- [Fix verification](https://github.com/devasish009/cyvora/blob/main/engine/validation/evidence_verifier.py): `engine/validation/evidence_verifier.py`

### State and safeguards

- [Project records](https://github.com/devasish009/cyvora/blob/main/infrastructure/database/database.py): `infrastructure/database/database.py`
- [Hindsight memory](https://github.com/devasish009/cyvora/blob/main/engine/memory/hindsight/hindsight_memory.py): `engine/memory/hindsight/hindsight_memory.py`
- [Session state](https://github.com/devasish009/cyvora/blob/main/engine/core/state_manager/state_manager.py): `engine/core/state_manager/state_manager.py`
- [Task coordination](https://github.com/devasish009/cyvora/blob/main/engine/core/task_manager/task_manager.py): `engine/core/task_manager/task_manager.py`
- [Workflow engine](https://github.com/devasish009/cyvora/blob/main/engine/core/workflow/workflow_engine.py): `engine/core/workflow/workflow_engine.py`
- [Event bus](https://github.com/devasish009/cyvora/blob/main/engine/core/event_system/event_bus.py): `engine/core/event_system/event_bus.py`
- [Security policy](https://github.com/devasish009/cyvora/blob/main/security/security_policy.py): `security/security_policy.py`

### Other components

- **Engineer**

## Connections

- Engineer → Control center: starts analysis
- Control center → REST and WebSocket API: uses API
- REST and WebSocket API → Project records: stores records (evidence: `apps/backend/main.py`)
- REST and WebSocket API → Repair orchestrator: starts repair (evidence: `apps/backend/main.py`)
- Repair orchestrator → Session state: creates session (evidence: `engine/core/orchestrator/engine_orchestrator.py`)
- Repair orchestrator → Security policy: checks access (evidence: `engine/core/orchestrator/engine_orchestrator.py`)
- Repair orchestrator → Project scanning: scans project (evidence: `engine/core/orchestrator/engine_orchestrator.py`)
- Repair orchestrator → Code and dependency analysis: analyzes code (evidence: `engine/core/orchestrator/engine_orchestrator.py`)
- Repair orchestrator → Code context: builds context (evidence: `engine/core/orchestrator/engine_orchestrator.py`)
- Repair orchestrator → Fault localization: localizes fault (evidence: `engine/core/orchestrator/engine_orchestrator.py`)
- Repair orchestrator → Error investigation: investigates error (evidence: `engine/core/orchestrator/engine_orchestrator.py`)
- Repair orchestrator → Root cause analysis: analyzes cause (evidence: `engine/core/orchestrator/engine_orchestrator.py`)
- Repair orchestrator → Repair planning: plans repair (evidence: `engine/core/orchestrator/engine_orchestrator.py`)
- Repair planning → Patch generation: synthesizes patch
- Repair orchestrator → Patch lifecycle: manages patches (evidence: `engine/core/orchestrator/engine_orchestrator.py`)
- Patch lifecycle → Unified diffs: applies or rolls back (evidence: `engine/repair/patch_manager/patch_manager.py`)
- Repair orchestrator → Isolated execution: validates candidate (evidence: `engine/core/orchestrator/engine_orchestrator.py`)
- Isolated execution → Security policy: checks execution (evidence: `engine/sandbox/sandbox_executor.py`)
- Repair orchestrator → Fix verification: verifies evidence (evidence: `engine/core/orchestrator/engine_orchestrator.py`)
- Fix verification → Isolated execution: runs checks (evidence: `engine/validation/evidence_verifier.py`)
- Repair orchestrator → Hindsight memory: records repair (evidence: `apps/backend/main.py`)
- Repair orchestrator → Event bus: publishes progress (evidence: `engine/core/orchestrator/engine_orchestrator.py`)
- Task coordination → Event bus: publishes task events (evidence: `engine/core/task_manager/task_manager.py`)
- Workflow engine → Event bus: publishes step events (evidence: `engine/core/workflow/workflow_engine.py`)
- REST and WebSocket API → Event bus: streams telemetry (evidence: `apps/backend/main.py`)
