The Dinner Mesh

Every language has one program that everyone knows. C has hello, world. Osmol has the dinner mesh: two people, one evening, one overdue code review, and not a single message. This is dinner.osmol, the canonical program that ships with the reference interpreter, and at the end of this chapter you will be able to read every line of it the way the equilibrium engine does.

Here it is, exactly as it lives in the osmol repository:

-- dinner.osmol — the Spec §8 mesh, now runnable
twin maya {
  hold eta(dinner) = 19:40 ±5m, decays 20:00
  seek venue(dinner) by 18:00 else escalate
  owe review(atlas) to raj by fri
  bond raj { trust high }
  express to raj: "Saw a fox on the way home and thought of you."

  membrane {
    eta(*) -> family: exact
    eta(*) -> others: coarse(30m)
    status(*) -> team: category
  }
  attention {
    interrupts 2/day
    quiet 22:00-07:00
    threshold others 0.8
  }
}

twin raj {
  decide venue(dinner) among { verde, banh-mi-house } by 18:00
  seek eta(dinner) by 19:00
  seek status(atlas.review) by thu else sync
  bond maya { trust high }

  membrane {
    venue(*) -> family: exact
    decision(*) -> family: exact
  }
  attention {
    interrupts 4/day
  }
}

Note: this file differs deliberately from spec §8. The program in the specification is the idealized dinner mesh; this one is the runnable one. Three additions and one omission. It adds bond raj { trust high } to maya (so the two twins are in each other's inner circle in both directions), it adds the express (so you can watch the human lane deliver), and it adds a venue(*) membrane rule to raj, because when raj's decision resolves, the assertion it emits is named venue(dinner), and without a matching rule the answer could never cross his membrane. It omits assume role reviewer(atlas), because the v0.1 interpreter does not parse assume role (see the v0.1 pragmas). Everything else is spec §8, character for character.

Maya, line by line

hold eta(dinner) = 19:40 ±5m, decays 20:00 is an assertion, the supply side of the mesh. Maya's twin claims a value: her ETA is 19:40, with ±5m of honest uncertainty, because she is a person crossing a city, not a train timetable. The decays 20:00 clause is temporal validity: once dinner has really started, an ETA is trivia, and the claim expires on its own. Nobody has to remember to un-say it. The full type of this assertion is a triple, (instant, exact, decays 20:00), because in Osmol, time and precision are part of the type, not metadata.

seek venue(dinner) by 18:00 else escalate is a gap, the demand side, and the only thing in the entire language that can attract flow. Maya does not know where dinner is. She does not ask anyone; she declares the absence. The by 18:00 deadline gives the gap urgency, and else escalate says: as the deadline nears, raise the priority of this gap rather than letting it lapse.

owe review(atlas) to raj by fri is a commitment. Maya owes raj the atlas review by Friday. Commitments generate structural supply automatically: in v0.1 this line also emits hold status(atlas.review) = in-progress on maya's side, because an unmet promise implies the standing interest of the counterparty in its status. Maya never has to write "just an update, still working on it" again. The owe is the update.

bond raj { trust high } is a bond. Raj is inner-circle. In v0.1, this is also what makes raj count as family when maya's membrane speaks of audiences (the circles pragma: family and team match any party the sender bonds trust high; others is everyone else).

express to raj: "Saw a fox on the way home and thought of you." is the human lane. This is the only place in Osmol where free prose may appear, and it crosses the mesh verbatim, provenance-labeled, untouched by any membrane transform or attention rule. The fox is not information. The fox is the point.

The membrane contains three permission rules, typed as casts. Family sees maya's ETA exact; everyone else sees it rounded to coarse(30m); her team sees the status of her work at category grain, that is in progress, not the details. Notice what the membrane cannot say: there is no rule that sharpens. Precision only flows downhill (Axiom IV, see the five axioms).

The attention block is maya's sovereign budget. Two interruptions a day, quiet from 22:00 to 07:00, and a threshold of 0.8 for strangers. These numbers are legal only inside maya's own twin; no other program on Earth can reference, lower, or spend them (Axiom III).

Raj, line by line

decide venue(dinner) among { verde, banh-mi-house } by 18:00 is an open decision. Two options, one deadline. A decide generates gaps for its unevaluated consequences and, this matters, the engine will never resolve it. Choosing the restaurant is human work, injected as a resolution (you will do exactly that in Resolving Decides). When it resolves, it emits hold venue(dinner) = verde, and that is the assertion maya's gap is waiting for.

seek eta(dinner) by 19:00 means raj wants to know when maya arrives, by seven. No escalation clause: if it goes unmet, it simply stays open.

seek status(atlas.review) by thu else sync is raj's standing interest in the review he is owed, with the strongest escalation in the language: else sync authorizes the mesh to schedule live human time if the gap survives past Thursday.

bond maya { trust high } and raj's membrane and attention are the mirror image of maya's declarations: maya is family to raj, his decisions and venue facts flow to family exact, and he budgets four interruptions a day, with no quiet hours declared.

The settling story

Now keep the whole mesh in your head and watch what the pressure function will do with it. The story is narrated here as spec §8 tells it; in the next chapter we watch it happen.

t₀. Raj's seek eta(dinner) and maya's hold eta(dinner) form a gradient. Maya's membrane consults its rules: raj is family (she bonds him trust high), so the cast is exact. The pressure clears raj's family threshold, and the delta is absorbed silent. Raj's phone shows nothing. Raj's twin simply now knows 19:40. This is the sentence to sit with: the highest-volume outcome in Osmol is knowledge without an event.

t₁. Raj resolves decide venue = verde (a human judgment, injected from outside the mesh), which emits hold venue(dinner) = verde. Maya's seek venue gradient fires through raj's venue(*) -> family: exact rule. Because her gap carried else escalate, the answer takes ledger placement: it appears on her consequence-sorted board, with the deadline still distant and no interrupt spent.

t₂. Maya's owe review(atlas) auto-generated status supply meets raj's seek status(atlas.review). Her membrane's status(*) -> team: category rule casts it down: raj's twin now holds in-progress at class grain, silent. He knows the review is moving. He does not know, and is not entitled to know, anything finer.

t₃. And if Thursday arrives with the review gap still open? The else sync clause authorizes both membranes to book twelve minutes of live conversation, agenda pre-compiled from the surviving gap. Synchrony is the exception handler, not the ritual.

Total messages composed by humans: zero. Total interruptions: zero. Everyone knows everything they were entitled to know, the moment it mattered, and the mesh goes quiet, because silence is a fixpoint.

In the next chapter, we run this file through the reference interpreter and read the trace it prints, pressure arithmetic and all. The story above is what the numbers are about to say.