Notes from the Trenches Receipts Included Compound engineering

Fix the mold, not the cast

!Hot-Fix → The Idempotent Fix: == Done, Right. For Good.

One evening, four fixes, and the same lesson every time. A parent can explain that the stove is hot; the third burn and the hospital visit is what creates the reflex. A hot-fix patches the thing in front of you. An idempotent fix goes into whatever made the thing, so running it twice changes nothing and the same break cannot come back for a sequel.

I · The cast and the mold

A mold is the hollow negative form. A cast is what comes out of it. One mold makes many casts, so a flaw in the mold shows up in every one of them, and a flaw in one cast is only that cast. Foundry workers have known this for a few thousand years. Software keeps relearning it one outage at a time, usually at 11 PM, usually on a Friday, usually with someone typing "quick fix" in a channel with four hundred people in it.

The tempting fix is always the cast. It is right there, it is the thing that looks wrong, and editing it feels wonderful, like cleaning your room by pushing everything under the bed. It is also the fix that does not hold, because the next pour brings the flaw straight back. In math, an operation is idempotent when doing it twice gives the same result as doing it once. That is the bar: a fix you could run again tomorrow and change nothing, because the cause has already left the building.

History's most famous hot-fix belongs to Cato the Elder, who by tradition ended every speech in the Roman Senate, on any subject at all, with the same line: Carthago delenda est, Carthage must be destroyed. Roads, taxes, the price of olives, it did not matter. He re-applied the patch every single time, because the cause was still standing. Rome eventually made the fix idempotent in 146 BC, and nobody had to say it again. The lesson is not to salt the earth. It is that a fix you have to keep repeating is not done; it is a habit with a body count.

A hot-fix makes the symptom go away. An idempotent fix makes the cause go away. Only one of them gets to say done with a straight face.
II · The edit that was refused

The first fix of the night was supposed to be one line. A new tool, an RFP answering engine, had a perfectly good live page that nothing linked to, a restaurant with no door. So I opened the public goods index and added a card by hand. The commit check, which has the warmth of a bouncer who has memorized the guest list, refused it: the page differs from its renderer.

The index is not a page anyone writes. It is a cast, poured from a data file by a small renderer, and a check on every commit compares the two. My hand edit would have lived exactly until the next render, then vanished like a sock in a dryer. So the card went where it belonged, into the data file, and the renderer learned one new trick: an unreleased tool with its own live page links that page instead of a code repository. Run it again and nothing moves. Very boring. Exactly the point.

III · The casts poured from an old mold

The second one was spicier, because every check said it was fine. Two public pages, an audit offer and its free sample, had been brought onto the shared design kit. The design checker scored both at zero findings. In a real browser, every heading had collapsed into plain Times at body size, the typographic equivalent of showing up to a wedding in the hotel bathrobe.

Both pages carried a copy of the kit's design tokens, pasted in weeks ago and never visited since, like a gym membership. The kit had grown up and moved on: new names for fonts, sizes and corners. The pages kept asking for names their old copy did not have, and a missing name in a stylesheet does not throw an error. It quietly falls back to the browser default and lets you find out in public. The checker passed both pages because there was nothing left on them to object to. A blank wall has no bad paint.

Patching the two pages would have been a hot-fix with a timer on it. The repair was to pour them again from the current kit, unchanged, and let the kit's own check confirm the copy matches. Eleven design findings on the older page went to zero, and three standing exceptions, written earlier the same day to excuse the mismatch, were deleted instead of renewed. Yes, the same day. We contain multitudes, and some of them write waivers.

The ledger: what each fix changed

CastA card typed into the generated index. MoldThe entry in the data file, and a renderer that knows what a preview page is. CastTwo pages with fonts patched one by one. MoldBoth pages re-poured from the current token file. Three exceptions deleted. CastA false alarm on a word the page has to contain, silenced everywhere. MoldOne exception scoped to one line of one file. The word still fails on every other page.

Same move every time: find what made the thing, change that, and leave a check that refuses the old shape at the door.

IV · Building the mold first

