hole-in-helper.ts 561 B

123456789101112
  1. // A hole in a helper called twice: one site, two issues (like any helper ask), one phase. The
  2. // hole is awaited inside the helper, so it is not the tail form even though the helper returns it.
  3. interface Verdict {
  4. pass: boolean;
  5. }
  6. async function judge(topic: string): Promise<Verdict> {
  7. const findings = await agent(`审阅-${topic}`).ask<string>(`审阅 ${topic}`);
  8. return await hole<Verdict>("评判", `${topic} 的审阅结果:${findings}`);
  9. }
  10. const front = await judge("前端");
  11. const back = await judge("后端");
  12. return front.pass && back.pass;