Development in the AI Era
All articles

The Fact That Lives in Neither Program

Nearly every failure I got called about occurred where one of my programs touched something it didn’t control: a printer, a scale, a sensor, the ERP, or another program from somebody down the hall. The code on each side was usually correct for every case it had been told about. What broke it was a fact that lived in neither program, so reading the code, mine or anybody else’s, was never going to find it.

Two Sensors and a Number

The program at the end of each production line prints item specifications on the boxes for boxed product as they move down the conveyor belt. It has to know whether a given box is for a short or tall item. Two sensors sit beside the conveyor, one about ten inches up and the other about fifteen and a half. A short box passes under the high one and trips only the low one, on and then off, which the program sees as two events. A tall box trips both and produces four events. The code counts events and picks what to print.

Reading through the code, you see where the event count was received and nothing about why or how that value was determined. The two and four event counts are based on the heights of two brackets somebody bolted to a frame, and if a bracket moves or a new box size comes in, the code gets it wrong without a single line of it having changed. The printers work the same way. Some lines have a network-based printer and some a serial one, and which is which is a fact about the building or the age of the line.

From time to time, the network printer on a line got unplugged. The operators saw its cable as a trip hazard, because nobody had strung it up and out of the way. The program would error every time it tried to print labels, and the operators, especially on the night shift, didn’t want to bother us, so they keyed the data in on the printer itself. In the morning we would hear that labels didn’t print, and we would start digging through everything, only to find they had unplugged the network cable, or even unplugged the printer’s power and moved it off the line to get it out of the way.

We got the cable strung overhead, and added a printer offline alert and a log message so we had a better clue as to what happened. We also added a note to the shift summary sent at every shift change whenever the networked printer had been unreachable during that shift.

The Shipment Number

Shipping prints an address label for almost every skid that leaves the warehouse. Some customers also require labels of their own, carrying their purchase order and item numbers, and a second system owns those. When a shipment is flagged with ‘special label required,’ the shipping program sends a call to the label system and passes it the shipment number.

From the shipment number alone, the label system can’t tell which items are on this truck, so it prints every special label on the purchase order. Each program does exactly what its own code says. The defect is in what one of them never tells the other, and both print to the same printer, so the people in shipping take it for one system when the shipping tech logs an issue, which starts a goose chase to find the culprit.

The label program answered the question the call asked, but the question was too vague. I needed to pass it more relevant data to print the labels actually needed for the current shipment, not for the complete purchase order.

The Scan That Didn’t Arrive

We ran a trial that let software choose how each finished skid got wrapped. A reader scanned the skid’s barcode on the conveyor, the program looked up the product, and a twenty-four-volt signal told the wrapper which pattern to use. Until then, a forklift driver had picked the pattern by hand. The trial worked until a scan failed. With no barcode there was no product, the wrapper fell back to its default pattern, and the default was wrong for what was on the pallet, so skids had to be wrapped again. Every line of that code was correct for the case where the scan arrives. The design left the missing scan to the wrapper, which is how a device ends up making a decision nobody made.

I now decide what silence means at every edge before the code exists, whether that’s a scan that doesn’t arrive or a reply that never comes. If I don’t choose the default, the device will.

Where the Fact Lives

I gave this subject one sentence in “AI Has Left the Building,” where I wrote that line-of-business applications “fail at the boundaries when connecting to databases, APIs, and networks; when authentication or hardware changes.” AI is making that sentence more true. It writes to the protocol document and the API reference, and the bracket isn’t in either one. Code that is almost right at an edge is harder to catch than code that is plainly wrong. It passes every test somebody thought to write and every review, because each fact a reviewer can see checks out. The fact that breaks it is on the floor, in another team’s program, or in what a device does when nothing arrives.

AI now sits on the far side of these edges. This month Physical Intelligence, which builds AI models to run robots, opened them to outside developers, and its announcement says some early deployments ran into network connectivity problems. The model and the robot can each be right, and the network between them belongs to neither. We built small rigs that pretend to be scales and printers so we could develop without standing at a line. They are fine for development, but a rig behaves the way I told it to, and the real printer never agreed to that.

The effort belongs at the edges I don’t control. A call between two classes I wrote yesterday doesn’t need a written default and a hardware test, because both sides of it are in my head. The bracket, the wrapper’s default and the second team’s assumptions aren’t in any document an AI or a reviewer can read. Those missing documents are where I’d spend the hours the tool gave back.

Always verify that any infrastructure requirements for an application are documented. Make sure all cables and ports are labeled, so an operator who is either new or unsure can figure out and follow the layout of the system before calling for help.

First published on LinkedIn, October 29, 2026. Discuss this on LinkedIn