# CI Watchdog — The Autonomous CI Minutes & Spend Sentinel with Open AI Failure Triage

> Source: <https://dev.to/devtushark/ci-watchdog-the-autonomous-ci-minutes-spend-sentinel-with-open-ai-failure-triage-43gd>
> Published: 2026-10-05 03:38:55+00:00

An autonomous GitHub App and SaaS platform that stops wasted CI spend before it hits your invoice, and automatically diagnoses broken builds using open-weight AI.

Every developer has that one friend or team lead who dreads the 20th of the month: the day GitHub sends the notification:

**"You have used 100% of your included GitHub Actions minutes."**

I built **CI Watchdog** for my friend and engineering teammate, who was constantly battling ballooning CI bills and jammed pipeline queues on open-source and startup projects.

**The problems:**

**The solution:**

`concurrency` blocks and generates 1-click YAML fixes.
| Route | Feature | Description | 
|---|---|---|
| `/app` | Control Room Overview | Live and dry-run minutes-saved counters, real-time system status indicators, and weekly savings charts. | 
| `/app/investigations` | AI Investigations | Instant root-cause diagnostic cards generated by Gemma / Gemini 3.8 Flash, with failure hypotheses, log evidence snippets, and recommended next steps. | 
| `/app/decisions` | Decision Engine & CSV Export | Full searchable decision history with rule and status filters, plus 1-click CSV download for engineering management reports. | 
| `/app/approvals` | Human Approval Queue | First-N quota approval flow with 1-click **Approve** and**Deny** buttons. | 
| `/app/digest` | Interactive ROI Calculator | Real-time savings simulator modeling monthly minute volume and runner tiers (see pricing below). | 

**Runner pricing used in the ROI calculator:**

| Runner | Cost per minute | 
|---|---|
| Ubuntu | $0.008 | 
| Windows | $0.016 | 
| macOS | $0.080 | 
| Apple Silicon (M-series) | $0.160 | 

The entire codebase is open-source and structured as a high-performance TypeScript monorepo using **Turborepo** and **pnpm**:

| Path | Description | 
|---|---|
| `apps/watchdog` | Event-driven Node.js background service deployed on Render. Connects to the GitHub App webhook stream, processes workflow states, runs the pure rule engine, and coordinates AI triage. | 
| `apps/dashboard` | Next.js 16 (Turbopack) dashboard deployed on Vercel with Shadcn UI, Auth.js (OAuth with GitHub & Google), and real-time state synchronization. | 
| `config/watchdog.yml` | Declarative team policies with per-repository overrides. | 

The rule engine (`apps/watchdog/src/rules/`) was designed to be 100% pure with zero side effects. Given the current run, sibling runs, historical durations, and workflow YAML, it evaluates four rules:

| Rule | Behavior | 
|---|---|
| `SUPERSEDED` | Cancels older runs queued on the same ref when a newer commit arrives. | 
| `RUNAWAY_DURATION` | Compares running jobs against historical p95 execution times and alerts/cancels if a job hangs. | 
| `MISSING_CONCURRENCY` | Scans workflow ASTs and alerts if jobs lack top-level concurrency cancellation blocks. | 
| `STALE_ON_CLOSE` | Immediately terminates active pipelines when a PR is merged or closed. | 

When a workflow concludes with a failure, CI Watchdog activates the AI investigator:

| Field | Description | 
|---|---|
| `rootCause` | Explicit technical diagnosis (e.g., missing Docker service container, database port refusal). | 
| `failedStep` | Exact bash command or step name that exited non-zero. | 
| `category` | One of: Infrastructure, Configuration, Test, or Code. | 
| `nextSteps` | Concrete remediation actions. | 

Automated cancellation can be intimidating for developers, so I implemented strict safety rails:

`main`, `master`, or `release/*` branches.
Open innovation is what makes a tool like CI Watchdog possible without compromising developer trust:

*Built with ❤️ during Hacktoberfest. If your team is burning minutes on redundant CI runs, give CI Watchdog a spin!*
