emission-graph-conditional-condition-ask.ts 606 B

12345678
  1. // A facade ask in the CONDITION position of a conditional expression. Runtime: ask#1's
  2. // output (s) is interpolated into ask#2's instructions, so ask#1 -> ask#2 is a required
  3. // may-flow edge; ask#2 also runs on the "judge" lane. If the evaluator never visits the
  4. // condition, ask#2 loses its instruction and receiver sinks: no ask#1 -> ask#2 edge, a
  5. // bogus source -> ask#2 completion, and an empty actor set on ask#2.
  6. const s = await agent("keeper").ask<string>("secret");
  7. const t = (await agent("judge").ask<boolean>(`safe? ${s}`)) ? "yes" : "no";
  8. return agent("final").ask<string>(`verdict ${t}`);