Skip to content

BackCase study

Jarvis site monitor

Explains outages in plain English and proposes guarded fixes.

Role
Sole developer
Team
Solo
Timeline
Built July 2026; running every 15 minutes since
Stack
Node.js, GitHub Actions, Groq, Playwright, Vercel
Reading time
3 min
The Jarvis dashboard in dark blue. A list of incidents for the monitored sites, and an Ask Jarvis panel explaining a 500 error in plain English, with buttons to review the pull request on GitHub or approve and merge it.
The Jarvis dashboard: incidents, a plain-English diagnosis, and one-tap approve & merge.

TL;DR

Problem
I had several sites live and needed to make sure none was left unattended. I wanted to know when one went down before a customer did, understand why without digging through logs, and fix small problems from my phone.
What I did
Every 15 minutes Jarvis checks each site. When one goes down it asks an AI model what the symptoms most likely mean, emails me a plain-English explanation and, if the fix is small and safe, opens a pull request I can approve with one tap.
Result
In deliberate test outages on a sandbox site, Jarvis caught and explained both failures and opened one-line fix pull requests, which I merged after review. Every fix has to pass five guard rails enforced in code.

Context

I had several sites live and needed to make sure none was left unattended. I built Jarvis in July 2026, and it has run continuously since.

Jarvis runs on GitHub Actions. A workflow requests each site in sites.json every 15 minutes and records whether it’s up, the status code and the response time.

Around that check sit four more pieces:

  • Explanations. When a site goes down, the symptoms go to an LLM through Groq. A three- to four-sentence explanation with suggested next steps goes into the alert email and the incident log.
  • Fix pull requests. If the fix looks small and safe, Jarvis proposes it as a pull request.
  • A weekly report. Every Monday, per site: a Google PageSpeed audit, a security-headers check, a Playwright smoke test in a real browser, and a visual comparison against last week’s screenshot to catch layouts that break quietly.
  • A dashboard. A small web app, installable on an iPhone home screen, with live status, incident history, past reports and a chat to talk through any incident.

The live instance runs from a private repo. The public repository is a copy with its schedules turned off.

The interactive demo is simulated, with fictional sites. When it proposes a fix, it runs the real guard-rail rules from proposeFix.js against fictional files.

Decisions

Safety rules in code

Instead of: Writing the rules into the prompt and hoping

The model can propose a fix. Whether that fix is allowed is decided by code that runs after the model has answered, so a persuasive answer can’t talk its way past the limits.

Find the file without the model first

Instead of: Asking the model to guess straight away

A failing /api/health maps to api/health.js and a short list of other likely paths. Jarvis tries those, and only asks the model to guess when none exists. A guess that isn’t a single file path is thrown away.

Fixes as find-and-replace snippets

Instead of: Full-file rewrites

The model returns an old snippet and a new one. Every unrelated line, comment and the trailing newline stay untouched. The old snippet has to appear in the file exactly once, or the fix is rejected.

Alert on a change of state

Instead of: Emailing on every failed check

Jarvis only alerts when a site goes from up to down or down to up, so a long outage means one email, not a hundred.

A confirmation page before merging

Instead of: A link that merges when it’s opened

Email scanners follow links automatically. The link in the alert email is signed, expires after 7 days and opens a confirmation page. Nothing merges until I tap “Confirm merge”.

State in JSON files in the repo

Instead of: A database

The workflow commits status.json and incidents.json back to the repository. That also keeps a full audit trail of every status change.

Hardest problem

Letting a model change code on a live site is only acceptable if the worst case is boring. So the fix layer is a row of gates, and every gate fails closed: if anything is ambiguous, no pull request is opened and the reason is recorded.

  1. Is fixing set up for this site?

    A token scoped only to the monitored sites’ repos. It can’t modify Jarvis itself.

    Not configured. Explain the outage. No fix attempted.

  2. Find the one file

    Deterministic paths from the failing URL first; the model’s guess only if none match.

    No single file. No pull request.

  3. Ask for a snippet

    One old snippet, one new snippet, in a fixed format.

    No confident fix, or wrong format. No pull request.

  4. Match exactly once

    The old snippet must appear in the file once and only once.

    Missing or repeated. Fix rejected.

  5. Count the changed lines

    Fifteen changed lines or fewer.

    Over the limit. Flagged for manual review.

  6. Open a pull request

    On a new branch. Never a push to main.

  7. A person confirms the merge

    From the dashboard, or the signed link’s confirmation page.

From outage to pull request. Any gate that fails stops there, with the reason recorded, never a commit.

The last two automated gates are a few lines each:

  const occurrences = originalContent.split(oldStr).length - 1;
  if (occurrences !== 1) {
    return { attempted: false, reason: 'fix rejected: snippet not uniquely found' };
  }

  const proposedContent = originalContent.replace(oldStr, newStr);

  if (proposedContent === originalContent) {
    return { attempted: false, reason: 'Proposed content was identical to the original — nothing to fix.' };
  }

  // Step 4: the hard safety gate. Refuse anything too large, no exceptions.
  const changedLines = countChangedLines(originalContent, proposedContent);
  if (changedLines > MAX_CHANGED_LINES) {
    return {
      attempted: false,
      reason: `Proposed fix changes ~${changedLines} lines — over the ${MAX_CHANGED_LINES}-line auto-fix limit. Flagged for manual review instead of opening a PR.`,
    };
  }
site-monitor/scripts/proposeFix.js

Results

  • Jarvis checks every site every 15 minutes and sends a health report every Monday.
  • Five guard rails sit between the model and a pull request, and a person confirms every merge.

To test it end to end, on 11 and 12 September 2026 I broke a sandbox site, Halide, on purpose, twice:

  • A deleted health file. The health check returned 404.
  • A missing await that crashed the health check. It returned 500.

Jarvis caught each failure, explained it in plain English, and opened fix pull requests #1 and #2. Each was a one-line change in one file, and I merged both after review.

An alert email from Jarvis. Halide failed its health check with status 500. Under What Jarvis thinks happened, a plain-English explanation of a crash early in the request, then a link to the fix pull request and links to approve and merge it or discuss the incident.
The alert from a deliberate test outage on a sandbox site, 12 September 2026.
Pull request number 2 on GitHub, titled Jarvis auto-fix: Halide down, marked Merged. Its description gives the detected issue and says one file changed, api/health.js, about one line.
The fix Jarvis opened: one file, one line (a missing await), merged after review.

Reflection

I built it to run for free on Groq. That kept costs at zero, but the explanations and fixes are limited by the model. I’d now spend a little on a stronger one.

Pages

Home
Selected work
BodyMed HubCase study
AI email triageCase study
Jarvis site monitorCase study
About
CV
Colophon

Actions

Copy email addresscian.mccaul@outlook.com
Download CVPDF
Light theme
Dark theme
System theme
Reduce glass

Elsewhere

GitHub
LinkedIn
Email mecian.mccaul@outlook.com