soigne-ci 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +141 -0
- package/git_heal_be/README.md +242 -0
- package/git_heal_fe/README.md +242 -0
- package/package.json +18 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Priyansh Nihalani
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Soigné (`soigne-ci`) 🩺✨
|
|
2
|
+
|
|
3
|
+
> **Self-Hosted Autonomous CI/CD Self-Healing Appliance for GitHub Actions**
|
|
4
|
+
> 🌐 **Homepage:** [https://soigne-dev.github.io/home/](https://soigne-dev.github.io/home/)
|
|
5
|
+
|
|
6
|
+
Soigné sits alongside GitHub Actions at your organization or repository level. When a CI build fails, Soigné intercepts the webhook, isolates the failing files and stack trace, synthesizes a surgical patch using **Google Gemini (BYOK)**, verifies the fix inside a network-isolated **Docker sandbox**, and opens a **verified Draft Pull Request**—without your source code ever leaving your own infrastructure.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## ✨ Key Features
|
|
11
|
+
|
|
12
|
+
* **Org-Wide, Zero Per-Repo YAML:** Install once at the GitHub Organization level—no need to maintain CI-healing scripts in every repository.
|
|
13
|
+
* **Google Gemini BYOK + Auto-Failover:** Bring your own Google AI Studio key (encrypted at rest with **AES-256-GCM** in PostgreSQL). Includes live model discovery (`GET /v1beta/models`), automatic failover on `429` / `503` / `404` errors, and `usage_metadata` token analytics.
|
|
14
|
+
* **Isolated Docker Sandboxes:** Candidate patches are verified inside `--network none`, `512m` memory-capped Docker containers with up to 3 compiler-feedback retries before raising a PR.
|
|
15
|
+
* **Safety Guardrails:**
|
|
16
|
+
* **Loop Prevention Guard:** Ignores runs on `soigne/fix-*` branches or bot commits so repairs never recurse.
|
|
17
|
+
* **Staleness Gatekeeper:** Compares the failing commit SHA against remote branch `HEAD` and aborts superseded runs before spending tokens.
|
|
18
|
+
* **Draft PRs Only:** Never pushes directly to `main` or protected branches.
|
|
19
|
+
* **Live SSE Terminal & Dashboard:** Real-time Server-Sent Events stream every file read, edit, compiler check, and unified diff to the React dashboard.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 📋 Prerequisites
|
|
24
|
+
|
|
25
|
+
Before running `soigne-ci`, make sure you have:
|
|
26
|
+
|
|
27
|
+
1. **Node.js 20+**
|
|
28
|
+
2. **PostgreSQL 16+** (running locally or accessible via `DATABASE_URL`)
|
|
29
|
+
3. **Docker** (running, used for `--network none` patch verification sandboxes)
|
|
30
|
+
4. **A GitHub App** (with `Workflow runs` webhook & Pull Request permissions)
|
|
31
|
+
5. **A Google Gemini API Key** (added and encrypted inside the Settings UI after launch)
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🚀 Quickstart via npm
|
|
36
|
+
|
|
37
|
+
### Step 1: Initialize Configuration
|
|
38
|
+
In any directory where you want to store your Soigné config, run:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx soigne-ci init
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This creates a starter `soigne.config.json` in your current folder with an auto-generated `encryptionKey`:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"uiPort": 5173,
|
|
49
|
+
"apiPort": 3001,
|
|
50
|
+
"apiUrl": "http://localhost:3001/api",
|
|
51
|
+
"databaseUrl": "postgresql://postgres:postgres@localhost:5432/soigne_db?schema=public",
|
|
52
|
+
"encryptionKey": "<auto-generated-64-char-hex-key>",
|
|
53
|
+
"githubAppId": "",
|
|
54
|
+
"githubPrivateKey": "",
|
|
55
|
+
"githubWebhookSecret": ""
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Edit `databaseUrl` and your GitHub App credentials in `soigne.config.json`.
|
|
60
|
+
|
|
61
|
+
### Step 2: Start Soigné
|
|
62
|
+
```bash
|
|
63
|
+
npx soigne-ci
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
On the first run, Soigné automatically:
|
|
67
|
+
1. Installs backend (`git_heal_be`) and frontend (`git_heal_fe`) dependencies separately.
|
|
68
|
+
2. Runs `prisma generate` and `prisma db push` against your PostgreSQL database.
|
|
69
|
+
3. Starts the backend API on `apiPort` (`3001`) and the frontend dashboard on `uiPort` (`5173`).
|
|
70
|
+
|
|
71
|
+
Open **`http://localhost:5173`**, go to **Settings**, and add your **Google Gemini API Key** (it will be encrypted with AES-256-GCM before storage).
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 🛠️ CLI Commands & Options
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
Usage:
|
|
79
|
+
soigne [command] [options]
|
|
80
|
+
|
|
81
|
+
Commands:
|
|
82
|
+
init Create a starter soigne.config.json in the current folder
|
|
83
|
+
(default) Start Soigné backend and frontend
|
|
84
|
+
|
|
85
|
+
Options:
|
|
86
|
+
--config <path> Path to a custom soigne.config.json
|
|
87
|
+
--ui-port <port> Frontend port (default: 5173)
|
|
88
|
+
--api-port <port> Backend API port (default: 3001)
|
|
89
|
+
--api-url <url> API URL passed to frontend (default: http://localhost:<apiPort>/api)
|
|
90
|
+
--db <url> PostgreSQL connection string
|
|
91
|
+
--skip-db Skip prisma generate & db push on startup
|
|
92
|
+
--force Overwrite existing soigne.config.json when running init
|
|
93
|
+
-h, --help Show this help message
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Examples
|
|
97
|
+
|
|
98
|
+
Use custom ports:
|
|
99
|
+
```bash
|
|
100
|
+
npx soigne-ci --ui-port 8080 --api-port 4000
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Run behind a production reverse proxy domain:
|
|
104
|
+
```bash
|
|
105
|
+
npx soigne-ci --ui-port 5173 --api-port 3001 --api-url https://soigne.company.com/api
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Use a specific config file and skip DB sync on restart:
|
|
109
|
+
```bash
|
|
110
|
+
npx soigne-ci --config ./prod.config.json --skip-db
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 🌐 Supported Languages & Verification
|
|
116
|
+
|
|
117
|
+
Soigné automatically runs static syntax checks by default, and supports per-repository `testCommand` overrides in the dashboard:
|
|
118
|
+
|
|
119
|
+
| Language / Stack | Extensions | Default Sandbox Check | Recommended `testCommand` |
|
|
120
|
+
| :--- | :--- | :--- | :--- |
|
|
121
|
+
| **JavaScript / TypeScript** | `.js`, `.jsx`, `.ts`, `.tsx`, `.mjs` | `node --check` | `npm test -- --bail` |
|
|
122
|
+
| **Python** | `.py` | `python -m py_compile` | `pytest -x` |
|
|
123
|
+
| **Go** | `.go` | `go vet` | `go test ./... -failfast` |
|
|
124
|
+
| **Rust** | `.rs` | `cargo check` | `cargo test` |
|
|
125
|
+
| **Java** | `.java` | `javac` | `mvn test` |
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## 🔗 Connecting GitHub Webhooks
|
|
130
|
+
|
|
131
|
+
* **Production (behind your domain):** Set your GitHub App / repo webhook URL to `https://your-domain.com/api/webhooks/github` (`application/json`, event: **Workflow runs**).
|
|
132
|
+
* **Local testing:** Forward GitHub webhooks to your local backend with [Smee.io](https://smee.io/):
|
|
133
|
+
```bash
|
|
134
|
+
npx smee-client --url https://smee.io/YOUR_CHANNEL --target http://localhost:3001/api/webhooks/github
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 📄 License
|
|
140
|
+
|
|
141
|
+
MIT License — see [LICENSE](./LICENSE) for details.
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Soigné 🩺✨
|
|
2
|
+
|
|
3
|
+
> **The Autonomous Self-Healing CI/CD Engine for GitHub**
|
|
4
|
+
> When your GitHub Actions pipeline fails, Soigné intercepts the build, isolates the regression, synthesizes a surgical fix with Google Gemini BYOK, verifies the patch inside an isolated sandbox, and delivers a verified Pull Request—in under 45 seconds.
|
|
5
|
+
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
[](https://nodejs.org/)
|
|
8
|
+
[](https://react.dev/)
|
|
9
|
+
[](https://www.postgresql.org/)
|
|
10
|
+
[](https://www.prisma.io/)
|
|
11
|
+
[](https://www.docker.com/)
|
|
12
|
+
[](https://ai.google.dev/)
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 📖 The Story of Soigné
|
|
18
|
+
|
|
19
|
+
In French, **soigné** describes something crafted with meticulous attention to detail, elegance, and thoroughness.
|
|
20
|
+
|
|
21
|
+
In modern software development, Continuous Integration was meant to give teams velocity and confidence. Instead, developers spend hours every week dealing with **CI fatigue**:
|
|
22
|
+
* A missing bracket or dangling semicolon breaks a 15-minute test run.
|
|
23
|
+
* A subtle type mismatch prevents a pull request from merging late in the sprint.
|
|
24
|
+
* Developers context-switch away from high-leverage feature work just to wade through thousands of lines of raw terminal logs.
|
|
25
|
+
|
|
26
|
+
We asked a simple question:
|
|
27
|
+
**What if your CI pipeline didn't just notify you when a build broke, but actively diagnosed the failure, tested a surgical fix in isolation, and prepared the solution for you?**
|
|
28
|
+
|
|
29
|
+
That is **Soigné**. It acts as an autonomous on-call engineer sitting between GitHub Actions and your repository: always vigilant, never guessing, and never submitting code that hasn't passed local compiler and test validation first.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 🛑 The Problem Soigné Solves
|
|
34
|
+
|
|
35
|
+
Traditional CI/CD systems are entirely **passive**:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Developer pushes code ➔ GitHub Actions runs ➔ Build fails (❌) ➔ Developer context-switches
|
|
39
|
+
➔ Digs through 2,000 lines of logs ➔ Finds typo on line 42 ➔ Fixes manually ➔ Pushes again
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This passive feedback loop leads to:
|
|
43
|
+
1. **Wasted Engineering Hours:** Engineers spending 20–30% of their time babysitting broken builds.
|
|
44
|
+
2. **Context Switching Costs:** Losing flow state to fix trivial syntax, import, or assertion errors.
|
|
45
|
+
3. **Flaky & Blind AI Commits:** Existing "AI fix" tools often push unverified code straight to branches, causing secondary pipeline breaks.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 💡 The Solution: How Soigné Works
|
|
50
|
+
|
|
51
|
+
Soigné introduces a closed-loop, deterministic healing pipeline that takes a broken workflow run and delivers a verified fix in under 45 seconds:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
[ GitHub Actions Build Fails ]
|
|
55
|
+
│
|
|
56
|
+
▼ (Webhook)
|
|
57
|
+
[ 1. Guardrails & Staleness ]
|
|
58
|
+
├── Stale commit? ──► Skip (0 tokens wasted)
|
|
59
|
+
└── Self-branch? ──► Stop (No recursive loops)
|
|
60
|
+
│
|
|
61
|
+
▼
|
|
62
|
+
[ 2. Matrix Log Scraper ]
|
|
63
|
+
└── Extracts failure type, target file, & stack trace
|
|
64
|
+
│
|
|
65
|
+
▼
|
|
66
|
+
[ 3. Ephemeral Workspace ]
|
|
67
|
+
└── Clones clean repository commit into isolation
|
|
68
|
+
│
|
|
69
|
+
▼
|
|
70
|
+
[ 4. Gemini BYOK Agent ]
|
|
71
|
+
└── Surgical patch generation (reads & edits code)
|
|
72
|
+
└── Dynamic failover on 429 / 503 / 404
|
|
73
|
+
│
|
|
74
|
+
▼
|
|
75
|
+
[ 5. Sandbox Verification ]
|
|
76
|
+
└── Runs `testCommand` / language compiler
|
|
77
|
+
├── Fails? ──► Feed compiler error back (Up to 3 retries)
|
|
78
|
+
└── Passes!
|
|
79
|
+
│
|
|
80
|
+
▼
|
|
81
|
+
[ 6. Autonomous Delivery ]
|
|
82
|
+
└── Opens GitHub Pull Request (or Draft PR)
|
|
83
|
+
│
|
|
84
|
+
▼
|
|
85
|
+
[ 7. Live SSE Stream ]
|
|
86
|
+
└── Real-time terminal log displayed on dashboard
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 🌐 Supported Tech Stacks & Languages
|
|
92
|
+
|
|
93
|
+
Soigné is built to be language-agnostic. Out of the box, it inspects your repository, extracts failure diagnostics from test runners, and verifies patches before pushing code.
|
|
94
|
+
|
|
95
|
+
### Supported Language Matrix
|
|
96
|
+
|
|
97
|
+
| Language / Stack | File Extensions | Default Sandbox Verification | Recommended `testCommand` Override | Popular Frameworks Supported |
|
|
98
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
99
|
+
| **JavaScript / TypeScript** | `.js`, `.jsx`, `.ts`, `.tsx`, `.mjs` | `node --check`, AST integrity | `npm test -- --bail` or `pnpm test` | Vitest, Jest, Mocha, Bun, Node Test Runner |
|
|
100
|
+
| **Python** | `.py` | `python -m py_compile "<file>"` | `pytest -x` or `python -m unittest` | Pytest, Unittest, Poetry, Pipenv, Flake8 |
|
|
101
|
+
| **Java** | `.java` | `javac "<file>"` | `mvn test -DfailIfNoTests=false` | JUnit 5, TestNG, Maven, Gradle |
|
|
102
|
+
| **Go** | `.go` | `go vet "<file>"` | `go test ./... -v -failfast` | Go Test, Ginkgo, Testify |
|
|
103
|
+
| **Rust** | `.rs` | `cargo check` | `cargo test` | Cargo Test, Tokio, Rust standard tests |
|
|
104
|
+
|
|
105
|
+
### How the Sandbox Test Command Override Works
|
|
106
|
+
Under **Repo Settings $\rightarrow$ Sandbox Test Command Override**, developers can define the exact command executed inside the isolated workspace container:
|
|
107
|
+
* Enter `npm test -- --bail` for fast-failing Node.js projects.
|
|
108
|
+
* Enter `pytest -x` for Python projects to stop immediately upon first error.
|
|
109
|
+
* Enter `go test ./...` for Go modules.
|
|
110
|
+
|
|
111
|
+
If the command exits with code `0`, Soigné considers the repair verified and raises the Pull Request.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 🧠 Google Gemini BYOK (Bring Your Own Key)
|
|
116
|
+
|
|
117
|
+
Soigné relies on **Google Gemini** for high-speed, deep-reasoning code repair:
|
|
118
|
+
|
|
119
|
+
### 1. Zero Vendor Lock-in (BYOK)
|
|
120
|
+
You bring your own Google AI Studio API key. Your key is encrypted with **AES-256-GCM** before being stored in your local PostgreSQL database.
|
|
121
|
+
|
|
122
|
+
### 2. Live Model Discovery
|
|
123
|
+
Soigné dynamically queries `GET /v1beta/models` using your key to discover which models are active and available in your tier (e.g. `gemini-2.5-flash`, `gemini-2.5-pro`, `gemini-1.5-flash`).
|
|
124
|
+
|
|
125
|
+
### 3. Automatic Zero-Downtime Failover
|
|
126
|
+
If Google returns:
|
|
127
|
+
* `429 (Resource Exhausted / Rate Quota)`
|
|
128
|
+
* `503 (Model Overloaded)`
|
|
129
|
+
* `404 (Model Not Found / Deprecated)`
|
|
130
|
+
|
|
131
|
+
Soigné dynamically fails over to the next best available model in real time without failing the run.
|
|
132
|
+
|
|
133
|
+
### 4. Transparent Token Tracking
|
|
134
|
+
Token counts are extracted directly from API response metadata (`usage_metadata`) and recorded in PostgreSQL. You can view your exact prompt, candidate, and total token usage in the **Token Analytics** dashboard.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 🚀 How to Use Soigné (Developer Walkthrough)
|
|
139
|
+
|
|
140
|
+
### Step 1: Clone and Install Dependencies
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
git clone https://github.com/priyanshnihalani/soigne.git
|
|
144
|
+
cd soigne
|
|
145
|
+
|
|
146
|
+
# Install backend dependencies
|
|
147
|
+
cd git_heal_be
|
|
148
|
+
npm install
|
|
149
|
+
|
|
150
|
+
# Install frontend dependencies
|
|
151
|
+
cd ../git_heal_fe
|
|
152
|
+
npm install
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Step 2: Configure Environment Variables
|
|
156
|
+
|
|
157
|
+
Create `.env` in `git_heal_be`:
|
|
158
|
+
```env
|
|
159
|
+
PORT=3001
|
|
160
|
+
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/soigne_db?schema=public"
|
|
161
|
+
ENCRYPTION_KEY="0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
|
|
162
|
+
GITHUB_APP_ID="your-github-app-id"
|
|
163
|
+
GITHUB_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n..."
|
|
164
|
+
GITHUB_WEBHOOK_SECRET="your-webhook-secret"
|
|
165
|
+
GEMINI_API_KEY="AIzaSy..."
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Create `.env` in `git_heal_fe`:
|
|
169
|
+
```env
|
|
170
|
+
VITE_API_BASE_URL="http://localhost:3001/api"
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Step 3: Run Database Migrations
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
cd git_heal_be
|
|
177
|
+
npx prisma db push
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Step 4: Start the Platform
|
|
181
|
+
|
|
182
|
+
In terminal 1 (Backend):
|
|
183
|
+
```bash
|
|
184
|
+
cd git_heal_be
|
|
185
|
+
npm run dev
|
|
186
|
+
# Server running at http://localhost:3001
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
In terminal 2 (Frontend):
|
|
190
|
+
```bash
|
|
191
|
+
cd git_heal_fe
|
|
192
|
+
npm run dev
|
|
193
|
+
# Dashboard running at http://localhost:5173
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Step 5: Connect GitHub Webhooks
|
|
197
|
+
|
|
198
|
+
To forward GitHub Actions failure events to your local instance, use a webhook forwarder such as [Smee.io](https://smee.io/):
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
npx smee-client --url https://smee.io/YOUR_SMEE_CHANNEL --target http://localhost:3001/api/webhooks/github
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
In your GitHub repository:
|
|
205
|
+
1. Navigate to **Settings $\rightarrow$ Webhooks $\rightarrow$ Add webhook**.
|
|
206
|
+
2. **Payload URL:** Your Smee channel URL.
|
|
207
|
+
3. **Content type:** `application/json`.
|
|
208
|
+
4. **Events:** Check **Workflow runs** (`workflow_run`).
|
|
209
|
+
|
|
210
|
+
### Step 6: Experience Autonomous Self-Healing
|
|
211
|
+
|
|
212
|
+
1. Make a typo or break a test assertion on your repository branch and push to GitHub.
|
|
213
|
+
2. GitHub Actions runs and fails.
|
|
214
|
+
3. Open `http://localhost:5173`:
|
|
215
|
+
- Watch the **Live Streaming Terminal** output the log scrape, reasoning phase, and sandbox verification.
|
|
216
|
+
- Within seconds, Soigné opens a verified Pull Request on GitHub with the exact diff and diagnostic explanation.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## 🖥️ Live Streaming Terminal & Dashboard
|
|
221
|
+
|
|
222
|
+
The frontend dashboard provides full transparency into the autonomous agent:
|
|
223
|
+
* **Live Terminal Stream:** Color-coded Server-Sent Events (SSE) streaming every file read, edit, compiler output, and git operation live.
|
|
224
|
+
* **Root Cause Tab:** Displays extracted error lines with code highlights and actionable recommendations.
|
|
225
|
+
* **Proposed Patch Tab:** Unified color-coded git diff (`+` additions, `-` deletions).
|
|
226
|
+
* **Sandbox Results Tab:** Execution times, compiler status, and verified test suites.
|
|
227
|
+
* **Agent Reasoning Tab:** Step-by-step breakdown of agent hypotheses and repair decisions.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 🛡️ Guardrails & Safety Architecture
|
|
232
|
+
|
|
233
|
+
* **Loop Prevention Guard:** Rejects any runs triggered on branches prefixed with `soigne/fix-*` or authored by bots, preventing infinite CI loops.
|
|
234
|
+
* **Staleness Gatekeeper:** Inspects the current branch `HEAD` SHA. If the commit is superseded by a newer push, healing is safely aborted to save tokens and prevent merge conflicts.
|
|
235
|
+
* **Isolated Ephemeral Workspaces:** All patch experiments are conducted in isolated directories (`.workspaces/${runId}`) and cleaned up immediately after verification.
|
|
236
|
+
* **Protected Branch Security:** Soigné never pushes directly to protected branches; fixes are exclusively delivered as Pull Requests.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## 📄 License
|
|
241
|
+
|
|
242
|
+
This project is open-source software licensed under the MIT License. See [LICENSE](LICENSE) for terms.
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Soigné 🩺✨
|
|
2
|
+
|
|
3
|
+
> **The Autonomous Self-Healing CI/CD Engine for GitHub**
|
|
4
|
+
> When your GitHub Actions pipeline fails, Soigné intercepts the build, isolates the regression, synthesizes a surgical fix with Google Gemini BYOK, verifies the patch inside an isolated sandbox, and delivers a verified Pull Request—in under 45 seconds.
|
|
5
|
+
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
[](https://nodejs.org/)
|
|
8
|
+
[](https://react.dev/)
|
|
9
|
+
[](https://www.postgresql.org/)
|
|
10
|
+
[](https://www.prisma.io/)
|
|
11
|
+
[](https://www.docker.com/)
|
|
12
|
+
[](https://ai.google.dev/)
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 📖 The Story of Soigné
|
|
18
|
+
|
|
19
|
+
In French, **soigné** describes something crafted with meticulous attention to detail, elegance, and thoroughness.
|
|
20
|
+
|
|
21
|
+
In modern software development, Continuous Integration was meant to give teams velocity and confidence. Instead, developers spend hours every week dealing with **CI fatigue**:
|
|
22
|
+
* A missing bracket or dangling semicolon breaks a 15-minute test run.
|
|
23
|
+
* A subtle type mismatch prevents a pull request from merging late in the sprint.
|
|
24
|
+
* Developers context-switch away from high-leverage feature work just to wade through thousands of lines of raw terminal logs.
|
|
25
|
+
|
|
26
|
+
We asked a simple question:
|
|
27
|
+
**What if your CI pipeline didn't just notify you when a build broke, but actively diagnosed the failure, tested a surgical fix in isolation, and prepared the solution for you?**
|
|
28
|
+
|
|
29
|
+
That is **Soigné**. It acts as an autonomous on-call engineer sitting between GitHub Actions and your repository: always vigilant, never guessing, and never submitting code that hasn't passed local compiler and test validation first.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 🛑 The Problem Soigné Solves
|
|
34
|
+
|
|
35
|
+
Traditional CI/CD systems are entirely **passive**:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Developer pushes code ➔ GitHub Actions runs ➔ Build fails (❌) ➔ Developer context-switches
|
|
39
|
+
➔ Digs through 2,000 lines of logs ➔ Finds typo on line 42 ➔ Fixes manually ➔ Pushes again
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This passive feedback loop leads to:
|
|
43
|
+
1. **Wasted Engineering Hours:** Engineers spending 20–30% of their time babysitting broken builds.
|
|
44
|
+
2. **Context Switching Costs:** Losing flow state to fix trivial syntax, import, or assertion errors.
|
|
45
|
+
3. **Flaky & Blind AI Commits:** Existing "AI fix" tools often push unverified code straight to branches, causing secondary pipeline breaks.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 💡 The Solution: How Soigné Works
|
|
50
|
+
|
|
51
|
+
Soigné introduces a closed-loop, deterministic healing pipeline that takes a broken workflow run and delivers a verified fix in under 45 seconds:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
[ GitHub Actions Build Fails ]
|
|
55
|
+
│
|
|
56
|
+
▼ (Webhook)
|
|
57
|
+
[ 1. Guardrails & Staleness ]
|
|
58
|
+
├── Stale commit? ──► Skip (0 tokens wasted)
|
|
59
|
+
└── Self-branch? ──► Stop (No recursive loops)
|
|
60
|
+
│
|
|
61
|
+
▼
|
|
62
|
+
[ 2. Matrix Log Scraper ]
|
|
63
|
+
└── Extracts failure type, target file, & stack trace
|
|
64
|
+
│
|
|
65
|
+
▼
|
|
66
|
+
[ 3. Ephemeral Workspace ]
|
|
67
|
+
└── Clones clean repository commit into isolation
|
|
68
|
+
│
|
|
69
|
+
▼
|
|
70
|
+
[ 4. Gemini BYOK Agent ]
|
|
71
|
+
└── Surgical patch generation (reads & edits code)
|
|
72
|
+
└── Dynamic failover on 429 / 503 / 404
|
|
73
|
+
│
|
|
74
|
+
▼
|
|
75
|
+
[ 5. Sandbox Verification ]
|
|
76
|
+
└── Runs `testCommand` / language compiler
|
|
77
|
+
├── Fails? ──► Feed compiler error back (Up to 3 retries)
|
|
78
|
+
└── Passes!
|
|
79
|
+
│
|
|
80
|
+
▼
|
|
81
|
+
[ 6. Autonomous Delivery ]
|
|
82
|
+
└── Opens GitHub Pull Request (or Draft PR)
|
|
83
|
+
│
|
|
84
|
+
▼
|
|
85
|
+
[ 7. Live SSE Stream ]
|
|
86
|
+
└── Real-time terminal log displayed on dashboard
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 🌐 Supported Tech Stacks & Languages
|
|
92
|
+
|
|
93
|
+
Soigné is built to be language-agnostic. Out of the box, it inspects your repository, extracts failure diagnostics from test runners, and verifies patches before pushing code.
|
|
94
|
+
|
|
95
|
+
### Supported Language Matrix
|
|
96
|
+
|
|
97
|
+
| Language / Stack | File Extensions | Default Sandbox Verification | Recommended `testCommand` Override | Popular Frameworks Supported |
|
|
98
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
99
|
+
| **JavaScript / TypeScript** | `.js`, `.jsx`, `.ts`, `.tsx`, `.mjs` | `node --check`, AST integrity | `npm test -- --bail` or `pnpm test` | Vitest, Jest, Mocha, Bun, Node Test Runner |
|
|
100
|
+
| **Python** | `.py` | `python -m py_compile "<file>"` | `pytest -x` or `python -m unittest` | Pytest, Unittest, Poetry, Pipenv, Flake8 |
|
|
101
|
+
| **Java** | `.java` | `javac "<file>"` | `mvn test -DfailIfNoTests=false` | JUnit 5, TestNG, Maven, Gradle |
|
|
102
|
+
| **Go** | `.go` | `go vet "<file>"` | `go test ./... -v -failfast` | Go Test, Ginkgo, Testify |
|
|
103
|
+
| **Rust** | `.rs` | `cargo check` | `cargo test` | Cargo Test, Tokio, Rust standard tests |
|
|
104
|
+
|
|
105
|
+
### How the Sandbox Test Command Override Works
|
|
106
|
+
Under **Repo Settings $\rightarrow$ Sandbox Test Command Override**, developers can define the exact command executed inside the isolated workspace container:
|
|
107
|
+
* Enter `npm test -- --bail` for fast-failing Node.js projects.
|
|
108
|
+
* Enter `pytest -x` for Python projects to stop immediately upon first error.
|
|
109
|
+
* Enter `go test ./...` for Go modules.
|
|
110
|
+
|
|
111
|
+
If the command exits with code `0`, Soigné considers the repair verified and raises the Pull Request.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 🧠 Google Gemini BYOK (Bring Your Own Key)
|
|
116
|
+
|
|
117
|
+
Soigné relies on **Google Gemini** for high-speed, deep-reasoning code repair:
|
|
118
|
+
|
|
119
|
+
### 1. Zero Vendor Lock-in (BYOK)
|
|
120
|
+
You bring your own Google AI Studio API key. Your key is encrypted with **AES-256-GCM** before being stored in your local PostgreSQL database.
|
|
121
|
+
|
|
122
|
+
### 2. Live Model Discovery
|
|
123
|
+
Soigné dynamically queries `GET /v1beta/models` using your key to discover which models are active and available in your tier (e.g. `gemini-2.5-flash`, `gemini-2.5-pro`, `gemini-1.5-flash`).
|
|
124
|
+
|
|
125
|
+
### 3. Automatic Zero-Downtime Failover
|
|
126
|
+
If Google returns:
|
|
127
|
+
* `429 (Resource Exhausted / Rate Quota)`
|
|
128
|
+
* `503 (Model Overloaded)`
|
|
129
|
+
* `404 (Model Not Found / Deprecated)`
|
|
130
|
+
|
|
131
|
+
Soigné dynamically fails over to the next best available model in real time without failing the run.
|
|
132
|
+
|
|
133
|
+
### 4. Transparent Token Tracking
|
|
134
|
+
Token counts are extracted directly from API response metadata (`usage_metadata`) and recorded in PostgreSQL. You can view your exact prompt, candidate, and total token usage in the **Token Analytics** dashboard.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 🚀 How to Use Soigné (Developer Walkthrough)
|
|
139
|
+
|
|
140
|
+
### Step 1: Clone and Install Dependencies
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
git clone https://github.com/priyanshnihalani/soigne.git
|
|
144
|
+
cd soigne
|
|
145
|
+
|
|
146
|
+
# Install backend dependencies
|
|
147
|
+
cd git_heal_be
|
|
148
|
+
npm install
|
|
149
|
+
|
|
150
|
+
# Install frontend dependencies
|
|
151
|
+
cd ../git_heal_fe
|
|
152
|
+
npm install
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Step 2: Configure Environment Variables
|
|
156
|
+
|
|
157
|
+
Create `.env` in `git_heal_be`:
|
|
158
|
+
```env
|
|
159
|
+
PORT=3001
|
|
160
|
+
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/soigne_db?schema=public"
|
|
161
|
+
ENCRYPTION_KEY="0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
|
|
162
|
+
GITHUB_APP_ID="your-github-app-id"
|
|
163
|
+
GITHUB_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n..."
|
|
164
|
+
GITHUB_WEBHOOK_SECRET="your-webhook-secret"
|
|
165
|
+
GEMINI_API_KEY="AIzaSy..."
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Create `.env` in `git_heal_fe`:
|
|
169
|
+
```env
|
|
170
|
+
VITE_API_BASE_URL="http://localhost:3001/api"
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Step 3: Run Database Migrations
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
cd git_heal_be
|
|
177
|
+
npx prisma db push
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Step 4: Start the Platform
|
|
181
|
+
|
|
182
|
+
In terminal 1 (Backend):
|
|
183
|
+
```bash
|
|
184
|
+
cd git_heal_be
|
|
185
|
+
npm run dev
|
|
186
|
+
# Server running at http://localhost:3001
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
In terminal 2 (Frontend):
|
|
190
|
+
```bash
|
|
191
|
+
cd git_heal_fe
|
|
192
|
+
npm run dev
|
|
193
|
+
# Dashboard running at http://localhost:5173
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Step 5: Connect GitHub Webhooks
|
|
197
|
+
|
|
198
|
+
To forward GitHub Actions failure events to your local instance, use a webhook forwarder such as [Smee.io](https://smee.io/):
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
npx smee-client --url https://smee.io/YOUR_SMEE_CHANNEL --target http://localhost:3001/api/webhooks/github
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
In your GitHub repository:
|
|
205
|
+
1. Navigate to **Settings $\rightarrow$ Webhooks $\rightarrow$ Add webhook**.
|
|
206
|
+
2. **Payload URL:** Your Smee channel URL.
|
|
207
|
+
3. **Content type:** `application/json`.
|
|
208
|
+
4. **Events:** Check **Workflow runs** (`workflow_run`).
|
|
209
|
+
|
|
210
|
+
### Step 6: Experience Autonomous Self-Healing
|
|
211
|
+
|
|
212
|
+
1. Make a typo or break a test assertion on your repository branch and push to GitHub.
|
|
213
|
+
2. GitHub Actions runs and fails.
|
|
214
|
+
3. Open `http://localhost:5173`:
|
|
215
|
+
- Watch the **Live Streaming Terminal** output the log scrape, reasoning phase, and sandbox verification.
|
|
216
|
+
- Within seconds, Soigné opens a verified Pull Request on GitHub with the exact diff and diagnostic explanation.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## 🖥️ Live Streaming Terminal & Dashboard
|
|
221
|
+
|
|
222
|
+
The frontend dashboard provides full transparency into the autonomous agent:
|
|
223
|
+
* **Live Terminal Stream:** Color-coded Server-Sent Events (SSE) streaming every file read, edit, compiler output, and git operation live.
|
|
224
|
+
* **Root Cause Tab:** Displays extracted error lines with code highlights and actionable recommendations.
|
|
225
|
+
* **Proposed Patch Tab:** Unified color-coded git diff (`+` additions, `-` deletions).
|
|
226
|
+
* **Sandbox Results Tab:** Execution times, compiler status, and verified test suites.
|
|
227
|
+
* **Agent Reasoning Tab:** Step-by-step breakdown of agent hypotheses and repair decisions.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 🛡️ Guardrails & Safety Architecture
|
|
232
|
+
|
|
233
|
+
* **Loop Prevention Guard:** Rejects any runs triggered on branches prefixed with `soigne/fix-*` or authored by bots, preventing infinite CI loops.
|
|
234
|
+
* **Staleness Gatekeeper:** Inspects the current branch `HEAD` SHA. If the commit is superseded by a newer push, healing is safely aborted to save tokens and prevent merge conflicts.
|
|
235
|
+
* **Isolated Ephemeral Workspaces:** All patch experiments are conducted in isolated directories (`.workspaces/${runId}`) and cleaned up immediately after verification.
|
|
236
|
+
* **Protected Branch Security:** Soigné never pushes directly to protected branches; fixes are exclusively delivered as Pull Requests.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## 📄 License
|
|
241
|
+
|
|
242
|
+
This project is open-source software licensed under the MIT License. See [LICENSE](LICENSE) for terms.
|
package/package.json
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soigne-ci",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Soigné — Self-hosted autonomous CI/CD self-healing appliance for GitHub Actions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"homepage": "https://soigne-dev.github.io/home/",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"ci",
|
|
10
|
+
"cd",
|
|
11
|
+
"ci-cd",
|
|
12
|
+
"github-actions",
|
|
13
|
+
"self-healing",
|
|
14
|
+
"gemini",
|
|
15
|
+
"ai",
|
|
16
|
+
"devops",
|
|
17
|
+
"docker",
|
|
18
|
+
"pull-request",
|
|
19
|
+
"automation",
|
|
20
|
+
"soigne"
|
|
21
|
+
],
|
|
7
22
|
"bin": {
|
|
8
23
|
"soigne": "./bin/soigne.js"
|
|
9
24
|
},
|
|
@@ -15,6 +30,8 @@
|
|
|
15
30
|
"vite": "^8.3.0"
|
|
16
31
|
},
|
|
17
32
|
"files": [
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE",
|
|
18
35
|
"bin/",
|
|
19
36
|
"soigne.config.json",
|
|
20
37
|
"git_heal_be/package.json",
|