The third fix was not a fix at all, which is the whole joke. The audit we sell ends in a report, and the obvious move was to hand-write that report for the one worked example we have. Instead the mold came first: one data file per audit, and a builder that turns it into a page from the design kit's own parts. The worked example became the first cast, and the mold stayed in the drawer for the next one.

Each claim in that report renders only as sharp as the record behind it. Well-backed claims are crisp. Unconfirmed ones wear a visible grain, like a photo of Bigfoot. The one place the record contradicts itself shows up as interference, which is the visual version of a witness changing their story. The builder has its own test, and a check flags any report that drifts from its data. The second client report costs a few hours instead of a few days, because nobody pours the mold twice.

V · The video where corrections become checks

The night before, a different session made a short video about building the RFP engine's videos, which is either compound engineering or a hall of mirrors, depending on how much coffee you have had. Its whole argument fits on one line: every fix today left something behind. A rule, a check, a reviewer, a tool, or a task for the next session.

It follows one chain from start to finish. A line of narration sounded strange read aloud. The rewrite became a written rule for the video kit. The rule became a check that reads every script before it is recorded. A reviewer agent that inspects every frame before it renders blocked the videos twice, on margins, type and density, and they passed on the third try. The audio tool that fixed the mix is now shared by both videos. And whatever was still loose became a row in the backlog, with its route, its gates and what it waits on.

That chain is the mold, filmed. The timing bug that put on-screen reveals on estimates instead of the voice was fixed inside the tool, so it stays fixed. The two frames that were too dense were trimmed by hand, and the video says so out loud: the checks for type size and density still live in the reviewer's judgment, not in a script. That is the honest part, and the useful part. It names exactly which fixes are casts and which are molds, which most retrospectives would rather not mention at dinner.

VI · The referee and the judge

Two roles keep a mold honest, and they must never be the same person, for the same reason you do not let a goalkeeper also run the scoreboard. A referee works during play. It runs written rules, instantly, and says go or stop: the check that refused my hand edit, the check that compares a page to its builder. It does not care about your feelings or your deadline. A judge works after play. It reads the finished record, weighs evidence, and sets precedent.

The improvement lives in the hallway between them. When the judge keeps finding the same flaw in cast after cast, the flaw belongs to the mold, and once it can be written as a rule it graduates to the referee. When the judge keeps overturning the same referee call, the rule is too blunt and goes back to the workshop. Neither role ever restarts play past a door that cannot be closed again. That one stays with a person, preferably one who has had coffee.

The referee guards the mold. The judge inspects the casts. A flaw the judge finds twice is not a flaw in the cast; it is a flaw in your process wearing a fake mustache.
VII · Compound interest, paid in checks

Here is what the evening actually bought. Not four fixed pages. Four checks that now refuse the old shape, three exceptions nobody has to renew, and one builder that will pour every report after this one. The next person to touch any of it inherits the fix without ever knowing there was a fire. That is the whole return on compound engineering: the work stays done, and the 11 PM Friday channel stays quiet.

From the ARCS proverbs: the mold, written down months earlier

On wasteWhat you built twice by hand, you should have built once as a mold. On timingThe moment to cut the mold was the moment the copy-paste began. On payoffThe mold pays for itself on the second casting and profits on every one after. On restraintA one-off earns no mold. Promote on the second real case, not the first. On loopsA finding that terminates in a file with no gate will happen again.

The house rules already said all of this. The evening just made them true four times in a row, which is the only way a proverb earns its keep.

Not everything earns a mold. A truly one-off flaw still gets patched where it sits, with a note left behind so the mold can catch up if it turns out not to be one-off after all. It usually turns out not to be. The discipline is not to never hot-fix. It is to never call a hot-fix done.

Salvador Dalí supposedly told people, “Have no fear of perfection; you'll never reach it.” He was right, and it is the most comforting thing a mustache has ever said. The idempotent fix is not perfection. It is smaller and more useful than that: one break that will not happen again, so tomorrow's mistakes can at least be new ones.

Done, right, for good means you could run the fix again tomorrow and nothing would change. Anything less is a calendar invite to meet the same bug again, recurring, no end date.
More field notes Read the rest of the series →