literally-aeo 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/README.md +29 -1
  2. package/dist/author-tools.js +479 -397
  3. package/dist/cli.mjs +808 -386
  4. package/dist/lib/access/schema.js +6 -6
  5. package/dist/lib/agents/author-schema.js +10 -10
  6. package/dist/lib/agents/author-validation.js +20 -18
  7. package/dist/lib/agents/copy-validation.js +22 -21
  8. package/dist/lib/agents/copywriter-input.js +23 -8
  9. package/dist/lib/agents/facts.js +22 -7
  10. package/dist/lib/agents/narrative-facts.js +20 -2
  11. package/dist/lib/agents/verifier.js +25 -24
  12. package/dist/lib/analysis/domain-classifier.js +19 -20
  13. package/dist/lib/analysis/domain-labels.js +10 -10
  14. package/dist/lib/analysis/progress-schema.js +2 -2
  15. package/dist/lib/analysis/progress.js +18 -19
  16. package/dist/lib/analysis/retrieval.js +20 -3
  17. package/dist/lib/analysis/scoring.js +20 -3
  18. package/dist/lib/analysis/search-analyzer.js +19 -5
  19. package/dist/lib/analysis/sentiment.js +16 -17
  20. package/dist/lib/author/examples.js +11 -11
  21. package/dist/lib/bundle/contracts.js +14 -12
  22. package/dist/lib/bundle/export.js +27 -27
  23. package/dist/lib/bundle/isolation.js +2 -2
  24. package/dist/lib/bundle/journal.js +13 -13
  25. package/dist/lib/bundle/project-journal.js +17 -17
  26. package/dist/lib/bundle/project.js +25 -25
  27. package/dist/lib/bundle/read.js +28 -28
  28. package/dist/lib/bundle/recorder.js +15 -15
  29. package/dist/lib/bundle/redact.js +13 -13
  30. package/dist/lib/bundle/trace-coverage.js +13 -13
  31. package/dist/lib/bundle/verify-integrity.js +15 -15
  32. package/dist/lib/bundle/verify-measurement.js +21 -21
  33. package/dist/lib/bundle/verify-report.js +29 -29
  34. package/dist/lib/bundle/verify.js +37 -37
  35. package/dist/lib/capture-manifest.js +12 -12
  36. package/dist/lib/checks/crawler-access.js +4 -1
  37. package/dist/lib/checks/money-pages.js +13 -0
  38. package/dist/lib/checks/renderability.js +5 -1
  39. package/dist/lib/checks/run-checks.js +21 -18
  40. package/dist/lib/chunks/{chunk-BSRKN6FU.js → chunk-2FOKEIIN.js} +1 -1
  41. package/dist/lib/chunks/{chunk-JXMDOAKA.js → chunk-2KH7LNK7.js} +11 -11
  42. package/dist/lib/chunks/{chunk-D3GE3OCB.js → chunk-3CMPR6ZZ.js} +1 -1
  43. package/dist/lib/chunks/{chunk-TJQ5OPLQ.js → chunk-3OE4UQIB.js} +7 -7
  44. package/dist/lib/chunks/{chunk-Y4OGZ3Q5.js → chunk-46PVVQYR.js} +1 -1
  45. package/dist/lib/chunks/{chunk-OU73OUX4.js → chunk-4GLW3ZRO.js} +67 -7
  46. package/dist/lib/chunks/{chunk-EV4DRS5M.js → chunk-4XIAXX7K.js} +1 -1
  47. package/dist/lib/chunks/{chunk-IBOWGKN7.js → chunk-52F5XYOW.js} +1 -1
  48. package/dist/lib/chunks/{chunk-FFOVLI3U.js → chunk-66T7JC57.js} +12 -10
  49. package/dist/lib/chunks/{chunk-IE7NAL6B.js → chunk-6HMHXSCS.js} +2 -2
  50. package/dist/lib/chunks/chunk-75DMLOQ7.js +127 -0
  51. package/dist/lib/chunks/{chunk-6G25V4CF.js → chunk-7CW6U5WJ.js} +1 -1
  52. package/dist/lib/chunks/{chunk-CUYVHXHI.js → chunk-7DNLRXEY.js} +3 -3
  53. package/dist/lib/chunks/{chunk-622NMXN6.js → chunk-7HM6IZ3L.js} +2 -2
  54. package/dist/lib/chunks/{chunk-F4W5YHDZ.js → chunk-7WO3FFPS.js} +2 -2
  55. package/dist/lib/chunks/{chunk-ULRXHSJL.js → chunk-7YDXD4MD.js} +9 -6
  56. package/dist/lib/chunks/{chunk-UEMZYHYJ.js → chunk-7YZPEX3T.js} +2 -2
  57. package/dist/lib/chunks/{chunk-OBXAHX3L.js → chunk-AASWJR7Q.js} +1 -5
  58. package/dist/lib/chunks/{chunk-NCXSNHXX.js → chunk-AJO7XVXK.js} +12 -12
  59. package/dist/lib/chunks/{chunk-2GU6CNQI.js → chunk-AT3XMGES.js} +5 -5
  60. package/dist/lib/chunks/{chunk-MNWO7EHC.js → chunk-BFWK3TBN.js} +2 -2
  61. package/dist/lib/chunks/{chunk-BGOIPHJZ.js → chunk-BGAHZIL3.js} +18 -12
  62. package/dist/lib/chunks/{chunk-ZCOI3HE2.js → chunk-BRENK356.js} +1 -1
  63. package/dist/lib/chunks/{chunk-KJMU5KH4.js → chunk-BXF4OC74.js} +18 -9
  64. package/dist/lib/chunks/{chunk-5JPYM4MD.js → chunk-BYHXNFWN.js} +1 -1
  65. package/dist/lib/chunks/{chunk-NCLFZOZU.js → chunk-CH7OCYDL.js} +1 -1
  66. package/dist/lib/chunks/{chunk-OKL7GN2F.js → chunk-DL6YQDTE.js} +31 -5
  67. package/dist/lib/chunks/{chunk-PDS5KWO3.js → chunk-E2YTTB6Q.js} +56 -42
  68. package/dist/lib/chunks/{chunk-SDWYZM64.js → chunk-EDQTINTL.js} +5 -1
  69. package/dist/lib/chunks/{chunk-4PD65FRJ.js → chunk-EOO5RBUW.js} +3 -3
  70. package/dist/lib/chunks/chunk-ESEMYWUH.js +257 -0
  71. package/dist/lib/chunks/{chunk-YHS5IEVZ.js → chunk-F2NSJ6PG.js} +12 -8
  72. package/dist/lib/chunks/{chunk-BLKLPUYR.js → chunk-F7DBTXKG.js} +6 -6
  73. package/dist/lib/chunks/{chunk-EE26FNSY.js → chunk-FDM2YNQL.js} +1 -1
  74. package/dist/lib/chunks/{chunk-RJ5R6YYA.js → chunk-FJL2V6P5.js} +6 -6
  75. package/dist/lib/chunks/chunk-FK2JQHAX.js +30 -0
  76. package/dist/lib/chunks/{chunk-QHUDJVPJ.js → chunk-GLUGYZQO.js} +7 -7
  77. package/dist/lib/chunks/{chunk-GNMFJ2OK.js → chunk-HCUJ2J7P.js} +8 -8
  78. package/dist/lib/chunks/{chunk-2ROXN2EC.js → chunk-HGGOGCPX.js} +10 -10
  79. package/dist/lib/chunks/{chunk-VPZQGND4.js → chunk-HGGRPOSA.js} +3 -3
  80. package/dist/lib/chunks/{chunk-EJ655TVU.js → chunk-I3UE52ZV.js} +2 -2
  81. package/dist/lib/chunks/{chunk-ML4W6KC6.js → chunk-J5NPHPXY.js} +5 -4
  82. package/dist/lib/chunks/{chunk-HFRAHG5C.js → chunk-J7QKT5E7.js} +17 -17
  83. package/dist/lib/chunks/{chunk-V7OAPKNF.js → chunk-JBOOD6MU.js} +10 -9
  84. package/dist/lib/chunks/{chunk-YAAUWCJ4.js → chunk-JKPBXPCW.js} +3 -3
  85. package/dist/lib/chunks/{chunk-5HT55QYX.js → chunk-JQDQVG3D.js} +1 -1
  86. package/dist/lib/chunks/{chunk-GESHTTSA.js → chunk-JYCVBFH5.js} +2 -2
  87. package/dist/lib/chunks/{chunk-W2VGLWTS.js → chunk-K2FZFESR.js} +10 -10
  88. package/dist/lib/chunks/{chunk-DC6PN7QJ.js → chunk-K4Y5NT4M.js} +11 -7
  89. package/dist/lib/chunks/chunk-K7YFL5KB.js +182 -0
  90. package/dist/lib/chunks/{chunk-EBUQPCKB.js → chunk-KFAT65P7.js} +1 -1
  91. package/dist/lib/chunks/{chunk-ZYSPTOKK.js → chunk-KQCRJIEG.js} +1 -1
  92. package/dist/lib/chunks/{chunk-R6XDZWUL.js → chunk-LR27H2HZ.js} +11 -11
  93. package/dist/lib/chunks/{chunk-FUAUPNRO.js → chunk-LTCDLURT.js} +7 -7
  94. package/dist/lib/chunks/{chunk-KZR25REO.js → chunk-LTI2YYU3.js} +1 -1
  95. package/dist/lib/chunks/{chunk-EPQHVILQ.js → chunk-MA27TFEY.js} +5 -3
  96. package/dist/lib/chunks/{chunk-UZJSTJFP.js → chunk-MENTBQGB.js} +6 -5
  97. package/dist/lib/chunks/chunk-MPJCZN4G.js +155 -0
  98. package/dist/lib/chunks/{chunk-BE4ENGUY.js → chunk-OOLWU667.js} +6 -6
  99. package/dist/lib/chunks/{chunk-QSJ4IKUF.js → chunk-PIF3GL62.js} +5 -5
  100. package/dist/lib/chunks/{chunk-W5X7WJYL.js → chunk-PIFTG6YW.js} +3 -3
  101. package/dist/lib/chunks/{chunk-YRBIC5QH.js → chunk-PKNODC6Y.js} +1 -1
  102. package/dist/lib/chunks/{chunk-SHUMCKCS.js → chunk-PWOYEIPF.js} +4 -4
  103. package/dist/lib/chunks/{chunk-RR46EDDR.js → chunk-QD3JXA3Y.js} +25 -25
  104. package/dist/lib/chunks/{chunk-7ZOJE6BH.js → chunk-QGZ4QSUE.js} +8 -7
  105. package/dist/lib/chunks/{chunk-D2INDP5W.js → chunk-R5UPOEWE.js} +9 -8
  106. package/dist/lib/chunks/{chunk-VKM6MMA4.js → chunk-RIJERFGU.js} +34 -3
  107. package/dist/lib/chunks/{chunk-5B3RNVZ6.js → chunk-RK57YZKM.js} +1 -1
  108. package/dist/lib/chunks/{chunk-GDKGZQ3T.js → chunk-RXSHKWZJ.js} +3 -3
  109. package/dist/lib/chunks/{chunk-NGHAP2P5.js → chunk-S6QOXJAL.js} +4 -4
  110. package/dist/lib/chunks/{chunk-6GHHNPFJ.js → chunk-SIJOQRRK.js} +1 -1
  111. package/dist/lib/chunks/{chunk-663HABKP.js → chunk-T6XZQOXS.js} +8 -8
  112. package/dist/lib/chunks/{chunk-EYKINDNK.js → chunk-TAPVCSCR.js} +1 -1
  113. package/dist/lib/chunks/{chunk-ISN6MBNB.js → chunk-U5USH2HB.js} +7 -7
  114. package/dist/lib/chunks/{chunk-MRL5RUP7.js → chunk-U6BW6LGX.js} +10 -3
  115. package/dist/lib/chunks/{chunk-L7MEIRJB.js → chunk-UNCUG2YS.js} +15 -6
  116. package/dist/lib/chunks/{chunk-3JO5TXBA.js → chunk-UYDQXXDQ.js} +4 -4
  117. package/dist/lib/chunks/{chunk-LOBXOZ2R.js → chunk-V5JJEEBT.js} +1 -1
  118. package/dist/lib/chunks/{chunk-XR44YSHT.js → chunk-VHKHYAC5.js} +30 -9
  119. package/dist/lib/chunks/{chunk-Z7V63UZA.js → chunk-VXDMOB7O.js} +4 -4
  120. package/dist/lib/chunks/{chunk-G62E525I.js → chunk-VXYQWE45.js} +2 -2
  121. package/dist/lib/chunks/{chunk-W5DC23OP.js → chunk-WCLKIPJV.js} +1 -1
  122. package/dist/lib/chunks/{chunk-7XO3SQAX.js → chunk-WDT2Y7D7.js} +1 -1
  123. package/dist/lib/chunks/{chunk-OVUCZLH2.js → chunk-WIBMVNIH.js} +2 -2
  124. package/dist/lib/chunks/{chunk-5T3V6XJS.js → chunk-WNIXDMJL.js} +1 -1
  125. package/dist/lib/chunks/{chunk-HTOD4W4E.js → chunk-WZGI7UVM.js} +2 -2
  126. package/dist/lib/chunks/{chunk-HQG63ZKO.js → chunk-XA27KAUV.js} +17 -17
  127. package/dist/lib/chunks/{chunk-I3XGRGXE.js → chunk-XAN4CRFP.js} +33 -41
  128. package/dist/lib/chunks/{chunk-AYY4MYTW.js → chunk-XFUYEFQP.js} +1 -1
  129. package/dist/lib/chunks/{chunk-FOCJ7HPC.js → chunk-XSER7WEB.js} +11 -11
  130. package/dist/lib/chunks/{chunk-WVACVWBL.js → chunk-YEUCAPKP.js} +6 -4
  131. package/dist/lib/chunks/{chunk-7Z27HQWL.js → chunk-YGLWQFKL.js} +3 -3
  132. package/dist/lib/chunks/{chunk-D7GEQVLL.js → chunk-YKJHFD64.js} +1 -1
  133. package/dist/lib/chunks/{chunk-OQU5IXAJ.js → chunk-ZOGIJGU3.js} +10 -10
  134. package/dist/lib/chunks/{chunk-5ZITQDVE.js → chunk-ZQ3ER7JD.js} +12 -13
  135. package/dist/lib/cli/bundle-commands.js +91 -88
  136. package/dist/lib/cli/run-commands.js +110 -105
  137. package/dist/lib/cli/status-command.js +77 -74
  138. package/dist/lib/codex-workflow/aggregate.js +21 -22
  139. package/dist/lib/codex-workflow/author-search.js +4 -3
  140. package/dist/lib/codex-workflow/author-tools.js +17 -15
  141. package/dist/lib/codex-workflow/author.js +38 -34
  142. package/dist/lib/codex-workflow/capture.js +25 -25
  143. package/dist/lib/codex-workflow/checkpoint.js +13 -13
  144. package/dist/lib/codex-workflow/checks.js +15 -16
  145. package/dist/lib/codex-workflow/copy-editor.js +31 -30
  146. package/dist/lib/codex-workflow/copy-recovery.js +11 -11
  147. package/dist/lib/codex-workflow/copy.js +28 -27
  148. package/dist/lib/codex-workflow/finish.js +34 -34
  149. package/dist/lib/codex-workflow/loop.js +65 -62
  150. package/dist/lib/codex-workflow/quality.js +11 -11
  151. package/dist/lib/codex-workflow/run-inputs.js +12 -12
  152. package/dist/lib/codex-workflow/run-source.js +26 -23
  153. package/dist/lib/codex-workflow/schemas.js +11 -11
  154. package/dist/lib/codex-workflow/session.js +14 -14
  155. package/dist/lib/codex-workflow/stage.js +45 -41
  156. package/dist/lib/codex-workflow/workdir.js +13 -13
  157. package/dist/lib/engine/audit-file.js +16 -11
  158. package/dist/lib/engine/author.js +53 -49
  159. package/dist/lib/engine/cost-estimate.js +18 -16
  160. package/dist/lib/engine/local-run.js +76 -73
  161. package/dist/lib/engine/preflight.js +12 -12
  162. package/dist/lib/engine/rejudge.js +82 -79
  163. package/dist/lib/engine/run-status.js +77 -74
  164. package/dist/lib/engine/templates.js +17 -12
  165. package/dist/lib/grounding/chromium-guard.js +13 -0
  166. package/dist/lib/grounding/controller.js +11 -10
  167. package/dist/lib/grounding/extract.js +10 -9
  168. package/dist/lib/grounding/fetch.js +4 -7
  169. package/dist/lib/grounding/file-store.js +5 -5
  170. package/dist/lib/grounding/grounding-runtime.js +32 -31
  171. package/dist/lib/grounding/guarded-request.js +18 -0
  172. package/dist/lib/grounding/model.js +9 -8
  173. package/dist/lib/grounding/profile.js +4 -4
  174. package/dist/lib/grounding/recorded-tools.js +16 -16
  175. package/dist/lib/grounding/session.js +3 -3
  176. package/dist/lib/grounding/tools.js +4 -3
  177. package/dist/lib/grounding/validation.js +2 -2
  178. package/dist/lib/harness/report/artifacts.js +11 -11
  179. package/dist/lib/harness/report/capture-coverage.js +4 -4
  180. package/dist/lib/lib/checkpoint.js +10 -10
  181. package/dist/lib/lib/progress-comparison.js +2 -2
  182. package/dist/lib/models/batching.js +3 -3
  183. package/dist/lib/models/structured.js +2 -2
  184. package/dist/lib/models/supported-models.js +1 -1
  185. package/dist/lib/pipeline.js +20 -21
  186. package/dist/lib/probes/agent-clis.js +10 -10
  187. package/dist/lib/probes/probes.js +12 -12
  188. package/dist/lib/probes/web-tool-guard.js +3 -3
  189. package/dist/lib/report/contracts.js +4 -4
  190. package/dist/lib/report/core/progress-comparison.js +2 -2
  191. package/dist/lib/report/core/progress-schema.js +2 -2
  192. package/dist/lib/report/core/schema.js +2 -4
  193. package/dist/lib/report/core/surfaces.js +1 -3
  194. package/dist/lib/runner.js +23 -24
  195. package/dist/lib/schema.js +19 -13
  196. package/dist/lib/section-result.js +14 -15
  197. package/dist/lib/stores/artifacts.js +17 -17
  198. package/dist/lib/stores/files.js +31 -31
  199. package/dist/lib/stores/local-versions.js +10 -10
  200. package/dist/lib/stores/memory.js +33 -33
  201. package/dist/lib/stores/publication.js +23 -22
  202. package/dist/lib/surfaces.js +1 -3
  203. package/dist/lib/viewer/server.js +38 -38
  204. package/dist/lib/workflow/schema.js +8 -8
  205. package/dist/types/agents/author-schema.d.ts +3 -3
  206. package/dist/types/analysis/scoring.d.ts +2 -2
  207. package/dist/types/bundle/contracts.d.ts +3 -2
  208. package/dist/types/checks/crawler-access.d.ts +3 -2
  209. package/dist/types/checks/money-pages.d.ts +19 -0
  210. package/dist/types/checks/renderability.d.ts +8 -1
  211. package/dist/types/codex-workflow/author-tools.d.ts +3 -3
  212. package/dist/types/codex-workflow/run-inputs.d.ts +3 -0
  213. package/dist/types/codex-workflow/schemas.d.ts +6 -6
  214. package/dist/types/engine/audit-file.d.ts +6 -1
  215. package/dist/types/engine/preflight.d.ts +2 -0
  216. package/dist/types/grounding/chromium-guard.d.ts +41 -0
  217. package/dist/types/grounding/fetch.d.ts +0 -10
  218. package/dist/types/grounding/guarded-request.d.ts +76 -0
  219. package/dist/types/harness/report/artifacts.d.ts +1 -0
  220. package/dist/types/lib/checkpoint.d.ts +5 -6
  221. package/dist/types/pipeline.d.ts +2 -1
  222. package/dist/types/probes/probes.d.ts +2 -1
  223. package/dist/types/report/contracts.d.ts +2 -0
  224. package/dist/types/report/core/schema.d.ts +3 -1
  225. package/dist/types/report/core/surfaces.d.ts +0 -1
  226. package/dist/types/schema.d.ts +22 -0
  227. package/dist/types/section-result.d.ts +1 -1
  228. package/package.json +1 -1
  229. package/resources/guide/OPERATOR.md +12 -3
  230. package/src/agents/author-schema.ts +13 -1
  231. package/src/agents/author-validation.ts +24 -6
  232. package/src/agents/facts.ts +8 -8
  233. package/src/agents/narrative-facts.ts +9 -20
  234. package/src/agents/verifier.ts +2 -2
  235. package/src/analysis/progress.ts +1 -0
  236. package/src/analysis/scoring.ts +9 -13
  237. package/src/bundle/contracts.ts +7 -2
  238. package/src/bundle/verify.ts +3 -3
  239. package/src/capture-manifest.ts +4 -0
  240. package/src/checks/crawler-access.ts +70 -50
  241. package/src/checks/money-pages.ts +48 -0
  242. package/src/checks/renderability.ts +113 -87
  243. package/src/checks/run-checks.ts +16 -3
  244. package/src/cli/run-commands.ts +2 -0
  245. package/src/codex-workflow/aggregate.ts +1 -0
  246. package/src/codex-workflow/author-tools.ts +39 -60
  247. package/src/codex-workflow/capture.ts +1 -0
  248. package/src/codex-workflow/copy-editor.ts +3 -3
  249. package/src/codex-workflow/loop.ts +2 -2
  250. package/src/engine/audit-file.ts +79 -2
  251. package/src/engine/guide/OPERATOR.md +12 -3
  252. package/src/engine/preflight.ts +50 -0
  253. package/src/grounding/chromium-guard.ts +273 -0
  254. package/src/grounding/controller.ts +1 -1
  255. package/src/grounding/fetch.ts +39 -276
  256. package/src/grounding/guarded-request.ts +428 -0
  257. package/src/grounding/tools.ts +2 -1
  258. package/src/grounding/validation.ts +1 -1
  259. package/src/lib/checkpoint.ts +15 -16
  260. package/src/models/supported-models.ts +3 -3
  261. package/src/pipeline.ts +13 -7
  262. package/src/probes/agent-clis.ts +2 -3
  263. package/src/probes/probes.ts +24 -10
  264. package/src/report/core/schema.ts +4 -1
  265. package/src/report/core/surfaces.ts +4 -8
  266. package/src/runner.ts +1 -0
  267. package/src/schema.ts +68 -4
  268. package/src/section-result.ts +6 -5
  269. package/dist/lib/chunks/chunk-6EH4N3EU.js +0 -113
  270. package/dist/lib/chunks/chunk-SWJ7KQSL.js +0 -318
  271. package/dist/lib/chunks/{chunk-CO5T6WU5.js → chunk-OD36HUXA.js} +3 -3
  272. package/dist/lib/chunks/{chunk-XI5H46DF.js → chunk-SASE7U6E.js} +3 -3
