# nyco-kalashnikov/sudosudo architecture

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

- Interactive diagram: https://gitdiagram.com/nyco-kalashnikov/sudosudo
- Repository: https://github.com/nyco-kalashnikov/sudosudo

## Overview

SudoSudo is a local webview network scanner. The main workflow accepts scan settings, generates IPs, probes selected service ports, gathers service details, scores findings, and persists results for later comparison. The local UI also exposes optional AI chat and classification, backed by semantic memory and OpenRouter. The README documents capabilities beyond the excerpts; those branches are included where supported, while uncertain internal calls are omitted.

Main entry points: [`main.py`](https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py) (Scan Coordinator), [`ia_service.py`](https://github.com/nyco-kalashnikov/sudosudo/blob/main/ia_service.py) (AI Analysis), [`index.html`](https://github.com/nyco-kalashnikov/sudosudo/blob/main/index.html) (Web Interface), [`memoria.py`](https://github.com/nyco-kalashnikov/sudosudo/blob/main/memoria.py) (Semantic Memory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Local Interface"]
  node_ui["Web Interface<br/>[index.html]"]
  node_api["Local API<br/>[main.py]"]
end

subgraph group_scanning["Network Scanning"]
  node_coordinator["Scan Coordinator<br/>[main.py]"]
  node_ipgen["IP Generation<br/>[main.py]"]
  node_portcheck["Port Checks<br/>[main.py]"]
  node_fingerprints["Service Details<br/>[main.py]"]
end

subgraph group_results["Findings and History"]
  node_scoring["Exposure Scoring<br/>[main.py]"]
  node_history["Scan History<br/>[main.py]"]
end

subgraph group_analysis["AI and Memory"]
  node_ai["AI Analysis<br/>[ia_service.py]"]
  node_memory["Semantic Memory<br/>[memoria.py]"]
  node_memorydb[("Memory Store<br/>[memoria.py]")]
  node_openrouter["OpenRouter"]
end

node_operator(("Operator"))

node_operator -->|"configures scans"| node_ui
node_ui -->|"sends requests"| node_api
node_api -->|"starts scan"| node_coordinator
node_coordinator -->|"generates targets"| node_ipgen
node_coordinator -->|"probes ports"| node_portcheck
node_portcheck -->|"collects details"| node_fingerprints
node_coordinator -->|"scores findings"| node_scoring
node_coordinator -->|"persists results"| node_history
node_api -->|"routes analysis"| node_ai
node_ai -->|"requests completion"| node_openrouter
node_ai -->|"stores and retrieves"| node_memory
node_memory -->|"reads and writes"| node_memorydb

click node_ui "https://github.com/nyco-kalashnikov/sudosudo/blob/main/index.html"
click node_api "https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py"
click node_coordinator "https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py"
click node_ipgen "https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py"
click node_portcheck "https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py"
click node_fingerprints "https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py"
click node_scoring "https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py"
click node_history "https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py"
click node_ai "https://github.com/nyco-kalashnikov/sudosudo/blob/main/ia_service.py"
click node_memory "https://github.com/nyco-kalashnikov/sudosudo/blob/main/memoria.py"
click node_memorydb "https://github.com/nyco-kalashnikov/sudosudo/blob/main/memoria.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_ui,node_api toneBlue
class node_coordinator,node_ipgen,node_portcheck,node_fingerprints toneAmber
class node_scoring,node_history toneMint
class node_ai,node_memory,node_memorydb,node_openrouter toneRose
class node_operator toneIndigo
```

## Components

### Local Interface

- [Web Interface](https://github.com/nyco-kalashnikov/sudosudo/blob/main/index.html): `index.html`
- [Local API](https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py): `main.py`

### Network Scanning

- [Scan Coordinator](https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py): `main.py`
- [IP Generation](https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py): `main.py`
- [Port Checks](https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py): `main.py`
- [Service Details](https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py): `main.py`

### Findings and History

- [Exposure Scoring](https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py): `main.py`
- [Scan History](https://github.com/nyco-kalashnikov/sudosudo/blob/main/main.py): `main.py`

### AI and Memory

- [AI Analysis](https://github.com/nyco-kalashnikov/sudosudo/blob/main/ia_service.py): `ia_service.py`
- [Semantic Memory](https://github.com/nyco-kalashnikov/sudosudo/blob/main/memoria.py): `memoria.py`
- [Memory Store](https://github.com/nyco-kalashnikov/sudosudo/blob/main/memoria.py): `memoria.py`
- **OpenRouter**

### Other components

- **Operator**

## Connections

- Operator → Web Interface: configures scans (evidence: `README.md`)
- Web Interface → Local API: sends requests (evidence: `README.md`)
- Local API → Scan Coordinator: starts scan (evidence: `main.py`)
- Scan Coordinator → IP Generation: generates targets (evidence: `README.md`)
- Scan Coordinator → Port Checks: probes ports (evidence: `README.md`)
- Port Checks → Service Details: collects details (evidence: `main.py`)
- Scan Coordinator → Exposure Scoring: scores findings (evidence: `README.md`)
- Scan Coordinator → Scan History: persists results (evidence: `README.md`)
- Local API → AI Analysis: routes analysis (evidence: `main.py`)
- AI Analysis → OpenRouter: requests completion (evidence: `ia_service.py`)
- AI Analysis → Semantic Memory: stores and retrieves (evidence: `ia_service.py`)
- Semantic Memory → Memory Store: reads and writes (evidence: `memoria.py`)
