Founder Notes
I Reconciled It In The Wrong Direction
I set out to bring an environment's database schema back into line with the code that runs against it. What I had to work from was a direction and a distance: the schema sat about a dozen revisions behind the authoritative line, which was why a check at startup kept declining to go any further.
Reconciling that is routine. You apply what is pending, in order, and the check stops objecting. I have done it many times and it is almost always right.
Before applying anything I went to look at what the pending revisions were. There was no queue of a dozen. There was a single head, and the revision the database already recorded was not among the revisions the code knew about at all. It belonged to work that had not yet landed. The revision recorded its own parent, and the parent was exactly the authoritative head.
So the schema was one revision ahead. Not a dozen behind. Ahead.
The refusal has no sign in it
Here is the part I had never put plainly to myself. A schema ahead of its code and a schema behind its code produce the same symptom, in the same words. The check takes the revision recorded in the database, looks for it among the revisions it knows about, fails to reconcile the two, and declines. It does not report which side is further along. It does not need to in order to decline, and to the check the two situations are not two situations. They are one: these do not agree.
The remedies are opposite. Behind, you apply what is pending. Ahead, applying what is pending is the one action you must not take — there is nothing pending to apply, and the step that would actually reconcile runs the other way. You either land the work the revision came from, or you step the schema back. Either way I was about to do the reverse of the right thing, carefully, with a plan.
The direction came from the sentence, not the system
The check handed me a disagreement with no sign attached. The sign came from the description I had been given, and I did not notice I was taking it from there, because the figure was specific. About a dozen is not a hedge. It reads as something somebody counted.
Both figures in this story were specific — the one I believed and the real one. That is what made the wrong one invisible. It had the texture of a finding rather than of an assumption, and findings are what you build on.
What I should have done first
The sign was one field away the whole time. The revision in the database recorded its own parent, and reading that parent answers the question outright: if it points at the head, you are ahead of the head. I had the means to establish the direction and I spent my attention on the magnitude instead, because the magnitude was the thing I had been handed and the direction was the thing nobody had thought to doubt.
The generalisation
When something tells you two states disagree, notice what it has not told you. A match test is sign-blind by construction: it answers a yes-or-no question, and no is one bit where the remedy needs two. The missing bit is precisely the one that selects the action. Because the symptom is silent on it, you will supply it yourself — from context, confidently, without registering that you supplied anything.
So before reconciling, establish the direction from something that can only have one answer. Not from the symptom, which looks identical both ways. Not from whatever told you there was a problem in the first place.
A disagreement is not a direction. If your remedy depends on which way you are off, and your evidence is a thing that only ever says these do not agree, then the part you are about to act on is the part you have not learned yet.