# ruoji6/artex architecture

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

- Interactive diagram: https://gitdiagram.com/ruoji6/artex
- Repository: https://github.com/ruoji6/artex

## Overview

ARTEX is a self-hosted AI-assisted penetration-testing system. Users configure targets and goals, create or schedule tasks, and follow agent exploration through assets, findings, traffic, and reports; they can also review intercepted actions for approval. The backend exposes a JSON API, coordinates planner/worker execution, and persists task and evidence state. The README also documents MCP, ScopeSentry asset sync, notifications, and LLM-record inspection. Edges are limited to excerpted references and explicit README statements; unsampled feature wiring is not inferred.

Main entry points: [`server/server.go`](https://github.com/ruoji6/artex/blob/main/server/server.go) (JSON API), [`server/engine.go`](https://github.com/ruoji6/artex/blob/main/server/engine.go) (Exploration engine), [`db`](https://github.com/ruoji6/artex/tree/main/db) (Task and asset stores), [`agent/worker.go`](https://github.com/ruoji6/artex/blob/main/agent/worker.go) (Agent worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_web["Web console"]
  node_api["JSON API<br/>[server.go]"]
end

subgraph group_runtime["Task runtime"]
  node_manager["Task manager<br/>[manager.go]"]
  node_engine["Exploration engine<br/>[engine.go]"]
  node_planner["Planner<br/>[planner.go]"]
  node_worker["Agent worker<br/>[worker.go]"]
end

subgraph group_evidence["Evidence and review"]
  node_db[("Task and asset stores")]
  node_traffic[("Traffic recorder<br/>[traffic.go]")]
  node_intercept["Action approvals<br/>[intercept.go]"]
  node_findings["Findings and reports"]
  node_evidence_store[("Evidence store<br/>[store.go]")]
end

subgraph group_operations["Integrations and operations"]
  node_llm["LLM provider pool<br/>[pool.go]"]
  node_llm_records[("LLM records<br/>[llmrec.go]")]
  node_mcp["MCP services<br/>[client.go]"]
  node_scope_sync["ScopeSentry sync"]
  node_notifications["Notifications<br/>[notify.go]"]
end

node_user(("Operator"))
node_github["GitHub releases"]

node_user -->|"uses"| node_web
node_web -->|"uses JSON API"| node_api
node_api -->|"manages tasks"| node_manager
node_engine -->|"reads task state"| node_manager
node_engine -.->|"runs planning"| node_planner
node_engine -->|"runs work"| node_worker
node_worker -->|"writes exploration"| node_db
node_engine -->|"loads task state"| node_db
node_manager -->|"starts proxy"| node_traffic
node_worker -->|"gates tool calls"| node_intercept
node_api -->|"configures review"| node_intercept
node_api -->|"serves finding reports"| node_findings
node_evidence_store -->|"uses database"| node_db
node_evidence_store -->|"uses traffic data"| node_traffic
node_llm_records -->|"records usage"| node_db
node_api -->|"exposes records"| node_llm_records
node_api -.->|"offers MCP access"| node_mcp
node_user -->|"imports assets"| node_scope_sync
node_api -.->|"provides sync endpoint"| node_scope_sync
node_api -.->|"configures notifications"| node_notifications
node_user -->|"checks updates"| node_github

click node_web "https://github.com/ruoji6/artex/tree/main/web/src/app/(main)"
click node_api "https://github.com/ruoji6/artex/blob/main/server/server.go"
click node_manager "https://github.com/ruoji6/artex/blob/main/server/manager.go"
click node_engine "https://github.com/ruoji6/artex/blob/main/server/engine.go"
click node_planner "https://github.com/ruoji6/artex/blob/main/agent/planner.go"
click node_worker "https://github.com/ruoji6/artex/blob/main/agent/worker.go"
click node_db "https://github.com/ruoji6/artex/tree/main/db"
click node_traffic "https://github.com/ruoji6/artex/blob/main/traffic/traffic.go"
click node_intercept "https://github.com/ruoji6/artex/blob/main/intercept/intercept.go"
click node_findings "https://github.com/ruoji6/artex/tree/main/report"
click node_evidence_store "https://github.com/ruoji6/artex/blob/main/evidence/store.go"
click node_llm "https://github.com/ruoji6/artex/blob/main/llmpool/pool.go"
click node_llm_records "https://github.com/ruoji6/artex/blob/main/llmrec/llmrec.go"
click node_mcp "https://github.com/ruoji6/artex/blob/main/mcphttp/client.go"
click node_scope_sync "https://github.com/ruoji6/artex/blob/main/server/sync_scopesentry.go"
click node_notifications "https://github.com/ruoji6/artex/blob/main/notify/notify.go"

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_web,node_api toneBlue
class node_manager,node_engine,node_planner,node_worker toneAmber
class node_db,node_traffic,node_intercept,node_findings,node_evidence_store toneMint
class node_llm,node_llm_records,node_mcp,node_scope_sync,node_notifications toneRose
class node_user,node_github toneIndigo
```

## Components

### User experience

- [Web console](https://github.com/ruoji6/artex/tree/main/web/src/app/(main)): `web/src/app/(main)`
- [JSON API](https://github.com/ruoji6/artex/blob/main/server/server.go): `server/server.go`

### Task runtime

- [Task manager](https://github.com/ruoji6/artex/blob/main/server/manager.go): `server/manager.go`
- [Exploration engine](https://github.com/ruoji6/artex/blob/main/server/engine.go): `server/engine.go`
- [Planner](https://github.com/ruoji6/artex/blob/main/agent/planner.go): `agent/planner.go`
- [Agent worker](https://github.com/ruoji6/artex/blob/main/agent/worker.go): `agent/worker.go`

### Evidence and review

- [Task and asset stores](https://github.com/ruoji6/artex/tree/main/db): `db`
- [Traffic recorder](https://github.com/ruoji6/artex/blob/main/traffic/traffic.go): `traffic/traffic.go`
- [Action approvals](https://github.com/ruoji6/artex/blob/main/intercept/intercept.go): `intercept/intercept.go`
- [Findings and reports](https://github.com/ruoji6/artex/tree/main/report): `report`
- [Evidence store](https://github.com/ruoji6/artex/blob/main/evidence/store.go): `evidence/store.go`

### Integrations and operations

- [LLM provider pool](https://github.com/ruoji6/artex/blob/main/llmpool/pool.go): `llmpool/pool.go`
- [LLM records](https://github.com/ruoji6/artex/blob/main/llmrec/llmrec.go): `llmrec/llmrec.go`
- [MCP services](https://github.com/ruoji6/artex/blob/main/mcphttp/client.go): `mcphttp/client.go`
- [ScopeSentry sync](https://github.com/ruoji6/artex/blob/main/server/sync_scopesentry.go): `server/sync_scopesentry.go`
- [Notifications](https://github.com/ruoji6/artex/blob/main/notify/notify.go): `notify/notify.go`

### Other components

- **Operator**
- **GitHub releases**

## Connections

- Operator → Web console: uses
- Web console → JSON API: uses JSON API
- JSON API → Task manager: manages tasks (evidence: `server/server.go`)
- Exploration engine → Task manager: reads task state (evidence: `server/engine.go`)
- Exploration engine → Planner: runs planning
- Exploration engine → Agent worker: runs work (evidence: `server/engine.go`)
- Agent worker → Task and asset stores: writes exploration (evidence: `agent/worker.go`)
- Exploration engine → Task and asset stores: loads task state (evidence: `server/engine.go`)
- Task manager → Traffic recorder: starts proxy (evidence: `server/manager.go`)
- Agent worker → Action approvals: gates tool calls (evidence: `agent/worker.go`)
- JSON API → Action approvals: configures review (evidence: `server/server.go`)
- JSON API → Findings and reports: serves finding reports (evidence: `server/server.go`)
- Evidence store → Task and asset stores: uses database (evidence: `evidence/store.go`)
- Evidence store → Traffic recorder: uses traffic data (evidence: `evidence/store.go`)
- LLM records → Task and asset stores: records usage (evidence: `llmrec/llmrec.go`)
- JSON API → LLM records: exposes records (evidence: `server/server.go`)
- JSON API → MCP services: offers MCP access
- Operator → ScopeSentry sync: imports assets
- JSON API → ScopeSentry sync: provides sync endpoint
- JSON API → Notifications: configures notifications
- Operator → GitHub releases: checks updates
