order-helper-ask-two-call-sites.ts 641 B

123456789101112
  1. // A helper containing an ask, called from two sites. Phase 1 ships ONE step per site,
  2. // so both calls collapse onto `ask#1`: the walk records two issue events for it, and
  3. // no repetition cue appears (two call sites are not a region). Phase 3's site
  4. // specialization splits it into `ask#1/1` and `ask#1/2`, at which point the two
  5. // `await`s show as an ordered pair — an intended snapshot change.
  6. const worker = agent("worker");
  7. async function run(topic: string): Promise<string> {
  8. return await worker.ask<string>(`work on ${topic}`);
  9. }
  10. const first = await run("alpha");
  11. const second = await run("beta");
  12. return `${first} ${second}`;