In 2021 one of my developers wrote a small job to tidy our purchasing system. Every night it found purchase orders more than ninety days old that had received nothing, closed them and released the money they had committed in the buyers' budgets. Before it, thousands of forgotten orders made the buyers' stock on order figures nonsense. The job worked well for three years.
Our landscaping range includes Indian sandstone paving, which we import by container. An order normally arrived about eleven weeks after it was placed, comfortably inside the job's rule. From early 2024 shipping lines avoided the Red Sea and sent ships around Africa, adding a couple of weeks to every voyage, and our buyers began ordering earlier so the stock would be here for spring.
The job knew none of that. It saw orders more than ninety days old with nothing received, and in February and March it closed forty one of them.
The containers arrived anyway. At our distribution yard, goods in scanned each delivery and the system refused it, because there was no open order to book it against. The yard unloaded the paving and stacked it in a corner. Our website showed it out of stock in April, our busiest month for paving, while three thousand square metres sat behind the fence. The supplier's invoices could not be matched either, and sat in the exceptions queue until the supplier rang.
It took a week to reopen the orders, book in the stock and pay the invoices. The job was not faulty. It encoded an assumption about how long goods take to arrive, and the world changed that assumption without telling it.
The job no longer closes anything. It lists old orders for the buyer responsible, who confirms each one, and it ignores any order that has a shipping status or an expected date still in the future. Imported orders now carry the vessel's expected arrival, updated by our freight forwarder. Every scheduled job that changes data, rather than reporting on it, is now listed with the assumption it relies on and the person who would know if that assumption stopped being true.
Tidy up jobs feel harmless because they deal with things nobody is looking at. That is exactly why nobody notices when they start removing things that matter.
– Serguey Shinder
Top comments (1)
The 'assumption register' for data-changing jobs is a good fix. One technical addition: make the job's guard conditions data-driven rather than a constant. Instead of a flat 90 days, compare age against the order's own promised date plus a tolerance per lane (e.g. forwarder ETA + 30 days), and fall back to flagging for review when no ETA exists. A second safety net is a soft close: set a 'pending_close' status with a 14-day grace period, so goods-in or invoice matching can auto-reopen the PO instead of rejecting the delivery at the dock. Receiving against a closed PO should create an exception task, not a hard refusal, since a physical pallet is stronger evidence than an old status field. Finally, log every automated close with the rule version, so a spike (41 in two months) triggers an alert on its own.