callback-array-from-phased.ts 605 B

12345678910
  1. // Callback invocation family: `Array.from(xs, fn)` with an inline mapper inside a phase, next
  2. // to a `flatMap` that was always a candidate. Both are `each` entries of the registry, so
  3. // both are fan-out candidates and the fixer's ask is a phase#2 member.
  4. phase("triage");
  5. const paths = await files.glob("src/**/*.ts");
  6. const flagged = await Promise.all(paths.flatMap((p) => [agent(`t-${p}`).ask<string>(`triage ${p}`)]));
  7. const picked = flagged.filter((f) => f.length > 0);
  8. phase("fix");
  9. const fixes = await Promise.all(Array.from(picked, (f) => agent("fixer").ask<string>(`fix ${f}`)));
  10. return fixes;