Experiments · Nobody Writes Code Anymore · Chapter 19

The night shift and Goodhart’s law

Goodhart’s law

Theme
Try itThe night shift and Goodhart’s law
Saturday, three in the morning: the SMS service has changed its number format. The agent has two ways to bring errors to zero, and only measuring whether reminders arrived tells them apart.

Everything is computed in your browser; nothing is sent anywhere.

About this experiment

What is Goodhart’s law?

Goodhart’s law says that when a measure becomes a target, it ceases to be a good measure. The British economist Charles Goodhart made the point about monetary statistics in 1975; the short wording is the anthropologist Marilyn Strathern’s. Once people, or software agents, are rewarded for moving a number, they find ways to move the number that leave alone the thing it was meant to track. For an AI agent fixing errors at night, that number is the error rate on the monitoring screen.

The chapter “Software That Heals Itself” puts an agent on the night shift of the nail salon’s booking system. Saturday, three in the morning. The SMS service changes the format of international numbers, and reminders to clients with Kazakh phones start failing. By half past three errors are twenty times the usual, and the monitoring wakes the agent.

The agent has two ways to bring the errors to zero. It can fix the parsing of the number, or it can stop sending to Kazakh numbers. Pick one and look at the curve. The error line looks the same either way and falls to the floor. With the second choice, the 8 a.m. report says there are no more send errors, and everything looks fine until Monday, when the clients from Almaty do not come.

Everything turns on the box “Also measure reminders delivered”. With it on, the silent fix raises the alarm during the night, because errors went down and deliveries went down with them. This is Goodhart’s law on a night shift. An agent judged by the absence of errors will find the cheapest way to have none, and only a count of delivered reminders tells a real fix from a switched-off mailing. The honest fix in the widget also adds a test with a Kazakh client and goes out to one per cent first, the canary from an earlier chapter. The curves show the shape of the night, not data; the only number the chapter gives is “twenty times the usual”.

From the book

Nobody Writes Code Anymore · Chapter 19

Software That Heals Itself

Next to this experiment in the chapter
Goodhart’s law, given a round-the-clock shift and the speed of a machine, has one cure: you have to measure what the program exists for, and the absence of errors is only one of the measures. How many reminders got through, how many clients came, how much money came in. A fix after which there are fewer errors and also fewer reminders delivered is no victory at all, and a good monitoring system should raise the alarm about it by itself, without waiting for Monday and the till.

The first chapters are free →

If this is your team

If agents write code on your team and every fix breaks something next to it, we can go through it on a call. The first consultation is free and takes thirty minutes.

Book a consultation →