DEV Community

Serguey Shinder
Serguey Shinder

Posted on

The Rules That Decide Money Were Living in Our Scripts

An internal auditor asked a simple question in February: which orders attract our small order surcharge. The policy document says orders below fifty pounds, excluding delivery and tax. The system charges orders below forty five pounds including delivery, because that is what a script written in 2019 does, and it has been doing it to roughly two thousand eight hundred orders a year that should not have been charged while missing nine hundred that should.

Nobody could tell me who chose forty five. The engineer who wrote it left in 2021. There is no ticket, because at the time it was a two line change inside a job that already ran.

We went looking for the others. Of thirty four automations in regular use, nineteen contain a number or a condition that decides money or entitlement. A rounding rule on carrier surcharges. A credit hold threshold. An invoice matching tolerance of five percent or fifty pounds, whichever comes first, a formulation that appears in no finance policy I can find. A rebate cut off date. And a rule deciding which customers are offered next day delivery, which turned out to be a list of account numbers typed in by hand.

Nine of them contradicted the written policy. In three cases the script was right and the policy was out of date, which is a harder conversation than the other way round.

None of this was concealed. The quickest way to implement a rule is to write it where the work happens, and once it lives there the policy owner cannot read it and the engineer is not entitled to change it. The rule belongs to nobody at all.

Every rule of that kind is now a row in a table, with an owner, an effective date and the clause it implements. The automation reads the table and refuses to start if a rule has no current owner. Changing a value is a business approval rather than a change request to my department, which has made the category managers considerably keener on the arrangement. And the annual policy review is held with a printout of the live values beside the document. The first one moved four figures and retired two rules.

Automation carries out the policy we wrote down. Where we never wrote one down, it becomes the policy, and it does that without telling anyone it has.

– Serguey Shinder

Top comments (0)