# adarsh-dev001/self-healing-demo architecture

> Architecture diagram of the GitHub repository adarsh-dev001/self-healing-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adarsh-dev001/self-healing-demo
- Repository: https://github.com/adarsh-dev001/self-healing-demo

## Overview

This repository describes a self-healing CI/CD product: a failed GitHub Actions run initiates Kestra recovery, followed by root-cause analysis, code repair, PR creation, and validation. The flow files and the calculator implementation are represented; the sampled source contains only the calculator, so internal calls within the recovery flows cannot be verified. Workflow relationships below rely on the README’s architecture description, not inspected flow contents.

Main entry points: [`kestra/flows/01-failure-intake-rca.yaml`](https://github.com/adarsh-dev001/self-healing-demo/blob/main/kestra/flows/01-failure-intake-rca.yaml) (Failure Intake and RCA), [`kestra/flows/02-cline-code-fixer.yaml`](https://github.com/adarsh-dev001/self-healing-demo/blob/main/kestra/flows/02-cline-code-fixer.yaml) (Code Fixer), [`kestra/flows/03-automated-pr-creator.yaml`](https://github.com/adarsh-dev001/self-healing-demo/blob/main/kestra/flows/03-automated-pr-creator.yaml) (PR Creator), [`kestra/flows/04-auto-merge-validator.yaml`](https://github.com/adarsh-dev001/self-healing-demo/blob/main/kestra/flows/04-auto-merge-validator.yaml) (Auto-Merge Validator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ci["Failure Detection"]
  node_github["GitHub Actions<br/>[ci.yml]"]
end

subgraph group_orchestration["Recovery Orchestration"]
  node_failure["Failure Intake and RCA"]
end

subgraph group_repair["Automated Repair"]
  node_fixer["Code Fixer"]
  node_pr["PR Creator"]
end

subgraph group_validation["Fix Validation"]
  node_validator["Auto-Merge Validator"]
end

node_gemini{{"Gemini Analysis"}}
node_coderabbit{{"CodeRabbit"}}
node_calculator["Calculator<br/>[calc.py]"]

node_github -->|"triggers recovery"| node_failure
node_failure -->|"analyzes failures"| node_gemini
node_failure -->|"passes RCA"| node_fixer
node_fixer -->|"creates fix"| node_pr
node_pr -->|"submits fix"| node_validator
node_validator -->|"reviews fix"| node_coderabbit

click node_github "https://github.com/adarsh-dev001/self-healing-demo/blob/main/.github/workflows/ci.yml"
click node_failure "https://github.com/adarsh-dev001/self-healing-demo/blob/main/kestra/flows/01-failure-intake-rca.yaml"
click node_fixer "https://github.com/adarsh-dev001/self-healing-demo/blob/main/kestra/flows/02-cline-code-fixer.yaml"
click node_pr "https://github.com/adarsh-dev001/self-healing-demo/blob/main/kestra/flows/03-automated-pr-creator.yaml"
click node_validator "https://github.com/adarsh-dev001/self-healing-demo/blob/main/kestra/flows/04-auto-merge-validator.yaml"
click node_calculator "https://github.com/adarsh-dev001/self-healing-demo/blob/main/src/calc.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_github toneBlue
class node_failure toneAmber
class node_fixer,node_pr toneMint
class node_validator toneRose
class node_gemini,node_coderabbit toneIndigo
class node_calculator toneTeal
```

## Components

### Failure Detection

- [GitHub Actions](https://github.com/adarsh-dev001/self-healing-demo/blob/main/.github/workflows/ci.yml): `.github/workflows/ci.yml`

### Recovery Orchestration

- [Failure Intake and RCA](https://github.com/adarsh-dev001/self-healing-demo/blob/main/kestra/flows/01-failure-intake-rca.yaml): `kestra/flows/01-failure-intake-rca.yaml`

### Automated Repair

- [Code Fixer](https://github.com/adarsh-dev001/self-healing-demo/blob/main/kestra/flows/02-cline-code-fixer.yaml): `kestra/flows/02-cline-code-fixer.yaml`
- [PR Creator](https://github.com/adarsh-dev001/self-healing-demo/blob/main/kestra/flows/03-automated-pr-creator.yaml): `kestra/flows/03-automated-pr-creator.yaml`

### Fix Validation

- [Auto-Merge Validator](https://github.com/adarsh-dev001/self-healing-demo/blob/main/kestra/flows/04-auto-merge-validator.yaml): `kestra/flows/04-auto-merge-validator.yaml`

### Other components

- **Gemini Analysis**
- **CodeRabbit**
- [Calculator](https://github.com/adarsh-dev001/self-healing-demo/blob/main/src/calc.py): `src/calc.py`

## Connections

- GitHub Actions → Failure Intake and RCA: triggers recovery (evidence: `README.md`)
- Failure Intake and RCA → Gemini Analysis: analyzes failures (evidence: `README.md`)
- Failure Intake and RCA → Code Fixer: passes RCA (evidence: `README.md`)
- Code Fixer → PR Creator: creates fix (evidence: `README.md`)
- PR Creator → Auto-Merge Validator: submits fix (evidence: `README.md`)
- Auto-Merge Validator → CodeRabbit: reviews fix (evidence: `README.md`)
