iteration-fanout-destructured-element-param.ts 457 B

12345678
  1. // map with a DESTRUCTURED element parameter ({ q }): at runtime q is element.q,
  2. // which carries ask#1's artifact — the judge's instructions are tainted by it.
  3. // Expected: source -> ask#1; ask#1 -> fan-out#1; ask#1 -> ask#2 (MUST);
  4. // fan-out#1 -> ask#2; ask#1/fan-out#1/ask#2 -> sink.
  5. const s = await agent("planner").ask<string>("plan");
  6. const jobs = [{ q: s }];
  7. const outs = jobs.map(({ q }) => agent("judge").ask<string>(q));
  8. return outs;