# must-darkviolet/qanexus architecture

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

- Interactive diagram: https://gitdiagram.com/must-darkviolet/qanexus
- Repository: https://github.com/must-darkviolet/qanexus

## Overview

QA PR Review Agent analyzes pull-request changes, selects or generates Playwright coverage, runs tests and a recorded browser walkthrough, then maintains an evidence-backed PR report. The graph follows the README’s documented workflow and uses sampled/index evidence for key internal links; unsampled subsystem details are represented only where README capabilities are explicit.

Main entry points: [`packages/backend/src/pipeline/orchestrator.ts`](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/pipeline/orchestrator.ts) (Review orchestrator), [`packages/backend/src/pipeline/impactService.ts`](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/pipeline/impactService.ts) (Regression impact), [`packages/backend/src/analysis/staticAnalyzer.ts`](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/analysis/staticAnalyzer.ts) (Static analysis), [`packages/backend/src/knowledge/store.ts`](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/knowledge/store.ts) (Application knowledge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Review intake"]
  node_dashboard["Review dashboard<br/>[page.tsx]"]
  node_github_routes["GitHub webhook/API<br/>[github.ts]"]
  node_workspace["PR checkout and diff<br/>[workspace.ts]"]
  node_orchestrator["Review orchestrator<br/>[orchestrator.ts]"]
end

subgraph group_analysis["Change analysis"]
  node_scanner["Repository scanner<br/>[scanner.ts]"]
  node_static_analysis["Static analysis<br/>[staticAnalyzer.ts]"]
  node_change_analysis["Change and impact analysis<br/>[changeDetector.ts]"]
  node_routes["Route discovery<br/>[routes.ts]"]
  node_repo_agent["Application mapping"]
  node_impact_service["Regression impact<br/>[impactService.ts]"]
end

subgraph group_verification["Test and browser verification"]
  node_test_selection["Test selection<br/>[testSelection.ts]"]
  node_generation["Test generation<br/>[generation.ts]"]
  node_preflight["Safety and preflight<br/>[preflight.ts]"]
  node_test_runner["Playwright execution<br/>[runner.ts]"]
  node_browser["Recorded walkthrough<br/>[browser.ts]"]
end

subgraph group_reporting["Findings and reporting"]
  node_review_report["PR review and comment<br/>[prReview.ts]"]
  node_artifacts["Review artifacts API<br/>[artifacts.ts]"]
end

subgraph group_state["Review state"]
  node_knowledge[("Application knowledge<br/>[store.ts]")]
  node_memory["History and retrieval<br/>[retrieval.ts]"]
  node_database[("Review database<br/>[client.ts]")]
end

node_pr(("Pull request"))
node_github["GitHub"]
node_playwright["Playwright"]

node_pr -->|"triggers review"| node_github_routes
node_dashboard -->|"starts review"| node_orchestrator
node_github_routes -->|"dispatches review"| node_orchestrator
node_orchestrator -->|"checks out and diffs"| node_workspace
node_workspace -->|"fetches PR"| node_github
node_orchestrator -->|"scans repository"| node_scanner
node_orchestrator -->|"analyzes repository"| node_static_analysis
node_static_analysis -->|"uses scanned files"| node_scanner
node_static_analysis -->|"extracts routes"| node_routes
node_orchestrator -->|"analyzes changes"| node_change_analysis
node_change_analysis -->|"compares revisions"| node_workspace
node_orchestrator -.->|"maps application"| node_repo_agent
node_repo_agent -->|"derives features"| node_static_analysis
node_repo_agent -.->|"persists mapping"| node_knowledge
node_orchestrator -->|"assesses regression"| node_impact_service
node_impact_service -->|"reads feature evidence"| node_knowledge
node_impact_service -->|"checks past findings"| node_memory
node_orchestrator -.->|"selects coverage"| node_test_selection
node_test_selection -->|"uses affected modules"| node_change_analysis
node_orchestrator -.->|"generates tests"| node_generation
node_generation -.->|"uses application context"| node_knowledge
node_generation -->|"validates generated code"| node_preflight
node_orchestrator -.->|"runs selected tests"| node_test_runner
node_test_runner -->|"executes tests"| node_playwright
node_orchestrator -.->|"records walkthrough"| node_browser
node_browser -->|"drives browser"| node_playwright
node_orchestrator -.->|"prepares result"| node_review_report
node_review_report -->|"posts or updates comment"| node_github
node_dashboard -.->|"displays recordings"| node_artifacts
node_orchestrator -.->|"stores run state"| node_database
node_knowledge -->|"reads and writes knowledge"| node_database
node_impact_service -->|"saves impact report"| node_database

click node_dashboard "https://github.com/must-darkviolet/qanexus/blob/master/packages/frontend/app/(dashboard)/projects/%5Bid%5D/page.tsx"
click node_github_routes "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/api/routes/github.ts"
click node_workspace "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/github/workspace.ts"
click node_orchestrator "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/pipeline/orchestrator.ts"
click node_scanner "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/analysis/scanner.ts"
click node_static_analysis "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/analysis/staticAnalyzer.ts"
click node_change_analysis "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/analysis/changeDetector.ts"
click node_routes "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/analysis/routes.ts"
click node_repo_agent "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/agents/repositoryAnalyzer.ts"
click node_knowledge "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/knowledge/store.ts"
click node_impact_service "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/pipeline/impactService.ts"
click node_memory "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/memory/retrieval.ts"
click node_test_selection "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/pipeline/testSelection.ts"
click node_generation "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/pipeline/generation.ts"
click node_preflight "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/playwright/preflight.ts"
click node_test_runner "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/playwright/runner.ts"
click node_browser "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/explore/browser.ts"
click node_review_report "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/pipeline/prReview.ts"
click node_artifacts "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/api/routes/artifacts.ts"
click node_database "https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/db/client.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_dashboard,node_github_routes,node_workspace,node_orchestrator toneBlue
class node_scanner,node_static_analysis,node_change_analysis,node_routes,node_repo_agent,node_impact_service toneAmber
class node_test_selection,node_generation,node_preflight,node_test_runner,node_browser,node_pr toneMint
class node_review_report,node_artifacts toneRose
class node_knowledge,node_memory,node_database,node_github,node_playwright toneIndigo
```

## Components

### Review intake

- [Review dashboard](https://github.com/must-darkviolet/qanexus/blob/master/packages/frontend/app/(dashboard)/projects/%5Bid%5D/page.tsx): `packages/frontend/app/(dashboard)/projects/[id]/page.tsx`
- [GitHub webhook/API](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/api/routes/github.ts): `packages/backend/src/api/routes/github.ts`
- [PR checkout and diff](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/github/workspace.ts): `packages/backend/src/github/workspace.ts`
- [Review orchestrator](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/pipeline/orchestrator.ts): `packages/backend/src/pipeline/orchestrator.ts`

### Change analysis

- [Repository scanner](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/analysis/scanner.ts): `packages/backend/src/analysis/scanner.ts`
- [Static analysis](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/analysis/staticAnalyzer.ts): `packages/backend/src/analysis/staticAnalyzer.ts`
- [Change and impact analysis](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/analysis/changeDetector.ts): `packages/backend/src/analysis/changeDetector.ts`
- [Route discovery](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/analysis/routes.ts): `packages/backend/src/analysis/routes.ts`
- [Application mapping](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/agents/repositoryAnalyzer.ts): `packages/backend/src/agents/repositoryAnalyzer.ts`
- [Regression impact](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/pipeline/impactService.ts): `packages/backend/src/pipeline/impactService.ts`

### Test and browser verification

- [Test selection](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/pipeline/testSelection.ts): `packages/backend/src/pipeline/testSelection.ts`
- [Test generation](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/pipeline/generation.ts): `packages/backend/src/pipeline/generation.ts`
- [Safety and preflight](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/playwright/preflight.ts): `packages/backend/src/playwright/preflight.ts`
- [Playwright execution](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/playwright/runner.ts): `packages/backend/src/playwright/runner.ts`
- [Recorded walkthrough](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/explore/browser.ts): `packages/backend/src/explore/browser.ts`

### Findings and reporting

- [PR review and comment](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/pipeline/prReview.ts): `packages/backend/src/pipeline/prReview.ts`
- [Review artifacts API](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/api/routes/artifacts.ts): `packages/backend/src/api/routes/artifacts.ts`

### Review state

- [Application knowledge](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/knowledge/store.ts): `packages/backend/src/knowledge/store.ts`
- [History and retrieval](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/memory/retrieval.ts): `packages/backend/src/memory/retrieval.ts`
- [Review database](https://github.com/must-darkviolet/qanexus/blob/master/packages/backend/src/db/client.ts): `packages/backend/src/db/client.ts`

### Other components

- **Pull request**
- **GitHub**
- **Playwright**

## Connections

- Pull request → GitHub webhook/API: triggers review (evidence: `README.md`)
- Review dashboard → Review orchestrator: starts review (evidence: `README.md`)
- GitHub webhook/API → Review orchestrator: dispatches review (evidence: `README.md`)
- Review orchestrator → PR checkout and diff: checks out and diffs (evidence: `README.md`)
- PR checkout and diff → GitHub: fetches PR (evidence: `README.md`)
- Review orchestrator → Repository scanner: scans repository (evidence: `packages/backend/src/pipeline/orchestrator.ts`)
- Review orchestrator → Static analysis: analyzes repository (evidence: `packages/backend/src/pipeline/orchestrator.ts`)
- Static analysis → Repository scanner: uses scanned files (evidence: `packages/backend/src/analysis/staticAnalyzer.ts`)
- Static analysis → Route discovery: extracts routes (evidence: `packages/backend/src/analysis/staticAnalyzer.ts`)
- Review orchestrator → Change and impact analysis: analyzes changes (evidence: `packages/backend/src/pipeline/orchestrator.ts`)
- Change and impact analysis → PR checkout and diff: compares revisions (evidence: `packages/backend/src/analysis/changeDetector.ts`)
- Review orchestrator → Application mapping: maps application (evidence: `packages/backend/src/pipeline/orchestrator.ts`)
- Application mapping → Static analysis: derives features (evidence: `packages/backend/src/agents/repositoryAnalyzer.ts`)
- Application mapping → Application knowledge: persists mapping (evidence: `packages/backend/src/agents/repositoryAnalyzer.ts`)
- Review orchestrator → Regression impact: assesses regression (evidence: `packages/backend/src/pipeline/orchestrator.ts`)
- Regression impact → Application knowledge: reads feature evidence (evidence: `packages/backend/src/pipeline/impactService.ts`)
- Regression impact → History and retrieval: checks past findings (evidence: `packages/backend/src/pipeline/impactService.ts`)
- Review orchestrator → Test selection: selects coverage (evidence: `packages/backend/src/pipeline/orchestrator.ts`)
- Test selection → Change and impact analysis: uses affected modules (evidence: `README.md`)
- Review orchestrator → Test generation: generates tests (evidence: `packages/backend/src/pipeline/orchestrator.ts`)
- Test generation → Application knowledge: uses application context
- Test generation → Safety and preflight: validates generated code (evidence: `README.md`)
- Review orchestrator → Playwright execution: runs selected tests (evidence: `packages/backend/src/pipeline/orchestrator.ts`)
- Playwright execution → Playwright: executes tests (evidence: `README.md`)
- Review orchestrator → Recorded walkthrough: records walkthrough (evidence: `packages/backend/src/pipeline/orchestrator.ts`)
- Recorded walkthrough → Playwright: drives browser (evidence: `packages/backend/src/explore/browser.ts`)
- Review orchestrator → PR review and comment: prepares result
- PR review and comment → GitHub: posts or updates comment (evidence: `README.md`)
- Review dashboard → Review artifacts API: displays recordings
- Review orchestrator → Review database: stores run state
- Application knowledge → Review database: reads and writes knowledge (evidence: `packages/backend/src/knowledge/store.ts`)
- Regression impact → Review database: saves impact report (evidence: `packages/backend/src/pipeline/impactService.ts`)
