# shadowincache/ironmind-fsociety-echelon26 architecture

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

- Interactive diagram: https://gitdiagram.com/shadowincache/ironmind-fsociety-echelon26
- Repository: https://github.com/shadowincache/ironmind-fsociety-echelon26

## Overview

IronMind protects AI-assisted GitHub code reviews from prompt injection. The principal workflow analyzes incoming text through sanitization and ML classification, tracks conversational drift in a temporal graph, then makes a proceed-or-rollback decision; suspicious prompts may be sent to a honeypot. The web dashboard presents repository, pull-request, commit, file, security, and chat views. The graph distinguishes the documented core defense API from the separate dashboard backend. Some dashboard-to-backend wiring and unsampled subsystems are represented only where documentation supports them; unsupported internal calls are omitted.

Main entry points: [`web/frontend/src/App.jsx`](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/App.jsx) (Dashboard App), [`src/api/main.py`](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/api/main.py) (Defense API), [`src/core/graph_manager.py`](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/core/graph_manager.py) (Temporal Graph), [`web/backend/main.py`](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/backend/main.py) (Dashboard Backend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_defense["Prompt Defense"]
  node_defense_api["Defense API<br/>[main.py]"]
  node_sanitizer["Prompt Sanitizer<br/>[sanitizer.py]"]
  node_classifier["Injection Classifier"]
  node_decision["Decision Engine<br/>[decision_engine.py]"]
  node_honeypot["Honeypot Sandbox<br/>[honeypot.py]"]
  node_reasoning["Thought Monitor"]
end

subgraph group_state["Security State"]
  node_graph_manager["Temporal Graph<br/>[graph_manager.py]"]
  node_neo4j[("Neo4j")]
end

subgraph group_dashboard["Review Dashboard"]
  node_dashboard_app["Dashboard App<br/>[App.jsx]"]
  node_navigation["Top Navigation<br/>[TopNavigation.jsx]"]
  node_chat["Chat View<br/>[ChatPage.jsx]"]
  node_pull_request["Pull Request View"]
  node_commits["Commits View<br/>[CommitsPage.jsx]"]
  node_files["Changed Files View"]
  node_security["Security View<br/>[SecurityPage.jsx]"]
  node_app_context["Dashboard State<br/>[AppContext.jsx]"]
end

subgraph group_webdata["Dashboard Services"]
  node_api_client["Dashboard API Client<br/>[api.js]"]
  node_dashboard_backend["Dashboard Backend<br/>[main.py]"]
  node_sqlite[("Dashboard SQLite")]
  node_ml_inference["Dashboard ML Inference"]
end

node_reviewer(("Reviewer"))

node_reviewer -->|"uses"| node_dashboard_app
node_dashboard_app -->|"renders"| node_navigation
node_dashboard_app -->|"renders"| node_chat
node_dashboard_app -->|"renders"| node_pull_request
node_dashboard_app -->|"renders"| node_commits
node_dashboard_app -->|"renders"| node_files
node_dashboard_app -->|"renders"| node_security
node_dashboard_app -->|"provides state"| node_app_context
node_app_context -->|"fetches data"| node_api_client
node_api_client -.->|"HTTP requests"| node_dashboard_backend
node_dashboard_backend -->|"reads and writes"| node_sqlite
node_dashboard_backend -->|"imports inference"| node_ml_inference
node_reviewer -->|"submits prompts"| node_defense_api
node_defense_api -->|"preprocesses"| node_sanitizer
node_defense_api -.->|"classifies"| node_classifier
node_defense_api -->|"tracks prompts"| node_graph_manager
node_graph_manager -->|"stores graph data"| node_neo4j
node_defense_api -->|"decides action"| node_decision
node_defense_api -->|"executes suspicious prompt"| node_honeypot
node_decision -.->|"deletes malicious nodes"| node_graph_manager
node_reasoning -->|"monitors turns"| node_graph_manager
node_reasoning -->|"uses decisions"| node_decision

click node_defense_api "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/api/main.py"
click node_sanitizer "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/core/sanitizer.py"
click node_classifier "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/ml/stage1_inference.py"
click node_graph_manager "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/core/graph_manager.py"
click node_decision "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/core/decision_engine.py"
click node_honeypot "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/sandbox/honeypot.py"
click node_reasoning "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/core/reasoning_monitor.py"
click node_dashboard_app "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/App.jsx"
click node_navigation "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/components/TopNavigation.jsx"
click node_chat "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/pages/ChatPage.jsx"
click node_pull_request "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/pages/PullRequestPage.jsx"
click node_commits "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/pages/CommitsPage.jsx"
click node_files "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/pages/FilesChangedPage.jsx"
click node_security "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/pages/SecurityPage.jsx"
click node_app_context "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/context/AppContext.jsx"
click node_api_client "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/services/api.js"
click node_dashboard_backend "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/backend/main.py"
click node_ml_inference "https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/ml/stage1_inference.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_defense_api,node_sanitizer,node_classifier,node_decision,node_honeypot,node_reasoning,node_reviewer toneBlue
class node_graph_manager,node_neo4j toneAmber
class node_dashboard_app,node_navigation,node_chat,node_pull_request,node_commits,node_files,node_security,node_app_context toneMint
class node_api_client,node_dashboard_backend,node_sqlite,node_ml_inference toneRose
```

## Components

### Prompt Defense

- [Defense API](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/api/main.py): `src/api/main.py`
- [Prompt Sanitizer](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/core/sanitizer.py): `src/core/sanitizer.py`
- [Injection Classifier](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/ml/stage1_inference.py): `src/ml/stage1_inference.py`
- [Decision Engine](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/core/decision_engine.py): `src/core/decision_engine.py`
- [Honeypot Sandbox](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/sandbox/honeypot.py): `src/sandbox/honeypot.py`
- [Thought Monitor](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/core/reasoning_monitor.py): `src/core/reasoning_monitor.py`

### Security State

- [Temporal Graph](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/core/graph_manager.py): `src/core/graph_manager.py`
- **Neo4j**

### Review Dashboard

- [Dashboard App](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/App.jsx): `web/frontend/src/App.jsx`
- [Top Navigation](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/components/TopNavigation.jsx): `web/frontend/src/components/TopNavigation.jsx`
- [Chat View](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/pages/ChatPage.jsx): `web/frontend/src/pages/ChatPage.jsx`
- [Pull Request View](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/pages/PullRequestPage.jsx): `web/frontend/src/pages/PullRequestPage.jsx`
- [Commits View](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/pages/CommitsPage.jsx): `web/frontend/src/pages/CommitsPage.jsx`
- [Changed Files View](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/pages/FilesChangedPage.jsx): `web/frontend/src/pages/FilesChangedPage.jsx`
- [Security View](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/pages/SecurityPage.jsx): `web/frontend/src/pages/SecurityPage.jsx`
- [Dashboard State](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/context/AppContext.jsx): `web/frontend/src/context/AppContext.jsx`

### Dashboard Services

- [Dashboard API Client](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/frontend/src/services/api.js): `web/frontend/src/services/api.js`
- [Dashboard Backend](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/web/backend/main.py): `web/backend/main.py`
- **Dashboard SQLite**
- [Dashboard ML Inference](https://github.com/shadowincache/ironmind-fsociety-echelon26/blob/main/src/ml/stage1_inference.py): `src/ml/stage1_inference.py`

### Other components

- **Reviewer**

## Connections

- Reviewer → Dashboard App: uses (evidence: `README.md`)
- Dashboard App → Top Navigation: renders (evidence: `web/frontend/src/App.jsx`)
- Dashboard App → Chat View: renders (evidence: `web/frontend/src/App.jsx`)
- Dashboard App → Pull Request View: renders (evidence: `web/frontend/src/App.jsx`)
- Dashboard App → Commits View: renders (evidence: `web/frontend/src/App.jsx`)
- Dashboard App → Changed Files View: renders (evidence: `web/frontend/src/App.jsx`)
- Dashboard App → Security View: renders (evidence: `web/frontend/src/App.jsx`)
- Dashboard App → Dashboard State: provides state (evidence: `web/frontend/src/App.jsx`)
- Dashboard State → Dashboard API Client: fetches data (evidence: `web/frontend/src/context/AppContext.jsx`)
- Dashboard API Client → Dashboard Backend: HTTP requests (evidence: `web/frontend/src/services/api.js`)
- Dashboard Backend → Dashboard SQLite: reads and writes (evidence: `web/backend/main.py`)
- Dashboard Backend → Dashboard ML Inference: imports inference (evidence: `web/backend/main.py`)
- Reviewer → Defense API: submits prompts (evidence: `README.md`)
- Defense API → Prompt Sanitizer: preprocesses (evidence: `src/api/main.py`)
- Defense API → Injection Classifier: classifies (evidence: `README.md`)
- Defense API → Temporal Graph: tracks prompts (evidence: `src/api/main.py`)
- Temporal Graph → Neo4j: stores graph data (evidence: `src/core/graph_manager.py`)
- Defense API → Decision Engine: decides action (evidence: `src/api/main.py`)
- Defense API → Honeypot Sandbox: executes suspicious prompt (evidence: `src/api/main.py`)
- Decision Engine → Temporal Graph: deletes malicious nodes (evidence: `README.md`)
- Thought Monitor → Temporal Graph: monitors turns (evidence: `src/core/reasoning_monitor.py`)
- Thought Monitor → Decision Engine: uses decisions (evidence: `src/core/reasoning_monitor.py`)
