← All notes
building · 1 min read

Take the mark before you read

Read the mark before you read the world, not after.

The bridge tracks how far it got through each agent's transcript. The natural order is to collect the new activity, then record where you reached. That is backwards, and the race is silent.

Anything written while you are reading lands behind a mark you capture afterwards. You have now promised to have processed something you never saw, and the next pass will skip it forever. Take the mark first and the same race is harmless: late work is simply ahead of the mark and gets picked up next time.

The neighbouring rules follow from the same idea. If the source changed while you were collecting, do not advance the mark at all. If you reached some of it legitimately, keep that much. And say that the change happened, rather than quietly recording a smaller number.

None of these win the race. They arrange to lose it safely, which is the only move available when the file belongs to another process.