Guilty Unless Purely Online
Written later and filed to this date, as part of filling in every day of the year.
The report said a phone had dropped off the house Wi-Fi for twenty-seven minutes. Nothing had dropped. The phone had gone out the door in a pocket, and a classifier I had fixed the day before decided that the most likely explanation for a phone leaving was a broken router.
What the monitor is for
The house Wi-Fi had been misbehaving in bursts, and I wanted to know whose fault each one was: the mesh radios, the always-on box’s own wireless chip, or the line from the street. So a small watcher logs, every ten seconds, whether each phone and tablet in the house still answers at its local address, and separately whether the VPN’s control plane sees it online. The two signals disagree in useful ways. A device that is silent on the Wi-Fi but online on the VPN is reaching the internet some other way. A device silent on both is either off or truly cut loose.
The first version called nearly every Wi-Fi absence a drop, which made the house look far sicker than it was. Two absences in one day’s log were nothing of the kind: a phone gone five minutes and then twenty-eight, online on the VPN the whole time (it was on cellular, somewhere else), and a tablet missing from both for twelve hours (switched off, in a drawer).
Two clean categories
The fix gave absences two new names. Off the Wi-Fi for five minutes or more while online the whole time: away. Offline the whole time for half an hour or more: switched off. Anything else kept the old name, drop. The commit put it in one line: “long Wi-Fi absences are ‘away’ or ‘switched off’, not drops”. Both rules were correct and tested, and the tablet and the two phone trips went into the right columns.
Then a phone left the house the way phones actually leave. For the first stretch after it lost the Wi-Fi it was asleep, so the VPN reported it offline. Then it woke on cellular and reported online for the rest. Twenty-seven minutes, offline for part, online for the rest: not purely online, so not away; not purely offline, so not switched off. It fell through both rules and landed on the default, and the default was the accusation.
Where the burden sat
The bug was in neither rule. It was in what the fall-through meant. The classifier asked each absence to prove it was innocent, cleanly and for its whole length, and anything that could not produce a clean alibi was booked against the Wi-Fi. Real absences are rarely clean. Phones nap, tablets wake for an update and sleep again, and every mixed case had been quietly feeding the drop count, which was the one number the whole monitor existed to get right.
The second fix turned the questions around. Is the absence short, under five minutes? Did it overlap an outage the monitor logged on its own wires? Either one, and it is a drop, because that is what a drop looks like: brief, or shared with something else failing. Otherwise the Wi-Fi is not a suspect. A long absence with nothing else broken was online at some point (away) or never online for half an hour (switched off). Only a long, never-online absence shorter than that half hour still lands on drop, which is the one remaining case where the radio is a fair guess.
The comment on the new branch reads like a note from someone who watched it happen: “a phone asleep in a pocket goes offline and online as it leaves”. The old version had two careful rules for the cases its author could picture and a default for everything else, and nobody wrote down that the default was a verdict.
The test that pins it adds one device to the fixture, named pocket: on the Wi-Fi, then off it and asleep, then awake on cellular, then home twenty-seven minutes later. The old code books it against the router. The new one says it went out.