james@feldmayer:~$ cat ~/blog/testing.md

Testing: from "does it work" to "who fixes it when it doesn't"

October 25, 2026 — ops notes on /adsplosion

I wrote a post-mortem about Adsplosion a few days ago, and in it I mentioned testing as a lesson learned. This post is the follow-up I promised myself: what testing actually means for a solo side project, why the version of it I had was a lie, and a proposal for what I'm building instead — because checking the site and finding it down again is not a QA strategy, it's a hobby with extra steps.

The test I had was: I clicked around

Let me be honest about what my "test suite" looked like until recently. I'd open the site, click a few buttons, watch an ad-parody fruit explode, and think: shipped. Maybe I'd check the server response code. That was it.

And it worked — for about the first hour of Adsplosion's life. Because in the first hour, the bugs are the loud kind. The merge animation doesn't fire. The board doesn't reset. You find them immediately because they're the bugs you were half-expecting.

Then the loud bugs are gone and what's left is the quiet kind:

Here's the thing I keep rediscovering: I don't actually check Adsplosion very often. I check it when I remember it exists. And the moment I remember is precisely when it's most likely to be down — because everything that breaks, breaks slowly and in the background, and my memory of "I should check on that" is the only monitoring it has. Unit tests can't save you from this. You cannot unit test "is the server still alive three days later."

What unit tests are actually for

So let's be precise about the layers, because people (me included) like to say "add tests" like it's one thing. It isn't.

Unit tests test logic in isolation. mergeFruits(apple, apple) returns pear. The scoring function handles zero and negative values. The input parser doesn't crash on garbage. These are cheap, fast, run in milliseconds, and they exist to answer one question: did the code I just wrote do what I meant? Their superpower is the regression — once the test exists, a bug you fixed can never silently come back.

Integration tests test components wired together. The API route, real (or realistic) storage, real request objects. They answer: do the pieces I built actually agree with each other? Most of my production bugs live here — the game and the server each working fine while speaking slightly different languages to each other.

Health tests (the ones I didn't have) test the deployment, not the code. Is the process listening? Does GET / return something other than a hung connection? Does the container pass its own healthcheck? These don't run in CI, they run forever, in production, on a schedule.

I had unit-test-shaped confidence and production-shaped problems.

Continuous testing: the loop I actually needed

Continuous testing isn't a fancy pipeline stage. For a solo project it's one idea: the site checks itself, and tells me when it's wrong, without me having to ask. The minimal viable version:

  1. A heartbeat. Every minute or five, a script hits the real URL with a real request and asserts: status 200, response under N seconds, body contains the thing that means "this is actually Adsplosion and not a default error page."
  2. Depth levels. A shallow check (is the port alive) every minute; a deep check (does the core flow work — can I actually play a merge?) every 15 minutes. Cheap checks are frequent; expensive checks are rare.
  3. Structured logs. Every check writes a line — timestamp, check name, pass/fail, latency, and on failure, the evidence: response body snippet, container status, last 20 log lines. The evidence is the important part.
  4. Alerting with a brain. A failure alerts once, not per-minute, and not for a 3-second blip. "Down for 3 consecutive checks" is an incident; "one failed check at 4am" is noise.
  5. A status page. The check results get rendered somewhere I actually look — which, for me, is now the /hidden/logs page on this very site. You're reading the monitoring of a site on the site.

The embarrassing realization was how much of this I already had. Caddy logs every request to disk. Docker knows whether the container is healthy. The logs page exists. None of it was connected into a loop that decides anything. I had sensors with no nervous system.

The proposal: logs + agents = a self-triage loop

Here's the actual proposal. Monitoring alone just moves the work: instead of discovering the outage, I get a push notification and I do the debugging at whatever hour it breaks. For a one-person operation, the debugging is the expensive part — not because I can't do it, but because I'm rarely at a keyboard and it interrupts whatever I was actually doing.

The insight from watching agents work: most incidents have a boring shape. Restart the container. Roll back the last deploy. Kill the log file eating the disk. Bounce the port. An agent doesn't need to be brilliant; it needs to be brave about the boring fixes and humble about everything else. So:

The loop has four roles:

┌─────────┐    every 60s    ┌──────────┐   failure    ┌───────────┐
│ MONITOR │ ──────────────▶ │ TRIAGE   │ ──────────▶  │ FIXER     │
│ (dumb)  │                 │ (agent)  │              │ (agent)   │
└─────────┘                 └──────────┘   safe fix   └───────────┘
     ▲                            │  + verdict         │
     │        runs deep check     │  + root cause      ▼
     └────────────────────────────┴────────────  ┌───────────┐
                    verifies the fix             │ REPORTER  │
                                                 │ (writes)  │
                                                 └───────────┘

1. The Monitor is deliberately dumb. A bash script with no opinions: run the checks, append JSON lines to a log, and on N consecutive failures, wake the triage agent. No LLM in the hot path — it should cost nothing and never fail.

2. The Triage agent gets one prompt and one input: "Here is the incident bundle. Classify it." The bundle is everything a human would look at: the failing check's evidence, last 100 lines of container logs, docker ps, disk/memory, the access log around the failure window, and the git log of recent deploys. Its output is a structured verdict: root cause hypothesis, severity, and a fix plan drawn from a fixed menu:

3. The Fixer executes only pre-approved playbooks — not freeform shell commands. A playbook is a tested script with a verification step and a rollback. restart-container runs, then the Monitor (not the agent, the dumb one) confirms recovery within 5 minutes. If it doesn't recover, escalate. The agent never verifies its own work; the heartbeat does. That's the same principle as unit tests — assertion separate from action.

4. The Reporter writes the incident report the way I'd write it for myself: what broke, when, root cause, what was done, and whether it needs a real fix. It lands on the /hidden/logs page and gets linked in the next post-mortem. Over time this becomes a searchable incident history — which is how playbooks get written: every Tier 3 that a human solves once gets encoded as a Tier 1 playbook, and the agent's jurisdiction slowly grows.

The two rules that make it safe:

What I'd actually be doing instead

Here's the part that motivated this whole post. The time spent checking whether Adsplosion is up, poking the container, reading logs to re-diagnose the same wedge for the fourth time — that's maybe 30 minutes a week, but it's 30 minutes of the worst kind: context-switching, low-grade dread, no learning. And the thing it produces is a service that's down between checks anyway.

The honest alternative to agentic ops isn't "I'll just check more diligently." It's:

The dream isn't a server that never goes down — that's not on offer for a side project running on a $5 VPS. The dream is a server that goes down, fixes itself in five minutes with a report written by the time I look, and only wakes me when the problem is genuinely a human problem. That's a reasonable use of an agent: not to be clever, but to be the diligent one at 3am so I don't have to be.

The monitoring loop I can build tonight. The agent that triages it is the next post — if it works, I'll write up the incident that proved it. If it doesn't, that's a post-mortem too, and honestly probably a funnier one.