# richardpateau/network-automation-engine architecture

> Architecture diagram of the GitHub repository richardpateau/network-automation-engine, 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/richardpateau/network-automation-engine
- Repository: https://github.com/richardpateau/network-automation-engine

## Overview

This is a network automation and compliance engine: it obtains device inventory and desired configuration from NetBox, processes devices concurrently, collects live state over supported transports, checks drift, remediates it, validates changes, and reports results. The graph shows the documented end-to-end stages and the sampled control flow. Many feature modules are unsampled, so their internal calls and exact orchestration links are intentionally not asserted; the oddly spaced remediation paths are preserved as listed in the tree.

Main entry points: [`src/process/manager.py`](https://github.com/richardpateau/network-automation-engine/blob/main/src/process/manager.py) (Concurrent Processing), [`src/main.py`](https://github.com/richardpateau/network-automation-engine/blob/main/src/main.py) (Application Entry), [`src/pipeline/runner.py`](https://github.com/richardpateau/network-automation-engine/blob/main/src/pipeline/runner.py) (Pipeline Runner), [`src/compliance/switching/stp/compliance.py`](https://github.com/richardpateau/network-automation-engine/blob/main/src/compliance/switching/stp/compliance.py) (STP Compliance)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration"]
  node_entry["Application Entry<br/>[main.py]"]
  node_processor["Concurrent Processing<br/>[manager.py]"]
  node_pipeline["Pipeline Runner<br/>[runner.py]"]
  node_resolver["Feature Resolver<br/>[resolver.py]"]
end

subgraph group_sot["Desired State"]
  node_inventory["NetBox Inventory<br/>[inventory.py]"]
  node_netbox["NetBox API Client<br/>[client.py]"]
end

subgraph group_device["Device Automation"]
  node_session["Device Sessions<br/>[session_manager.py]"]
  node_cli["CLI Collection<br/>[builders.py]"]
  node_netconf["NETCONF Collection<br/>[builders.py]"]
  node_restconf["RESTCONF Collection<br/>[builders.py]"]
end

subgraph group_policy["Compliance and Remediation"]
  node_compliance["Compliance Checks"]
  node_stpcheck["STP Compliance<br/>[compliance.py]"]
  node_remediation["Configuration Remediation"]
  node_stpremediation["STP Remediation<br/>[stp.py]"]
  node_natremediation["NAT Remediation<br/>[nat.py]"]
  node_templateenv["Template Environment<br/>[template_env.py]"]
end

subgraph group_results["Reporting"]
  node_reporting["Compliance Reports"]
end

node_operator(("Operator"))
node_network(("Managed Devices"))
node_netboxservice[("NetBox")]

node_operator -->|"starts run"| node_entry
node_entry -.->|"loads desired state"| node_inventory
node_inventory -->|"requests API"| node_netbox
node_netbox -->|"queries inventory"| node_netboxservice
node_entry -->|"submits device tasks"| node_processor
node_processor -->|"opens session"| node_session
node_processor -->|"collects CLI state"| node_cli
node_processor -->|"collects NETCONF state"| node_netconf
node_processor -->|"collects RESTCONF state"| node_restconf
node_processor -->|"runs pipeline"| node_pipeline
node_pipeline -->|"uses resolver"| node_resolver
node_pipeline -.->|"evaluates features"| node_compliance
node_compliance -.->|"remediates drift"| node_remediation
node_stpcheck -->|"configures STP"| node_stpremediation
node_stpremediation -->|"renders templates"| node_templateenv
node_natremediation -->|"renders templates"| node_templateenv
node_stpcheck -->|"recollects state"| node_cli
node_processor -.->|"records device results"| node_reporting
node_entry -.->|"generates reports"| node_reporting
node_session -.->|"connects to devices"| node_network
node_remediation -.->|"changes configuration"| node_network

click node_entry "https://github.com/richardpateau/network-automation-engine/blob/main/src/main.py"
click node_processor "https://github.com/richardpateau/network-automation-engine/blob/main/src/process/manager.py"
click node_pipeline "https://github.com/richardpateau/network-automation-engine/blob/main/src/pipeline/runner.py"
click node_resolver "https://github.com/richardpateau/network-automation-engine/blob/main/src/pipeline/resolver.py"
click node_inventory "https://github.com/richardpateau/network-automation-engine/blob/main/src/sot/inventory.py"
click node_netbox "https://github.com/richardpateau/network-automation-engine/blob/main/src/sot/client.py"
click node_session "https://github.com/richardpateau/network-automation-engine/blob/main/src/transports/session_manager.py"
click node_cli "https://github.com/richardpateau/network-automation-engine/blob/main/src/collectors/cli/builders.py"
click node_netconf "https://github.com/richardpateau/network-automation-engine/blob/main/src/collectors/netconf/builders.py"
click node_restconf "https://github.com/richardpateau/network-automation-engine/blob/main/src/collectors/restconf/builders.py"
click node_compliance "https://github.com/richardpateau/network-automation-engine/tree/main/src/compliance"
click node_stpcheck "https://github.com/richardpateau/network-automation-engine/blob/main/src/compliance/switching/stp/compliance.py"
click node_remediation "https://github.com/richardpateau/network-automation-engine/tree/main/src/remediation"
click node_stpremediation "https://github.com/richardpateau/network-automation-engine/blob/main/src/remediation/switching%20/stp.py"
click node_natremediation "https://github.com/richardpateau/network-automation-engine/blob/main/src/remediation/routing/nat.py"
click node_templateenv "https://github.com/richardpateau/network-automation-engine/blob/main/src/remediation/template_env.py"
click node_reporting "https://github.com/richardpateau/network-automation-engine/tree/main/src/reporting"

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_entry,node_processor,node_pipeline,node_resolver toneBlue
class node_inventory,node_netbox,node_netboxservice toneAmber
class node_session,node_cli,node_netconf,node_restconf toneMint
class node_compliance,node_stpcheck,node_remediation,node_stpremediation,node_natremediation,node_templateenv toneRose
class node_reporting,node_operator,node_network toneIndigo
```

## Components

### Orchestration

- [Application Entry](https://github.com/richardpateau/network-automation-engine/blob/main/src/main.py): `src/main.py`
- [Concurrent Processing](https://github.com/richardpateau/network-automation-engine/blob/main/src/process/manager.py): `src/process/manager.py`
- [Pipeline Runner](https://github.com/richardpateau/network-automation-engine/blob/main/src/pipeline/runner.py): `src/pipeline/runner.py`
- [Feature Resolver](https://github.com/richardpateau/network-automation-engine/blob/main/src/pipeline/resolver.py): `src/pipeline/resolver.py`

### Desired State

- [NetBox Inventory](https://github.com/richardpateau/network-automation-engine/blob/main/src/sot/inventory.py): `src/sot/inventory.py`
- [NetBox API Client](https://github.com/richardpateau/network-automation-engine/blob/main/src/sot/client.py): `src/sot/client.py`

### Device Automation

- [Device Sessions](https://github.com/richardpateau/network-automation-engine/blob/main/src/transports/session_manager.py): `src/transports/session_manager.py`
- [CLI Collection](https://github.com/richardpateau/network-automation-engine/blob/main/src/collectors/cli/builders.py): `src/collectors/cli/builders.py`
- [NETCONF Collection](https://github.com/richardpateau/network-automation-engine/blob/main/src/collectors/netconf/builders.py): `src/collectors/netconf/builders.py`
- [RESTCONF Collection](https://github.com/richardpateau/network-automation-engine/blob/main/src/collectors/restconf/builders.py): `src/collectors/restconf/builders.py`

### Compliance and Remediation

- [Compliance Checks](https://github.com/richardpateau/network-automation-engine/tree/main/src/compliance): `src/compliance`
- [STP Compliance](https://github.com/richardpateau/network-automation-engine/blob/main/src/compliance/switching/stp/compliance.py): `src/compliance/switching/stp/compliance.py`
- [Configuration Remediation](https://github.com/richardpateau/network-automation-engine/tree/main/src/remediation): `src/remediation`
- [STP Remediation](https://github.com/richardpateau/network-automation-engine/blob/main/src/remediation/switching%20/stp.py): `src/remediation/switching /stp.py`
- [NAT Remediation](https://github.com/richardpateau/network-automation-engine/blob/main/src/remediation/routing/nat.py): `src/remediation/routing/nat.py`
- [Template Environment](https://github.com/richardpateau/network-automation-engine/blob/main/src/remediation/template_env.py): `src/remediation/template_env.py`

### Reporting

- [Compliance Reports](https://github.com/richardpateau/network-automation-engine/tree/main/src/reporting): `src/reporting`

### Other components

- **Operator**
- **Managed Devices**
- **NetBox**

## Connections

- Operator → Application Entry: starts run
- Application Entry → NetBox Inventory: loads desired state
- NetBox Inventory → NetBox API Client: requests API (evidence: `src/sot/inventory.py`)
- NetBox API Client → NetBox: queries inventory (evidence: `src/sot/client.py`)
- Application Entry → Concurrent Processing: submits device tasks (evidence: `src/main.py`)
- Concurrent Processing → Device Sessions: opens session (evidence: `src/process/manager.py`)
- Concurrent Processing → CLI Collection: collects CLI state (evidence: `src/process/manager.py`)
- Concurrent Processing → NETCONF Collection: collects NETCONF state (evidence: `src/process/manager.py`)
- Concurrent Processing → RESTCONF Collection: collects RESTCONF state (evidence: `src/process/manager.py`)
- Concurrent Processing → Pipeline Runner: runs pipeline (evidence: `src/process/manager.py`)
- Pipeline Runner → Feature Resolver: uses resolver (evidence: `src/pipeline/runner.py`)
- Pipeline Runner → Compliance Checks: evaluates features
- Compliance Checks → Configuration Remediation: remediates drift
- STP Compliance → STP Remediation: configures STP (evidence: `src/compliance/switching/stp/compliance.py`)
- STP Remediation → Template Environment: renders templates (evidence: `src/remediation/switching /stp.py`)
- NAT Remediation → Template Environment: renders templates (evidence: `src/remediation/routing/nat.py`)
- STP Compliance → CLI Collection: recollects state (evidence: `src/compliance/switching/stp/compliance.py`)
- Concurrent Processing → Compliance Reports: records device results
- Application Entry → Compliance Reports: generates reports
- Device Sessions → Managed Devices: connects to devices
- Configuration Remediation → Managed Devices: changes configuration
