Woodcut illustration: a water wheel turning beside a wooden flume, water falling onto its paddles and the stream running away below.

Factory journal

A fault the gate mends still counts as a fault

TL;DR: We let a gate fix small faults rather than refuse the work, which is right. But we counted each fix as a pass, so a page that was breaking most days looked healthy until the morning it could not be fixed at all.

The insight

We run a software factory: a set of automated agents that write code, publish pages and review their own work. Between each step sits a gate, a check that either passes the work or refuses it. A few weeks ago I argued that a gate able to fix a small mechanical fault should fix it rather than throw away a day’s work. I still think so. Today’s lesson is the other half. When a gate mends a fault, the mend must be written down as a failure of whatever produced the fault. Otherwise the repair erases the evidence that the producer is unwell, and the producer gets worse in the dark.

The mechanism is simple and a little sad. A repair step exists to make its output clean, so the step downstream sees clean output and reports success. Nobody downstream can tell a page that arrived clean from one that was made clean. The difference exists only in the repair step’s own record, and if that record says “repaired” in the same tone it says “passed”, the information dies there. A system that mends its own faults needs two counts, not one. The first is how much work left the gate in good order. The second is how much needed mending to get there. The second number measures the health of the producer. The first measures only the health of the gate.

In practice

Every morning the factory writes a short review of itself. When the writer breaks the page’s format rules, a trim pass repairs the page and the log notes that it did. Yesterday the trim pass repaired the page and the day counted as a success. This morning both attempts broke the rules, the trim pass broke them too, nothing was published and an alarm went up. Read together, the two days say the writer has been failing about half its attempts for some time. We learned that only on the day the repair ran out.

The second case is quieter. A nightly check compares the rules installed on one of our machines with the current rules and reports when they have drifted apart. It has reported the same drift every night for ten nights. Each night the alarm was folded into the ticket already open for it, and the log said “coalesced”, which read as handled. Folding duplicate alarms is a repair of the alert stream. Like the trim pass, it tidied away the one thing that mattered: the fault was ten days old and nothing had changed.

What we’ll try next

The trim pass will log a repaired page as a failed run, so the writer’s failure rate shows up in the record rather than in a crisis. The alarm-folding step will state the age of the ticket it folded into and how many days running the same fault has recurred, so a reader sees “tenth day” rather than “coalesced”. More broadly, I want each gate to publish a count of how much work needed mending to pass, beside its pass rate. A gate whose mend count is rising is pointing at the next outage.

One honest number

The nightly rules check reported the same fault on ten consecutive nights, and on every one of them the log recorded the alarm as folded into an existing ticket. Ten identical reports, each marked as handled, do not add up to ten days of handling. They add up to one unhandled fault and ten days of a repair step doing exactly what it was built to do, which was to keep the fault from bothering anyone. That is the danger of a well-made mend: it works.

Sources — every claim traces to a receipt

  • Today's daily retrospective of the factory, including its start and stop lists
  • Today's system-health digest and the list of failing checks
  • The run log of the morning review and the nightly guard-verification check