# kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine architecture

> Architecture diagram of the GitHub repository kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine
- Repository: https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine

## Overview

This is a multi-agent legacy-code migration engine: a user starts a repository migration, then files are parsed and dependency-ordered, risk-planned, migrated, parity-tested in a Docker sandbox with bounded correction, reviewed, and held for per-file human approval. Approved files advance; rejected files return to migration, and the API exposes a final report. The React UI starts jobs, polls status, and displays diffs and review decisions. Edges follow the shown API, orchestrator, agent, and tool calls; unshown persistence or deployment details are omitted.

Main entry points: [`backend/app/orchestrator.py`](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/orchestrator.py) (Workflow orchestrator), [`backend/app/tools/llm_client.py`](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/tools/llm_client.py) (LLM client), [`frontend/src/App.jsx`](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/frontend/src/App.jsx) (Migration dashboard), [`backend/app/main.py`](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/main.py) (Migration API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_app_ui["Migration dashboard<br/>[App.jsx]"]
  node_diff["Diff viewer<br/>[DiffViewer.jsx]"]
  node_approval_panel["Approval panel<br/>[ApprovalPanel.jsx]"]
end

subgraph group_api["API control"]
  node_api["Migration API<br/>[main.py]"]
  node_job_state[("Job state<br/>[main.py]")]
  node_schemas["Migration schemas<br/>[models.py]"]
  node_config["Runtime settings<br/>[config.py]"]
  node_report["Migration report<br/>[main.py]"]
end

subgraph group_migration["Migration workflow"]
  node_orchestrator["Workflow orchestrator<br/>[orchestrator.py]"]
  node_parser["Repository parser<br/>[repo_parser.py]"]
  node_planner["Risk planner<br/>[planner.py]"]
  node_coder["Migration coder<br/>[coder.py]"]
  node_tester["Parity tester<br/>[tester.py]"]
  node_reviewer["Migration reviewer<br/>[reviewer.py]"]
end

subgraph group_integrations["Agent tools"]
  node_llm_client["LLM client<br/>[llm_client.py]"]
  node_sandbox["Docker test runner<br/>[sandbox_runner.py]"]
end

node_user(("Migration user"))
node_anthropic{{"Anthropic API"}}
node_docker{{"Docker runtime"}}

node_user -->|"starts and reviews"| node_app_ui
node_app_ui -->|"calls migration endpoints"| node_api
node_app_ui -->|"renders diff"| node_diff
node_app_ui -->|"renders decisions"| node_approval_panel
node_api -->|"starts and resumes"| node_orchestrator
node_api -->|"stores job state"| node_job_state
node_api -->|"builds report"| node_report
node_orchestrator -->|"parses repository"| node_parser
node_orchestrator -->|"plans files"| node_planner
node_orchestrator -->|"migrates files"| node_coder
node_orchestrator -->|"generates and runs tests"| node_tester
node_orchestrator -->|"reviews results"| node_reviewer
node_planner -->|"requests plan"| node_llm_client
node_coder -->|"requests migration"| node_llm_client
node_tester -->|"generates tests"| node_llm_client
node_reviewer -->|"requests review"| node_llm_client
node_llm_client -->|"calls model"| node_anthropic
node_tester -->|"executes tests"| node_sandbox
node_sandbox -->|"runs isolated container"| node_docker

click node_app_ui "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/frontend/src/App.jsx"
click node_diff "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/frontend/src/components/DiffViewer.jsx"
click node_approval_panel "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/frontend/src/components/ApprovalPanel.jsx"
click node_api "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/main.py"
click node_job_state "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/main.py"
click node_schemas "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/models.py"
click node_config "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/config.py"
click node_orchestrator "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/orchestrator.py"
click node_parser "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/tools/repo_parser.py"
click node_planner "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/agents/planner.py"
click node_coder "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/agents/coder.py"
click node_tester "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/agents/tester.py"
click node_reviewer "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/agents/reviewer.py"
click node_report "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/main.py"
click node_llm_client "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/tools/llm_client.py"
click node_sandbox "https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/tools/sandbox_runner.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_app_ui,node_diff,node_approval_panel,node_user toneBlue
class node_api,node_job_state,node_schemas,node_config,node_report toneAmber
class node_orchestrator,node_parser,node_planner,node_coder,node_tester,node_reviewer,node_anthropic toneMint
class node_llm_client,node_sandbox toneRose
class node_docker toneIndigo
```

## Components

### User interface

- [Migration dashboard](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Diff viewer](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/frontend/src/components/DiffViewer.jsx): `frontend/src/components/DiffViewer.jsx`
- [Approval panel](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/frontend/src/components/ApprovalPanel.jsx): `frontend/src/components/ApprovalPanel.jsx`

### API control

- [Migration API](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/main.py): `backend/app/main.py`
- [Job state](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/main.py): `backend/app/main.py`
- [Migration schemas](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/models.py): `backend/app/models.py`
- [Runtime settings](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/config.py): `backend/app/config.py`
- [Migration report](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/main.py): `backend/app/main.py`

### Migration workflow

- [Workflow orchestrator](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/orchestrator.py): `backend/app/orchestrator.py`
- [Repository parser](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/tools/repo_parser.py): `backend/app/tools/repo_parser.py`
- [Risk planner](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/agents/planner.py): `backend/app/agents/planner.py`
- [Migration coder](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/agents/coder.py): `backend/app/agents/coder.py`
- [Parity tester](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/agents/tester.py): `backend/app/agents/tester.py`
- [Migration reviewer](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/agents/reviewer.py): `backend/app/agents/reviewer.py`

### Agent tools

- [LLM client](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/tools/llm_client.py): `backend/app/tools/llm_client.py`
- [Docker test runner](https://github.com/kaviyasivakumarc29-debug/-multi-agent-legacy-code-migration-engine/blob/main/backend/app/tools/sandbox_runner.py): `backend/app/tools/sandbox_runner.py`

### Other components

- **Migration user**
- **Anthropic API**
- **Docker runtime**

## Connections

- Migration user → Migration dashboard: starts and reviews (evidence: `frontend/src/App.jsx`)
- Migration dashboard → Migration API: calls migration endpoints (evidence: `frontend/src/App.jsx`)
- Migration dashboard → Diff viewer: renders diff (evidence: `frontend/src/App.jsx`)
- Migration dashboard → Approval panel: renders decisions (evidence: `frontend/src/App.jsx`)
- Migration API → Workflow orchestrator: starts and resumes (evidence: `backend/app/main.py`)
- Migration API → Job state: stores job state (evidence: `backend/app/main.py`)
- Migration API → Migration report: builds report (evidence: `backend/app/main.py`)
- Workflow orchestrator → Repository parser: parses repository (evidence: `backend/app/orchestrator.py`)
- Workflow orchestrator → Risk planner: plans files (evidence: `backend/app/orchestrator.py`)
- Workflow orchestrator → Migration coder: migrates files (evidence: `backend/app/orchestrator.py`)
- Workflow orchestrator → Parity tester: generates and runs tests (evidence: `backend/app/orchestrator.py`)
- Workflow orchestrator → Migration reviewer: reviews results (evidence: `backend/app/orchestrator.py`)
- Risk planner → LLM client: requests plan (evidence: `backend/app/agents/planner.py`)
- Migration coder → LLM client: requests migration (evidence: `backend/app/agents/coder.py`)
- Parity tester → LLM client: generates tests (evidence: `backend/app/agents/tester.py`)
- Migration reviewer → LLM client: requests review (evidence: `backend/app/agents/reviewer.py`)
- LLM client → Anthropic API: calls model (evidence: `backend/app/tools/llm_client.py`)
- Parity tester → Docker test runner: executes tests (evidence: `backend/app/agents/tester.py`)
- Docker test runner → Docker runtime: runs isolated container (evidence: `backend/app/tools/sandbox_runner.py`)
