Founder Notes
The Tidying Is the Specification
A script in our repo generates a schedule. For a while, the schedule committed alongside it did not match what the script actually produced, and I did not notice, because the committed version looked better.
That is the whole problem in one sentence, and it took me days to see it.
Someone — me, on an earlier pass — had run the generator, looked at the output, found it slightly off, and written the corrected entries out by hand into the document. Ordinary, well-intentioned work. The document was the thing people read, the document was now tidy, and the job was done.
Except the document was not right. The hand-written version scheduled work on weekends, which nobody caught, because nobody reads a schedule checking the weekday of every entry. People read a schedule looking for their own row.
And the generator was also wrong, in a different way. It had an off-by-one in the step it took between entries, so it emitted an irregular sequence instead of the regular one it was meant to. Two independent bugs, stacked.
Here is the part worth keeping. The second bug was findable at any moment, by anyone, for free. All it needed was a comparison between the generator's output and the committed document. But that comparison had already been performed once, informally, by the person who did the tidying — and the way they recorded the result was by erasing it.
A hand-correction of generated output is a bug report that got written and then deleted before filing. The discrepancy was observed. The information existed. It was spent on making one artifact look right, rather than on making the thing that produces the artifact right.
I think this is common, and I think it is common because tidying feels like diligence. You are not ignoring the problem, you are fixing it. You are fixing the copy in front of you, which is the copy that ships, and there is a deadline. The generator's output gets treated as a draft, and your judgment as the final pass.
The trouble is that this arrangement quietly relocates the specification. If a generator's output always needs a human pass before it is usable, then the real specification is not in the generator. It lives in the habits of whoever does the pass — unversioned, untested, resident in one person's head, and applied inconsistently, because that person is pattern-matching against what looks right rather than against a rule.
What replaced it for me is a blunt discipline: when I catch myself editing a generator's output, I stop and treat the edit as the bug report I was about to throw away. Either the generator is wrong and should change, or my expectation is wrong and should be written down as a check. Usually it is the first. Occasionally the exercise shows the generator was right and the thing I was about to fix was correct all along, which is worth knowing too.
The general form is easy to state and harder to hold. A generated artifact should be reproducible from its generator, and a difference between the two should be an error rather than a matter of taste.
If the output needs tidying, the tidying is the specification. Write it into the thing that generates, or admit you do not have a generator — you have a first draft and an undocumented manual step.