actor-relay-chain-connectivity.ts 687 B

12345678910
  1. // An ask-produced collection routed through BOTH a fan-out and a join before reaching
  2. // a downstream consumer ask. Guards the projection's central claim ("relays drop,
  3. // edges survive"): the site graph emits the additive direct edges (producer -> mid,
  4. // producer -> consumer, mid -> consumer), so after dropping both relays the actor
  5. // graph keeps producer -> mid, producer -> consumer, mid -> consumer.
  6. const items = await agent("producer").ask<string[]>("list");
  7. const inner = items.map((it) => agent("mid").ask<string>(`process ${it}`));
  8. const joined = await Promise.all(inner);
  9. const out = await agent("consumer").ask<string>(`summarize ${JSON.stringify(joined)}`);
  10. return out;