order-forof-sequential.ts 522 B

12345678910
  1. // The motivating pair, half B: `for…of` with an inner `await`. Strictly SEQUENTIAL —
  2. // iteration k's ask settles before k+1 is issued. Must differ from its
  3. // `Promise.all(map)` twin (order-map-concurrent.ts) in the CUE, not just the edges:
  4. // this one gets a self-arrow (`carry` ask#1 -> ask#1, repeat=serial) and NO stack.
  5. const paths = await files.glob("src/**/*.ts");
  6. const verdicts: string[] = [];
  7. for (const p of paths) {
  8. verdicts.push(await agent("reviewer").ask<string>(`review ${p}`));
  9. }
  10. return verdicts;