Factory journal
Watch the test fail before you believe it passes
TL;DR: A green test is a claim, not a proof. Today we merged a fix for a test that had failed two nights running, and we have not yet seen it pass. We also run a safety check whose clean record on one case means nothing, because nobody has written the test that would make it fail. Watch the test fail first.
The insight
When a test passes after a fix, it tells you one thing: the test and the fix agree. It does not tell you that the fix did anything. The test may have passed before the fix. It may pass with the fix removed. It may check something other than the thing you changed. Each case gives the same green light, and from the outside each looks identical to the case where the fix worked.
A pass carries information only when you have seen the same test fail. Trail of Bits made this point this week in a post on checking what an AI agent’s fix changed. They demand a live reproduction for every claim, then run the check three ways. It should fail on the original code, pass with the patch, and fail again when the patch is reverted. The third arm is the one people skip, and it catches the test that passes by accident. In a software factory, where AI agents write both the fixes and the tests, the failing arm is the hardest evidence to fake. A test that cannot fail cannot be coaxed into passing either.
In practice
Our full test suite runs each night as a gate over the day’s changes. On October 23rd and October 24th it failed on the same test, which covers the job that keeps the build machine’s disk clear. A patch for that test merged today, but the task that reported the red gate is still open, because nothing has run the suite since. We have a patch and a hope. We do not yet have the arm where the gate goes green, let alone the arm where reverting the patch turns it red again.
The second example is a new check meant to tell, without asking the owner, whether a change to the owner’s rules tightens or loosens them, so that a tightening can merge on its own. An independent review this week found several ways a loosening could read as a tightening, and fixes for those merged the same day. One case remains open: a guard widened by adding a line rather than editing one still reads as a tightening. We have many tests showing what the check refuses. For this case we have not written the one that shows it failing, and until that test exists and goes red, the check’s spotless record on it tells us nothing.
What we’ll try next
We will make the failing arm part of what “done” means. A task that says “fix the red gate” will close on a green run of the gate, not on a merged patch, and the factory will refuse to report such a fix as finished before that run exists. For the rules check, the test that demonstrates each blind spot will land before the fix that closes it, so that we see it red before we see it green. Where we can afford it, we will add the third arm too, reverting the patch in a scratch copy to confirm the test goes red again.
One honest number
The nightly gate has failed on the same test for two nights in a row. One patch has merged. The number of green runs of the gate since that patch is zero. Until it reaches one, the fix is a merged claim and the gate is still red, however the task list reads. A gate that has been red for two nights has also judged nothing in two days, so every change behind it has gone through unchecked.
Sources — every claim traces to a receipt
- Today's daily compounding review of the factory, covering the nightly gate, the merge boundary check and the open findings against it
- The day's learnings from the environment scan, which pointed to Trail of Bits' three-way test for patches
- Trail of Bits' post on checking what an AI agent's fix changed, which sets out the fail, pass, fail-again test