Founder Notes
I Was One Entry Away
Two different parts of the system write the same records. I knew that, and for a long time I filed it under tolerable overlap rather than under problem, because one of the two paths is strict.
The strict path takes the fields that matter from a reviewed table. If the table has no entry for the thing being written, the strict path refuses and nothing is written. That is the behaviour I designed and the behaviour I trusted.
The other path is older. It takes the same fields out of prose, from a description written for people and parsed well enough to work. Nobody ever intended it to be the authority on anything. It has simply been there, and it writes to the same place.
So I went looking for what the loose path had got wrong. The answer, to my surprise, was nothing. Every record it had written was correct.
Why it was correct
Not because of anything about the loose path. The loose path has no opinion about correctness.
It was correct because the reviewed table was missing an entry for something else entirely, an item unrelated to any of this that nobody had got around to adding. With that entry absent, the loose path had never once been handed a case where its answer and the strict answer came apart. It had been writing correct values because it had never been asked an interesting question.
I want to be exact about the shape of that, because it is the whole point. I was protected. Nothing was protecting me. The protection was a side effect of an unrelated piece of incompleteness, and it would last exactly as long as that incompleteness did.
The part that changed how I think about controls
Here is what makes it worse than a near miss.
Picture the moment the protection disappears. Nobody is touching this code. Nobody is thinking about write paths at all. Someone is adding a missing entry to a reviewed table, which is small, correct, entirely legitimate work, the sort of thing you would thank a colleague for doing. The instant it lands, the loose path starts answering a question it has no business answering, and nothing anywhere will mention that anything changed.
That is the question I had not been asking. I had been asking whether my safeguards work. Most of them work. The sharper question is what it would take for one to stop working, and whether that thing would look like a change to the safeguard at all.
A real control has to be argued with. Taking it out is an act aimed at it, and someone can ask you why you did that. A control that evaporates as a side effect of unrelated, correct work, done by someone who has never heard of it, is not a control. It is a coincidence I had been reading as a design.
What I did about it
I fixed the two paths so the fields that matter come from one place, and the loose path no longer writes them. That took an afternoon and it was not interesting.
The interesting part was going back through the other things I would have described as safe and asking the new question of each one. Not whether it works. Does this hold because of something inside it, or does it hold because of a condition somewhere else that nobody is keeping in place on my behalf?
A few of them turned out to be coincidences. I would never have found them by looking for failures, because none of them had failed. They were all working perfectly, for reasons that had nothing to do with them, and each one was one small correct change away from stopping.
If I cannot say what would have to happen for a safeguard to stop working, I do not have a safeguard yet. I have a situation that currently resembles one.