# diablogithubx/devops-ai-triage-toolkit architecture

> Architecture diagram of the GitHub repository diablogithubx/devops-ai-triage-toolkit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/diablogithubx/devops-ai-triage-toolkit
- Repository: https://github.com/diablogithubx/devops-ai-triage-toolkit

## Overview

The toolkit investigates Kubernetes workload and CI failures through a CLI-driven, read-only agent: it gathers evidence via MCP tools, consults an LLM, and returns a diagnosis with execution traces. Distinct branches provide Kubernetes inspection, CI-log analysis, and evaluation of investigation outcomes. The README documents the skill-guided workflow and controlled failure environment. Some source excerpts are partial; uncertain internal links are omitted rather than inferred.

Main entry points: [`agent/agent_loop.py`](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/agent_loop.py) (Investigation loop), [`mcp-server/server.py`](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/mcp-server/server.py) (MCP server), [`agent/cli.py`](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/cli.py) (Agent CLI), [`agent/mcp_client.py`](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/mcp_client.py) (MCP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Diagnostic agent"]
  node_cli["Agent CLI<br/>[cli.py]"]
  node_settings["Agent settings<br/>[config.py]"]
  node_skill["Triage skill<br/>[SKILL.md]"]
  node_agentloop["Investigation loop<br/>[agent_loop.py]"]
  node_llmclient["LLM client<br/>[llm_client.py]"]
  node_mcpclient["MCP client<br/>[mcp_client.py]"]
  node_mcpprocess["MCP process config<br/>[mcp_process.py]"]
  node_trace["Execution traces<br/>[trace.py]"]
end

subgraph group_mcp["MCP diagnostics"]
  node_server["MCP server<br/>[server.py]"]
  node_safety["Input and response safety<br/>[safety.py]"]
  node_kubetools["Kubernetes tools"]
  node_citools["CI log tools<br/>[ci_tools.py]"]
  node_extract["Failure extraction<br/>[ci_extraction.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_evalrunner["Evaluation runner<br/>[runner.py]"]
  node_evaluator["Outcome evaluator<br/>[evaluator.py]"]
  node_report["Evaluation reports<br/>[report.py]"]
end

subgraph group_environment["Failure environment"]
  node_workloads["Failure workloads"]
end

node_operator(("Operator"))
node_provider{{"LLM provider"}}
node_kubeapi{{"Kubernetes API"}}
node_cilogs["CI log fixtures"]

node_operator -->|"starts investigation"| node_cli
node_cli -->|"loads settings"| node_settings
node_cli -->|"runs"| node_agentloop
node_agentloop -->|"uses runbook"| node_skill
node_agentloop -->|"requests completion"| node_llmclient
node_llmclient -->|"sends requests"| node_provider
node_agentloop -->|"dispatches tools"| node_mcpclient
node_mcpclient -->|"builds server parameters"| node_mcpprocess
node_mcpclient -->|"calls over stdio"| node_server
node_agentloop -->|"emits events"| node_trace
node_server -->|"routes diagnostics"| node_kubetools
node_server -->|"routes diagnostics"| node_citools
node_server -->|"applies controls"| node_safety
node_kubetools -->|"reads cluster state"| node_kubeapi
node_citools -->|"extracts evidence"| node_extract
node_citools -->|"reads logs"| node_cilogs
node_workloads -->|"deployed to"| node_kubeapi
node_evalrunner -->|"executes cases"| node_cli
node_evalrunner -->|"scores outcomes"| node_evaluator
node_report -->|"formats run results"| node_evalrunner

click node_cli "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/cli.py"
click node_settings "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/config.py"
click node_skill "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/skills/k8s-triage/SKILL.md"
click node_agentloop "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/agent_loop.py"
click node_llmclient "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/llm_client.py"
click node_mcpclient "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/mcp_client.py"
click node_mcpprocess "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/common/mcp_process.py"
click node_trace "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/trace.py"
click node_server "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/mcp-server/server.py"
click node_safety "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/mcp-server/safety.py"
click node_kubetools "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/mcp-server/kubernetes_tools.py"
click node_citools "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/mcp-server/ci_tools.py"
click node_extract "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/common/ci_extraction.py"
click node_cilogs "https://github.com/diablogithubx/devops-ai-triage-toolkit/tree/main/fixtures/ci"
click node_evalrunner "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/eval/runner.py"
click node_evaluator "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/eval/evaluator.py"
click node_report "https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/eval/report.py"
click node_workloads "https://github.com/diablogithubx/devops-ai-triage-toolkit/tree/main/env/workloads"

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_settings,node_skill,node_agentloop,node_llmclient,node_mcpclient,node_mcpprocess,node_trace toneBlue
class node_server,node_safety,node_kubetools,node_citools,node_extract toneAmber
class node_evalrunner,node_evaluator,node_report,node_kubeapi toneMint
class node_workloads toneRose
class node_operator,node_provider toneIndigo
class node_cilogs toneTeal
```

## Components

### Diagnostic agent

- [Agent CLI](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/cli.py): `agent/cli.py`
- [Agent settings](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/config.py): `agent/config.py`
- [Triage skill](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/skills/k8s-triage/SKILL.md): `skills/k8s-triage/SKILL.md`
- [Investigation loop](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/agent_loop.py): `agent/agent_loop.py`
- [LLM client](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/llm_client.py): `agent/llm_client.py`
- [MCP client](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/mcp_client.py): `agent/mcp_client.py`
- [MCP process config](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/common/mcp_process.py): `common/mcp_process.py`
- [Execution traces](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/trace.py): `agent/trace.py`

### MCP diagnostics

- [MCP server](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/mcp-server/server.py): `mcp-server/server.py`
- [Input and response safety](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/mcp-server/safety.py): `mcp-server/safety.py`
- [Kubernetes tools](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/mcp-server/kubernetes_tools.py): `mcp-server/kubernetes_tools.py`
- [CI log tools](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/mcp-server/ci_tools.py): `mcp-server/ci_tools.py`
- [Failure extraction](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/common/ci_extraction.py): `common/ci_extraction.py`

### Evaluation

- [Evaluation runner](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/eval/runner.py): `agent/eval/runner.py`
- [Outcome evaluator](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/eval/evaluator.py): `agent/eval/evaluator.py`
- [Evaluation reports](https://github.com/diablogithubx/devops-ai-triage-toolkit/blob/main/agent/eval/report.py): `agent/eval/report.py`

### Failure environment

- [Failure workloads](https://github.com/diablogithubx/devops-ai-triage-toolkit/tree/main/env/workloads): `env/workloads`

### Other components

- **Operator**
- **LLM provider**
- **Kubernetes API**
- [CI log fixtures](https://github.com/diablogithubx/devops-ai-triage-toolkit/tree/main/fixtures/ci): `fixtures/ci`

## Connections

- Operator → Agent CLI: starts investigation (evidence: `README.md`)
- Agent CLI → Agent settings: loads settings (evidence: `agent/cli.py`)
- Agent CLI → Investigation loop: runs (evidence: `agent/cli.py`)
- Investigation loop → Triage skill: uses runbook (evidence: `README.md`)
- Investigation loop → LLM client: requests completion (evidence: `agent/agent_loop.py`)
- LLM client → LLM provider: sends requests (evidence: `agent/llm_client.py`)
- Investigation loop → MCP client: dispatches tools (evidence: `agent/agent_loop.py`)
- MCP client → MCP process config: builds server parameters (evidence: `agent/mcp_client.py`)
- MCP client → MCP server: calls over stdio (evidence: `README.md`)
- Investigation loop → Execution traces: emits events (evidence: `agent/agent_loop.py`)
- MCP server → Kubernetes tools: routes diagnostics (evidence: `mcp-server/server.py`)
- MCP server → CI log tools: routes diagnostics (evidence: `mcp-server/server.py`)
- MCP server → Input and response safety: applies controls (evidence: `mcp-server/server.py`)
- Kubernetes tools → Kubernetes API: reads cluster state (evidence: `mcp-server/kubernetes_tools.py`)
- CI log tools → Failure extraction: extracts evidence (evidence: `mcp-server/ci_tools.py`)
- CI log tools → CI log fixtures: reads logs (evidence: `README.md`)
- Failure workloads → Kubernetes API: deployed to (evidence: `README.md`)
- Evaluation runner → Agent CLI: executes cases (evidence: `README.md`)
- Evaluation runner → Outcome evaluator: scores outcomes (evidence: `agent/eval/runner.py`)
- Evaluation reports → Evaluation runner: formats run results (evidence: `agent/eval/report.py`)
