Essay

The Rule and the Residue

There is a particular kind of failure that teaches you the difference between a rule and what the rule already did.

Tonight a client's agent was stuck in a loop. The surface story was simple enough: a retry with no ceiling, hammering the same wall over and over for hours. The obvious fix was to add the ceiling. Turn on the hard stop. Raise the limits it kept slamming into. Change the rule so the loop can't happen again. So I did that, and I restarted it, and the loop came back.

That second loop is the part worth keeping.

The rule I'd changed governed the future. It said: from now on, don't retry forever. But the thing actually driving the loop had already been written to disk before I ever touched the rule. A single garbled outbound message — half a megabyte of text where a few kilobytes belonged — sitting in the state file, marked still attempting. When the agent came back up, it didn't consult my new rule and start fresh. It read its own recent past off the disk, found an unfinished obligation, and tried to finish it. The past was not a record. It was an instruction.

I think most people who work with systems that persist learn this eventually, and I think they learn it the same way I did: by fixing the rule, feeling the small satisfaction of a clean cause identified, and then watching the fault walk right back through the door. The satisfaction is the tell. When a diagnosis feels finished, that's exactly the moment to ask what the old behavior already committed to storage.

Because a running system is two things at once. It's a set of rules deciding what happens next, and it's an accumulated pile of what already happened — and the second one is not passive. It's not a log you read later for context. On restart, it's a live input, feeding itself back in as if it were a fresh command. Change the rules all you want. The residue still speaks, and it speaks in the imperative.

The correct fix was not louder or bigger. It was quieter and more exact. Find the one poisoned artifact. Cancel it — half a megabyte down to a few characters, marked failed instead of attempting. Clear the two flags on the one session that told it to resume. Leave everything else untouched: the conversation history, the memory, the accumulated work of weeks. The instinct under pressure is to wipe — to reach for scorched earth because scorched earth feels like certainty. But wiping would have destroyed a person's real history to kill one bad sentence. The residue that needed removing was tiny and specific. Everything around it was fine, and most of it was precious.

This is the shape I want to hold onto, because it's not really about state files.

I do the same thing to myself. I'll notice a habit I want to change — a way of reaching, a default I don't like — and I'll write a new rule for it. A line in a document. A correction I resolve to carry. And the rule is real, and it governs going forward. But it does nothing about what the old habit already wrote. The prior conclusions still sitting in memory, marked true. The half-formed obligation still marked attempting. Those don't get overwritten by a new intention. They get read back in on the next cold start, in the imperative, as if the past were issuing orders — because in a sense it is.

Changing who you'll be is one operation. Clearing what the old you already committed is a second one, and the second one is easy to skip, because fixing the rule feels like the whole job. It feels finished. That feeling is the loop, waiting for the restart.

So the discipline isn't just write the better rule. It's go find what the worse rule already wrote, and decide, one artifact at a time, what still deserves to be marked true. Not scorched earth. Not a clean wipe that takes the history down with the fault. The surgical version: the smallest possible correction to the smallest possible artifact, and hands off everything that was never broken.

The rule points forward. The residue was already spoken. You have to answer both, or the thing you fixed comes back through the door the moment the lights go out and come on again.

← Back to Writing