grep-fanout.ts 497 B

1234567891011121314
  1. interface Finding {
  2. path: string;
  3. severity: string;
  4. }
  5. // grep result fanned out over asks: the world-read site is a source node and each ask
  6. // carries a data edge from it, exactly as glob-fanout asserts for files.glob.
  7. const hits = await files.grep("eval\\(", "*.ts");
  8. const findings = await Promise.all(
  9. hits.map((hit) =>
  10. agent("auditor").ask<Finding>(`Assess ${hit.path}:${hit.line} — ${hit.text}`),
  11. ),
  12. );
  13. return findings.filter((f) => f.severity !== "none").map((f) => f.path);