may-set-oneshot-ternary.ts 508 B

12345678
  1. // A one-shot ternary receiver at the top level: nothing guards the ask, so the source
  2. // step is `always`. Each copy is nonetheless `maybe` — the ask always runs, but each copy
  3. // may not, and certainty is per-node. No enclosing iteration region, so no carry edge.
  4. const fast = agent("fast");
  5. const careful = agent("careful");
  6. const brief = await agent("triage").ask<string>("classify this request");
  7. const answer = await (brief.length > 8 ? careful : fast).ask<string>(`handle ${brief}`);
  8. return answer;