# chrisroyse/pheromind architecture

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

- Interactive diagram: https://gitdiagram.com/chrisroyse/pheromind
- Repository: https://github.com/chrisroyse/pheromind

## Overview

The tree contains a Pheromind vision README but no swarm implementation. The executable product visible in source is `poop`, a local source-code secret scanner. Its main flow accepts a path, scans supported files and archives, optionally checks Git history, merges optional external-tool findings, and presents results. The source excerpt is partial, so uncertain internal wiring is omitted; the README’s Pheromind capabilities are not represented as implemented components.

Main entry points: [`poop/source-secure.js`](https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js) (Scan orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_main["Scan orchestration<br/>[source-secure.js]"]
end

subgraph group_scan["Scanning"]
  node_discovery["Path discovery<br/>[source-secure.js]"]
  node_file_scan["File scanning<br/>[source-secure.js]"]
  node_detectors["Secret detectors<br/>[source-secure.js]"]
  node_archive_scan["Archive scanning<br/>[source-secure.js]"]
  node_archive_extract["Archive extraction<br/>[source-secure.js]"]
  node_history["Git history scan<br/>[source-secure.js]"]
end

subgraph group_integrations["Optional integrations"]
  node_ai_check["AI checks<br/>[source-secure.js]"]
  node_external_scan["External scans<br/>[source-secure.js]"]
end

subgraph group_results["Findings"]
  node_merge["Finding merge<br/>[source-secure.js]"]
  node_remediation["Remediation guidance<br/>[source-secure.js]"]
  node_report["Scan results<br/>[source-secure.js]"]
end

node_user(("CLI user"))
node_ollama["Ollama"]
node_trufflehog["TruffleHog"]
node_gitleaks["Gitleaks"]

node_user -->|"provides path and flags"| node_main
node_main -->|"discovers targets"| node_discovery
node_discovery -->|"dispatches files"| node_file_scan
node_discovery -->|"dispatches archives"| node_archive_scan
node_main -->|"scans history"| node_history
node_file_scan -->|"checks content"| node_detectors
node_file_scan -.->|"optionally checks"| node_ai_check
node_ai_check -.->|"requests analysis"| node_ollama
node_archive_scan -->|"extracts contents"| node_archive_extract
node_archive_scan -->|"scans contents"| node_file_scan
node_main -.->|"runs optional scans"| node_external_scan
node_external_scan -.->|"invokes when available"| node_trufflehog
node_external_scan -.->|"invokes when available"| node_gitleaks
node_main -->|"merges findings"| node_merge
node_external_scan -.->|"returns findings"| node_merge
node_file_scan -->|"returns findings"| node_merge
node_history -->|"returns findings"| node_merge
node_merge -->|"provides guidance"| node_remediation
node_main -->|"presents results"| node_report

click node_main "https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js"
click node_discovery "https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js"
click node_file_scan "https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js"
click node_detectors "https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js"
click node_archive_scan "https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js"
click node_archive_extract "https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js"
click node_history "https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js"
click node_ai_check "https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js"
click node_external_scan "https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js"
click node_merge "https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js"
click node_remediation "https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js"
click node_report "https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js"

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_main,node_user toneBlue
class node_discovery,node_file_scan,node_detectors,node_archive_scan,node_archive_extract,node_history toneAmber
class node_ai_check,node_external_scan toneMint
class node_merge,node_remediation,node_report toneRose
class node_ollama,node_trufflehog,node_gitleaks toneIndigo
```

## Components

### CLI entry

- [Scan orchestration](https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js): `poop/source-secure.js`

### Scanning

- [Path discovery](https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js): `poop/source-secure.js`
- [File scanning](https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js): `poop/source-secure.js`
- [Secret detectors](https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js): `poop/source-secure.js`
- [Archive scanning](https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js): `poop/source-secure.js`
- [Archive extraction](https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js): `poop/source-secure.js`
- [Git history scan](https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js): `poop/source-secure.js`

### Optional integrations

- [AI checks](https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js): `poop/source-secure.js`
- [External scans](https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js): `poop/source-secure.js`

### Findings

- [Finding merge](https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js): `poop/source-secure.js`
- [Remediation guidance](https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js): `poop/source-secure.js`
- [Scan results](https://github.com/chrisroyse/pheromind/blob/main/poop/source-secure.js): `poop/source-secure.js`

### Other components

- **CLI user**
- **Ollama**
- **TruffleHog**
- **Gitleaks**

## Connections

- CLI user → Scan orchestration: provides path and flags
- Scan orchestration → Path discovery: discovers targets
- Path discovery → File scanning: dispatches files
- Path discovery → Archive scanning: dispatches archives
- Scan orchestration → Git history scan: scans history
- File scanning → Secret detectors: checks content
- File scanning → AI checks: optionally checks
- AI checks → Ollama: requests analysis
- Archive scanning → Archive extraction: extracts contents
- Archive scanning → File scanning: scans contents
- Scan orchestration → External scans: runs optional scans
- External scans → TruffleHog: invokes when available
- External scans → Gitleaks: invokes when available
- Scan orchestration → Finding merge: merges findings
- External scans → Finding merge: returns findings
- File scanning → Finding merge: returns findings
- Git history scan → Finding merge: returns findings
- Finding merge → Remediation guidance: provides guidance
- Scan orchestration → Scan results: presents results
