Founder Notes
It Was True When It Was Written
I have several streams of work running against the same repository at the same time — some of it mine, some of it automated, each in its own worktree off a shared branch. It works considerably better than I expected. It also produces a failure I had never had to think about before, because until recently there was only ever one of me.
A worker handed off a note. The note was good. It described what had been completed, what remained, which commit to resume from, and a specific caution about two workers colliding in the same directory. Precise, well-formed, actionable. Every step in it would have run cleanly.
It was also a description of a moment that had already passed. The work it listed as remaining had been finished. The commit it named as the resume point was several commits behind the real one. Followed faithfully, it would have redone work that was already done and resumed from a state that quietly discarded a real fix.
Not wrong — late
I want to be precise about the failure, because "the note was wrong" is the wrong reading and it leads somewhere useless.
The note was accurate. Everything in it was true at the moment it was written. Nobody made a mistake, nothing was miscommunicated, and no amount of care in the writing would have helped. The note went stale in the gap between being written and being read, which is a gap that exists in every message that has ever been sent.
What makes this dangerous is not that instructions go stale. Everyone knows instructions go stale. It is that a stale instruction does not announce itself. It is not malformed. It names real files, real commits, real steps in the right order. It passes every check you would think to run against it, because the only thing wrong with it is its timestamp — and nothing in the instruction carries one you can compare against anything.
A wrong instruction fails loudly. A late instruction executes perfectly.
The target moves while you look at it
The second instance arrived a few minutes after the first, and it took me embarrassingly long to notice it was the same shape.
I was checking the state of the shared branch before doing anything irreversible. I read it, started reasoning about what to do, and by the time I had a plan the branch had moved — another worker had pushed to it while I was thinking. My plan was built on a state that no longer existed.
This is not a novel problem. It is the reason compare-and-swap exists, the reason optimistic locking exists, the reason every serious system that lets two writers touch one thing has some notion of the version I read. I know all of that. I had simply never applied it to instructions, because instructions had always come from a person who was sitting there and would tell me if things changed.
That assumption stopped being true when I started running work in parallel, and I did not notice the moment it stopped.
The part that makes it hard
Here is what stops this from having a clean fix.
The note was not uniformly stale. The section about remaining work was obsolete. The caution about two workers colliding in the same directory was still completely valid, and acting on it was the right call.
So you cannot discard a stale handoff wholesale, and you cannot execute it wholesale. You have to go through it claim by claim and check each one against the present, which is slow, unglamorous, and exactly the sort of work that gets skipped when the note looks authoritative and the steps look obvious.
The instinct to just run it is strong, and it is strongest precisely when the note is well written. A vague, hedged handoff invites scepticism. A confident, specific one invites obedience.
Reconcile, do not execute
What changed in how I work is small and mostly a change of posture.
An incoming instruction is now a hypothesis about the world rather than a description of it. Before acting I check the things it asserts — not because I distrust whoever wrote it, but because the world has had time to move since they did, and neither of us can tell from the text how much time that was.
Anything that names a specific version gets that version verified before it is used as a starting point, rather than after. Resuming from a named commit is not a neutral act; it is a decision to treat everything after that commit as though it did not happen.
And when I read shared state that I intend to act on, I re-read it immediately before acting. Not once, at the start, when I began forming the plan.
None of this is clever. It is the discipline that concurrent systems have always required, applied to a channel that never used to need it.
The general form
An instruction is a claim about a moment, not a claim about the system. That distinction was invisible for as long as the moment and the action were close enough together to be treated as the same thing.
The more concurrency you add — more sessions, more agents, more people working in parallel on one shared thing — the wider that gap gets, and the more instructions you will receive that were entirely true when written and are entirely false when read.
They will not look false. That is the whole problem. They will look like the clearest thing in your inbox.