# chu0119/pojun architecture

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

- Interactive diagram: https://gitdiagram.com/chu0119/pojun
- Repository: https://github.com/chu0119/pojun

## Overview

Pojun is an AI-driven penetration-testing platform: a user supplies a target and goals, then an event-driven multi-agent workflow explores, executes tools, records evidence and findings, and produces a report. Its web console also exposes task oversight, approvals, traffic, vulnerability intelligence, and platform configuration. The graph combines sampled Go call/import references with README-described capabilities; unsampled subsystems are included only where the README establishes their role, and their links are documented rather than inferred from names.

Main entry points: [`server/server.go`](https://github.com/chu0119/pojun/blob/main/server/server.go) (HTTP API), [`agent/worker.go`](https://github.com/chu0119/pojun/blob/main/agent/worker.go) (Intent worker), [`web/src/app/(main)/function/tasks/detail/page.tsx`](https://github.com/chu0119/pojun/blob/main/web/src/app/(main)/function/tasks/detail/page.tsx) (Web console), [`server/manager.go`](https://github.com/chu0119/pojun/blob/main/server/manager.go) (Task manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_web["Web console<br/>[page.tsx]"]
  node_api["HTTP API<br/>[server.go]"]
end

subgraph group_execution["Task execution"]
  node_manager["Task manager<br/>[manager.go]"]
  node_engine["Exploration engine<br/>[engine.go]"]
  node_worker["Intent worker<br/>[worker.go]"]
  node_planner["Intent planner<br/>[planner.go]"]
  node_agenttools["Agent tools<br/>[tools.go]"]
  node_intercept["Approval gates<br/>[intercept.go]"]
end

subgraph group_evidence["Evidence and findings"]
  node_database[("PostgreSQL store<br/>[db.go]")]
  node_traffic["Traffic capture<br/>[traffic.go]"]
  node_evidence_store[("Evidence store<br/>[store.go]")]
  node_findings["Finding workflow<br/>[findings.go]"]
  node_reports["Report export<br/>[report.go]"]
end

subgraph group_platform["Platform services"]
  node_vulnintel["Vulnerability intelligence<br/>[intel.go]"]
  node_llmpool["LLM pool<br/>[pool.go]"]
  node_listener["Callback listener<br/>[listener.go]"]
  node_notifications["Notifications<br/>[notify.go]"]
end

subgraph group_operations["Operations"]
  node_hostd["Host installer<br/>[server.go]"]
end

node_user(("Operator"))
node_operator_target(("Authorized target"))
node_llm{{"LLM provider"}}

node_user -->|"sets target"| node_web
node_web -.->|"calls API"| node_api
node_api -->|"handles tasks"| node_manager
node_manager -.->|"runs tasks"| node_engine
node_engine -->|"requests plans"| node_planner
node_engine -->|"dispatches intents"| node_worker
node_planner -.->|"reads task state"| node_database
node_worker -->|"executes tools"| node_agenttools
node_worker -->|"gates tool calls"| node_intercept
node_worker -.->|"requests completions"| node_llm
node_manager -.->|"configures pool"| node_llmpool
node_worker -->|"writes task results"| node_database
node_worker -->|"routes HTTP traffic"| node_traffic
node_traffic -->|"supplies traffic evidence"| node_evidence_store
node_worker -->|"reports findings"| node_findings
node_findings -.->|"persists findings"| node_database
node_api -.->|"exports reports"| node_reports
node_api -.->|"serves intelligence"| node_vulnintel
node_api -.->|"exposes callbacks"| node_listener
node_api -.->|"configures delivery"| node_notifications
node_api -.->|"requests installs"| node_hostd
node_agenttools -->|"tests target"| node_operator_target
node_web -.->|"reviews findings"| node_findings
node_web -.->|"reviews traffic"| node_traffic

click node_web "https://github.com/chu0119/pojun/blob/main/web/src/app/(main)/function/tasks/detail/page.tsx"
click node_api "https://github.com/chu0119/pojun/blob/main/server/server.go"
click node_manager "https://github.com/chu0119/pojun/blob/main/server/manager.go"
click node_engine "https://github.com/chu0119/pojun/blob/main/server/engine.go"
click node_worker "https://github.com/chu0119/pojun/blob/main/agent/worker.go"
click node_planner "https://github.com/chu0119/pojun/blob/main/agent/planner.go"
click node_agenttools "https://github.com/chu0119/pojun/blob/main/agent/tools.go"
click node_intercept "https://github.com/chu0119/pojun/blob/main/intercept/intercept.go"
click node_database "https://github.com/chu0119/pojun/blob/main/db/db.go"
click node_traffic "https://github.com/chu0119/pojun/blob/main/traffic/traffic.go"
click node_evidence_store "https://github.com/chu0119/pojun/blob/main/evidence/store.go"
click node_findings "https://github.com/chu0119/pojun/blob/main/db/findings.go"
click node_reports "https://github.com/chu0119/pojun/blob/main/report/report.go"
click node_vulnintel "https://github.com/chu0119/pojun/blob/main/vulnintel/intel.go"
click node_llmpool "https://github.com/chu0119/pojun/blob/main/llmpool/pool.go"
click node_listener "https://github.com/chu0119/pojun/blob/main/listener/listener.go"
click node_notifications "https://github.com/chu0119/pojun/blob/main/notify/notify.go"
click node_hostd "https://github.com/chu0119/pojun/blob/main/hostd/server.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_worker,node_planner,node_agenttools,node_intercept toneAmber
class node_database,node_traffic,node_evidence_store,node_findings,node_reports toneMint
class node_vulnintel,node_llmpool,node_listener,node_notifications toneRose
class node_hostd,node_user,node_operator_target,node_llm toneIndigo
```

## Components

### User interface

- [Web console](https://github.com/chu0119/pojun/blob/main/web/src/app/(main)/function/tasks/detail/page.tsx): `web/src/app/(main)/function/tasks/detail/page.tsx`
- [HTTP API](https://github.com/chu0119/pojun/blob/main/server/server.go): `server/server.go`

### Task execution

- [Task manager](https://github.com/chu0119/pojun/blob/main/server/manager.go): `server/manager.go`
- [Exploration engine](https://github.com/chu0119/pojun/blob/main/server/engine.go): `server/engine.go`
- [Intent worker](https://github.com/chu0119/pojun/blob/main/agent/worker.go): `agent/worker.go`
- [Intent planner](https://github.com/chu0119/pojun/blob/main/agent/planner.go): `agent/planner.go`
- [Agent tools](https://github.com/chu0119/pojun/blob/main/agent/tools.go): `agent/tools.go`
- [Approval gates](https://github.com/chu0119/pojun/blob/main/intercept/intercept.go): `intercept/intercept.go`

### Evidence and findings

- [PostgreSQL store](https://github.com/chu0119/pojun/blob/main/db/db.go): `db/db.go`
- [Traffic capture](https://github.com/chu0119/pojun/blob/main/traffic/traffic.go): `traffic/traffic.go`
- [Evidence store](https://github.com/chu0119/pojun/blob/main/evidence/store.go): `evidence/store.go`
- [Finding workflow](https://github.com/chu0119/pojun/blob/main/db/findings.go): `db/findings.go`
- [Report export](https://github.com/chu0119/pojun/blob/main/report/report.go): `report/report.go`

### Platform services

- [Vulnerability intelligence](https://github.com/chu0119/pojun/blob/main/vulnintel/intel.go): `vulnintel/intel.go`
- [LLM pool](https://github.com/chu0119/pojun/blob/main/llmpool/pool.go): `llmpool/pool.go`
- [Callback listener](https://github.com/chu0119/pojun/blob/main/listener/listener.go): `listener/listener.go`
- [Notifications](https://github.com/chu0119/pojun/blob/main/notify/notify.go): `notify/notify.go`

### Operations

- [Host installer](https://github.com/chu0119/pojun/blob/main/hostd/server.go): `hostd/server.go`

### Other components

- **Operator**
- **Authorized target**
- **LLM provider**

## Connections

- Operator → Web console: sets target
- Web console → HTTP API: calls API
- HTTP API → Task manager: handles tasks (evidence: `server/server.go`)
- Task manager → Exploration engine: runs tasks
- Exploration engine → Intent planner: requests plans
- Exploration engine → Intent worker: dispatches intents
- Intent planner → PostgreSQL store: reads task state
- Intent worker → Agent tools: executes tools (evidence: `agent/worker.go`)
- Intent worker → Approval gates: gates tool calls (evidence: `agent/worker.go`)
- Intent worker → LLM provider: requests completions
- Task manager → LLM pool: configures pool
- Intent worker → PostgreSQL store: writes task results
- Intent worker → Traffic capture: routes HTTP traffic
- Traffic capture → Evidence store: supplies traffic evidence (evidence: `evidence/store.go`)
- Intent worker → Finding workflow: reports findings
- Finding workflow → PostgreSQL store: persists findings
- HTTP API → Report export: exports reports
- HTTP API → Vulnerability intelligence: serves intelligence
- HTTP API → Callback listener: exposes callbacks
- HTTP API → Notifications: configures delivery
- HTTP API → Host installer: requests installs
- Agent tools → Authorized target: tests target
- Web console → Finding workflow: reviews findings
- Web console → Traffic capture: reviews traffic
