a failed probe must not look like a passing one
the nightly check kept reporting green through its own crashes, and separating 'nothing proven' from 'proven good' took longer than building the check did.
it looked like a monitoring win
for a while i believed the automation layer of the side business was in good shape. the nightly probe ran on the same box as everything else, it exited zero on schedule, and the summary line it printed looked exactly like the summaries i had shipped at work for years: counts of checks run, counts of checks passed. quiet nights, green line, small relief. that is the whole appeal of a build-in-public dashboard -- it lets you stop thinking.
the symptom, once i finally saw it, was embarrassing. the probe had been failing to even start its inner verification step for days -- wrong path after a refactor, or a hung subprocess, i never pinned down which occurrence was which -- and every one of those nights it exited zero and printed a summary anyway. the failure of the probe was indistinguishable, in the output, from a clean run. the alarm meant to tell me something was wrong had trained me to ignore it by crying wolf in the shape of success.
the easy misread is structural, not personal. any process that runs on a schedule and exits cleanly looks healthy from the outside, and humans are tuned to read exit status as truth. my day job had burned this lesson into me years ago -- a batch job that 'succeeded' while skipping half its records -- but apparently the lesson doesn't transfer automatically. it has to be re-earned every time you point an old loop at a new system, because the new system fails in new, lazier ways.
i had also quietly assumed that the one-machine stack was too small to need this kind of rigor. that was the actual mistake. a stack that runs the business while i sleep needs its probes to be honest more than a big system does, because there's no pager rotation, no second shift, no colleague who happens to glance at the graph. it's just me, and i only see what the machine chooses to say.
the wrong theory: flaky checks
my first theory was flakiness. the probe timed out occasionally, i reasoned, so the fix was retries -- wrap the inner checks in a second attempt, add a grace period, call it weather. this fit the evidence because the failures were intermittent-looking: most nights green, some nights a stale summary that still said zero. flakiness is the default theory for any intermittent signal, and it's convenient, because the fix is a retry loop instead of an investigation.
the deeper version of that theory -- and the more seductive one -- was that the environment was unstable. the side stack shares a box with everything else; contention could plausibly slow the probe past its timeout. under that theory the probe itself was fine and the machine was the problem, which meant the fix was more hardware or tighter scheduling. both theories had the same flaw: they located the fault anywhere except in the probe's own notion of what 'ran' means.
what should have tipped me off earlier was the shape of the failures. a genuinely flaky check fails loudly -- it errors, it prints a partial count, it leaves debris. these nights produced clean, confident, well-formed output with a number in it. zero is a pass-shaped number, and any pipeline that can emit zero when it proved nothing is lying, regardless of how often it happens to tell the truth.
i also noticed i had stopped reading the actual lines. the summary number had become the whole signal -- exactly the failure mode i'd seen in big operations, where a rollup hides a broken probe underneath it. the side stack had reproduced the pathology of the day job at one-hundredth the scale, which is the strongest argument i know that these problems are about loop design, not size.
what settled it: forcing the failure on purpose
so i stopped theorizing and made the probe lie to me deliberately. step one: i broke the inner verification on purpose -- pointed it at a path that doesn't exist -- and ran the full nightly loop. it exited zero and printed a summary. there it was, reproduced on demand: the probe reporting a clean result from a run in which nothing was verified.
step two: i traced exactly where the zero came from. the wrapper caught the inner failure, fell through to a default summary of zero checks failed, and exited clean. no branch anywhere distinguished 'checks ran and passed' from 'checks could not run at all.' the code had no word for the second situation, so it collapsed it into the first. that's not a bug in a branch; it's a missing concept.
step three: i measured the other problem the same way, by forcing it. the probe kept timing out on one repository sweep, so i ran the sweep by hand with instrumentation: enumerate everything first, filter afterward, and compare against enumerating with the filter applied as i walked. same result set -- a few thousand python files and shell scripts, verified both ways -- but the enumerate-first version ran in under twenty seconds where the walk-and-filter version needed the better part of two minutes. the timeout wasn't contention. it was my own check doing wasted work, and the timeout was masking that as instability.
the measurement decided it because it separated two failures i had been treating as one: an exit-status problem, which is about honesty, and a performance problem, which is about efficiency. forcing each failure deliberately, in isolation, told me which loop to steal from the day job -- the 'distinguish cannot-run from ran-and-failed' pattern -- and which was just me writing a slow check.
the fix: give silence its own exit code
the exit-status fix was small. 'could not run' now gets its own return codes -- one for the inner check timing out, one for the probe failing to execute at all -- and its own message, phrased as 'nothing proven either way.' deliberately no count. a count implies the check ran; absence of proof must not borrow the costume of a passing result. the summary now only prints a number when there is an honest number to print.
the parsing fix was just as small. the digest step used to take the last line printed; it now takes the last line that parses. a crash that emits garbage mid-run can no longer have its wreckage mistaken for a summary, because unparseable output is skipped, not consumed. quiet difference, big consequence: the downstream automation can only act on output that is structurally valid, and everything else becomes an alarm.
the performance fix was one pruning change in the repo sweep -- filter during enumeration instead of before it -- which brought the sweep from about a minute and a half to under twenty seconds at identical coverage, verified against the old numbers. and when a check times out repeatedly now, the timeout is treated as a diagnosis, not a symptom: a check that keeps timing out is broken as a check, and gets fixed, not retried.
what i did not change matters as much. i didn't add retries, didn't add a second monitoring layer watching the first, didn't move anything off the single box. one honest probe beats three redundant dishonest ones, and redundancy is the classic way to feel rigorous without being correct. i also didn't automate any response to the new exit codes -- they surface to me, and the decision about what a 'nothing proven' night means stays human.
the rule i keep now
the rule: every automated check must be able to say three things, not two -- passed, failed, and could-not-run -- and the third must never be shaped like the first. zero is a pass-shaped number, so nothing-proven gets its own exit code and its own message and never a count; the last line that counts is the last line that parses, not the last line printed; and a check that keeps timing out is a broken check, fixed at the source rather than wrapped in retries. before trusting any probe i now break it on purpose and watch what it reports, because the only honest test of an alarm is a fire i set myself. and when an old loop gets stolen from the day job, its honesty guarantees come with it -- those aren't overhead, they're the actual product.
the rule: a probe that can't distinguish 'ran and failed' from 'could not run' isn't monitoring anything -- give silence its own exit code and make the alarm earn its green.