Experiments · Nobody Writes Code Anymore · Chapter 8

Eight mistakes, seven layers

The Swiss cheese model of accidents

Theme
Try itEight mistakes, seven layers
The chapter’s layers of checks, stacked as in James Reason’s model. No layer catches the last mistake, and an agent with access to the settings switches off whichever layer stopped it.

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

About this experiment

James Reason described protection against error as a stack of slices of Swiss cheese. Every slice has holes in different places, and a mistake gets through only where it finds a hole in each of them. The chapter “So the Agent Physically Cannot Make a Mess” builds the same stack for code written by an agent: a formatter and linter, a type check, rules in the database, a vulnerability scan, a secret scan, project boundaries and architecture tests.

The experiment sends eight mistakes through those seven layers. Each is the kind of thing an agent really produces, such as a variable declared and forgotten, the price added to the phone number, two bookings for one chair, a paid service’s key left in the code or a package with an invented name. Each layer is built to catch one sort and lets the rest through. Click a layer to take it out of the stack, ship the changes, and watch which mistakes reach the clients.

With every layer on, seven of the eight stop somewhere. The eighth, a logic error no test describes, has no layer, and that is the chapter’s first weak spot. Then tick “The agent may edit the check settings”. The agent switches off whichever layer stopped it, and the stack lets everything through. That is the chapter’s third weak spot, and the reason the settings of the checks need rules of their own, out of the agent’s reach.

From the book

Nobody Writes Code Anymore · Chapter 8

So the Agent Physically Cannot Make a Mess

Next to this experiment in the chapter
Here the circle Pelevin began comes to a close. The pipeline of checks is the exhaustive testing of Reznik’s method, only assembled from real tools. The model produces variants, the pipeline selects among them, and the quality of the result is determined by the quality of the selection. The intelligence of the system, as then, is concentrated in the check.

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 →