# rasinduchandumina/vs_code-qa-extention architecture

> Architecture diagram of the GitHub repository rasinduchandumina/vs_code-qa-extention, 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/rasinduchandumina/vs_code-qa-extention
- Repository: https://github.com/rasinduchandumina/vs_code-qa-extention

## Overview

This VS Code extension takes developers from workspace analysis through AI-assisted test design, human review, generated test execution, and failure diagnosis. It also supports changed-code impact selection, traceability, defect export, and AI test repair. The entrypoint coordinates the sampled scanner, AI client, tree providers, and test runner; scanner and AI internals are only partly excerpted, so some capability links rely on README documentation.

Main entry points: [`src/extension.ts`](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/extension.ts) (Command coordinator), [`src/ai/aiClient.ts`](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/ai/aiClient.ts) (AI generation and diagnosis), [`src/scanner/workspaceScanner.ts`](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/scanner/workspaceScanner.ts) (Workspace scanner), [`src/ui/testTreeProvider.ts`](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/ui/testTreeProvider.ts) (Test-case review trees)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_coordination["Extension coordination"]
  node_extension["Command coordinator<br/>[extension.ts]"]
  node_results["Failure report and repair<br/>[extension.ts]"]
  node_defect["Defect report export<br/>[extension.ts]"]
end

subgraph group_analysis["Code analysis"]
  node_scanner["Workspace scanner"]
  node_ast["AST function analysis"]
  node_existing["Existing-test analysis"]
  node_impact["Changed-code impact"]
  node_trace["Traceability matrix"]
end

subgraph group_generation["AI test assistance"]
  node_ai["AI generation and diagnosis<br/>[aiClient.ts]"]
  node_schemas["Validated AI contracts<br/>[schemas.ts]"]
end

subgraph group_execution["Review and execution"]
  node_review["Test-case review trees"]
  node_runner["Test runner<br/>[testRunner.ts]"]
end

node_developer(("Developer"))
node_vscode["VS Code host"]
node_gemini["Gemini API"]
node_secrets[("VS Code SecretStorage")]
node_childprocess["Isolated child processes"]

node_developer -->|"uses"| node_vscode
node_vscode -->|"activates commands"| node_extension
node_extension -->|"requests scans"| node_scanner
node_scanner -->|"parses source"| node_ast
node_scanner -->|"inspects suites"| node_existing
node_scanner -->|"analyzes changes"| node_impact
node_extension -->|"requests analysis"| node_impact
node_extension -.->|"generates matrix"| node_trace
node_extension -->|"requests AI work"| node_ai
node_ai -->|"sends prompts"| node_gemini
node_ai -->|"reads credentials"| node_secrets
node_ai -->|"validates responses"| node_schemas
node_extension -->|"updates trees"| node_review
node_review -->|"uses test-case types"| node_schemas
node_extension -->|"runs suites"| node_runner
node_runner -.->|"executes tests"| node_childprocess
node_extension -->|"handles failures"| node_results
node_results -->|"requests diagnosis or repair"| node_ai
node_extension -->|"exports report"| node_defect

click node_extension "https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/extension.ts"
click node_scanner "https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/scanner/workspaceScanner.ts"
click node_ast "https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/scanner/workspaceScanner.ts"
click node_existing "https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/scanner/workspaceScanner.ts"
click node_impact "https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/scanner/workspaceScanner.ts"
click node_trace "https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/scanner/workspaceScanner.ts"
click node_ai "https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/ai/aiClient.ts"
click node_schemas "https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/ai/schemas.ts"
click node_review "https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/ui/testTreeProvider.ts"
click node_runner "https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/tests/testRunner.ts"
click node_results "https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/extension.ts"
click node_defect "https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/extension.ts"

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_extension,node_results,node_defect toneBlue
class node_scanner,node_ast,node_existing,node_impact,node_trace,node_secrets toneAmber
class node_ai,node_schemas,node_gemini toneMint
class node_review,node_runner toneRose
class node_developer,node_vscode,node_childprocess toneIndigo
```

## Components

### Extension coordination

- [Command coordinator](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/extension.ts): `src/extension.ts`
- [Failure report and repair](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/extension.ts): `src/extension.ts`
- [Defect report export](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/extension.ts): `src/extension.ts`

### Code analysis

- [Workspace scanner](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/scanner/workspaceScanner.ts): `src/scanner/workspaceScanner.ts`
- [AST function analysis](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/scanner/workspaceScanner.ts): `src/scanner/workspaceScanner.ts`
- [Existing-test analysis](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/scanner/workspaceScanner.ts): `src/scanner/workspaceScanner.ts`
- [Changed-code impact](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/scanner/workspaceScanner.ts): `src/scanner/workspaceScanner.ts`
- [Traceability matrix](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/scanner/workspaceScanner.ts): `src/scanner/workspaceScanner.ts`

### AI test assistance

- [AI generation and diagnosis](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/ai/aiClient.ts): `src/ai/aiClient.ts`
- [Validated AI contracts](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/ai/schemas.ts): `src/ai/schemas.ts`

### Review and execution

- [Test-case review trees](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/ui/testTreeProvider.ts): `src/ui/testTreeProvider.ts`
- [Test runner](https://github.com/rasinduchandumina/vs_code-qa-extention/blob/main/src/tests/testRunner.ts): `src/tests/testRunner.ts`

### Other components

- **Developer**
- **VS Code host**
- **Gemini API**
- **VS Code SecretStorage**
- **Isolated child processes**

## Connections

- Developer → VS Code host: uses (evidence: `README.md`)
- VS Code host → Command coordinator: activates commands (evidence: `README.md`)
- Command coordinator → Workspace scanner: requests scans (evidence: `src/extension.ts`)
- Workspace scanner → AST function analysis: parses source (evidence: `src/scanner/workspaceScanner.ts`)
- Workspace scanner → Existing-test analysis: inspects suites (evidence: `src/scanner/workspaceScanner.ts`)
- Workspace scanner → Changed-code impact: analyzes changes (evidence: `src/scanner/workspaceScanner.ts`)
- Command coordinator → Changed-code impact: requests analysis (evidence: `src/extension.ts`)
- Command coordinator → Traceability matrix: generates matrix (evidence: `README.md`)
- Command coordinator → AI generation and diagnosis: requests AI work (evidence: `src/extension.ts`)
- AI generation and diagnosis → Gemini API: sends prompts (evidence: `src/ai/aiClient.ts`)
- AI generation and diagnosis → VS Code SecretStorage: reads credentials (evidence: `src/ai/aiClient.ts`)
- AI generation and diagnosis → Validated AI contracts: validates responses (evidence: `src/ai/aiClient.ts`)
- Command coordinator → Test-case review trees: updates trees (evidence: `README.md`)
- Test-case review trees → Validated AI contracts: uses test-case types (evidence: `src/ui/testTreeProvider.ts`)
- Command coordinator → Test runner: runs suites (evidence: `src/extension.ts`)
- Test runner → Isolated child processes: executes tests (evidence: `README.md`)
- Command coordinator → Failure report and repair: handles failures (evidence: `README.md`)
- Failure report and repair → AI generation and diagnosis: requests diagnosis or repair (evidence: `README.md`)
- Command coordinator → Defect report export: exports report (evidence: `src/extension.ts`)
