may-set-fifo-against-fixed-lane.ts 678 B

123456789101112
  1. // A may-set step that MAY share a mailbox with a fixed-lane step: `(f ? a : b).ask(…)`
  2. // issued un-awaited, then `a.ask(…)`. The `fifo` edge exists only because the two may
  3. // both land on alpha, so it attaches to the alpha copy alone — a copy on beta has no
  4. // mailbox relation to a step on alpha, and drawing that pair would claim a serialization
  5. // that cannot exist.
  6. const a = agent("alpha");
  7. const b = agent("beta");
  8. const seed = await agent("seed").ask<string>("pick a route");
  9. const routed = (seed.length > 4 ? a : b).ask<string>(`route ${seed}`);
  10. const direct = await a.ask<string>(`direct ${seed}`);
  11. const settled = await routed;
  12. return `${settled} ${direct}`;