7  Part VI — Replay it over Syncthing, and name the messages

Steps 39 to 47 distribute the dynamic version across two machines, say precisely what “direct” means, and then — only now, after the ideas have been used — give the three kinds of message their names: Intent, Status, Event.

7.1 The distributed dynamic run

Sensor on one machine, ROT13 and the actuator on the other, no mediator anywhere. After the two TOPIC Intents had replicated, a typed line produced the result on the other machine — and the board shows what that cost:

  • consoleIn/outbox: the input;
  • rot13/outbox: the result, written by the service that produced it;
  • consoleOut/inbox: Intent only, where the mediated version held a full copy of every message.

The timing was the interesting part. The input was published at 02:35:12 and the results appeared on the first machine at 04:11:28.797 and .893 — 96 ms apart, long after the input. Syncthing had been saturated overnight, so the batch arrived when the queue drained. The chain was correct throughout; the transport’s latency is simply not something the architecture controls. Compare 24 ms for the same chain on one machine.

7.2 What “direct” means, exactly

Two hops that look alike are architecturally opposite:

  • a transport hop — Syncthing on each side, possibly a relay in between — adds no participant that knows the topology and nothing reacts to it. If the packets detoured through another continent, no claim here would be contradicted.
  • an architectural hop — a mediator copying consoleIn/outbox → rot13/inbox — adds a component that must know both names, sits in the availability chain, and republishes the message.

So the defensible claim is: ROT13 reacts to ConsoleIn’s publication with no component of ours in between, and without containing ConsoleIn’s identity. Not: the data goes straight from A to B. The architecture controls which messages a service reacts to, not the transport’s routing.

7.3 Intent, Status, Event

Three kinds of message, named only after being used:

says our examples
E — Event something happened TEXT hello as ConsoleIn/E/text; TEXT uryyb as ROT13/E/crypted
S — Status/State something is currently true ROT13/S/subscriptions — not published by our system yet
I — Intent what should happen TOPIC consoleIn/outbox, ROUTE … …

Past tense is a useful hint for Events. For Intent the test is two questions: does the message report something that happened? No. Something currently true? No. Then it requests behaviour.

One trap: publishing an Intent is naturally something that happened. Classify by what the message says, not by the fact that it exists — otherwise every message becomes an Event and the vocabulary stops being useful.

Status deserves its own note, because the instinct is to ask for it: “what are your subscriptions?” But asking is a call, and a call needs the asker to know the component, to know it is up, and to wait. Status is published: ROT13 publishes ROT13/S/subscriptions whenever its wiring changes, and anyone interested reads it. The reader then needs a topic, not a component, and ROT13 never learns who audits it. Each kind answers a different question:

  • an Event is only useful if you were listening — our stranded messages, three times over;
  • a Status is what a newcomer needs: the current value, without replaying history;
  • an Intent asks for a change.

And commands are not forbidden. Sending ROT13/I with ACTION Hello is command-like, and the material’s verdict is “Fine.” The component performs its capability and publishes its Events and its Status. The flow it endorses is Intent → component → State + Events.

7.4 The one-writer rule

Every writable resource has exactly one writer authority.

Do not confuse that with the UUID in a message filename. The UUID prevents two publications from choosing the same physical name; writer authority says which component owns a logical Event or Status resource. Two writers never collide on a filename, and that is exactly why the problem is easy to miss.

What a second writer costs: the mailbox name was the only provenance marker, so rot13/outbox stops meaning “ROT13 transformed this” and a subscriber can no longer trust the contract it built on. For Status it is worse — two components each claiming to publish the current value of one fact simply contradict each other, with no ordering guarantee across machines to break the tie. For append-only Events many publications coexist by design; the question is semantic ownership, not collision. When two authorities appear, ask why there are two rather than reaching for a lock.