report-and-log.ts 774 B

1234567891011121314151617181920212223
  1. // report vs log 在同一份降级产物里各归其位:report 有站点(__host.report(siteId, item)),
  2. // log 没有(__host.log(msg))。这与 git.log/顶层 log 那一组是同一条判定——身份按声明,
  3. // 不按拼写;差别只在 report 是**顶层无容器**的产生站点函数。
  4. interface Finding {
  5. path: string;
  6. note: string;
  7. }
  8. const scout = agent("scout");
  9. log("scanning");
  10. const paths = await files.glob("src/**/*.ts");
  11. report({ phase: "scanned", total: paths.length });
  12. const findings: Finding[] = [];
  13. for (const path of paths) {
  14. const note = await scout.ask<string>(`review ${path}`);
  15. report({ path, note });
  16. findings.push({ path, note });
  17. }
  18. log("done");
  19. report({ phase: "done", total: findings.length });
  20. return findings;