# actaclad/plumbline architecture

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

- Interactive diagram: https://gitdiagram.com/actaclad/plumbline
- Repository: https://github.com/actaclad/plumbline

## Overview

Plumbline is an offline static analyzer for reliability, architecture, harness, and security defects in LLM and agentic Python. Its main workflow scans Python files, parses their ASTs, annotates framework semantics, analyzes taint and rules, then gates and reports findings with a Readiness Score. It also supports baselines and exports the same rule knowledge as a coding-agent skill pack. The tree and excerpts establish the analysis layers; some CLI and integration details are documented only in the README, so those links cite it.

Main entry points: [`src/plumbline/engine.py`](https://github.com/actaclad/plumbline/blob/main/src/plumbline/engine.py) (Scan engine), [`src/plumbline/cli.py`](https://github.com/actaclad/plumbline/blob/main/src/plumbline/cli.py) (CLI commands), [`src/plumbline/adapters`](https://github.com/actaclad/plumbline/tree/main/src/plumbline/adapters) (Framework adapters), [`src/plumbline/rules`](https://github.com/actaclad/plumbline/tree/main/src/plumbline/rules) (Rule detectors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scan["Scan orchestration"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_engine["Scan engine<br/>[engine.py]"]
  node_config["Scan configuration<br/>[config.py]"]
  node_baseline["Finding baseline<br/>[baseline.py]"]
end

subgraph group_analysis["Static analysis"]
  node_ast["AST and scopes<br/>[ast_layer.py]"]
  node_adapters["Framework adapters"]
  node_semantics["Semantic model<br/>[model.py]"]
  node_taint["Taint analysis<br/>[taint.py]"]
  node_derive["Derived facts<br/>[derive.py]"]
  node_evidence["Project evidence<br/>[evidence.py]"]
end

subgraph group_rules["Detection knowledge"]
  node_rules["Rule detectors"]
  node_rule_helpers["Rule analysis helpers<br/>[_taint_flow.py]"]
  node_enrichment["Optional fix enrichment<br/>[enrichment.py]"]
end

subgraph group_results["Results and prevention"]
  node_findings["Findings and gate<br/>[model.py]"]
  node_scoring["Readiness scoring<br/>[readiness.py]"]
  node_reporters["CLI and file reports"]
  node_skillpack["Skill-pack export<br/>[export.py]"]
end

node_developer(("Project maintainer"))
node_coding_agent(("Coding agent"))

node_developer -->|"runs scan"| node_cli
node_cli -->|"starts analysis"| node_engine
node_engine -->|"reads settings"| node_config
node_engine -->|"applies baseline"| node_baseline
node_engine -->|"parses files"| node_ast
node_engine -->|"collects semantics"| node_adapters
node_adapters -->|"reads source trees"| node_ast
node_adapters -->|"emits annotations"| node_semantics
node_engine -->|"analyzes flows"| node_taint
node_taint -->|"reads annotations"| node_semantics
node_engine -->|"derives facts"| node_derive
node_engine -->|"collects evidence"| node_evidence
node_engine -->|"runs detectors"| node_rules
node_rules -->|"uses flow helpers"| node_rule_helpers
node_rule_helpers -->|"reads taint"| node_taint
node_engine -->|"finalizes findings"| node_findings
node_engine -->|"emits reports"| node_reporters
node_findings -->|"scores pillars"| node_scoring
node_scoring -->|"renders score"| node_reporters
node_cli -->|"exports rules"| node_skillpack
node_rules -->|"serializes rule knowledge"| node_skillpack
node_cli -.->|"optionally enriches fixes"| node_enrichment
node_skillpack -->|"guides code generation"| node_coding_agent

click node_cli "https://github.com/actaclad/plumbline/blob/main/src/plumbline/cli.py"
click node_engine "https://github.com/actaclad/plumbline/blob/main/src/plumbline/engine.py"
click node_config "https://github.com/actaclad/plumbline/blob/main/src/plumbline/config.py"
click node_baseline "https://github.com/actaclad/plumbline/blob/main/src/plumbline/baseline.py"
click node_ast "https://github.com/actaclad/plumbline/blob/main/src/plumbline/core/ast_layer.py"
click node_adapters "https://github.com/actaclad/plumbline/tree/main/src/plumbline/adapters"
click node_semantics "https://github.com/actaclad/plumbline/blob/main/src/plumbline/model.py"
click node_taint "https://github.com/actaclad/plumbline/blob/main/src/plumbline/core/taint.py"
click node_derive "https://github.com/actaclad/plumbline/blob/main/src/plumbline/core/derive.py"
click node_evidence "https://github.com/actaclad/plumbline/blob/main/src/plumbline/core/evidence.py"
click node_rules "https://github.com/actaclad/plumbline/tree/main/src/plumbline/rules"
click node_rule_helpers "https://github.com/actaclad/plumbline/blob/main/src/plumbline/rules/_taint_flow.py"
click node_enrichment "https://github.com/actaclad/plumbline/blob/main/src/plumbline/enrichment.py"
click node_findings "https://github.com/actaclad/plumbline/blob/main/src/plumbline/model.py"
click node_scoring "https://github.com/actaclad/plumbline/blob/main/src/plumbline/scoring/readiness.py"
click node_reporters "https://github.com/actaclad/plumbline/tree/main/src/plumbline/reporters"
click node_skillpack "https://github.com/actaclad/plumbline/blob/main/src/plumbline/skills/export.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_cli,node_engine,node_config,node_baseline toneBlue
class node_ast,node_adapters,node_semantics,node_taint,node_derive,node_evidence toneAmber
class node_rules,node_rule_helpers,node_enrichment toneMint
class node_findings,node_scoring,node_reporters,node_skillpack toneRose
class node_developer,node_coding_agent toneIndigo
```

## Components

### Scan orchestration

- [CLI commands](https://github.com/actaclad/plumbline/blob/main/src/plumbline/cli.py): `src/plumbline/cli.py`
- [Scan engine](https://github.com/actaclad/plumbline/blob/main/src/plumbline/engine.py): `src/plumbline/engine.py`
- [Scan configuration](https://github.com/actaclad/plumbline/blob/main/src/plumbline/config.py): `src/plumbline/config.py`
- [Finding baseline](https://github.com/actaclad/plumbline/blob/main/src/plumbline/baseline.py): `src/plumbline/baseline.py`

### Static analysis

- [AST and scopes](https://github.com/actaclad/plumbline/blob/main/src/plumbline/core/ast_layer.py): `src/plumbline/core/ast_layer.py`
- [Framework adapters](https://github.com/actaclad/plumbline/tree/main/src/plumbline/adapters): `src/plumbline/adapters`
- [Semantic model](https://github.com/actaclad/plumbline/blob/main/src/plumbline/model.py): `src/plumbline/model.py`
- [Taint analysis](https://github.com/actaclad/plumbline/blob/main/src/plumbline/core/taint.py): `src/plumbline/core/taint.py`
- [Derived facts](https://github.com/actaclad/plumbline/blob/main/src/plumbline/core/derive.py): `src/plumbline/core/derive.py`
- [Project evidence](https://github.com/actaclad/plumbline/blob/main/src/plumbline/core/evidence.py): `src/plumbline/core/evidence.py`

### Detection knowledge

- [Rule detectors](https://github.com/actaclad/plumbline/tree/main/src/plumbline/rules): `src/plumbline/rules`
- [Rule analysis helpers](https://github.com/actaclad/plumbline/blob/main/src/plumbline/rules/_taint_flow.py): `src/plumbline/rules/_taint_flow.py`
- [Optional fix enrichment](https://github.com/actaclad/plumbline/blob/main/src/plumbline/enrichment.py): `src/plumbline/enrichment.py`

### Results and prevention

- [Findings and gate](https://github.com/actaclad/plumbline/blob/main/src/plumbline/model.py): `src/plumbline/model.py`
- [Readiness scoring](https://github.com/actaclad/plumbline/blob/main/src/plumbline/scoring/readiness.py): `src/plumbline/scoring/readiness.py`
- [CLI and file reports](https://github.com/actaclad/plumbline/tree/main/src/plumbline/reporters): `src/plumbline/reporters`
- [Skill-pack export](https://github.com/actaclad/plumbline/blob/main/src/plumbline/skills/export.py): `src/plumbline/skills/export.py`

### Other components

- **Project maintainer**
- **Coding agent**

## Connections

- Project maintainer → CLI commands: runs scan (evidence: `README.md`)
- CLI commands → Scan engine: starts analysis (evidence: `README.md`)
- Scan engine → Scan configuration: reads settings (evidence: `src/plumbline/engine.py`)
- Scan engine → Finding baseline: applies baseline (evidence: `src/plumbline/engine.py`)
- Scan engine → AST and scopes: parses files (evidence: `src/plumbline/engine.py`)
- Scan engine → Framework adapters: collects semantics (evidence: `src/plumbline/engine.py`)
- Framework adapters → AST and scopes: reads source trees (evidence: `src/plumbline/adapters/base.py`)
- Framework adapters → Semantic model: emits annotations (evidence: `src/plumbline/adapters/base.py`)
- Scan engine → Taint analysis: analyzes flows (evidence: `src/plumbline/engine.py`)
- Taint analysis → Semantic model: reads annotations (evidence: `src/plumbline/core/taint.py`)
- Scan engine → Derived facts: derives facts (evidence: `src/plumbline/engine.py`)
- Scan engine → Project evidence: collects evidence (evidence: `src/plumbline/engine.py`)
- Scan engine → Rule detectors: runs detectors (evidence: `src/plumbline/engine.py`)
- Rule detectors → Rule analysis helpers: uses flow helpers (evidence: `src/plumbline/rules/out/plb_out_002.py`)
- Rule analysis helpers → Taint analysis: reads taint (evidence: `src/plumbline/rules/_taint_flow.py`)
- Scan engine → Findings and gate: finalizes findings (evidence: `src/plumbline/engine.py`)
- Scan engine → CLI and file reports: emits reports (evidence: `README.md`)
- Findings and gate → Readiness scoring: scores pillars (evidence: `src/plumbline/scoring/readiness.py`)
- Readiness scoring → CLI and file reports: renders score (evidence: `src/plumbline/reporters/html.py`)
- CLI commands → Skill-pack export: exports rules (evidence: `README.md`)
- Rule detectors → Skill-pack export: serializes rule knowledge (evidence: `src/plumbline/skills/export.py`)
- CLI commands → Optional fix enrichment: optionally enriches fixes (evidence: `README.md`)
- Skill-pack export → Coding agent: guides code generation (evidence: `README.md`)