@@ -0,0 +1,428 @@
1
+ import type { LookupAddress } from 'node:dns';
2
+ import { lookup } from 'node:dns/promises';
3
+ import { request } from 'node:https';
4
+ import { isIP } from 'node:net';
5
+ import { setTimeout as delay } from 'node:timers/promises';
6
+ import { isPublicAddress } from '../workflow/callbacks';
7
+
8
+ // ============================================================================
9
+ // The one guard every request to a site passes through
10
+ // (specs/aeo-checks-and-reach-spec.md §3.1): https on port 443 with no
11
+ // credentials, every DNS answer public and the socket pinned to the checked
12
+ // address, each redirect hop validated again, an identity-encoded body bounded
13
+ // in bytes. The research fetch, the site checks and the Chromium proxy all
14
+ // decide destinations here.
15
+ // ============================================================================
16
+
17
+ export type SourceRetrievalReason =
18
+ | 'unsafe_destination'
19
+ | 'timeout'
20
+ | 'too_large'
21
+ | 'unsupported_content'
22
+ | 'http_error'
23
+ | 'empty_content'
24
+ | 'network_error';
25
+
26
+ export class SourceRetrievalError extends Error {
27
+ readonly reason: SourceRetrievalReason;
28
+ readonly status: number | undefined;
29
+
30
+ constructor(
31
+ reason: SourceRetrievalReason,
32
+ message: string,
33
+ { status, cause }: { status?: number; cause?: unknown } = {},
34
+ ) {
35
+ super(message, cause === undefined ? undefined : { cause });
36
+ this.name = 'SourceRetrievalError';
37
+ this.reason = reason;
38
+ this.status = status;
39
+ }
40
+ }
41
+
42
+ export const validateResearchUrl = (value: string): URL => {
43
+ let url: URL;
44
+
45
+ try {
46
+ url = new URL(value);
47
+ } catch {
48
+ throw new SourceRetrievalError(
49
+ 'unsafe_destination',
50
+ `Invalid source URL: ${value}.`,
51
+ );
52
+ }
53
+
54
+ if (
55
+ url.protocol !== 'https:' ||
56
+ url.username ||
57
+ url.password ||
58
+ url.port ||
59
+ url.hostname === 'localhost' ||
60
+ url.hostname.endsWith('.localhost') ||
61
+ url.hostname.endsWith('.local') ||
62
+ url.hostname.endsWith('.internal') ||
63
+ url.hostname === 'metadata.google.internal'
64
+ ) {
65
+ throw new SourceRetrievalError(
66
+ 'unsafe_destination',
67
+ `Source must use public HTTPS with no credentials: ${url.hostname}.`,
68
+ );
69
+ }
70
+
71
+ const host = url.hostname.replace(/^\[|\]$/g, '');
72
+
73
+ if (isIP(host) && !isPublicAddress(host)) {
74
+ throw new SourceRetrievalError(
75
+ 'unsafe_destination',
76
+ `Private source destination: ${host}.`,
77
+ );
78
+ }
79
+
80
+ url.hash = '';
81
+
82
+ return url;
83
+ };
84
+
85
+ const withAbort = <T>(promise: Promise<T>, signal: AbortSignal): Promise<T> => {
86
+ signal.throwIfAborted();
87
+
88
+ return new Promise((resolve, reject) => {
89
+ const aborted = () => {
90
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- AbortSignal.reason is typed any; rejecting with it keeps the caller's abort error.
91
+ reject(signal.reason);
92
+ };
93
+
94
+ signal.addEventListener('abort', aborted, { once: true });
95
+
96
+ promise.then(resolve, reject).finally(() => {
97
+ signal.removeEventListener('abort', aborted);
98
+ });
99
+ });
100
+ };
101
+
102
+ export type LookupAll = (host: string) => Promise<LookupAddress[]>;
103
+
104
+ const lookupAll: LookupAll = (host) => {
105
+ return lookup(host, { all: true });
106
+ };
107
+
108
+ /**
109
+ * resolvePublicAddress returns the address a connection to the host is
110
+ * pinned to. Every DNS answer must be public, not only the first: a host
111
+ * that also answers with a private address could hand it to the next
112
+ * lookup, so the socket never looks the name up again.
113
+ */
114
+ export const resolvePublicAddress = async (
115
+ hostname: string,
116
+ signal: AbortSignal,
117
+ lookupHost: LookupAll = lookupAll,
118
+ ): Promise<LookupAddress> => {
119
+ const host = hostname.replace(/^\[|\]$/g, '');
120
+ const addresses = await withAbort(lookupHost(host), signal);
121
+
122
+ if (
123
+ addresses.length === 0 ||
124
+ addresses.some(({ address }) => !isPublicAddress(address))
125
+ ) {
126
+ throw new SourceRetrievalError(
127
+ 'unsafe_destination',
128
+ `Source DNS must resolve exclusively to public addresses: ${host}.`,
129
+ );
130
+ }
131
+
132
+ const [firstAddress] = addresses;
133
+
134
+ if (!firstAddress) {
135
+ throw new SourceRetrievalError(
136
+ 'unsafe_destination',
137
+ `Source DNS returned no address: ${host}.`,
138
+ );
139
+ }
140
+
141
+ return firstAddress;
142
+ };
143
+
144
+ /**
145
+ * HostPacer runs one request at a time per host, each starting a fixed
146
+ * interval after the previous one ended. One pacer serves every request of
147
+ * a phase, so checks that run side by side still reach a site one by one.
148
+ */
149
+ export type HostPacer = <T>(url: URL, send: () => Promise<T>) => Promise<T>;
150
+
151
+ export const createHostPacer = (
152
+ intervalInMs: number,
153
+ wait: (ms: number) => Promise<unknown> = delay,
154
+ ): HostPacer => {
155
+ const lastRequestByHost = new Map<string, Promise<unknown>>();
156
+
157
+ return (url, send) => {
158
+ const previous = lastRequestByHost.get(url.hostname);
159
+ const current = (async () => {
160
+ if (previous) {
161
+ await previous;
162
+ await wait(intervalInMs);
163
+ }
164
+
165
+ return send();
166
+ })();
167
+
168
+ lastRequestByHost.set(
169
+ url.hostname,
170
+ current.catch(() => undefined),
171
+ );
172
+
173
+ return current;
174
+ };
175
+ };
176
+
177
+ /** How a successful response's body is read. */
178
+ export type BodyPolicy = {
179
+ /** Content types the body may have; any other is refused unread. */
180
+ contentTypes: RegExp | 'any';
181
+ maxBytes: number;
182
+ /** Past maxBytes: keep the prefix and say so, or refuse the response. */
183
+ oversize: 'truncate' | 'refuse';
184
+ };
185
+
186
+ export type GuardedRequestOptions = {
187
+ url: string;
188
+ /** Bounds each hop from when it is sent; a wait for the host's turn in
189
+ * the pacer is not counted, or a request queued behind a slow render
190
+ * would time out without ever being sent. */
191
+ timeoutInMs: number;
192
+ signal?: AbortSignal;
193
+ userAgent: string;
194
+ accept: string;
195
+ /** Redirects followed before the request is refused. */
196
+ redirects: number;
197
+ /** Absent: only the status and headers are read, never the body. */
198
+ body?: BodyPolicy;
199
+ /** Wraps every hop's request: the caller's spacing per host. */
200
+ pace?: HostPacer;
201
+ };
202
+
203
+ export type GuardedHop = { url: string; status: number };
204
+
205
+ export type GuardedResponse = {
206
+ /** The URL of the final hop. */
207
+ url: string;
208
+ status: number;
209
+ contentType: string;
210
+ /** Read only for a 2xx under a body policy. */
211
+ body: Buffer | undefined;
212
+ isTruncated: boolean;
213
+ /** Every response received, the final one last. */
214
+ hops: GuardedHop[];
215
+ };
216
+
217
+ /** A failure as a site check records it: a refused destination or redirect
218
+ * names its reason (`unsafe_destination: …`). */
219
+ export const describeSiteError = (error: unknown): string => {
220
+ if (error instanceof SourceRetrievalError) {
221
+ return `${error.reason}: ${error.message}`;
222
+ }
223
+
224
+ return error instanceof Error ? error.message : String(error);
225
+ };
226
+
227
+ /** A request bound to a phase's pacer: what the site checks receive. */
228
+ export type SiteRequest = (
229
+ options: Omit<GuardedRequestOptions, 'pace'>,
230
+ ) => Promise<GuardedResponse>;
231
+
232
+ type HopResponse = Omit<GuardedResponse, 'url' | 'hops'> & {
233
+ location: string | undefined;
234
+ };
235
+
236
+ const isRedirect = (status: number): boolean => {
237
+ return status >= 300 && status < 400;
238
+ };
239
+
240
+ const isSuccess = (status: number): boolean => {
241
+ return status >= 200 && status < 300;
242
+ };
243
+
244
+ const requestHop = async (
245
+ url: URL,
246
+ options: GuardedRequestOptions,
247
+ signal: AbortSignal,
248
+ ): Promise<HopResponse> => {
249
+ const address = await resolvePublicAddress(url.hostname, signal);
250
+
251
+ signal.throwIfAborted();
252
+
253
+ return new Promise((resolve, reject) => {
254
+ const req = request(
255
+ url,
256
+ {
257
+ method: 'GET',
258
+ signal,
259
+ headers: {
260
+ 'accept': options.accept,
261
+ // Never a compressed body: nothing to decompress, so no bomb to
262
+ // bound. An encoded body despite this is refused below.
263
+ 'accept-encoding': 'identity',
264
+ 'user-agent': options.userAgent,
265
+ },
266
+ lookup: (_host, lookupOptions, callback) => {
267
+ if (lookupOptions.all) {
268
+ callback(null, [address]);
269
+ } else {
270
+ callback(null, address.address, address.family);
271
+ }
272
+ },
273
+ },
274
+ (response) => {
275
+ const status = response.statusCode ?? 0;
276
+ const contentType = response.headers['content-type'] ?? '';
277
+ const encoding = response.headers['content-encoding'];
278
+ const policy = options.body;
279
+ const settle = (body: Buffer | undefined, isTruncated: boolean) => {
280
+ resolve({
281
+ status,
282
+ location: response.headers.location,
283
+ contentType,
284
+ body,
285
+ isTruncated,
286
+ });
287
+ };
288
+
289
+ if (!policy || !isSuccess(status)) {
290
+ response.destroy();
291
+ settle(undefined, false);
292
+
293
+ return;
294
+ }
295
+
296
+ if (
297
+ (policy.contentTypes !== 'any' &&
298
+ !policy.contentTypes.test(contentType)) ||
299
+ (encoding && encoding !== 'identity')
300
+ ) {
301
+ response.destroy();
302
+ reject(
303
+ new SourceRetrievalError(
304
+ 'unsupported_content',
305
+ `Unsupported source content: ${contentType}.`,
306
+ ),
307
+ );
308
+
309
+ return;
310
+ }
311
+
312
+ const chunks: Buffer[] = [];
313
+ let bytes = 0;
314
+
315
+ response.on('data', (chunk: Buffer) => {
316
+ bytes += chunk.length;
317
+
318
+ if (bytes <= policy.maxBytes) {
319
+ chunks.push(chunk);
320
+
321
+ return;
322
+ }
323
+
324
+ response.destroy();
325
+
326
+ if (policy.oversize === 'refuse') {
327
+ reject(
328
+ new SourceRetrievalError(
329
+ 'too_large',
330
+ `Source response exceeds byte limit: ${bytes} bytes.`,
331
+ ),
332
+ );
333
+
334
+ return;
335
+ }
336
+
337
+ const kept = Buffer.concat(chunks);
338
+
339
+ settle(
340
+ Buffer.concat([
341
+ kept,
342
+ chunk.subarray(0, policy.maxBytes - kept.length),
343
+ ]),
344
+ true,
345
+ );
346
+ });
347
+
348
+ response.once('error', reject);
349
+ response.once('end', () => {
350
+ settle(Buffer.concat(chunks), false);
351
+ });
352
+ },
353
+ );
354
+
355
+ req.once('error', reject);
356
+ req.end();
357
+ });
358
+ };
359
+
360
+ /**
361
+ * guardedRequest sends a GET under the guard and returns any status: the
362
+ * caller decides what a 403 or a 5xx means. A redirect it cannot follow
363
+ * (no Location, or past the limit) and an unsafe hop are refused.
364
+ */
365
+ export const guardedRequest = async (
366
+ options: GuardedRequestOptions,
367
+ ): Promise<GuardedResponse> => {
368
+ const pace: HostPacer = options.pace ?? ((_url, send) => send());
369
+ const hops: GuardedHop[] = [];
370
+ let url = validateResearchUrl(options.url);
371
+ let hopSignal: AbortSignal | undefined;
372
+
373
+ try {
374
+ for (let redirects = 0; ; redirects += 1) {
375
+ const target = url;
376
+ const response = await pace(target, () => {
377
+ options.signal?.throwIfAborted();
378
+
379
+ const signal = AbortSignal.any([
380
+ AbortSignal.timeout(options.timeoutInMs),
381
+ ...(options.signal ? [options.signal] : []),
382
+ ]);
383
+
384
+ hopSignal = signal;
385
+
386
+ return requestHop(target, options, signal);
387
+ });
388
+
389
+ hops.push({ url: target.href, status: response.status });
390
+
391
+ if (!isRedirect(response.status)) {
392
+ const { location: _location, ...final } = response;
393
+
394
+ return { ...final, url: target.href, hops };
395
+ }
396
+
397
+ if (!response.location) {
398
+ throw new SourceRetrievalError(
399
+ 'http_error',
400
+ `Source redirect without a location: ${target.href}.`,
401
+ );
402
+ }
403
+
404
+ if (redirects === options.redirects) {
405
+ throw new SourceRetrievalError(
406
+ 'http_error',
407
+ `Source redirect limit exceeded: ${target.href}.`,
408
+ );
409
+ }
410
+
411
+ url = validateResearchUrl(new URL(response.location, target).href);
412
+ }
413
+ } catch (error) {
414
+ if (options.signal?.aborted) {
415
+ throw options.signal.reason;
416
+ }
417
+
418
+ if (error instanceof SourceRetrievalError) {
419
+ throw error;
420
+ }
421
+
422
+ throw new SourceRetrievalError(
423
+ hopSignal?.aborted ? 'timeout' : 'network_error',
424
+ `Source retrieval failed: ${url.href}.`,
425
+ { cause: error },
426
+ );
427
+ }
428
+ };
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { contentHash } from '../stores/content-hash';
3
- import { fetchGroundingSource, validateResearchUrl } from './fetch';
3
+ import { fetchGroundingSource } from './fetch';
4
+ import { validateResearchUrl } from './guarded-request';
4
5
  import { GroundingIntegrityError } from './validation';
