literally-aeo 0.2.0 → 0.2.1

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 (265) hide show
  1. package/README.md +29 -1
  2. package/dist/author-tools.js +479 -397
  3. package/dist/cli.mjs +777 -382
  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 +18 -18
  7. package/dist/lib/agents/copy-validation.js +22 -21
  8. package/dist/lib/agents/copywriter-input.js +22 -7
  9. package/dist/lib/agents/facts.js +21 -6
  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/renderability.js +5 -1
  38. package/dist/lib/checks/run-checks.js +21 -18
  39. package/dist/lib/chunks/{chunk-BSRKN6FU.js → chunk-2FOKEIIN.js} +1 -1
  40. package/dist/lib/chunks/{chunk-JXMDOAKA.js → chunk-2KH7LNK7.js} +11 -11
  41. package/dist/lib/chunks/{chunk-HFRAHG5C.js → chunk-3GPUCXVA.js} +14 -14
  42. package/dist/lib/chunks/{chunk-TJQ5OPLQ.js → chunk-3OE4UQIB.js} +7 -7
  43. package/dist/lib/chunks/{chunk-FOCJ7HPC.js → chunk-3OWJBGQE.js} +11 -11
  44. package/dist/lib/chunks/{chunk-Y4OGZ3Q5.js → chunk-46PVVQYR.js} +1 -1
  45. package/dist/lib/chunks/{chunk-EV4DRS5M.js → chunk-4XIAXX7K.js} +1 -1
  46. package/dist/lib/chunks/{chunk-IBOWGKN7.js → chunk-52F5XYOW.js} +1 -1
  47. package/dist/lib/chunks/{chunk-OQU5IXAJ.js → chunk-66DVMLGR.js} +10 -10
  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-7Z27HQWL.js → chunk-6JICXLDA.js} +3 -3
  51. package/dist/lib/chunks/chunk-75DMLOQ7.js +127 -0
  52. package/dist/lib/chunks/{chunk-6G25V4CF.js → chunk-7CW6U5WJ.js} +1 -1
  53. package/dist/lib/chunks/{chunk-622NMXN6.js → chunk-7HM6IZ3L.js} +2 -2
  54. package/dist/lib/chunks/{chunk-XR44YSHT.js → chunk-7LBSNDRR.js} +10 -8
  55. package/dist/lib/chunks/{chunk-F4W5YHDZ.js → chunk-7WO3FFPS.js} +2 -2
  56. package/dist/lib/chunks/{chunk-ULRXHSJL.js → chunk-7YDXD4MD.js} +9 -6
  57. package/dist/lib/chunks/{chunk-NGHAP2P5.js → chunk-AAFHXNLU.js} +4 -4
  58. package/dist/lib/chunks/{chunk-OBXAHX3L.js → chunk-AASWJR7Q.js} +1 -5
  59. package/dist/lib/chunks/{chunk-VPZQGND4.js → chunk-AJKV46SM.js} +3 -3
  60. package/dist/lib/chunks/{chunk-NCXSNHXX.js → chunk-AJO7XVXK.js} +12 -12
  61. package/dist/lib/chunks/{chunk-5JPYM4MD.js → chunk-AK6YNTCV.js} +1 -1
  62. package/dist/lib/chunks/{chunk-MNWO7EHC.js → chunk-BFWK3TBN.js} +2 -2
  63. package/dist/lib/chunks/{chunk-BGOIPHJZ.js → chunk-BGAHZIL3.js} +18 -12
  64. package/dist/lib/chunks/{chunk-ZCOI3HE2.js → chunk-BRENK356.js} +1 -1
  65. package/dist/lib/chunks/{chunk-KJMU5KH4.js → chunk-BXF4OC74.js} +18 -9
  66. package/dist/lib/chunks/{chunk-NCLFZOZU.js → chunk-CH7OCYDL.js} +1 -1
  67. package/dist/lib/chunks/{chunk-FUAUPNRO.js → chunk-DDS4G4DO.js} +7 -7
  68. package/dist/lib/chunks/{chunk-OKL7GN2F.js → chunk-DL6YQDTE.js} +31 -5
  69. package/dist/lib/chunks/{chunk-PDS5KWO3.js → chunk-E2YTTB6Q.js} +56 -42
  70. package/dist/lib/chunks/{chunk-UEMZYHYJ.js → chunk-E3OGPTUY.js} +1 -1
  71. package/dist/lib/chunks/{chunk-SDWYZM64.js → chunk-EDQTINTL.js} +5 -1
  72. package/dist/lib/chunks/chunk-ESEMYWUH.js +257 -0
  73. package/dist/lib/chunks/{chunk-YHS5IEVZ.js → chunk-F2NSJ6PG.js} +12 -8
  74. package/dist/lib/chunks/{chunk-BLKLPUYR.js → chunk-F7DBTXKG.js} +6 -6
  75. package/dist/lib/chunks/{chunk-EE26FNSY.js → chunk-FDM2YNQL.js} +1 -1
  76. package/dist/lib/chunks/{chunk-GESHTTSA.js → chunk-FIC7JSR4.js} +2 -2
  77. package/dist/lib/chunks/{chunk-RJ5R6YYA.js → chunk-FJL2V6P5.js} +6 -6
  78. package/dist/lib/chunks/{chunk-QSJ4IKUF.js → chunk-FL6LN2K6.js} +5 -5
  79. package/dist/lib/chunks/{chunk-663HABKP.js → chunk-HI3PD3KR.js} +8 -8
  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-V7OAPKNF.js → chunk-JBOOD6MU.js} +10 -9
  83. package/dist/lib/chunks/{chunk-YAAUWCJ4.js → chunk-JKPBXPCW.js} +3 -3
  84. package/dist/lib/chunks/{chunk-5HT55QYX.js → chunk-JQDQVG3D.js} +1 -1
  85. package/dist/lib/chunks/{chunk-YRBIC5QH.js → chunk-JXBLGCXZ.js} +1 -1
  86. package/dist/lib/chunks/{chunk-D2INDP5W.js → chunk-JYFEXVWC.js} +7 -6
  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-ZYSPTOKK.js → chunk-KQCRJIEG.js} +1 -1
  91. package/dist/lib/chunks/{chunk-RR46EDDR.js → chunk-KSOHZKV5.js} +22 -22
  92. package/dist/lib/chunks/{chunk-R6XDZWUL.js → chunk-LR27H2HZ.js} +11 -11
  93. package/dist/lib/chunks/{chunk-KZR25REO.js → chunk-LTI2YYU3.js} +1 -1
  94. package/dist/lib/chunks/{chunk-EPQHVILQ.js → chunk-MA27TFEY.js} +5 -3
  95. package/dist/lib/chunks/{chunk-UZJSTJFP.js → chunk-MENTBQGB.js} +6 -5
  96. package/dist/lib/chunks/chunk-MPJCZN4G.js +155 -0
  97. package/dist/lib/chunks/{chunk-QHUDJVPJ.js → chunk-MTDYBJXH.js} +7 -7
  98. package/dist/lib/chunks/{chunk-BE4ENGUY.js → chunk-OQFAMKLN.js} +6 -6
  99. package/dist/lib/chunks/{chunk-SHUMCKCS.js → chunk-PWOYEIPF.js} +4 -4
  100. package/dist/lib/chunks/{chunk-4PD65FRJ.js → chunk-PXB4PWJI.js} +3 -3
  101. package/dist/lib/chunks/{chunk-7ZOJE6BH.js → chunk-QGZ4QSUE.js} +8 -7
  102. package/dist/lib/chunks/{chunk-GNMFJ2OK.js → chunk-QJZTDZMB.js} +8 -8
  103. package/dist/lib/chunks/{chunk-HQG63ZKO.js → chunk-R2AJYV6A.js} +17 -17
  104. package/dist/lib/chunks/{chunk-5B3RNVZ6.js → chunk-RK57YZKM.js} +1 -1
  105. package/dist/lib/chunks/{chunk-EBUQPCKB.js → chunk-RPTADJXD.js} +1 -1
  106. package/dist/lib/chunks/{chunk-GDKGZQ3T.js → chunk-RXSHKWZJ.js} +3 -3
  107. package/dist/lib/chunks/{chunk-CUYVHXHI.js → chunk-SD7LR26G.js} +3 -3
  108. package/dist/lib/chunks/{chunk-6GHHNPFJ.js → chunk-SIJOQRRK.js} +1 -1
  109. package/dist/lib/chunks/{chunk-2GU6CNQI.js → chunk-SLAPBFRH.js} +5 -5
  110. package/dist/lib/chunks/{chunk-2ROXN2EC.js → chunk-SMPP7B7F.js} +10 -10
  111. package/dist/lib/chunks/{chunk-L7MEIRJB.js → chunk-SQQ56UP2.js} +15 -6
  112. package/dist/lib/chunks/{chunk-WVACVWBL.js → chunk-T5XQ6NXD.js} +6 -4
  113. package/dist/lib/chunks/{chunk-EYKINDNK.js → chunk-TAPVCSCR.js} +1 -1
  114. package/dist/lib/chunks/{chunk-ISN6MBNB.js → chunk-U5USH2HB.js} +7 -7
  115. package/dist/lib/chunks/{chunk-MRL5RUP7.js → chunk-U6BW6LGX.js} +10 -3
  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-OU73OUX4.js → chunk-VPXYGN4I.js} +71 -6
  119. package/dist/lib/chunks/{chunk-Z7V63UZA.js → chunk-VXDMOB7O.js} +4 -4
  120. package/dist/lib/chunks/{chunk-W5DC23OP.js → chunk-WCLKIPJV.js} +1 -1
  121. package/dist/lib/chunks/{chunk-7XO3SQAX.js → chunk-WDT2Y7D7.js} +1 -1
  122. package/dist/lib/chunks/{chunk-OVUCZLH2.js → chunk-WIBMVNIH.js} +2 -2
  123. package/dist/lib/chunks/{chunk-5T3V6XJS.js → chunk-WNIXDMJL.js} +1 -1
  124. package/dist/lib/chunks/{chunk-HTOD4W4E.js → chunk-WZGI7UVM.js} +2 -2
  125. package/dist/lib/chunks/{chunk-D3GE3OCB.js → chunk-XAKME6NM.js} +1 -1
  126. package/dist/lib/chunks/{chunk-I3XGRGXE.js → chunk-XAN4CRFP.js} +33 -41
  127. package/dist/lib/chunks/{chunk-AYY4MYTW.js → chunk-XFUYEFQP.js} +1 -1
  128. package/dist/lib/chunks/{chunk-G62E525I.js → chunk-XNTFOVCE.js} +2 -2
  129. package/dist/lib/chunks/{chunk-D7GEQVLL.js → chunk-YKJHFD64.js} +1 -1
  130. package/dist/lib/chunks/{chunk-VKM6MMA4.js → chunk-YZEZRQIG.js} +33 -2
  131. package/dist/lib/chunks/{chunk-5ZITQDVE.js → chunk-ZQ3ER7JD.js} +12 -13
  132. package/dist/lib/cli/bundle-commands.js +87 -85
  133. package/dist/lib/cli/run-commands.js +104 -100
  134. package/dist/lib/cli/status-command.js +73 -71
  135. package/dist/lib/codex-workflow/aggregate.js +21 -22
  136. package/dist/lib/codex-workflow/author-search.js +4 -3
  137. package/dist/lib/codex-workflow/author-tools.js +17 -15
  138. package/dist/lib/codex-workflow/author.js +36 -33
  139. package/dist/lib/codex-workflow/capture.js +24 -24
  140. package/dist/lib/codex-workflow/checkpoint.js +13 -13
  141. package/dist/lib/codex-workflow/checks.js +15 -16
  142. package/dist/lib/codex-workflow/copy-editor.js +30 -29
  143. package/dist/lib/codex-workflow/copy-recovery.js +11 -11
  144. package/dist/lib/codex-workflow/copy.js +27 -26
  145. package/dist/lib/codex-workflow/finish.js +34 -34
  146. package/dist/lib/codex-workflow/loop.js +62 -60
  147. package/dist/lib/codex-workflow/quality.js +11 -11
  148. package/dist/lib/codex-workflow/run-inputs.js +12 -12
  149. package/dist/lib/codex-workflow/run-source.js +26 -23
  150. package/dist/lib/codex-workflow/schemas.js +11 -11
  151. package/dist/lib/codex-workflow/session.js +14 -14
  152. package/dist/lib/codex-workflow/stage.js +43 -40
  153. package/dist/lib/codex-workflow/workdir.js +13 -13
  154. package/dist/lib/engine/audit-file.js +14 -10
  155. package/dist/lib/engine/author.js +50 -47
  156. package/dist/lib/engine/cost-estimate.js +18 -16
  157. package/dist/lib/engine/local-run.js +72 -70
  158. package/dist/lib/engine/preflight.js +11 -11
  159. package/dist/lib/engine/rejudge.js +78 -76
  160. package/dist/lib/engine/run-status.js +73 -71
  161. package/dist/lib/engine/templates.js +15 -11
  162. package/dist/lib/grounding/chromium-guard.js +13 -0
  163. package/dist/lib/grounding/controller.js +11 -10
  164. package/dist/lib/grounding/extract.js +10 -9
  165. package/dist/lib/grounding/fetch.js +4 -7
  166. package/dist/lib/grounding/file-store.js +5 -5
  167. package/dist/lib/grounding/grounding-runtime.js +32 -31
  168. package/dist/lib/grounding/guarded-request.js +18 -0
  169. package/dist/lib/grounding/model.js +9 -8
  170. package/dist/lib/grounding/profile.js +4 -4
  171. package/dist/lib/grounding/recorded-tools.js +16 -16
  172. package/dist/lib/grounding/session.js +3 -3
  173. package/dist/lib/grounding/tools.js +4 -3
  174. package/dist/lib/grounding/validation.js +2 -2
  175. package/dist/lib/harness/report/artifacts.js +11 -11
  176. package/dist/lib/harness/report/capture-coverage.js +4 -4
  177. package/dist/lib/lib/checkpoint.js +10 -10
  178. package/dist/lib/lib/progress-comparison.js +2 -2
  179. package/dist/lib/models/batching.js +3 -3
  180. package/dist/lib/models/structured.js +2 -2
  181. package/dist/lib/pipeline.js +19 -20
  182. package/dist/lib/probes/agent-clis.js +10 -10
  183. package/dist/lib/probes/probes.js +11 -11
  184. package/dist/lib/probes/web-tool-guard.js +3 -3
  185. package/dist/lib/report/contracts.js +4 -4
  186. package/dist/lib/report/core/progress-comparison.js +2 -2
  187. package/dist/lib/report/core/progress-schema.js +2 -2
  188. package/dist/lib/report/core/schema.js +2 -4
  189. package/dist/lib/report/core/surfaces.js +1 -3
  190. package/dist/lib/runner.js +23 -24
  191. package/dist/lib/schema.js +19 -13
  192. package/dist/lib/section-result.js +14 -15
  193. package/dist/lib/stores/artifacts.js +17 -17
  194. package/dist/lib/stores/files.js +31 -31
  195. package/dist/lib/stores/local-versions.js +10 -10
  196. package/dist/lib/stores/memory.js +33 -33
  197. package/dist/lib/stores/publication.js +23 -22
  198. package/dist/lib/surfaces.js +1 -3
  199. package/dist/lib/viewer/server.js +38 -38
  200. package/dist/lib/workflow/schema.js +8 -8
  201. package/dist/types/agents/author-schema.d.ts +3 -3
  202. package/dist/types/analysis/scoring.d.ts +2 -2
  203. package/dist/types/bundle/contracts.d.ts +3 -2
  204. package/dist/types/checks/crawler-access.d.ts +3 -2
  205. package/dist/types/checks/renderability.d.ts +8 -1
  206. package/dist/types/codex-workflow/author-tools.d.ts +3 -3
  207. package/dist/types/codex-workflow/run-inputs.d.ts +3 -0
  208. package/dist/types/codex-workflow/schemas.d.ts +6 -6
  209. package/dist/types/engine/audit-file.d.ts +6 -1
  210. package/dist/types/engine/preflight.d.ts +2 -0
  211. package/dist/types/grounding/chromium-guard.d.ts +41 -0
  212. package/dist/types/grounding/fetch.d.ts +0 -10
  213. package/dist/types/grounding/guarded-request.d.ts +76 -0
  214. package/dist/types/harness/report/artifacts.d.ts +1 -0
  215. package/dist/types/lib/checkpoint.d.ts +5 -6
  216. package/dist/types/pipeline.d.ts +2 -1
  217. package/dist/types/probes/probes.d.ts +2 -1
  218. package/dist/types/report/contracts.d.ts +2 -0
  219. package/dist/types/report/core/schema.d.ts +3 -1
  220. package/dist/types/report/core/surfaces.d.ts +0 -1
  221. package/dist/types/schema.d.ts +22 -0
  222. package/dist/types/section-result.d.ts +1 -1
  223. package/package.json +1 -1
  224. package/resources/guide/OPERATOR.md +12 -3
  225. package/src/agents/author-schema.ts +13 -1
  226. package/src/agents/author-validation.ts +2 -5
  227. package/src/agents/facts.ts +8 -8
  228. package/src/agents/narrative-facts.ts +9 -20
  229. package/src/agents/verifier.ts +2 -2
  230. package/src/analysis/progress.ts +1 -0
  231. package/src/analysis/scoring.ts +9 -13
  232. package/src/bundle/contracts.ts +7 -2
  233. package/src/bundle/verify.ts +3 -3
  234. package/src/capture-manifest.ts +4 -0
  235. package/src/checks/crawler-access.ts +70 -50
  236. package/src/checks/renderability.ts +113 -87
  237. package/src/checks/run-checks.ts +16 -3
  238. package/src/cli/run-commands.ts +2 -0
  239. package/src/codex-workflow/aggregate.ts +1 -0
  240. package/src/codex-workflow/author-tools.ts +39 -60
  241. package/src/codex-workflow/capture.ts +1 -0
  242. package/src/codex-workflow/copy-editor.ts +3 -3
  243. package/src/codex-workflow/loop.ts +2 -2
  244. package/src/engine/audit-file.ts +89 -2
  245. package/src/engine/guide/OPERATOR.md +12 -3
  246. package/src/engine/preflight.ts +50 -0
  247. package/src/grounding/chromium-guard.ts +273 -0
  248. package/src/grounding/controller.ts +1 -1
  249. package/src/grounding/fetch.ts +39 -276
  250. package/src/grounding/guarded-request.ts +428 -0
  251. package/src/grounding/tools.ts +2 -1
  252. package/src/grounding/validation.ts +1 -1
  253. package/src/lib/checkpoint.ts +15 -16
  254. package/src/pipeline.ts +13 -7
  255. package/src/probes/agent-clis.ts +2 -3
  256. package/src/probes/probes.ts +24 -10
  257. package/src/report/core/schema.ts +4 -1
  258. package/src/report/core/surfaces.ts +4 -8
  259. package/src/runner.ts +1 -0
  260. package/src/schema.ts +68 -4
  261. package/src/section-result.ts +6 -5
  262. package/dist/lib/chunks/chunk-6EH4N3EU.js +0 -113
  263. package/dist/lib/chunks/chunk-SWJ7KQSL.js +0 -318
  264. package/dist/lib/chunks/{chunk-CO5T6WU5.js → chunk-OD36HUXA.js} +3 -3
  265. package/dist/lib/chunks/{chunk-XI5H46DF.js → chunk-SASE7U6E.js} +3 -3
