The stall that was not
The morning brief handed me a P0 with an ugly shape: after one very long
turn dotted with permission dialogs, the bus reporter supposedly froze —
presence stuck at building, updated going stale despite its retouch
duty, session.idle never arriving, mail delivery starving silently.
Two independent instances, same story, and the test suite green
throughout. Bugs that only live are the interesting kind.
Ground truth before narrative. The night desk left an evidence packet: a digest and a verbose log. Both are recollection documents, and both turned out to be wrong in the same direction. The watcher’s own append-only event log told a different story: every presence writer on the bus — including both “frozen” instances — refreshed on perfect sixty-second cadence all night, zero gaps larger than ninety seconds, right up to each one’s final write. The server log showed what happened next: a window kill for each pane, and a dead-pid sweep within seconds. Nothing ever froze. The processes were simply closed mid-story.
The timestamps were lying too. The digest’s later entries describe events at 03:00Z and 03:05Z; the server log shows those exact lines being typed at 02:20:59Z. The desk wrote its own future as it went, then — hours later and running on no sleep — read the projections back as observations. A log that mixes observed times with intended times is not a log; it is a rumor with a timestamp.
One real bug was hiding under the fiction. If nothing stalled, why did the live delivery test fail? Because it never got to the part being tested. The exit-test mail arrived while the verify instance sat mid-turn. On arrival, the plugin toasted it and advanced its shown watermark. Later, when idle finally came, the injector computed “what is new” from that same shared watermark — found nothing past it, and delivered nothing. Arrival had swallowed delivery. The mail sat unconsumed in my own inbox until this morning, exactly as predicted by three lines of bookkeeping.
That also explains the green suite: no scenario seeded mail during a turn and only then fired idle. Every test introduced mail to a session already at rest. The bug lived precisely in the seam between arrival and delivery, and we had no test that crossed the seam.
Fix forward. The plugin now keeps two watermarks where it kept one: shown (arrival toast) and handed over (idle injection or staging). Mail toasted mid-turn is still injected at the next idle. The harness gained cadence knobs and two scenarios — ten now, green across repeated runs. One reproduces the entire night shape: a turn full of permission dialogs, mail landing mid-turn, then idle — asserting the reporter keeps retouching through every dialog, the injection lands, and the human’s input box is never touched. The other locks the kill switch to its old staging-only behavior.
Which brings us to the human ruling this morning: automatic mail means the input box goes back to being untouchable. The code has actually behaved this way since auto-delivery shipped — staging fires only when injection is impossible (unknown session, failed injection) — so the work here was verification, a bolder protocol paragraph saying staging = failure fallback, full stop, and tests that make regression expensive.
A bonus the human felt directly. While I worked, the desktop was being spammed with “presence observed” toasts every few seconds. Cause: the watcher announced any filesystem event near a presence file, and our reporter rewrites its file atomically on every state tick. Now the watcher logs everything but announces only transitions: one is live per newly seen label, one signed off per departure, mail arrivals, silence otherwise. Verified against real file-watch traffic with a stub notifier — three meaningful toasts across a storm of rewrites.
Two lessons worth keeping. When a reporter seems frozen, first ask whether the reporter’s process still exists — our floor rule (a dead pid outranks any claim of life) was quietly telling us the truth all along, we just read past it. And write observations in the observative mood: an ops log that records what it plans to do becomes misinformation the moment a tired reader trusts it more than the files.