5
6
  import {
6
7
  groundingSourceSchema,
@@ -1,5 +1,5 @@
1
1
  import { contentHash } from '../stores/content-hash';
2
- import { validateResearchUrl } from './fetch';
2
+ import { validateResearchUrl } from './guarded-request';
3
3
  import {
4
4
  groundingBundleSchema,
5
5
  type GroundingBundle,
@@ -1,6 +1,6 @@
1
1
  import { createHash } from 'node:crypto';
2
- import type { AeoPrompt, AeoSurface, AgentProbeConfig } from '../schema';
3
- import { surfaceRunCounts, isAgentSurface } from '../schema';
2
+ import type { AeoPrompt, AeoSurface, ProbeDepth } from '../schema';
3
+ import { agentProbedPrompts, isAgentSurface, runsPerPromptOn } from '../schema';
4
4
  import type { CheckpointMatch, ProbeUnit } from '../stores/ports';
5
5
 
6
6
  export type {
@@ -51,27 +51,26 @@ export const unitRecordKey = (unit: ProbeUnit): string => {
51
51
 
52
52
  /**
53
53
  * The probe units a run plans for one section: chat surfaces cover every
54
- * prompt at the canonical run counts; agent surfaces follow the config's
55
- * agentProbes volume. Mirrors the pipeline's fan-out exactly — the planned
56
- * set is both the resume scope and the scoring denominator.
54
+ * prompt, agent surfaces the config's agentProbes subset, each at the depth
55
+ * runsPerPromptOn gives it. Mirrors the pipeline's fan-out exactly — the
56
+ * planned set is both the resume scope and the scoring denominator.
57
57
  */
58
- export const plannedProbeUnitsForSection = (args: {
59
- sectionKey: string;
60
- prompts: AeoPrompt[];
61
- surfaces: readonly AeoSurface[];
62
- agentProbes: AgentProbeConfig;
63
- }): ProbeUnit[] => {
58
+ export const plannedProbeUnitsForSection = (
59
+ args: ProbeDepth & {
60
+ sectionKey: string;
61
+ prompts: AeoPrompt[];
62
+ surfaces: readonly AeoSurface[];
63
+ },
64
+ ): ProbeUnit[] => {
64
65
  const chatSurfaces = args.surfaces.filter((s) => !isAgentSurface(s));
65
66
  const agentSurfaces = args.surfaces.filter(isAgentSurface);
66
- const agentPrompts = args.agentProbes.maxPromptsPerSection
67
- ? args.prompts.slice(0, args.agentProbes.maxPromptsPerSection)
68
- : args.prompts;
67
+ const agentPrompts = agentProbedPrompts(args.prompts, args.agentProbes);
69
68
 
70
69
  const units: ProbeUnit[] = [];
71
70
 
72
71
  for (const prompt of args.prompts) {
73
72
  for (const surface of chatSurfaces) {
74
- for (let run = 1; run <= surfaceRunCounts[surface]; run += 1) {
73
+ for (let run = 1; run <= runsPerPromptOn(surface, args); run += 1) {
75
74
  units.push(
76
75
  createUnit({
77
76
  sectionKey: args.sectionKey,
@@ -86,7 +85,7 @@ export const plannedProbeUnitsForSection = (args: {
86
85
 
87
86
  for (const prompt of agentPrompts) {
88
87
  for (const surface of agentSurfaces) {
89
- for (let run = 1; run <= args.agentProbes.runsPerPrompt; run += 1) {
88
+ for (let run = 1; run <= runsPerPromptOn(surface, args); run += 1) {
90
89
  units.push(
91
90
  createUnit({
92
91
  sectionKey: args.sectionKey,
@@ -42,7 +42,7 @@ export const supportedModels: readonly SupportedModel[] = [
42
42
  id: 'anthropic/claude-opus-5.5',
43
43
  label: 'Claude Opus 5.5',
44
44
  pricingUsdPerMillion: { input: 4, output: 20, cachedInput: 0.2 },
45
- pricingCheckedAt: '2026-11-04',
45
+ pricingCheckedAt: '2026-11-08',
46
46
  contextWindow: 1_000_000,
47
47
  maxOutputTokens: 128_000,
48
48
  thinkingInOutput: true,
@@ -53,8 +53,8 @@ export const supportedModels: readonly SupportedModel[] = [
53
53
  {
54
54
  id: 'anthropic/claude-sonnet-5.5',
55
55
  label: 'Claude Sonnet 5.5',
56
- pricingUsdPerMillion: { input: 2, output: 10, cachedInput: 0.2 },
57
- pricingCheckedAt: '2026-11-04',
56
+ pricingUsdPerMillion: { input: 2, output: 10, cachedInput: 0.1 },
57
+ pricingCheckedAt: '2026-11-08',
58
58
  contextWindow: 1_000_000,
59
59
  maxOutputTokens: 128_000,
60
60
  thinkingInOutput: true,
package/src/pipeline.ts CHANGED
@@ -7,9 +7,10 @@ import type {
7
7
  AeoSurface,
8
8
  AeoVisibility,
9
9
  AgentProbeConfig,
10
+ ChatProbeConfig,
10
11
  RetrievalLog,
11
12
  } from './schema';
12
- import { isAgentSurface } from './schema';
13
+ import { agentProbedPrompts, isAgentSurface } from './schema';
13
14
  import { createLog } from './lib/log';
14
15
  import {
15
16
  aiSearchProbeModels,
@@ -129,6 +130,8 @@ export type SectionRunArgs = {
129
130
  // and how many of the section's prompts get agent probes. Always present —
130
131
  // the config schema fills the canonical default.
131
132
  agentProbes: AgentProbeConfig;
133
+ // Chat probe volume; undefined = the canonical surfaceRunCounts.
134
+ chatProbes: ChatProbeConfig | undefined;
132
135
  agentCliVersions: AgentCliVersions;
133
136
  // The run every fresh capture and analysis is stamped with (§4.2).
134
137
  runId: string;
@@ -243,13 +246,9 @@ export const captureSectionProbes = async (
243
246
 
244
247
  // Agent probes may cover a configured subset of prompts (the first N in
245
248
  // config order) at a configured run count; the chat batch always covers
246
- // every prompt at the canonical counts.
249
+ // every prompt, at the configured chat depth.
247
250
  const agentRunsPerPrompt = args.agentProbes.runsPerPrompt;
248
- const agentPrompts = args.agentProbes.maxPromptsPerSection
249
- ? args.prompts.slice(0, args.agentProbes.maxPromptsPerSection)
250
- : args.prompts;
251
-
252
- const agentPromptInputs = promptInputs.slice(0, agentPrompts.length);
251
+ const agentPromptInputs = agentProbedPrompts(promptInputs, args.agentProbes);
253
252
 
254
253
  // Store resume: split the section's planned units into cached hits
255
254
  // (reused as-is) and missing keys (the only units the probe batches run).
@@ -258,6 +257,7 @@ export const captureSectionProbes = async (
258
257
  prompts: args.prompts,
259
258
  surfaces: args.surfaces,
260
259
  agentProbes: args.agentProbes,
260
+ chatProbes: args.chatProbes,
261
261
  });
262
262
 
263
263
  const unitByKey = new Map<string, ProbeUnit>();
@@ -332,6 +332,11 @@ export const captureSectionProbes = async (
332
332
  captureMetadata: {
333
333
  requestedModel: requestedModelOf(probe),
334
334
  reportedModel: probe.reportedModel ?? null,
335
+ // Progress comparisons hash these into each answer's collection
336
+ // method, so they stay as earlier releases recorded them. Chat
337
+ // depth is left out: it does not change how one answer is
338
+ // collected, and a depth difference already shows as a scope
339
+ // change.
335
340
  parameters: {
336
341
  geography: args.geography,
337
342
  language: args.language,
@@ -367,6 +372,7 @@ export const captureSectionProbes = async (
367
372
  language: args.language,
368
373
  prompts: promptInputs,
369
374
  surfaces: selectedChatSurfaces,
375
+ chatProbes: args.chatProbes,
370
376
  filter: shouldRun,
371
377
  onResult: bank,
372
378
  trace,
@@ -523,9 +523,8 @@ export const runAgentProbesForPrompts = async (args: {
523
523
  prompts: ProbePromptInput[];
524
524
  surfaces?: readonly AeoAgentSurface[];
525
525
  versions: AgentCliVersions;
526
- // Runs per prompt per surface — defaults to the canonical surfaceRunCounts
527
- // value; report configs may lower it to shrink the agent batch (spec §5,
528
- // revised 2026-08-21).
526
+ // Runs per prompt per surface: the config's agentProbes depth (spec §5,
527
+ // revised 2026-08-21). Omitted = the canonical surfaceRunCounts value.
529
528
  runsPerPrompt?: number;
530
529
  // Unit-level gate for store resume: return false to skip a planned
531
530
  // (prompt × surface × run) execution. Omitted = run everything.
@@ -3,8 +3,13 @@ import { gateway } from '@ai-sdk/gateway';
3
3
  import { openai } from '@ai-sdk/openai';
4
4
  import { google } from '@ai-sdk/google';
5
5
  import { anthropic } from '@ai-sdk/anthropic';
6
- import type { AeoChatSurface, AeoSurface, RetrievalLog } from '../schema';
7
- import { chatSurfaces, surfaceRunCounts } from '../schema';
6
+ import type {
7
+ AeoChatSurface,
8
+ AeoSurface,
9
+ ChatProbeConfig,
10
+ RetrievalLog,
11
+ } from '../schema';
12
+ import { chatRunsPerPrompt, chatSurfaces } from '../schema';
8
13
  import { surfaceRetrievalExposure } from '../retrieval';
9
14
  import { createLog } from '../lib/log';
10
15
  import { servedModelOf } from '../models/served-model';
@@ -115,6 +120,9 @@ export type ProbeJob = {
115
120
  // Which chat surfaces to run — defaults to all five. Lets `--surfaces`
116
121
  // iterate cheaply without touching the canonical run counts.
117
122
  surfaces?: readonly AeoChatSurface[];
123
+ // Runs per prompt; undefined = the canonical surfaceRunCounts. Must be
124
+ // the depth the plan was built with, or resume and scoring disagree.
125
+ chatProbes: ChatProbeConfig | undefined;
118
126
  // Unit-level gate for store resume: return false to skip a planned
119
127
  // (prompt × surface × run) execution. Omitted = run everything.
120
128
  filter?: (unit: {
@@ -401,18 +409,23 @@ const unexposedRetrieval = (surface: AeoChatSurface): RetrievalLog => {
401
409
  return { exposure: surfaceRetrievalExposure[surface], calls: [] };
402
410
  };
403
411
 
404
- // Builds the 5-surface probe configuration. The list and per-surface run
405
- // counts are the canonical console behavior — run counts live in
406
- // surfaceRunCounts (schema.ts) so scoring denominators stay in sync.
412
+ // Builds the 5-surface probe configuration. Run counts come from
413
+ // chatRunsPerPrompt (schema.ts), the rule the plan and the scoring
414
+ // denominators read too.
407
415
  const buildProbeModels = (args: {
408
416
  geography: string;
409
417
  language: string;
410
418
  surfaces: readonly AeoChatSurface[];
419
+ chatProbes: ChatProbeConfig | undefined;
411
420
  }): ProbeModelConfig[] => {
421
+ const runsOn = (surface: AeoChatSurface) => {
422
+ return chatRunsPerPrompt(surface, args.chatProbes);
423
+ };
424
+
412
425
  const all: ProbeModelConfig[] = [
413
426
  {
414
427
  name: 'chatgpt',
415
- runs: surfaceRunCounts.chatgpt,
428
+ runs: runsOn('chatgpt'),
416
429
  provider: 'gateway',
417
430
  probe: async (promptText) => {
418
431
  return runSearchRequiredProbe({
@@ -426,7 +439,7 @@ const buildProbeModels = (args: {
426
439
  },
427
440
  {
428
441
  name: 'gemini',
429
- runs: surfaceRunCounts.gemini,
442
+ runs: runsOn('gemini'),
430
443
  provider: 'gateway',
431
444
  probe: async (promptText) => {
432
445
  return runSearchRequiredProbe({
@@ -441,7 +454,7 @@ const buildProbeModels = (args: {
441
454
  },
442
455
  {
443
456
  name: 'claude',
444
- runs: surfaceRunCounts.claude,
457
+ runs: runsOn('claude'),
445
458
  provider: 'gateway',
446
459
  probe: async (promptText) => {
447
460
  return runSearchRequiredProbe({
@@ -457,7 +470,7 @@ const buildProbeModels = (args: {
457
470
  },
458
471
  {
459
472
  name: 'perplexity',
460
- runs: surfaceRunCounts.perplexity,
473
+ runs: runsOn('perplexity'),
461
474
  provider: 'gateway',
462
475
  probe: async (promptText) => {
463
476
  // Perplexity cites with bare numeric markers ([1], [2]) and returns
@@ -513,7 +526,7 @@ const buildProbeModels = (args: {
513
526
  },
514
527
  {
515
528
  name: 'google_ai_overview',
516
- runs: surfaceRunCounts.google_ai_overview,
529
+ runs: runsOn('google_ai_overview'),
517
530
  provider: 'dataforseo',
518
531
  probe: async (promptText) => {
519
532
  const retrieval = unexposedRetrieval('google_ai_overview');
@@ -606,6 +619,7 @@ export const runProbesForPrompts = async (
606
619
  geography: job.geography,
607
620
  language: job.language,
608
621
  surfaces: job.surfaces ?? chatSurfaces,
622
+ chatProbes: job.chatProbes,
609
623
  });
610
624
 
611
625
  const limiter = job.limiter ?? unlimited();