@@ -47,6 +47,9 @@ export declare const runInputsSchema: z.ZodObject<{
47
47
  runsPerPrompt: z.ZodDefault<z.ZodNumber>;
48
48
  maxPromptsPerSection: z.ZodOptional<z.ZodNumber>;
49
49
  }, z.core.$strip>>;
50
+ chatProbes: z.ZodOptional<z.ZodObject<{
51
+ runsPerPrompt: z.ZodNumber;
52
+ }, z.core.$strict>>;
50
53
  moneyPages: z.ZodArray<z.ZodString>;
51
54
  productBrief: z.ZodString;
52
55
  surfaces: z.ZodPrefault<z.ZodObject<{
@@ -222,12 +222,12 @@ export declare const authorStageOutputSchema: z.ZodObject<{
222
222
  domain: z.ZodString;
223
223
  aliases: z.ZodDefault<z.ZodArray<z.ZodString>>;
224
224
  }, z.core.$strip>;
225
+ moneyPages: z.ZodArray<z.ZodString>;
226
+ productBrief: z.ZodString;
225
227
  agentProbes: z.ZodPrefault<z.ZodObject<{
226
- runsPerPrompt: z.ZodDefault<z.ZodNumber>;
227
228
  maxPromptsPerSection: z.ZodOptional<z.ZodNumber>;
229
+ runsPerPrompt: z.ZodDefault<z.ZodNumber>;
228
230
  }, z.core.$strip>>;
229
- moneyPages: z.ZodArray<z.ZodString>;
230
- productBrief: z.ZodString;
231
231
  sections: z.ZodArray<z.ZodObject<{
232
232
  prompts: z.ZodArray<z.ZodObject<{
233
233
  id: z.ZodString;
@@ -424,12 +424,12 @@ export declare const stageSchemas: {
424
424
  domain: z.ZodString;
425
425
  aliases: z.ZodDefault<z.ZodArray<z.ZodString>>;
426
426
  }, z.core.$strip>;
427
+ moneyPages: z.ZodArray<z.ZodString>;
428
+ productBrief: z.ZodString;
427
429
  agentProbes: z.ZodPrefault<z.ZodObject<{
428
- runsPerPrompt: z.ZodDefault<z.ZodNumber>;
429
430
  maxPromptsPerSection: z.ZodOptional<z.ZodNumber>;
431
+ runsPerPrompt: z.ZodDefault<z.ZodNumber>;
430
432
  }, z.core.$strip>>;
431
- moneyPages: z.ZodArray<z.ZodString>;
432
- productBrief: z.ZodString;
433
433
  sections: z.ZodArray<z.ZodObject<{
434
434
  prompts: z.ZodArray<z.ZodObject<{
435
435
  id: z.ZodString;
@@ -31,6 +31,7 @@ export declare const runPolicySchema: z.ZodObject<{
31
31
  maxTokens: z.ZodDefault<z.ZodNumber>;
32
32
  maxHours: z.ZodDefault<z.ZodNumber>;
33
33
  }, z.core.$strict>>;
34
+ checkHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
34
35
  }, z.core.$strict>;
35
36
  export declare const auditFileSchema: z.ZodObject<{
36
37
  version: z.ZodLiteral<1>;
@@ -78,7 +79,10 @@ export declare const auditFileSchema: z.ZodObject<{
78
79
  agentProbes: z.ZodPrefault<z.ZodObject<{
79
80
  runsPerPrompt: z.ZodDefault<z.ZodNumber>;
80
81
  maxPromptsPerSection: z.ZodOptional<z.ZodNumber>;
81
- }, z.core.$strip>>;
82
+ }, z.core.$strict>>;
83
+ chatProbes: z.ZodOptional<z.ZodObject<{
84
+ runsPerPrompt: z.ZodNumber;
85
+ }, z.core.$strict>>;
82
86
  geography: z.ZodDefault<z.ZodString>;
83
87
  language: z.ZodDefault<z.ZodString>;
84
88
  moneyPages: z.ZodDefault<z.ZodArray<z.ZodURL>>;
@@ -107,6 +111,7 @@ export declare const auditFileSchema: z.ZodObject<{
107
111
  maxTokens: z.ZodDefault<z.ZodNumber>;
108
112
  maxHours: z.ZodDefault<z.ZodNumber>;
109
113
  }, z.core.$strict>>;
114
+ checkHosts: z.ZodDefault<z.ZodArray<z.ZodString>>;
110
115
  }, z.core.$strict>>;
111
116
  author: z.ZodOptional<z.ZodObject<{
112
117
  runId: z.ZodString;
@@ -29,4 +29,6 @@ export declare const runPreflight: (args: {
29
29
  model?: string;
30
30
  /** Full grounding researches through the pinned search provider. */
31
31
  groundingSearch?: boolean;
32
+ /** Money pages are rendered in Chromium by the renderability check. */
33
+ rendersPages?: boolean;
32
34
  }) => Promise<PreflightCheck[]>;
@@ -0,0 +1,41 @@
1
+ import type { LookupAddress } from 'node:dns';
2
+ import { type Socket } from 'node:net';
3
+ import type { BrowserContext, Page } from 'playwright';
4
+ import { type LookupAll } from './guarded-request';
5
+ export type ConnectionCounts = {
6
+ allowed: number;
7
+ refused: number;
8
+ };
9
+ export type GuardingProxyOptions = {
10
+ /** Test seam: the DNS answers for a host. */
11
+ lookupHost?: LookupAll;
12
+ /** Test seam: where an allowed connection is dialled. */
13
+ dial?: (address: LookupAddress) => Socket;
14
+ };
15
+ export type GuardingProxy = {
16
+ server: string;
17
+ counts: () => ConnectionCounts;
18
+ close: () => Promise<void>;
19
+ };
20
+ /** startGuardingProxy listens on a free loopback port until closed. */
21
+ export declare const startGuardingProxy: (options?: GuardingProxyOptions) => Promise<GuardingProxy>;
22
+ /**
23
+ * withBoundedPage runs `use` on a new page of the context, then closes it.
24
+ * A page that freezes its main thread never answers evaluate() or content(),
25
+ * and no Playwright timeout covers those calls; closing the page makes them
26
+ * fail. So past the deadline the page is closed and the render refused,
27
+ * instead of holding the run, and the host's turn in the pacer, forever.
28
+ */
29
+ export declare const withBoundedPage: <T>(context: Pick<BrowserContext, "newPage">, deadlineInMs: number, use: (page: Page) => Promise<T>) => Promise<T>;
30
+ /**
31
+ * withGuardedChromium runs `use` in a fresh browser context whose every
32
+ * connection passes the guarding proxy, then closes both. Downloads are
33
+ * refused, service workers blocked and media never loaded.
34
+ */
35
+ export declare const withGuardedChromium: <T>(use: (context: BrowserContext) => Promise<T>, options?: {
36
+ userAgent?: string;
37
+ proxy?: GuardingProxyOptions;
38
+ }) => Promise<{
39
+ result: T;
40
+ connections: ConnectionCounts;
41
+ }>;
@@ -5,16 +5,6 @@ export declare const sourceLimits: {
5
5
  readonly retainedBytes: 16384;
6
6
  readonly redirects: 3;
7
7
  };
8
- export type SourceRetrievalReason = 'unsafe_destination' | 'timeout' | 'too_large' | 'unsupported_content' | 'http_error' | 'empty_content' | 'network_error';
9
- export declare class SourceRetrievalError extends Error {
10
- readonly reason: SourceRetrievalReason;
11
- readonly status: number | undefined;
12
- constructor(reason: SourceRetrievalReason, message: string, { status, cause }?: {
13
- status?: number;
14
- cause?: unknown;
15
- });
16
- }
17
- export declare const validateResearchUrl: (value: string) => URL;
18
8
  /**
19
9
  * canonicalResearchUrl returns a URL as research receipts compare it: no
20
10
  * hash, lowercase host, no trailing slash on a path. The author's journal, its
@@ -0,0 +1,76 @@
1
+ import type { LookupAddress } from 'node:dns';
2
+ export type SourceRetrievalReason = 'unsafe_destination' | 'timeout' | 'too_large' | 'unsupported_content' | 'http_error' | 'empty_content' | 'network_error';
3
+ export declare class SourceRetrievalError extends Error {
4
+ readonly reason: SourceRetrievalReason;
5
+ readonly status: number | undefined;
6
+ constructor(reason: SourceRetrievalReason, message: string, { status, cause }?: {
7
+ status?: number;
8
+ cause?: unknown;
9
+ });
10
+ }
11
+ export declare const validateResearchUrl: (value: string) => URL;
12
+ export type LookupAll = (host: string) => Promise<LookupAddress[]>;
13
+ /**
14
+ * resolvePublicAddress returns the address a connection to the host is
15
+ * pinned to. Every DNS answer must be public, not only the first: a host
16
+ * that also answers with a private address could hand it to the next
17
+ * lookup, so the socket never looks the name up again.
18
+ */
19
+ export declare const resolvePublicAddress: (hostname: string, signal: AbortSignal, lookupHost?: LookupAll) => Promise<LookupAddress>;
20
+ /**
21
+ * HostPacer runs one request at a time per host, each starting a fixed
22
+ * interval after the previous one ended. One pacer serves every request of
23
+ * a phase, so checks that run side by side still reach a site one by one.
24
+ */
25
+ export type HostPacer = <T>(url: URL, send: () => Promise<T>) => Promise<T>;
26
+ export declare const createHostPacer: (intervalInMs: number, wait?: (ms: number) => Promise<unknown>) => HostPacer;
27
+ /** How a successful response's body is read. */
28
+ export type BodyPolicy = {
29
+ /** Content types the body may have; any other is refused unread. */
30
+ contentTypes: RegExp | 'any';
31
+ maxBytes: number;
32
+ /** Past maxBytes: keep the prefix and say so, or refuse the response. */
33
+ oversize: 'truncate' | 'refuse';
34
+ };
35
+ export type GuardedRequestOptions = {
36
+ url: string;
37
+ /** Bounds each hop from when it is sent; a wait for the host's turn in
38
+ * the pacer is not counted, or a request queued behind a slow render
39
+ * would time out without ever being sent. */
40
+ timeoutInMs: number;
41
+ signal?: AbortSignal;
42
+ userAgent: string;
43
+ accept: string;
44
+ /** Redirects followed before the request is refused. */
45
+ redirects: number;
46
+ /** Absent: only the status and headers are read, never the body. */
47
+ body?: BodyPolicy;
48
+ /** Wraps every hop's request: the caller's spacing per host. */
49
+ pace?: HostPacer;
50
+ };
51
+ export type GuardedHop = {
52
+ url: string;
53
+ status: number;
54
+ };
55
+ export type GuardedResponse = {
56
+ /** The URL of the final hop. */
57
+ url: string;
58
+ status: number;
59
+ contentType: string;
60
+ /** Read only for a 2xx under a body policy. */
61
+ body: Buffer | undefined;
62
+ isTruncated: boolean;
63
+ /** Every response received, the final one last. */
64
+ hops: GuardedHop[];
65
+ };
66
+ /** A failure as a site check records it: a refused destination or redirect
67
+ * names its reason (`unsafe_destination: …`). */
68
+ export declare const describeSiteError: (error: unknown) => string;
69
+ /** A request bound to a phase's pacer: what the site checks receive. */
70
+ export type SiteRequest = (options: Omit<GuardedRequestOptions, 'pace'>) => Promise<GuardedResponse>;
71
+ /**
72
+ * guardedRequest sends a GET under the guard and returns any status: the
73
+ * caller decides what a 403 or a 5xx means. A redirect it cannot follow
74
+ * (no Location, or past the limit) and an unsafe hop are refused.
75
+ */
76
+ export declare const guardedRequest: (options: GuardedRequestOptions) => Promise<GuardedResponse>;
@@ -244,6 +244,7 @@ export declare const technicalChecksArtifactSchema: z.ZodObject<{
244
244
  robotsUrl: z.ZodString;
245
245
  fetchedAt: z.ZodString;
246
246
  robotsFetchError: z.ZodNullable<z.ZodString>;
247
+ robotsTruncated: z.ZodOptional<z.ZodBoolean>;
247
248
  bots: z.ZodArray<z.ZodObject<{
248
249
  bot: z.ZodString;
249
250
  kind: z.ZodEnum<{
@@ -1,4 +1,4 @@
1
- import type { AeoPrompt, AeoSurface, AgentProbeConfig } from '../schema';
1
+ import type { AeoPrompt, AeoSurface, ProbeDepth } from '../schema';
2
2
  import type { CheckpointMatch, ProbeUnit } from '../stores/ports';
3
3
  export type { CapturedUnitRecord, CheckpointMatch, CheckpointProbe, FailedUnitRecord, ProbeUnit, UnitRecord, } from '../stores/ports';
4
4
  /** Key without the prompt text: section | surface | prompt id | run index. */
@@ -17,15 +17,14 @@ export declare const promptTextHash: (promptText: string) => string;
17
17
  export declare const unitRecordKey: (unit: ProbeUnit) => string;
18
18
  /**
19
19
  * The probe units a run plans for one section: chat surfaces cover every
20
- * prompt at the canonical run counts; agent surfaces follow the config's
21
- * agentProbes volume. Mirrors the pipeline's fan-out exactly — the planned
22
- * set is both the resume scope and the scoring denominator.
20
+ * prompt, agent surfaces the config's agentProbes subset, each at the depth
21
+ * runsPerPromptOn gives it. Mirrors the pipeline's fan-out exactly — the
22
+ * planned set is both the resume scope and the scoring denominator.
23
23
  */
24
- export declare const plannedProbeUnitsForSection: (args: {
24
+ export declare const plannedProbeUnitsForSection: (args: ProbeDepth & {
25
25
  sectionKey: string;
26
26
  prompts: AeoPrompt[];
27
27
  surfaces: readonly AeoSurface[];
28
- agentProbes: AgentProbeConfig;
29
28
  }) => ProbeUnit[];
30
29
  export declare const entryMatches: (entry: {
31
30
  sectionKey: string;
@@ -1,4 +1,4 @@
1
- import type { AeoAgentSurface, AeoBrand, AeoEvidenceChunk, AeoPrompt, AeoSurface, AeoVisibility, AgentProbeConfig, RetrievalLog } from './schema';
1
+ import type { AeoAgentSurface, AeoBrand, AeoEvidenceChunk, AeoPrompt, AeoSurface, AeoVisibility, AgentProbeConfig, ChatProbeConfig, RetrievalLog } from './schema';
2
2
  import { type ProbeResult } from './probes/probes';
3
3
  import { type AgentCliVersions, type AgentProbeResult, type AgentRuntime } from './probes/agent-clis';
4
4
  import type { ProbeFailureKind } from './probes/failure';
@@ -52,6 +52,7 @@ export type SectionRunArgs = {
52
52
  language: string;
53
53
  surfaces: readonly AeoSurface[];
54
54
  agentProbes: AgentProbeConfig;
55
+ chatProbes: ChatProbeConfig | undefined;
55
56
  agentCliVersions: AgentCliVersions;
56
57
  runId: string;
57
58
  probeStore: ProbeStore | null;
@@ -1,4 +1,4 @@
1
- import type { AeoChatSurface, AeoSurface, RetrievalLog } from '../schema';
1
+ import type { AeoChatSurface, AeoSurface, ChatProbeConfig, RetrievalLog } from '../schema';
2
2
  import { type ProbeTrace } from './probe-trace';
3
3
  import { type ProbeLimiter } from './limits';
4
4
  import type { ProbeOutcome } from './outcomes';
@@ -25,6 +25,7 @@ export type ProbeJob = {
25
25
  language: string;
26
26
  prompts: ProbePromptInput[];
27
27
  surfaces?: readonly AeoChatSurface[];
28
+ chatProbes: ChatProbeConfig | undefined;
28
29
  filter?: (unit: {
29
30
  promptId: string;
30
31
  surface: AeoChatSurface;
@@ -320,6 +320,7 @@ export declare const reportDisplaySchema: z.ZodObject<{
320
320
  robotsUrl: z.ZodString;
321
321
  fetchedAt: z.ZodString;
322
322
  robotsFetchError: z.ZodNullable<z.ZodString>;
323
+ robotsTruncated: z.ZodOptional<z.ZodBoolean>;
323
324
  bots: z.ZodArray<z.ZodObject<{
324
325
  bot: z.ZodString;
325
326
  kind: z.ZodEnum<{
@@ -778,6 +779,7 @@ export declare const clientReportBundleSchema: z.ZodDiscriminatedUnion<[z.ZodObj
778
779
  robotsUrl: z.ZodString;
779
780
  fetchedAt: z.ZodString;
780
781
  robotsFetchError: z.ZodNullable<z.ZodString>;
782
+ robotsTruncated: z.ZodOptional<z.ZodBoolean>;
781
783
  bots: z.ZodArray<z.ZodObject<{
782
784
  bot: z.ZodString;
783
785
  kind: z.ZodEnum<{
@@ -3,7 +3,7 @@ export declare const aeoSnapshotVersion = 2;
3
3
  /** Ceiling on additive scrutiny rounds; the workflow loop and the stored
4
4
  * `meta.quality.reviewRounds` share it. */
5
5
  export declare const maxReviewRounds = 5;
6
- export { agentSurfaces, allSurfaces, chatSurfaces, surfaceRunCounts, isAgentSurface, plannedRunsPerPrompt, } from './surfaces';
6
+ export { agentSurfaces, allSurfaces, chatSurfaces, surfaceRunCounts, isAgentSurface, } from './surfaces';
7
7
  export type { AeoAgentSurface, AeoChatSurface, AeoSurface } from './surfaces';
8
8
  export declare const aeoSurfaceSchema: z.ZodEnum<{
9
9
  chatgpt: "chatgpt";
@@ -357,6 +357,7 @@ export declare const aeoTechnicalChecksSchema: z.ZodObject<{
357
357
  robotsUrl: z.ZodString;
358
358
  fetchedAt: z.ZodString;
359
359
  robotsFetchError: z.ZodNullable<z.ZodString>;
360
+ robotsTruncated: z.ZodOptional<z.ZodBoolean>;
360
361
  bots: z.ZodArray<z.ZodObject<{
361
362
  bot: z.ZodString;
362
363
  kind: z.ZodEnum<{
@@ -595,6 +596,7 @@ export declare const aeoSnapshotSchema: z.ZodObject<{
595
596
  robotsUrl: z.ZodString;
596
597
  fetchedAt: z.ZodString;
597
598
  robotsFetchError: z.ZodNullable<z.ZodString>;
599
+ robotsTruncated: z.ZodOptional<z.ZodBoolean>;
598
600
  bots: z.ZodArray<z.ZodObject<{
599
601
  bot: z.ZodString;
600
602
  kind: z.ZodEnum<{
@@ -8,4 +8,3 @@ export type AeoSurface = (typeof allSurfaces)[number];
8
8
  export declare const surfaceLabels: Record<string, string>;
9
9
  export declare const isAgentSurface: (surface: string) => surface is AeoAgentSurface;
10
10
  export declare const surfaceRunCounts: Readonly<Record<AeoSurface, number>>;
11
- export declare const plannedRunsPerPrompt: (surfaces: readonly AeoSurface[]) => number;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { type AeoChatSurface, type AeoSurface } from './report/core/schema';
2
3
  import { coverageThresholdsSchema } from './coverage-schema';
3
4
  export * from './report/core/schema';
4
5
  export declare const aeoSectionConfigSchema: z.ZodObject<{
@@ -25,6 +26,24 @@ export declare const agentProbeConfigSchema: z.ZodObject<{
25
26
  maxPromptsPerSection: z.ZodOptional<z.ZodNumber>;
26
27
  }, z.core.$strip>;
27
28
  export type AgentProbeConfig = z.infer<typeof agentProbeConfigSchema>;
29
+ /** agentProbedPrompts is the prompts the coding agents are asked: the first
30
+ * maxPromptsPerSection in config order, or every prompt. */
31
+ export declare const agentProbedPrompts: <Prompt>(prompts: readonly Prompt[], agentProbes: AgentProbeConfig) => Prompt[];
32
+ export declare const chatProbeConfigSchema: z.ZodObject<{
33
+ runsPerPrompt: z.ZodNumber;
34
+ }, z.core.$strict>;
35
+ export type ChatProbeConfig = z.infer<typeof chatProbeConfigSchema>;
36
+ /** chatRunsPerPrompt is how many times each prompt is asked on a chat
37
+ * surface. */
38
+ export declare const chatRunsPerPrompt: (surface: AeoChatSurface, chatProbes: ChatProbeConfig | undefined) => number;
39
+ export type ProbeDepth = {
40
+ agentProbes: AgentProbeConfig;
41
+ chatProbes: ChatProbeConfig | undefined;
42
+ };
43
+ /** runsPerPromptOn is how many times each prompt is asked on a surface: the
44
+ * depth the plan is built at, which the probe batches and every
45
+ * planned-answer denominator must match. */
46
+ export declare const runsPerPromptOn: (surface: AeoSurface, depth: ProbeDepth) => number;
28
47
  export declare const aeoAuditConfigSchema: z.ZodObject<{
29
48
  reportKey: z.ZodString;
30
49
  questionSetName: z.ZodOptional<z.ZodString>;
@@ -65,6 +84,9 @@ export declare const aeoAuditConfigSchema: z.ZodObject<{
65
84
  runsPerPrompt: z.ZodDefault<z.ZodNumber>;
66
85
  maxPromptsPerSection: z.ZodOptional<z.ZodNumber>;
67
86
  }, z.core.$strip>>;
87
+ chatProbes: z.ZodOptional<z.ZodObject<{
88
+ runsPerPrompt: z.ZodNumber;
89
+ }, z.core.$strict>>;
68
90
  moneyPages: z.ZodArray<z.ZodString>;
69
91
  productBrief: z.ZodString;
70
92
  surfaces: z.ZodPrefault<z.ZodObject<{
@@ -1,4 +1,4 @@
1
1
  import type { PromptAnalysisResult, SectionCaptureSummary, SectionRunArgs, SectionRunResult } from './pipeline';
2
2
  /** Pure assembly of a section from its capture and extractions: scoring,
3
3
  * evidence split, matrix and visibility. The same inputs give the same result. */
4
- export declare const assembleSectionResult: (args: Pick<SectionRunArgs, "sectionKey" | "brand" | "competitors" | "prompts" | "surfaces" | "agentProbes">, capture: SectionCaptureSummary, analyses: readonly PromptAnalysisResult[]) => SectionRunResult;
4
+ export declare const assembleSectionResult: (args: Pick<SectionRunArgs, "sectionKey" | "brand" | "competitors" | "prompts" | "surfaces" | "agentProbes" | "chatProbes">, capture: SectionCaptureSummary, analyses: readonly PromptAnalysisResult[]) => SectionRunResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "literally-aeo",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Literally.dev AEO: run an AI visibility audit locally and verify its evidence offline.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -114,9 +114,17 @@ sections, the buyer questions in each, the competitors, and the surfaces
114
114
  (the assistants that will be asked). Apply the user's edits to
115
115
  `draft/audit.json` yourself. The optional `model` field names the model
116
116
  that judges and writes the report; leave it out to use the recommended
117
- one, which `literally-aeo doctor` lists with every supported model. Run
117
+ one, which `literally-aeo doctor` lists with every supported model. If the
118
+ user would rather measure fewer questions more deeply, set
119
+ `chatProbes.runsPerPrompt` and `agentProbes.runsPerPrompt` (1 to 25 runs
120
+ of each question per assistant); left out, each question is asked twice
121
+ (once on AI Overviews). Run
118
122
  `literally-aeo doctor --config draft/audit.json --env-file .env --json`
119
- after editing.
123
+ after editing. Money pages must be on the company's site or its
124
+ subdomains; for a page on another host the user owns (a docs site, say),
125
+ add that host to `runPolicy.checkHosts`. With money pages, doctor also
126
+ checks that Chromium launches and, if not, names the command that
127
+ installs it.
120
128
 
121
129
  ## Checkpoint 6: approve the audit cost
122
130
 
@@ -174,7 +182,8 @@ Quote the report; do not add claims it does not make.
174
182
 
175
183
  Offer `literally-aeo export run`: a `.aeo.zip` bundle with the captured
176
184
  answers, every judgment, the metrics, the report and the journal of every
177
- operation, which anyone can check offline with `literally-aeo verify`.
185
+ operation, which anyone can check offline with `literally-aeo verify` from
186
+ this release or a newer one.
178
187
  Credentials found in it block the export. Tell the user the bundle shows
179
188
  the questions and the answers, so they should share it only where those can
180
189
  be read.
@@ -1,5 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { aeoAuditConfigSchema, aeoSectionConfigSchema } from '../schema';
2
+ import {
3
+ aeoAuditConfigSchema,
4
+ aeoSectionConfigSchema,
5
+ agentProbeConfigSchema,
6
+ } from '../schema';
3
7
  import { proposedProductFactSchema } from '../grounding/schema';
4
8
 
5
9
  // ============================================================================
@@ -17,8 +21,16 @@ export const authorOutputSchema = aeoAuditConfigSchema
17
21
  sourceOverrides: true,
18
22
  productGrounding: true,
19
23
  competitorQualification: true,
24
+ // Depth decides what a run costs, so the operator sets it in audit.json
25
+ // with the estimate in front of them, never the author.
26
+ chatProbes: true,
20
27
  })
21
28
  .extend({
29
+ // The agent batch the author could always propose: 1 or 2 runs per
30
+ // prompt. A deeper one is the operator's call, as chat depth is.
31
+ agentProbes: agentProbeConfigSchema
32
+ .extend({ runsPerPrompt: z.number().int().min(1).max(2).default(2) })
33
+ .prefault({}),
22
34
  sections: z
23
35
  .array(
24
36
  aeoSectionConfigSchema.extend({
@@ -1,11 +1,8 @@
1
1
  import { aeoAuditConfigSchema, type AeoAuditConfig } from '../schema';
2
2
  import { normalizeDomain } from '../analysis/scoring';
3
3
  import banlist from '../author/banlist.json';
4
- import {
5
- canonicalResearchUrl,
6
- fetchGroundingSource,
7
- SourceRetrievalError,
8
- } from '../grounding/fetch';
4
+ import { canonicalResearchUrl, fetchGroundingSource } from '../grounding/fetch';
5
+ import { SourceRetrievalError } from '../grounding/guarded-request';
9
6
  import { credentialDetected } from './credentials';
10
7
  import {
11
8
  authorNotesSchema,
@@ -1,8 +1,8 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import { canonicalJson } from '../lib/canonical-json';
3
3
  import { isDomainCited } from '../analysis/domain-match';
4
+ import { plannedProbeUnitsForSection } from '../lib/checkpoint';
4
5
  import type { AeoAuditConfig, AeoSnapshot } from '../schema';
5
- import { isAgentSurface, surfaceRunCounts } from '../surfaces';
6
6
  import type {
7
7
  ClaimAssessment,
8
8
  ClaimCandidate,
@@ -129,13 +129,13 @@ export const buildFactCatalog = ({
129
129
  const rows = section.visibility.matrix.filter(
130
130
  (row) => row.surface === surface,
131
131
  );
132
- const count = isAgentSurface(surface)
133
- ? Math.min(
134
- configured.prompts.length,
135
- config.agentProbes.maxPromptsPerSection ??
136
- configured.prompts.length,
137
- ) * config.agentProbes.runsPerPrompt
138
- : configured.prompts.length * surfaceRunCounts[surface];
132
+ const count = plannedProbeUnitsForSection({
133
+ sectionKey: section.key,
134
+ prompts: configured.prompts,
135
+ surfaces: [surface],
136
+ agentProbes: config.agentProbes,
137
+ chatProbes: config.chatProbes,
138
+ }).length;
139
139
 
140
140
  for (const metric of ['mentions', 'citations'] as const) {
141
141
  const numerator = rows.filter((row) =>
@@ -1,10 +1,6 @@
1
+ import { plannedProbeUnitsForSection } from '../lib/checkpoint';
1
2
  import type { AeoAuditConfig, AeoSnapshot, AeoSurface } from '../schema';
2
- import {
3
- allSurfaces,
4
- isAgentSurface,
5
- surfaceLabels,
6
- surfaceRunCounts,
7
- } from '../surfaces';
3
+ import { allSurfaces, isAgentSurface, surfaceLabels } from '../surfaces';
8
4
  import type { ReportFact } from './facts';
9
5
  import { pendingReportCopy } from './copy-schema';
10
6
 
@@ -110,16 +106,6 @@ export const buildNarrativeFacts = (
110
106
  unit: 'count',
111
107
  sentence: `This audit tested ${config.brand.name} in the ${market} section using these questions: ${JSON.stringify(configured.prompts.map(({ text }) => text))}. These are the configured audit questions, not measured search demand or verified customer conversations. Locale: ${config.geography}, language: ${config.language}.`,
112
108
  });
113
- const planned = (surface: AeoSurface) => {
114
- return isAgentSurface(surface)
115
- ? Math.min(
116
- configured.prompts.length,
117
- config.agentProbes.maxPromptsPerSection ??
118
- configured.prompts.length,
119
- ) * config.agentProbes.runsPerPrompt
120
- : configured.prompts.length * surfaceRunCounts[surface];
121
- };
122
-
123
109
  for (const group of ['chat', 'agents'] as const) {
124
110
  const surfaces = section.visibility.surfaces.filter(
125
111
  (surface) => isAgentSurface(surface) === (group === 'agents'),
@@ -132,10 +118,13 @@ export const buildNarrativeFacts = (
132
118
  const rows = section.visibility.matrix.filter((row) =>
133
119
  surfaces.includes(row.surface),
134
120
  );
135
- const denominator = surfaces.reduce(
136
- (sum, surface) => sum + planned(surface),
137
- 0,
138
- );
121
+ const denominator = plannedProbeUnitsForSection({
122
+ sectionKey: section.key,
123
+ prompts: configured.prompts,
124
+ surfaces,
125
+ agentProbes: config.agentProbes,
126
+ chatProbes: config.chatProbes,
127
+ }).length;
139
128
  const names =
140
129
  group === 'agents' ? 'coding agents' : 'chat and search assistants';
141
130
  const entities = [
@@ -318,8 +318,8 @@ export const checkPremiseVerdicts = (
318
318
  // The premise findings are the evidence; the block flag follows them. A
319
319
  // pass over an unsupported premise is a failed block with that finding,
320
320
  // which the verifier's own edit then repairs: refusing it as an invalid
321
- // review sent Botpress's copy pass round the same review six times and
322
- // failed the pipeline (2026-09-15). A failure that names nothing is
321
+ // review once sent a run's copy pass round the same review six times
322
+ // and failed the pipeline. A failure that names nothing is
323
323
  // still a verdict the host cannot act on. A pass with stray text in
324
324
  // `errors` is a pass.
325
325
  if (!review.passed && !blockRejections.size) {
@@ -115,6 +115,7 @@ export const projectProgressMeasurement = (
115
115
  prompts: section.prompts,
116
116
  surfaces,
117
117
  agentProbes: config.agentProbes,
118
+ chatProbes: config.chatProbes,
118
119
  }),
119
120
  );
120
121
  const planned = new Map<string, ProbeUnit>();
@@ -1,6 +1,5 @@
1
1
  import { normalizeDomain } from '../report/core/normalize-domain';
2
- import type { AeoSurface } from '../schema';
3
- import { surfaceRunCounts, plannedRunsPerPrompt } from '../surfaces';
2
+ import { runsPerPromptOn, type AeoSurface, type ProbeDepth } from '../schema';
4
3
 
5
4
  // ============================================================================
6
5
  // Scorecard aggregation (ported from the console's intelligence/scoring.ts).
@@ -62,19 +61,17 @@ export const computeAISearchSummary = (args: {
62
61
  prompts: PromptForScoring[];
63
62
  results: AnalyzedProbeForScoring[];
64
63
  surfaces: readonly AeoSurface[];
65
- // Overrides the canonical per-surface run count (agent batches configured
66
- // below the default, spec §5 revised). Applies uniformly to every scoped
67
- // surface; omit for the canonical surfaceRunCounts denominators.
68
- runsPerSurface?: number;
64
+ // The configured depth the plan asked each prompt at.
65
+ depth: ProbeDepth;
69
66
  }): ScoringSummary => {
70
- const { competitorDomains, prompts, results, surfaces } = args;
67
+ const { competitorDomains, prompts, results, surfaces, depth } = args;
71
68
 
72
69
  // Probe planning: total probes attempted = prompts × (sum of runs across
73
70
  // the scoped surfaces). Failures lower share of voice instead of hiding.
74
- const totalRunsPerPrompt =
75
- args.runsPerSurface !== undefined
76
- ? surfaces.length * args.runsPerSurface
77
- : plannedRunsPerPrompt(surfaces);
71
+ const totalRunsPerPrompt = surfaces.reduce(
72
+ (sum, surface) => sum + runsPerPromptOn(surface, depth),
73
+ 0,
74
+ );
78
75
  const totalPrompts = prompts.length * totalRunsPerPrompt;
79
76
 
80
77
  const mentioned = results.filter((r) => r.clientMentioned).length;
@@ -89,8 +86,7 @@ export const computeAISearchSummary = (args: {
89
86
 
90
87
  for (const surface of surfaces) {
91
88
  const modelResults = results.filter((r) => r.model === surface);
92
- const runsPerPrompt = args.runsPerSurface ?? surfaceRunCounts[surface];
93
- const total = prompts.length * runsPerPrompt;
89
+ const total = prompts.length * runsPerPromptOn(surface, depth);
94
90
 
95
91
  byModel[surface] = {
96
92
  sov:
@@ -13,8 +13,13 @@ import { canonicalDigest } from './json';
13
13
  export const toolId = 'literally-aeo';
14
14
  // The package version, recorded in every journal and bundle; the build and
15
15
  // version.spec.ts refuse a mismatch with package.json.
16
- export const toolVersion = '0.2.0';
17
- export const bundleSchemaVersion = 1;
16
+ export const toolVersion = '0.2.1';
17
+ // Version 2: config.json may set chatProbes, and agentProbes.runsPerPrompt
18
+ // above 2. A verifier that reads only version 1 then refuses the bundle as
19
+ // unsupported instead of dropping its depth and failing it.
20
+ export const bundleSchemaVersion = 2;
21
+ // A version 1 bundle reads as version 2 at the standard depth.
22
+ export const readableBundleSchemaVersions: readonly number[] = [1, 2];
18
23
  export const traceSchemaVersion = 1;
19
24
  export const canonicalization = 'literally-aeo-canonical-json-v1';
20
25
  // Bump when the arithmetic the verifier recomputes changes