# xiayiyang831xyy/aitc-studio architecture

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

- Interactive diagram: https://gitdiagram.com/xiayiyang831xyy/aitc-studio
- Repository: https://github.com/xiayiyang831xyy/aitc-studio

## Overview

AITC is an AI test-engineering platform that turns requirements into reviewed, executable test assets. The main path runs from project and requirement input through feature confirmation, hybrid knowledge retrieval, skill-based generation, automated quality scoring, human approval, test execution, and evaluation. The React client also exposes knowledge, settings, and an Agent assistant; the backend includes persistent run governance and configurable model adapters. Workflow and capability links are based on README statements where implementation excerpts were unavailable.

Main entry points: [`backend/app/skills/registry.py`](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/skills/registry.py) (Skill registry), [`backend/app/workflows/generation/graph.py`](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/workflows/generation/graph.py) (Generation workflow), [`web/src/App.jsx`](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/App.jsx) (AITC web app), [`web/src/services/api.js`](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/services/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web interface"]
  node_webapp["AITC web app<br/>[App.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_generation_ui["Generation review<br/>[GenerateFlow.jsx]"]
  node_assistant_ui["Agent assistant<br/>[AgentAssistant.jsx]"]
  node_knowledge_ui["Knowledge panels<br/>[Knowledge.jsx]"]
  node_tasks_ui["Test tasks"]
end

subgraph group_product["Test production"]
  node_api["HTTP API<br/>[main.py]"]
  node_requirement["Requirement intake<br/>[requirements.py]"]
  node_generation["Generation service"]
  node_workflow["Generation workflow<br/>[graph.py]"]
  node_quality["Quality checks<br/>[quality_checker.py]"]
  node_test_assets[("Cases and execution<br/>[testcase.py]")]
  node_evaluation["Offline evaluation"]
end

subgraph group_ai["AI capabilities"]
  node_knowledge["Hybrid knowledge RAG"]
  node_skills["Skill registry<br/>[registry.py]"]
  node_llm_chains["Structured AI chains<br/>[chains.py]"]
  node_llm_service["Model service<br/>[llm.py]"]
  node_endpoint_security["Endpoint security"]
  node_settings["Model settings"]
  node_prompt_loader["Prompt loader<br/>[prompt_loader.py]"]
  node_skill_base["Skill contracts<br/>[base.py]"]
  node_skill_mock["Mock skill support<br/>[mock.py]"]
  node_prompt_format["Prompt formatting"]
end

subgraph group_runtime["Run governance"]
  node_runtime_harness["Runtime harness<br/>[harness.py]"]
  node_runtime_repo["Run repository<br/>[repository.py]"]
  node_agent["Test assistant agent<br/>[runner.py]"]
  node_worker["Background worker<br/>[worker.py]"]
end

subgraph group_data["Persistence"]
  node_database[("SQL database<br/>[database.py]")]
  node_run_model[("Agent run records<br/>[agent_run.py]")]
  node_generation_model[("Generation records<br/>[generation.py]")]
  node_config["Application config<br/>[config.py]"]
end

node_engineer(("Test engineer"))

node_engineer -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_generation_ui
node_webapp -->|"routes to"| node_assistant_ui
node_webapp -->|"routes to"| node_knowledge_ui
node_webapp -->|"routes to"| node_tasks_ui
node_generation_ui -.->|"requests"| node_api_client
node_assistant_ui -.->|"requests"| node_api_client
node_knowledge_ui -.->|"requests"| node_api_client
node_tasks_ui -->|"requests"| node_api_client
node_api_client -.->|"calls"| node_api
node_api -->|"mounts routes"| node_requirement
node_api -->|"mounts routes"| node_generation
node_requirement -.->|"starts generation"| node_workflow
node_generation -.->|"runs"| node_workflow
node_workflow -->|"retrieves context"| node_knowledge
node_workflow -->|"dispatches skills"| node_skills
node_workflow -->|"checks candidates"| node_quality
node_skills -->|"invokes"| node_llm_chains
node_llm_chains -->|"uses model"| node_llm_service
node_llm_service -->|"checks endpoints"| node_endpoint_security
node_llm_service -->|"loads config"| node_settings
node_skills -->|"uses contracts"| node_skill_base
node_skills -->|"loads prompts"| node_prompt_loader
node_skills -->|"supports mock"| node_skill_mock
node_skills -->|"formats prompts"| node_prompt_format
node_quality -->|"scores drafts"| node_generation_model
node_generation -->|"persists candidates"| node_generation_model
node_generation_ui -->|"approves cases"| node_test_assets
node_tasks_ui -->|"selects cases"| node_test_assets
node_test_assets -->|"feeds evaluation"| node_evaluation
node_assistant_ui -->|"drives tasks"| node_agent
node_agent -->|"starts pipeline"| node_workflow
node_worker -.->|"claims runs"| node_runtime_repo
node_runtime_harness -.->|"records events"| node_runtime_repo
node_runtime_repo -->|"stores runs"| node_run_model
node_database -->|"creates tables"| node_run_model
node_database -->|"creates tables"| node_generation_model
node_database -->|"reads config"| node_config
node_evaluation -->|"uses runtime"| node_runtime_harness

click node_webapp "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/App.jsx"
click node_api_client "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/services/api.js"
click node_generation_ui "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/pages/GenerateFlow.jsx"
click node_assistant_ui "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/pages/AgentAssistant.jsx"
click node_knowledge_ui "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/pages/Knowledge.jsx"
click node_tasks_ui "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/pages/ProjectTestTasks.jsx"
click node_api "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/main.py"
click node_requirement "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/api/requirements.py"
click node_generation "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/generation_service.py"
click node_workflow "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/workflows/generation/graph.py"
click node_quality "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/quality_checker.py"
click node_test_assets "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/models/testcase.py"
click node_evaluation "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/evaluation_service.py"
click node_knowledge "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/knowledge_service.py"
click node_skills "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/skills/registry.py"
click node_llm_chains "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/ai/chains.py"
click node_llm_service "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/llm.py"
click node_endpoint_security "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/model_endpoint_security.py"
click node_settings "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/settings_service.py"
click node_runtime_harness "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/agent_runtime/harness.py"
click node_runtime_repo "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/agent_runtime/repository.py"
click node_agent "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/agent/runner.py"
click node_worker "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/worker.py"
click node_database "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/database.py"
click node_run_model "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/models/agent_run.py"
click node_generation_model "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/models/generation.py"
click node_prompt_loader "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/skills/shared/prompt_loader.py"
click node_skill_base "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/skills/base.py"
click node_skill_mock "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/skills/shared/mock.py"
click node_prompt_format "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/skills/shared/prompt_formatter.py"
click node_config "https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/config.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_webapp,node_api_client,node_generation_ui,node_assistant_ui,node_knowledge_ui,node_tasks_ui toneBlue
class node_api,node_requirement,node_generation,node_workflow,node_quality,node_test_assets,node_evaluation toneAmber
class node_knowledge,node_skills,node_llm_chains,node_llm_service,node_endpoint_security,node_settings,node_prompt_loader,node_skill_base,node_skill_mock,node_prompt_format toneMint
class node_runtime_harness,node_runtime_repo,node_agent,node_worker toneRose
class node_database,node_run_model,node_generation_model,node_config,node_engineer toneIndigo
```

## Components

### Web interface

- [AITC web app](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [API client](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/services/api.js): `web/src/services/api.js`
- [Generation review](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/pages/GenerateFlow.jsx): `web/src/pages/GenerateFlow.jsx`
- [Agent assistant](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/pages/AgentAssistant.jsx): `web/src/pages/AgentAssistant.jsx`
- [Knowledge panels](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/pages/Knowledge.jsx): `web/src/pages/Knowledge.jsx`
- [Test tasks](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/web/src/pages/ProjectTestTasks.jsx): `web/src/pages/ProjectTestTasks.jsx`

### Test production

- [HTTP API](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/main.py): `backend/app/main.py`
- [Requirement intake](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/api/requirements.py): `backend/app/api/requirements.py`
- [Generation service](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/generation_service.py): `backend/app/services/generation_service.py`
- [Generation workflow](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/workflows/generation/graph.py): `backend/app/workflows/generation/graph.py`
- [Quality checks](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/quality_checker.py): `backend/app/services/quality_checker.py`
- [Cases and execution](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/models/testcase.py): `backend/app/models/testcase.py`
- [Offline evaluation](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/evaluation_service.py): `backend/app/services/evaluation_service.py`

### AI capabilities

- [Hybrid knowledge RAG](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/knowledge_service.py): `backend/app/services/knowledge_service.py`
- [Skill registry](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/skills/registry.py): `backend/app/skills/registry.py`
- [Structured AI chains](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/ai/chains.py): `backend/app/ai/chains.py`
- [Model service](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/llm.py): `backend/app/services/llm.py`
- [Endpoint security](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/model_endpoint_security.py): `backend/app/services/model_endpoint_security.py`
- [Model settings](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/services/settings_service.py): `backend/app/services/settings_service.py`
- [Prompt loader](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/skills/shared/prompt_loader.py): `backend/app/skills/shared/prompt_loader.py`
- [Skill contracts](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/skills/base.py): `backend/app/skills/base.py`
- [Mock skill support](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/skills/shared/mock.py): `backend/app/skills/shared/mock.py`
- [Prompt formatting](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/skills/shared/prompt_formatter.py): `backend/app/skills/shared/prompt_formatter.py`

### Run governance

- [Runtime harness](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/agent_runtime/harness.py): `backend/app/agent_runtime/harness.py`
- [Run repository](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/agent_runtime/repository.py): `backend/app/agent_runtime/repository.py`
- [Test assistant agent](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/agent/runner.py): `backend/app/agent/runner.py`
- [Background worker](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/worker.py): `backend/app/worker.py`

### Persistence

- [SQL database](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/database.py): `backend/app/database.py`
- [Agent run records](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/models/agent_run.py): `backend/app/models/agent_run.py`
- [Generation records](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/models/generation.py): `backend/app/models/generation.py`
- [Application config](https://github.com/xiayiyang831xyy/aitc-studio/blob/main/backend/app/config.py): `backend/app/config.py`

### Other components

- **Test engineer**

## Connections

- Test engineer → AITC web app: uses (evidence: `README.md`)
- AITC web app → Generation review: routes to (evidence: `web/src/App.jsx`)
- AITC web app → Agent assistant: routes to (evidence: `web/src/App.jsx`)
- AITC web app → Knowledge panels: routes to (evidence: `web/src/App.jsx`)
- AITC web app → Test tasks: routes to (evidence: `web/src/App.jsx`)
- Generation review → API client: requests
- Agent assistant → API client: requests
- Knowledge panels → API client: requests
- Test tasks → API client: requests (evidence: `web/src/pages/ProjectTestTasks.jsx`)
- API client → HTTP API: calls
- HTTP API → Requirement intake: mounts routes (evidence: `backend/app/main.py`)
- HTTP API → Generation service: mounts routes (evidence: `backend/app/main.py`)
- Requirement intake → Generation workflow: starts generation
- Generation service → Generation workflow: runs
- Generation workflow → Hybrid knowledge RAG: retrieves context (evidence: `README.md`)
- Generation workflow → Skill registry: dispatches skills (evidence: `README.md`)
- Generation workflow → Quality checks: checks candidates (evidence: `README.md`)
- Skill registry → Structured AI chains: invokes
- Structured AI chains → Model service: uses model (evidence: `backend/app/ai/chains.py`)
- Model service → Endpoint security: checks endpoints (evidence: `backend/app/services/llm.py`)
- Model service → Model settings: loads config (evidence: `backend/app/services/llm.py`)
- Skill registry → Skill contracts: uses contracts (evidence: `backend/app/skills/registry.py`)
- Skill registry → Prompt loader: loads prompts (evidence: `backend/app/skills/shared/prompt_loader.py`)
- Skill registry → Mock skill support: supports mock
- Skill registry → Prompt formatting: formats prompts
- Quality checks → Generation records: scores drafts (evidence: `README.md`)
- Generation service → Generation records: persists candidates (evidence: `README.md`)
- Generation review → Cases and execution: approves cases (evidence: `README.md`)
- Test tasks → Cases and execution: selects cases (evidence: `README.md`)
- Cases and execution → Offline evaluation: feeds evaluation (evidence: `README.md`)
- Agent assistant → Test assistant agent: drives tasks (evidence: `README.md`)
- Test assistant agent → Generation workflow: starts pipeline (evidence: `README.md`)
- Background worker → Run repository: claims runs
- Runtime harness → Run repository: records events
- Run repository → Agent run records: stores runs (evidence: `backend/app/agent_runtime/repository.py`)
- SQL database → Agent run records: creates tables (evidence: `backend/app/database.py`)
- SQL database → Generation records: creates tables (evidence: `backend/app/database.py`)
- SQL database → Application config: reads config (evidence: `backend/app/database.py`)
- Offline evaluation → Runtime harness: uses runtime (evidence: `backend/app/services/evaluation_service.py`)
