literally-aeo 0.1.1 → 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 (369) hide show
  1. package/README.md +71 -7
  2. package/dist/author-tools.js +512 -461
  3. package/dist/cli.mjs +3512 -2010
  4. package/dist/lib/access/schema.js +6 -6
  5. package/dist/lib/agents/author-schema.js +11 -12
  6. package/dist/lib/agents/author-validation.js +19 -20
  7. package/dist/lib/agents/copy-validation.js +22 -22
  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 +26 -25
  12. package/dist/lib/analysis/domain-classifier.js +21 -22
  13. package/dist/lib/analysis/domain-labels.js +11 -12
  14. package/dist/lib/analysis/progress-schema.js +2 -2
  15. package/dist/lib/analysis/progress.js +19 -21
  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 +18 -19
  20. package/dist/lib/author/examples.js +12 -13
  21. package/dist/lib/bundle/contracts.js +15 -14
  22. package/dist/lib/bundle/export.js +34 -31
  23. package/dist/lib/bundle/isolation.js +17 -0
  24. package/dist/lib/bundle/journal.js +14 -15
  25. package/dist/lib/bundle/project-journal.js +19 -18
  26. package/dist/lib/bundle/project.js +31 -28
  27. package/dist/lib/bundle/read.js +35 -32
  28. package/dist/lib/bundle/recorder.js +17 -16
  29. package/dist/lib/bundle/redact.js +14 -15
  30. package/dist/lib/bundle/trace-coverage.js +14 -15
  31. package/dist/lib/bundle/verify-integrity.js +16 -17
  32. package/dist/lib/bundle/verify-measurement.js +22 -23
  33. package/dist/lib/bundle/verify-report.js +29 -30
  34. package/dist/lib/bundle/verify.js +37 -38
  35. package/dist/lib/bundle/writer-lock.js +3 -1
  36. package/dist/lib/capture-manifest.js +13 -14
  37. package/dist/lib/checks/crawler-access.js +4 -1
  38. package/dist/lib/checks/renderability.js +5 -1
  39. package/dist/lib/checks/run-checks.js +23 -19
  40. package/dist/lib/chunks/chunk-2B5QF6UQ.js +159 -0
  41. package/dist/lib/chunks/chunk-2FOKEIIN.js +93 -0
  42. package/dist/lib/chunks/{chunk-KRFHQQS7.js → chunk-2KH7LNK7.js} +24 -24
  43. package/dist/lib/chunks/{chunk-NVBMIPXR.js → chunk-3GPUCXVA.js} +44 -26
  44. package/dist/lib/chunks/{chunk-3EBWDHPK.js → chunk-3OE4UQIB.js} +14 -16
  45. package/dist/lib/chunks/{chunk-FNDJUELJ.js → chunk-3OWJBGQE.js} +14 -14
  46. package/dist/lib/chunks/{chunk-Y4OGZ3Q5.js → chunk-46PVVQYR.js} +1 -1
  47. package/dist/lib/chunks/{chunk-EV4DRS5M.js → chunk-4XIAXX7K.js} +1 -1
  48. package/dist/lib/chunks/{chunk-IBOWGKN7.js → chunk-52F5XYOW.js} +1 -1
  49. package/dist/lib/chunks/{chunk-3DG7GHFA.js → chunk-66DVMLGR.js} +10 -10
  50. package/dist/lib/chunks/{chunk-FFOVLI3U.js → chunk-66T7JC57.js} +12 -10
  51. package/dist/lib/chunks/{chunk-KMRQSIZW.js → chunk-6GOBBNDU.js} +16 -1
  52. package/dist/lib/chunks/{chunk-WUELMJ22.js → chunk-6HMHXSCS.js} +2 -2
  53. package/dist/lib/chunks/{chunk-SWS3K62X.js → chunk-6JICXLDA.js} +3 -3
  54. package/dist/lib/chunks/{chunk-SBAZBOPI.js → chunk-6P7EZJI7.js} +4 -2
  55. package/dist/lib/chunks/chunk-75DMLOQ7.js +127 -0
  56. package/dist/lib/chunks/{chunk-RMFT4KKK.js → chunk-7CW6U5WJ.js} +1 -1
  57. package/dist/lib/chunks/{chunk-5VNYUCLL.js → chunk-7HM6IZ3L.js} +6 -9
  58. package/dist/lib/chunks/{chunk-X6E44EGV.js → chunk-7LBSNDRR.js} +10 -8
  59. package/dist/lib/chunks/{chunk-S2AM76LT.js → chunk-7WO3FFPS.js} +3 -3
  60. package/dist/lib/chunks/{chunk-ULRXHSJL.js → chunk-7YDXD4MD.js} +9 -6
  61. package/dist/lib/chunks/{chunk-HFOYASRQ.js → chunk-AAFHXNLU.js} +4 -4
  62. package/dist/lib/chunks/{chunk-OBXAHX3L.js → chunk-AASWJR7Q.js} +1 -5
  63. package/dist/lib/chunks/{chunk-MD4AVTK2.js → chunk-AJKV46SM.js} +3 -3
  64. package/dist/lib/chunks/{chunk-IEVAFDW7.js → chunk-AJO7XVXK.js} +12 -12
  65. package/dist/lib/chunks/{chunk-GMKF2FU4.js → chunk-AK6YNTCV.js} +1 -1
  66. package/dist/lib/chunks/{chunk-WKH6BJAZ.js → chunk-BFWK3TBN.js} +6 -6
  67. package/dist/lib/chunks/{chunk-FKLNEB2P.js → chunk-BGAHZIL3.js} +51 -17
  68. package/dist/lib/chunks/{chunk-ZCOI3HE2.js → chunk-BRENK356.js} +1 -1
  69. package/dist/lib/chunks/{chunk-S7KJZIUR.js → chunk-BXF4OC74.js} +18 -9
  70. package/dist/lib/chunks/{chunk-NCLFZOZU.js → chunk-CH7OCYDL.js} +1 -1
  71. package/dist/lib/chunks/{chunk-FPAN3VRW.js → chunk-DDS4G4DO.js} +27 -19
  72. package/dist/lib/chunks/{chunk-ZLOOC46D.js → chunk-DL6YQDTE.js} +34 -8
  73. package/dist/lib/chunks/chunk-DVFFYY5G.js +74 -0
  74. package/dist/lib/chunks/{chunk-PDS5KWO3.js → chunk-E2YTTB6Q.js} +56 -42
  75. package/dist/lib/chunks/{chunk-YR67JG2V.js → chunk-E3OGPTUY.js} +8 -3
  76. package/dist/lib/chunks/{chunk-SDWYZM64.js → chunk-EDQTINTL.js} +5 -1
  77. package/dist/lib/chunks/chunk-ESEMYWUH.js +257 -0
  78. package/dist/lib/chunks/{chunk-YHS5IEVZ.js → chunk-F2NSJ6PG.js} +12 -8
  79. package/dist/lib/chunks/{chunk-7GXRDAUY.js → chunk-F7DBTXKG.js} +6 -6
  80. package/dist/lib/chunks/chunk-FAUFE7MI.js +31 -0
  81. package/dist/lib/chunks/{chunk-4E4NDGOZ.js → chunk-FDM2YNQL.js} +1 -1
  82. package/dist/lib/chunks/{chunk-47IZBMP2.js → chunk-FIC7JSR4.js} +2 -2
  83. package/dist/lib/chunks/{chunk-CJ5YD3CU.js → chunk-FJL2V6P5.js} +6 -6
  84. package/dist/lib/chunks/{chunk-KHU5DRBE.js → chunk-FL6LN2K6.js} +9 -9
  85. package/dist/lib/chunks/{chunk-HSZ3DM74.js → chunk-GEFKDW7X.js} +15 -2
  86. package/dist/lib/chunks/{chunk-XNRSHATN.js → chunk-HI3PD3KR.js} +8 -8
  87. package/dist/lib/chunks/{chunk-AUB5THIS.js → chunk-I3UE52ZV.js} +2 -2
  88. package/dist/lib/chunks/{chunk-IAR6XGEW.js → chunk-J5NPHPXY.js} +5 -4
  89. package/dist/lib/chunks/{chunk-XJVXASDD.js → chunk-JBOOD6MU.js} +11 -10
  90. package/dist/lib/chunks/{chunk-5KKLUM7M.js → chunk-JKPBXPCW.js} +3 -3
  91. package/dist/lib/chunks/{chunk-5HT55QYX.js → chunk-JQDQVG3D.js} +1 -1
  92. package/dist/lib/chunks/{chunk-3KQFLOC7.js → chunk-JXBLGCXZ.js} +1 -1
  93. package/dist/lib/chunks/{chunk-D2INDP5W.js → chunk-JYFEXVWC.js} +7 -6
  94. package/dist/lib/chunks/{chunk-X2Y2ZNG3.js → chunk-K2FZFESR.js} +8 -8
  95. package/dist/lib/chunks/{chunk-DC6PN7QJ.js → chunk-K4Y5NT4M.js} +11 -7
  96. package/dist/lib/chunks/chunk-K7YFL5KB.js +182 -0
  97. package/dist/lib/chunks/{chunk-ZYSPTOKK.js → chunk-KQCRJIEG.js} +1 -1
  98. package/dist/lib/chunks/{chunk-LPND3VNQ.js → chunk-KSOHZKV5.js} +43 -35
  99. package/dist/lib/chunks/{chunk-FBFZBLTY.js → chunk-LR27H2HZ.js} +15 -16
  100. package/dist/lib/chunks/{chunk-KZR25REO.js → chunk-LTI2YYU3.js} +1 -1
  101. package/dist/lib/chunks/{chunk-EPQHVILQ.js → chunk-MA27TFEY.js} +5 -3
  102. package/dist/lib/chunks/{chunk-J46W3EMQ.js → chunk-MENTBQGB.js} +8 -7
  103. package/dist/lib/chunks/chunk-MPJCZN4G.js +155 -0
  104. package/dist/lib/chunks/{chunk-56VOFZ7T.js → chunk-MTDYBJXH.js} +92 -26
  105. package/dist/lib/chunks/{chunk-PCYNBDZ7.js → chunk-OD36HUXA.js} +17 -12
  106. package/dist/lib/chunks/{chunk-WDSCJEDG.js → chunk-OQFAMKLN.js} +11 -11
  107. package/dist/lib/chunks/{chunk-Z4LMDKBU.js → chunk-PWOYEIPF.js} +4 -4
  108. package/dist/lib/chunks/{chunk-XL4JIQ5X.js → chunk-PXB4PWJI.js} +7 -3
  109. package/dist/lib/chunks/{chunk-7ZOJE6BH.js → chunk-QGZ4QSUE.js} +8 -7
  110. package/dist/lib/chunks/chunk-QJZTDZMB.js +321 -0
  111. package/dist/lib/chunks/{chunk-MHAKYFDF.js → chunk-R2AJYV6A.js} +22 -22
  112. package/dist/lib/chunks/{chunk-5B3RNVZ6.js → chunk-RK57YZKM.js} +1 -1
  113. package/dist/lib/chunks/{chunk-ZXGATMMH.js → chunk-RPTADJXD.js} +1 -1
  114. package/dist/lib/chunks/{chunk-2NJEWPCV.js → chunk-RXSHKWZJ.js} +3 -3
  115. package/dist/lib/chunks/chunk-RYCRL3YA.js +106 -0
  116. package/dist/lib/chunks/{chunk-E3OEE5XN.js → chunk-SD7LR26G.js} +3 -3
  117. package/dist/lib/chunks/{chunk-GVC4LH2N.js → chunk-SIJOQRRK.js} +1 -1
  118. package/dist/lib/chunks/{chunk-ZBDUE3A5.js → chunk-SLAPBFRH.js} +12 -7
  119. package/dist/lib/chunks/{chunk-CKUTDJAB.js → chunk-SMPP7B7F.js} +45 -10
  120. package/dist/lib/chunks/{chunk-POUSX3T4.js → chunk-SQQ56UP2.js} +15 -6
  121. package/dist/lib/chunks/{chunk-I3TMFPK4.js → chunk-T5XQ6NXD.js} +6 -4
  122. package/dist/lib/chunks/{chunk-EYKINDNK.js → chunk-TAPVCSCR.js} +1 -1
  123. package/dist/lib/chunks/{chunk-ISN6MBNB.js → chunk-U5USH2HB.js} +7 -7
  124. package/dist/lib/chunks/chunk-U64NCRRR.js +97 -0
  125. package/dist/lib/chunks/{chunk-D2LPQO6Y.js → chunk-U6BW6LGX.js} +10 -3
  126. package/dist/lib/chunks/chunk-U772TN32.js +67 -0
  127. package/dist/lib/chunks/{chunk-XHWRSGX3.js → chunk-UYDQXXDQ.js} +4 -4
  128. package/dist/lib/chunks/{chunk-CPT2GKKW.js → chunk-V5JJEEBT.js} +1 -1
  129. package/dist/lib/chunks/{chunk-YWJPJI3W.js → chunk-VL253W5C.js} +3 -1
  130. package/dist/lib/chunks/{chunk-I7VNIW6Q.js → chunk-VPXYGN4I.js} +86 -15
  131. package/dist/lib/chunks/{chunk-Z7V63UZA.js → chunk-VXDMOB7O.js} +4 -4
  132. package/dist/lib/chunks/chunk-W5X7WJYL.js +91 -0
  133. package/dist/lib/chunks/{chunk-6AUEDSTU.js → chunk-WCLKIPJV.js} +1 -1
  134. package/dist/lib/chunks/{chunk-QFVRCSJ2.js → chunk-WDOA5JEH.js} +2 -0
  135. package/dist/lib/chunks/chunk-WDT2Y7D7.js +117 -0
  136. package/dist/lib/chunks/{chunk-OVUCZLH2.js → chunk-WIBMVNIH.js} +2 -2
  137. package/dist/lib/chunks/{chunk-5T3V6XJS.js → chunk-WNIXDMJL.js} +1 -1
  138. package/dist/lib/chunks/{chunk-OORO55OM.js → chunk-WZGI7UVM.js} +23 -8
  139. package/dist/lib/chunks/{chunk-2GY42RIJ.js → chunk-XAKME6NM.js} +1 -1
  140. package/dist/lib/chunks/{chunk-Q2PWES4B.js → chunk-XAN4CRFP.js} +33 -41
  141. package/dist/lib/chunks/{chunk-MIF5IYNR.js → chunk-XDG6NPJB.js} +26 -29
  142. package/dist/lib/chunks/{chunk-IPNK7FYT.js → chunk-XFUYEFQP.js} +1 -1
  143. package/dist/lib/chunks/{chunk-OQVIRYT5.js → chunk-XNTFOVCE.js} +2 -2
  144. package/dist/lib/chunks/chunk-Y2CZ6FZY.js +61 -0
  145. package/dist/lib/chunks/{chunk-D7GEQVLL.js → chunk-YKJHFD64.js} +1 -1
  146. package/dist/lib/chunks/chunk-YZEZRQIG.js +194 -0
  147. package/dist/lib/chunks/chunk-ZIGNJAPC.js +11 -0
  148. package/dist/lib/chunks/{chunk-5ZITQDVE.js → chunk-ZQ3ER7JD.js} +12 -13
  149. package/dist/lib/cli/bundle-commands.js +102 -94
  150. package/dist/lib/cli/guide-command.js +25 -0
  151. package/dist/lib/cli/io.js +1 -1
  152. package/dist/lib/cli/run-commands.js +310 -140
  153. package/dist/lib/cli/status-command.js +236 -0
  154. package/dist/lib/codex-workflow/aggregate.js +22 -24
  155. package/dist/lib/codex-workflow/author-search.js +4 -3
  156. package/dist/lib/codex-workflow/author-tools.js +18 -17
  157. package/dist/lib/codex-workflow/author.js +39 -36
  158. package/dist/lib/codex-workflow/capture.js +26 -25
  159. package/dist/lib/codex-workflow/checkpoint.js +14 -15
  160. package/dist/lib/codex-workflow/checks.js +16 -18
  161. package/dist/lib/codex-workflow/codex-binary.js +13 -0
  162. package/dist/lib/codex-workflow/codex-home.js +6 -3
  163. package/dist/lib/codex-workflow/copy-editor.js +33 -32
  164. package/dist/lib/codex-workflow/copy-recovery.js +12 -13
  165. package/dist/lib/codex-workflow/copy.js +30 -29
  166. package/dist/lib/codex-workflow/finish.js +37 -38
  167. package/dist/lib/codex-workflow/host-models.js +7 -7
  168. package/dist/lib/codex-workflow/loop.js +71 -65
  169. package/dist/lib/codex-workflow/quality.js +12 -13
  170. package/dist/lib/codex-workflow/run-inputs.js +13 -14
  171. package/dist/lib/codex-workflow/run-source.js +28 -24
  172. package/dist/lib/codex-workflow/schemas.js +12 -13
  173. package/dist/lib/codex-workflow/session.js +15 -16
  174. package/dist/lib/codex-workflow/stage.js +51 -45
  175. package/dist/lib/codex-workflow/workdir.js +14 -15
  176. package/dist/lib/engine/audit-file.js +18 -13
  177. package/dist/lib/engine/author.js +62 -53
  178. package/dist/lib/engine/budget.js +7 -1
  179. package/dist/lib/engine/cost-estimate.js +43 -0
  180. package/dist/lib/engine/local-run.js +79 -71
  181. package/dist/lib/engine/preflight.js +17 -13
  182. package/dist/lib/engine/rejudge.js +87 -79
  183. package/dist/lib/engine/resources.js +1 -1
  184. package/dist/lib/engine/run-configuration.js +2 -1
  185. package/dist/lib/engine/run-status.js +153 -0
  186. package/dist/lib/engine/templates.js +19 -14
  187. package/dist/lib/grounding/chromium-guard.js +13 -0
  188. package/dist/lib/grounding/controller.js +13 -12
  189. package/dist/lib/grounding/extract.js +12 -11
  190. package/dist/lib/grounding/fetch.js +4 -7
  191. package/dist/lib/grounding/file-store.js +5 -5
  192. package/dist/lib/grounding/grounding-runtime.js +34 -32
  193. package/dist/lib/grounding/guarded-request.js +18 -0
  194. package/dist/lib/grounding/model.js +11 -10
  195. package/dist/lib/grounding/profile.js +4 -4
  196. package/dist/lib/grounding/recorded-tools.js +18 -17
  197. package/dist/lib/grounding/session.js +3 -3
  198. package/dist/lib/grounding/tools.js +4 -3
  199. package/dist/lib/grounding/validation.js +2 -2
  200. package/dist/lib/harness/report/artifacts.js +12 -13
  201. package/dist/lib/harness/report/capture-coverage.js +4 -4
  202. package/dist/lib/lib/checkpoint.js +11 -12
  203. package/dist/lib/lib/progress-comparison.js +2 -2
  204. package/dist/lib/models/batching.js +5 -5
  205. package/dist/lib/models/cost-coefficients.js +20 -0
  206. package/dist/lib/models/local-profile.js +10 -0
  207. package/dist/lib/models/pricing.js +6 -0
  208. package/dist/lib/models/profiles.js +7 -14
  209. package/dist/lib/models/structured-images.js +1 -1
  210. package/dist/lib/models/structured.js +4 -4
  211. package/dist/lib/models/supported-models.js +20 -0
  212. package/dist/lib/pipeline.js +21 -21
  213. package/dist/lib/probes/agent-cli-parsers.js +1 -1
  214. package/dist/lib/probes/agent-clis.js +13 -12
  215. package/dist/lib/probes/charged-trace.js +10 -0
  216. package/dist/lib/probes/probes.js +12 -12
  217. package/dist/lib/probes/web-tool-guard.js +3 -3
  218. package/dist/lib/report/contracts.js +4 -4
  219. package/dist/lib/report/core/progress-comparison.js +2 -2
  220. package/dist/lib/report/core/progress-schema.js +2 -2
  221. package/dist/lib/report/core/schema.js +2 -4
  222. package/dist/lib/report/core/surfaces.js +1 -3
  223. package/dist/lib/runner.js +25 -26
  224. package/dist/lib/schema.js +20 -15
  225. package/dist/lib/section-result.js +15 -17
  226. package/dist/lib/stores/artifacts.js +18 -19
  227. package/dist/lib/stores/files.js +32 -32
  228. package/dist/lib/stores/local-versions.js +11 -12
  229. package/dist/lib/stores/memory.js +34 -35
  230. package/dist/lib/stores/publication.js +23 -23
  231. package/dist/lib/surfaces.js +1 -3
  232. package/dist/lib/viewer/server.js +38 -39
  233. package/dist/lib/workflow/schema.js +9 -10
  234. package/dist/types/agents/author-schema.d.ts +3 -3
  235. package/dist/types/agents/copy-validation.d.ts +4 -4
  236. package/dist/types/agents/verifier.d.ts +6 -6
  237. package/dist/types/analysis/scoring.d.ts +2 -2
  238. package/dist/types/bundle/contracts.d.ts +3 -2
  239. package/dist/types/bundle/isolation.d.ts +37 -0
  240. package/dist/types/bundle/project-journal.d.ts +2 -0
  241. package/dist/types/bundle/recorder.d.ts +4 -0
  242. package/dist/types/bundle/writer-lock.d.ts +9 -0
  243. package/dist/types/checks/crawler-access.d.ts +3 -2
  244. package/dist/types/checks/renderability.d.ts +8 -1
  245. package/dist/types/cli/guide-command.d.ts +4 -0
  246. package/dist/types/cli/status-command.d.ts +2 -0
  247. package/dist/types/codex-workflow/author-tools.d.ts +3 -3
  248. package/dist/types/codex-workflow/codex-binary.d.ts +26 -0
  249. package/dist/types/codex-workflow/codex-home.d.ts +24 -20
  250. package/dist/types/codex-workflow/copy-editor.d.ts +1 -1
  251. package/dist/types/codex-workflow/copy.d.ts +3 -4
  252. package/dist/types/codex-workflow/finish.d.ts +5 -3
  253. package/dist/types/codex-workflow/host-models.d.ts +7 -3
  254. package/dist/types/codex-workflow/loop.d.ts +10 -1
  255. package/dist/types/codex-workflow/run-inputs.d.ts +31 -113
  256. package/dist/types/codex-workflow/schemas.d.ts +6 -6
  257. package/dist/types/codex-workflow/stage.d.ts +16 -5
  258. package/dist/types/engine/audit-file.d.ts +9 -3
  259. package/dist/types/engine/author.d.ts +7 -1
  260. package/dist/types/engine/budget.d.ts +46 -15
  261. package/dist/types/engine/cost-estimate.d.ts +40 -0
  262. package/dist/types/engine/local-run.d.ts +6 -0
  263. package/dist/types/engine/preflight.d.ts +7 -0
  264. package/dist/types/engine/resources.d.ts +2 -0
  265. package/dist/types/engine/run-configuration.d.ts +4 -3
  266. package/dist/types/engine/run-status.d.ts +75 -0
  267. package/dist/types/engine/templates.d.ts +1 -2
  268. package/dist/types/grounding/chromium-guard.d.ts +41 -0
  269. package/dist/types/grounding/fetch.d.ts +0 -10
  270. package/dist/types/grounding/guarded-request.d.ts +76 -0
  271. package/dist/types/harness/report/artifacts.d.ts +1 -0
  272. package/dist/types/lib/checkpoint.d.ts +5 -6
  273. package/dist/types/models/cost-coefficients.d.ts +106 -0
  274. package/dist/types/models/local-profile.d.ts +12 -0
  275. package/dist/types/models/pricing.d.ts +8 -0
  276. package/dist/types/models/profiles.d.ts +55 -160
  277. package/dist/types/models/served-model.d.ts +2 -3
  278. package/dist/types/models/structured.d.ts +3 -3
  279. package/dist/types/models/supported-models.d.ts +48 -0
  280. package/dist/types/pipeline.d.ts +2 -1
  281. package/dist/types/probes/charged-trace.d.ts +8 -0
  282. package/dist/types/probes/probe-trace.d.ts +2 -0
  283. package/dist/types/probes/probes.d.ts +2 -1
  284. package/dist/types/report/contracts.d.ts +2 -0
  285. package/dist/types/report/core/schema.d.ts +3 -1
  286. package/dist/types/report/core/surfaces.d.ts +0 -1
  287. package/dist/types/schema.d.ts +50 -113
  288. package/dist/types/section-result.d.ts +1 -1
  289. package/dist/types/workflow/schema.d.ts +79 -152
  290. package/package.json +2 -1
  291. package/resources/guide/OPERATOR.md +189 -0
  292. package/src/agents/author-schema.ts +13 -1
  293. package/src/agents/author-validation.ts +2 -5
  294. package/src/agents/copy-validation.ts +8 -12
  295. package/src/agents/facts.ts +8 -8
  296. package/src/agents/narrative-facts.ts +9 -20
  297. package/src/agents/verifier.ts +12 -16
  298. package/src/analysis/progress.ts +1 -0
  299. package/src/analysis/scoring.ts +9 -13
  300. package/src/bundle/contracts.ts +9 -4
  301. package/src/bundle/isolation.ts +157 -0
  302. package/src/bundle/project-journal.ts +4 -0
  303. package/src/bundle/project.ts +20 -7
  304. package/src/bundle/recorder.ts +5 -0
  305. package/src/bundle/verify.ts +3 -3
  306. package/src/bundle/writer-lock.ts +27 -0
  307. package/src/capture-manifest.ts +4 -0
  308. package/src/checks/crawler-access.ts +70 -50
  309. package/src/checks/renderability.ts +113 -87
  310. package/src/checks/run-checks.ts +16 -3
  311. package/src/cli/guide-command.ts +28 -0
  312. package/src/cli/io.ts +2 -0
  313. package/src/cli/literally-aeo.ts +39 -19
  314. package/src/cli/run-commands.ts +238 -18
  315. package/src/cli/status-command.ts +113 -0
  316. package/src/codex-workflow/aggregate.ts +1 -0
  317. package/src/codex-workflow/author-tools.ts +39 -60
  318. package/src/codex-workflow/capture.ts +1 -0
  319. package/src/codex-workflow/codex-binary.ts +105 -0
  320. package/src/codex-workflow/codex-home.ts +50 -40
  321. package/src/codex-workflow/copy-editor.ts +3 -3
  322. package/src/codex-workflow/copy.ts +7 -10
  323. package/src/codex-workflow/finish.ts +13 -8
  324. package/src/codex-workflow/host-models.ts +33 -24
  325. package/src/codex-workflow/loop.ts +38 -11
  326. package/src/codex-workflow/stage.ts +126 -17
  327. package/src/engine/audit-file.ts +98 -9
  328. package/src/engine/author.ts +47 -2
  329. package/src/engine/budget.ts +138 -43
  330. package/src/engine/cost-estimate.ts +178 -0
  331. package/src/engine/guide/OPERATOR.md +189 -0
  332. package/src/engine/local-run.ts +38 -8
  333. package/src/engine/preflight.ts +140 -7
  334. package/src/engine/resources.ts +9 -4
  335. package/src/engine/run-configuration.ts +19 -1
  336. package/src/engine/run-status.ts +452 -0
  337. package/src/engine/templates.ts +5 -2
  338. package/src/grounding/chromium-guard.ts +273 -0
  339. package/src/grounding/controller.ts +1 -1
  340. package/src/grounding/fetch.ts +39 -276
  341. package/src/grounding/guarded-request.ts +428 -0
  342. package/src/grounding/tools.ts +2 -1
  343. package/src/grounding/validation.ts +1 -1
  344. package/src/lib/checkpoint.ts +15 -16
  345. package/src/models/cost-coefficients.ts +140 -0
  346. package/src/models/local-profile.ts +150 -0
  347. package/src/models/pricing.ts +31 -0
  348. package/src/models/profiles.ts +58 -419
  349. package/src/models/served-model.ts +2 -3
  350. package/src/models/structured-images.ts +5 -4
  351. package/src/models/structured.ts +20 -7
  352. package/src/models/supported-models.ts +112 -0
  353. package/src/pipeline.ts +13 -7
  354. package/src/probes/agent-clis.ts +26 -5
  355. package/src/probes/charged-trace.ts +87 -0
  356. package/src/probes/probe-trace.ts +2 -0
  357. package/src/probes/probes.ts +72 -12
  358. package/src/report/core/schema.ts +4 -1
  359. package/src/report/core/surfaces.ts +4 -8
  360. package/src/runner.ts +1 -0
  361. package/src/schema.ts +68 -4
  362. package/src/section-result.ts +6 -5
  363. package/dist/lib/chunks/chunk-6EH4N3EU.js +0 -113
  364. package/dist/lib/chunks/chunk-CFFPOTP4.js +0 -356
  365. package/dist/lib/chunks/chunk-LIZX4N3H.js +0 -110
  366. package/dist/lib/chunks/chunk-OYKV5NDM.js +0 -28
  367. package/dist/lib/chunks/chunk-SWJ7KQSL.js +0 -318
  368. package/dist/lib/chunks/chunk-WE2WPNG2.js +0 -104
  369. package/dist/lib/chunks/{chunk-XI5H46DF.js → chunk-SASE7U6E.js} +3 -3
@@ -0,0 +1,157 @@
1
+ import { z } from 'zod';
2
+ import { readEnv } from '../lib/env';
3
+ import { isAgentSurface } from '../surfaces';
4
+ import type { BundleEvent } from './contracts';
5
+
6
+ // ============================================================================
7
+ // The isolation a run actually had (specs/aeo-open-source-cli-spec.md §4.1,
8
+ // specs/aeo-claude-operator-spec.md §4.4). Each writer records its boundary
9
+ // when it opens the journal; the sandbox of every Codex stage session and
10
+ // every coding-agent probe are already operations in the journal. runtime.json
11
+ // reports what those events show and discloses what a native run lacks; a
12
+ // writer that recorded nothing is unknown, never assumed isolated.
13
+ // ============================================================================
14
+
15
+ export const IsolationBoundary = {
16
+ NATIVE: 'native',
17
+ CONTAINER: 'container',
18
+ } as const;
19
+
20
+ export type IsolationBoundary =
21
+ (typeof IsolationBoundary)[keyof typeof IsolationBoundary];
22
+
23
+ export const writerIsolationSchema = z.looseObject({
24
+ boundary: z.enum([IsolationBoundary.NATIVE, IsolationBoundary.CONTAINER]),
25
+ /** The sandbox the Codex probe surface runs in, should it run. */
26
+ codexProbeSandbox: z.string(),
27
+ });
28
+
29
+ export type WriterIsolation = z.infer<typeof writerIsolationSchema>;
30
+
31
+ /**
32
+ * observedIsolation is this process's boundary: the hosted container runs
33
+ * every agent CLI through an isolated worker under its own UID
34
+ * (AEO_ISOLATED_ADAPTER); anything else runs on the operator's machine as
35
+ * the operator.
36
+ */
37
+ export const observedIsolation = (): WriterIsolation => {
38
+ const isolation: WriterIsolation = {
39
+ boundary:
40
+ readEnv('AEO_ISOLATED_ADAPTER') === '1'
41
+ ? IsolationBoundary.CONTAINER
42
+ : IsolationBoundary.NATIVE,
43
+ codexProbeSandbox:
44
+ readEnv('AEO_CODEX_SANDBOX') === 'danger-full-access'
45
+ ? 'danger-full-access'
46
+ : 'read-only',
47
+ };
48
+
49
+ return isolation;
50
+ };
51
+
52
+ export type RunIsolation = {
53
+ /** One per writer, in journal order; unknown for a writer from before
54
+ * isolation was recorded. */
55
+ writers: (IsolationBoundary | 'unknown')[];
56
+ /** The Codex stage sessions' sandbox modes, as each session recorded. */
57
+ stageSandboxes: string[];
58
+ /** The agent CLIs probed by a native writer: they ran as the operator's
59
+ * own account, with its account-level settings. */
60
+ agentCliAccounts: string[];
61
+ };
62
+
63
+ const runtimeIsolationOf = (
64
+ event: BundleEvent,
65
+ ): IsolationBoundary | 'unknown' => {
66
+ const runtime = z
67
+ .looseObject({ isolation: writerIsolationSchema })
68
+ .safeParse(event.payload.runtime);
69
+
70
+ return runtime.success ? runtime.data.isolation.boundary : 'unknown';
71
+ };
72
+
73
+ const stringOf = (value: unknown): string | undefined => {
74
+ return typeof value === 'string' ? value : undefined;
75
+ };
76
+
77
+ const sandboxOf = (event: BundleEvent): string | undefined => {
78
+ const details = z
79
+ .looseObject({ sandbox: z.string() })
80
+ .safeParse(event.payload.details);
81
+
82
+ return details.success ? details.data.sandbox : undefined;
83
+ };
84
+
85
+ /** summarizeIsolation reads a run's isolation from its journal events. */
86
+ export const summarizeIsolation = (
87
+ events: readonly BundleEvent[],
88
+ ): RunIsolation => {
89
+ const writers: RunIsolation['writers'] = [];
90
+ const stageSandboxes = new Set<string>();
91
+ const agentCliAccounts = new Set<string>();
92
+
93
+ for (const event of events) {
94
+ if (event.type === 'run_started' || event.type === 'run_resumed') {
95
+ writers.push(runtimeIsolationOf(event));
96
+ continue;
97
+ }
98
+
99
+ if (event.type !== 'operation_started') {
100
+ continue;
101
+ }
102
+
103
+ const kind = stringOf(event.payload.kind);
104
+ const role = stringOf(event.payload.role);
105
+ const sandbox = sandboxOf(event);
106
+
107
+ if (kind === 'codex_session' && sandbox !== undefined) {
108
+ stageSandboxes.add(sandbox);
109
+ }
110
+
111
+ // A probe belongs to the writer that opened the journal before it.
112
+ const writer = writers.at(-1);
113
+
114
+ if (
115
+ (kind === 'probe' || kind === 'canary') &&
116
+ role !== undefined &&
117
+ isAgentSurface(role) &&
118
+ writer !== IsolationBoundary.CONTAINER
119
+ ) {
120
+ agentCliAccounts.add(role);
121
+ }
122
+ }
123
+
124
+ const isolation: RunIsolation = {
125
+ writers,
126
+ stageSandboxes: [...stageSandboxes].sort(),
127
+ agentCliAccounts: [...agentCliAccounts].sort(),
128
+ };
129
+
130
+ return isolation;
131
+ };
132
+
133
+ /** isolationLimitations states what the recorded isolation does not
134
+ * cover, in plain sentences for runtime.json. */
135
+ export const isolationLimitations = (isolation: RunIsolation): string[] => {
136
+ const limitations: string[] = [];
137
+
138
+ if (isolation.writers.includes('unknown')) {
139
+ limitations.push(
140
+ 'A writer of this run predates isolation recording; its boundary is unknown.',
141
+ );
142
+ }
143
+
144
+ if (isolation.writers.includes(IsolationBoundary.NATIVE)) {
145
+ limitations.push(
146
+ "Part or all of this run executed natively, without a container boundary. Codex sandboxes restrict writes and network access, not reads: a Codex session could read any file the operator's account can, while it processed untrusted answers and pages.",
147
+ );
148
+ }
149
+
150
+ if (isolation.agentCliAccounts.length > 0) {
151
+ limitations.push(
152
+ `The coding-agent CLIs ${isolation.agentCliAccounts.join(', ')} ran as the operator's own account. Account-level settings outside the tool's control (user rules, approved MCP servers) applied and are not recorded.`,
153
+ );
154
+ }
155
+
156
+ return limitations;
157
+ };
@@ -8,6 +8,7 @@ import {
8
8
  RunOrigin,
9
9
  type BundleManifest,
10
10
  } from './contracts';
11
+ import { summarizeIsolation, type RunIsolation } from './isolation';
11
12
  import { readJournal } from './journal';
12
13
  import { sha256Hex } from './json';
13
14
  import { runJournalDir } from './recorder';
@@ -61,6 +62,7 @@ export type JournalProjection = {
61
62
  origin: RunOrigin;
62
63
  trace: BundleManifest['trace'];
63
64
  writers: z.infer<typeof runtimeSchema>[];
65
+ isolation: RunIsolation;
64
66
  };
65
67
 
66
68
  /**
@@ -100,6 +102,7 @@ export const projectJournal = async (
100
102
  origin: RunOrigin.LEGACY_IMPORT,
101
103
  trace: { coverage: 'none', limitations: legacyTraceLimitations },
102
104
  writers: [],
105
+ isolation: summarizeIsolation([]),
103
106
  };
104
107
  }
105
108
 
@@ -173,6 +176,7 @@ export const projectJournal = async (
173
176
  origin: origin.success ? origin.data : RunOrigin.LEGACY_IMPORT,
174
177
  trace,
175
178
  writers,
179
+ isolation: summarizeIsolation(events),
176
180
  };
177
181
 
178
182
  return projection;
@@ -2,7 +2,7 @@ import { readdir, readFile } from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
  import { credentialDetected } from '../agents/credentials';
4
4
  import { capturePlan } from '../capture-manifest';
5
- import { codexModel } from '../codex-workflow/codex-home';
5
+ import { codexGateway } from '../codex-workflow/codex-home';
6
6
  import { stagePrompts } from '../codex-workflow/prompts';
7
7
  import { readRunInputs, type RunInputs } from '../codex-workflow/run-inputs';
8
8
  import { stageVersions } from '../codex-workflow/schemas';
@@ -19,6 +19,7 @@ import {
19
19
  predecessorPrefix,
20
20
  type PlanDocument,
21
21
  } from './contracts';
22
+ import { isolationLimitations } from './isolation';
22
23
  import { canonicalDigest, encodeBundleJson } from './json';
23
24
  import { bundlePathError } from './paths';
24
25
  import { predecessorDir, readDerivedFrom, type DerivedFrom } from './lineage';
@@ -111,6 +112,21 @@ const runPolicyOf = (request: RunInputs['request']) => {
111
112
  return runPolicy;
112
113
  };
113
114
 
115
+ /** The Codex stages' model as the run pinned it; null for a run whose
116
+ * profile predates the stage model in the profile (its sessions record the
117
+ * model they asked for in the journal). */
118
+ const stageModelOf = (inputs: RunInputs) => {
119
+ const stages = inputs.request.modelProfile?.stages;
120
+
121
+ return stages
122
+ ? {
123
+ model: stages.model,
124
+ provider: codexGateway.providerName,
125
+ reasoningEffort: stages.reasoningEffort,
126
+ }
127
+ : null;
128
+ };
129
+
114
130
  const methodOf = async (dir: string, inputs: RunInputs, snapshot: unknown) => {
115
131
  const meta =
116
132
  isRecord(snapshot) && isRecord(snapshot.meta) ? snapshot.meta : {};
@@ -142,11 +158,7 @@ const methodOf = async (dir: string, inputs: RunInputs, snapshot: unknown) => {
142
158
  // a session's own packet is in the journal.
143
159
  stagePrompts,
144
160
  stageVersions,
145
- codexModel: {
146
- model: codexModel.model,
147
- provider: codexModel.providerName,
148
- reasoningEffort: codexModel.reasoningEffort,
149
- },
161
+ codexModel: stageModelOf(inputs),
150
162
  };
151
163
 
152
164
  return method;
@@ -303,9 +315,10 @@ export const projectWorkdir = async (
303
315
  version: 1,
304
316
  writers: journal.writers,
305
317
  agentCliVersions: capture.agentCliVersions,
318
+ isolation: journal.isolation,
306
319
  limitations:
307
320
  journal.writers.length > 0
308
- ? []
321
+ ? isolationLimitations(journal.isolation)
309
322
  : [
310
323
  'The work directory predates runtime recording; the writers of this run are unknown.',
311
324
  ],
@@ -18,6 +18,7 @@ import {
18
18
  type RunOrigin,
19
19
  } from './contracts';
20
20
  import { openJournal, putObject, readJournal, type Journal } from './journal';
21
+ import { observedIsolation, type WriterIsolation } from './isolation';
21
22
 
22
23
  // ============================================================================
23
24
  // The execution recorder (specs/aeo-open-source-cli-spec.md §7): the host
@@ -169,6 +170,9 @@ export type OpenRecorderOptions = {
169
170
  * run_resumed (spec §7.2): the export claims coverage only for kinds
170
171
  * every writer observed. Defaults to the workflow's own. */
171
172
  observes?: readonly OperationKind[];
173
+ /** The boundary this writer runs inside; observed from the process when
174
+ * the writer does not state it. */
175
+ isolation?: WriterIsolation;
172
176
  };
173
177
 
174
178
  const frozenMeasurement = (text: string): string | undefined => {
@@ -220,6 +224,7 @@ export const openRecorder = async (
220
224
  node: process.version,
221
225
  platform: process.platform,
222
226
  arch: process.arch,
227
+ isolation: options.isolation ?? observedIsolation(),
223
228
  };
224
229
 
225
230
  const observes = [...(options.observes ?? workflowOperationKinds)];
@@ -11,9 +11,9 @@ import {
11
11
  import {
12
12
  bundleManifestSchema,
13
13
  bundlePaths,
14
- bundleSchemaVersion,
15
14
  canonicalization,
16
15
  predecessorPrefix,
16
+ readableBundleSchemaVersions,
17
17
  traceSchemaVersion,
18
18
  type BundleManifest,
19
19
  } from './contracts';
@@ -157,7 +157,7 @@ const readManifest = (
157
157
  : [];
158
158
 
159
159
  if (
160
- declared[0] !== bundleSchemaVersion ||
160
+ !readableBundleSchemaVersions.some((version) => version === declared[0]) ||
161
161
  declared[1] !== traceSchemaVersion ||
162
162
  declared[2] !== canonicalization
163
163
  ) {
@@ -167,7 +167,7 @@ const readManifest = (
167
167
  title: 'Bundle integrity',
168
168
  outcome: CheckOutcome.UNSUPPORTED,
169
169
  code: 'bundle_version_unsupported',
170
- explanation: `This verifier reads bundle schema ${bundleSchemaVersion}, trace schema ${traceSchemaVersion} and ${canonicalization}; the bundle declares ${JSON.stringify(declared)}. It does not download or upgrade code to read another.`,
170
+ explanation: `This verifier reads bundle schema ${readableBundleSchemaVersions.join(' or ')}, trace schema ${traceSchemaVersion} and ${canonicalization}; the bundle declares ${JSON.stringify(declared)}. It does not download or upgrade code to read another: verify the bundle with the literally-aeo release that produced it, or a newer one.`,
171
171
  }),
172
172
  };
173
173
  }
@@ -131,3 +131,30 @@ export const acquireWriterLock = async (
131
131
 
132
132
  return { takenOver, release };
133
133
  };
134
+
135
+ /** live: the process runs on this host; abandoned: it is gone from this
136
+ * host; unknown: it belongs to another host, which this one cannot ask. */
137
+ export type WriterLockState = 'live' | 'abandoned' | 'unknown';
138
+
139
+ /** readWriterLock reports who holds a run directory without taking it:
140
+ * undefined when no writer does. */
141
+ export const readWriterLock = async (
142
+ dir: string,
143
+ ): Promise<{ owner: WriterLockOwner; state: WriterLockState } | undefined> => {
144
+ const owner = await readOwner(path.join(dir, writerLockFile)).catch(
145
+ // A lock torn mid-write reads as an unknown owner, never as no writer.
146
+ () => ({ host: '', pid: -1, purpose: 'unknown', acquiredAt: '' }),
147
+ );
148
+
149
+ if (owner === undefined) {
150
+ return undefined;
151
+ }
152
+
153
+ let state: WriterLockState = 'unknown';
154
+
155
+ if (owner.host === hostname()) {
156
+ state = owner.pid > 0 && isProcessAlive(owner.pid) ? 'live' : 'abandoned';
157
+ }
158
+
159
+ return { owner, state };
160
+ };
@@ -93,6 +93,9 @@ export const capturePlan = (
93
93
  geography: config.geography,
94
94
  language: config.language,
95
95
  agentProbes: config.agentProbes,
96
+ // Undefined members are dropped, so a config without chat depth keeps
97
+ // the digest earlier releases gave it.
98
+ chatProbes: config.chatProbes,
96
99
  surfaces,
97
100
  });
98
101
 
@@ -104,6 +107,7 @@ export const capturePlan = (
104
107
  prompts: section.prompts,
105
108
  surfaces,
106
109
  agentProbes: config.agentProbes,
110
+ chatProbes: config.chatProbes,
107
111
  }),
108
112
  ),
109
113
  };
@@ -1,5 +1,9 @@
1
- import type { AeoTechnicalChecks } from '../schema';
1
+ import {
2
+ describeSiteError,
3
+ type SiteRequest,
4
+ } from '../grounding/guarded-request';
2
5
  import { createLog } from '../lib/log';
6
+ import type { AeoTechnicalChecks } from '../schema';
3
7
 
4
8
  const log = createLog('CrawlerAccess');
5
9
 
@@ -65,19 +69,18 @@ export const aiBotRoster: readonly AiBot[] = [
65
69
  { bot: 'CCBot', kind: 'training' },
66
70
  ];
67
71
 
68
- const fetchTimeoutMs = 15_000;
69
- const probeIntervalMs = 1000;
72
+ const requestTimeoutInMs = 15_000;
73
+ const auditUserAgent = 'literally-aeo-audit/1.0';
70
74
  const controlUserAgent =
71
75
  'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36';
76
+ // RFC 9309 §2.3.1.2 and §2.5: follow at least five redirects for
77
+ // robots.txt, and parse at least its first 500 KiB.
78
+ const robotsRedirects = 5;
79
+ const robotsMaxBytes = 500 * 1024;
80
+ const pageRedirects = 5;
72
81
 
73
82
  type LiveVerdict = 'ok' | 'refused_as_bot' | 'inconclusive';
74
83
 
75
- const sleep = (ms: number) => {
76
- return new Promise<void>((resolve) => {
77
- setTimeout(resolve, ms);
78
- });
79
- };
80
-
81
84
  const isRefused = (code: number | null) => {
82
85
  return code === 403 || code === 429;
83
86
  };
@@ -97,27 +100,38 @@ const getLiveVerdict = (
97
100
  return isRefused(liveStatus) ? 'refused_as_bot' : 'ok';
98
101
  };
99
102
 
100
- const describeError = (error: unknown): string => {
101
- return error instanceof Error ? error.message : String(error);
103
+ const getOrigin = (brandDomain: string): string => {
104
+ return `https://${brandDomain.replace(/^https?:\/\//, '').replace(/\/.*$/, '')}`;
102
105
  };
103
106
 
104
107
  export const runCrawlerAccessCheck = async (
105
108
  brandDomain: string,
109
+ request: SiteRequest,
106
110
  ): Promise<NonNullable<AeoTechnicalChecks['crawlerAccess']>> => {
107
- const origin = `https://${brandDomain.replace(/^https?:\/\//, '').replace(/\/.*$/, '')}`;
111
+ const origin = getOrigin(brandDomain);
108
112
  const robotsUrl = `${origin}/robots.txt`;
109
113
 
110
114
  let robotsBody: string | null = null;
111
115
  let robotsFetchError: string | null = null;
116
+ let robotsTruncated = false;
112
117
 
113
118
  try {
114
- const response = await fetch(robotsUrl, {
115
- signal: AbortSignal.timeout(fetchTimeoutMs),
116
- headers: { 'user-agent': 'literally-aeo-audit/1.0' },
119
+ const response = await request({
120
+ url: robotsUrl,
121
+ timeoutInMs: requestTimeoutInMs,
122
+ userAgent: auditUserAgent,
123
+ accept: '*/*',
124
+ redirects: robotsRedirects,
125
+ body: {
126
+ contentTypes: 'any',
127
+ maxBytes: robotsMaxBytes,
128
+ oversize: 'truncate',
129
+ },
117
130
  });
118
131
 
119
- if (response.ok) {
120
- robotsBody = await response.text();
132
+ if (response.status >= 200 && response.status < 300) {
133
+ robotsBody = response.body?.toString('utf8') ?? '';
134
+ robotsTruncated = response.isTruncated;
121
135
  } else if (response.status === 404) {
122
136
  // No robots.txt = allow all; that is a real answer, not an error.
123
137
  robotsBody = '';
@@ -125,25 +139,30 @@ export const runCrawlerAccessCheck = async (
125
139
  robotsFetchError = `HTTP ${response.status}`;
126
140
  }
127
141
  } catch (error) {
128
- robotsFetchError = describeError(error);
142
+ robotsFetchError = describeSiteError(error);
129
143
  }
130
144
 
131
145
  const groups = robotsBody !== null ? parseRobotsTxt(robotsBody) : null;
132
146
 
133
- // One request at a time, spaced like a polite crawler: six bot agents
134
- // fired at once from one address looks like an attack to a rate rule and
135
- // colours every answer after the first.
136
- const status = async (userAgent: string): Promise<number | null> => {
147
+ // The request is paced per host by its caller: six bot agents fired at
148
+ // once from one address looks like an attack to a rate rule and colours
149
+ // every answer after the first.
150
+ const getStatus = async (userAgent: string): Promise<number | null> => {
137
151
  try {
138
- const response = await fetch(origin, {
139
- signal: AbortSignal.timeout(fetchTimeoutMs),
140
- headers: { 'user-agent': userAgent },
141
- redirect: 'follow',
152
+ const response = await request({
153
+ url: origin,
154
+ timeoutInMs: requestTimeoutInMs,
155
+ userAgent,
156
+ accept: '*/*',
157
+ redirects: pageRedirects,
142
158
  });
143
159
 
144
160
  return response.status;
145
161
  } catch (error) {
146
- log.warn('Live UA probe failed', { userAgent, error: String(error) });
162
+ log.warn('Live UA probe failed', {
163
+ userAgent,
164
+ error: describeSiteError(error),
165
+ });
147
166
 
148
167
  return null;
149
168
  }
@@ -156,11 +175,7 @@ export const runCrawlerAccessCheck = async (
156
175
  continue;
157
176
  }
158
177
 
159
- if (probed.length > 0) {
160
- await sleep(probeIntervalMs);
161
- }
162
-
163
- probed.push({ bot, liveStatus: await status(bot.liveProbeUa) });
178
+ probed.push({ bot, liveStatus: await getStatus(bot.liveProbeUa) });
164
179
  }
165
180
 
166
181
  // The control: the same page, from the same address, as an ordinary
@@ -168,14 +183,10 @@ export const runCrawlerAccessCheck = async (
168
183
  // that presented as that bot from an address the site cannot verify as
169
184
  // the bot's own (Cloudflare and others verify search bots by IP), so it
170
185
  // never proves the real bot is blocked. A browser refused too says the
171
- // address is blocked, which says nothing about bots. Botpress's report
172
- // called five bots blocked on that evidence (2026-09-15).
173
- if (probed.length > 0) {
174
- await sleep(probeIntervalMs);
175
- }
176
-
186
+ // address is blocked, which says nothing about bots. An earlier report
187
+ // called five bots blocked on that evidence.
177
188
  const controlStatus =
178
- probed.length > 0 ? await status(controlUserAgent) : null;
189
+ probed.length > 0 ? await getStatus(controlUserAgent) : null;
179
190
 
180
191
  const bots = aiBotRoster.map((bot) => {
181
192
  const robotsAllowed = groups ? isRootAllowed(groups, bot.bot) : null;
@@ -210,6 +221,7 @@ export const runCrawlerAccessCheck = async (
210
221
  log.info('Crawler access check completed', {
211
222
  robotsUrl,
212
223
  robotsFetchError,
224
+ robotsTruncated,
213
225
  controlStatus,
214
226
  bots: bots.length,
215
227
  robotsBlocked: bots.filter((b) => b.robotsAllowed === false).length,
@@ -221,6 +233,7 @@ export const runCrawlerAccessCheck = async (
221
233
  robotsUrl,
222
234
  fetchedAt: new Date().toISOString(),
223
235
  robotsFetchError,
236
+ robotsTruncated,
224
237
  controlStatus,
225
238
  bots,
226
239
  };
@@ -228,11 +241,14 @@ export const runCrawlerAccessCheck = async (
228
241
 
229
242
  export const checkLlmsTxt = async (
230
243
  brandDomain: string,
244
+ request: SiteRequest,
231
245
  ): Promise<NonNullable<AeoTechnicalChecks['llmsTxt']>> => {
232
- const origin = `https://${brandDomain.replace(/^https?:\/\//, '').replace(/\/.*$/, '')}`;
246
+ const origin = getOrigin(brandDomain);
247
+ // Started together, sent one after the other: the request is paced per
248
+ // host.
233
249
  const [llmsTxt, llmsFullTxt] = await Promise.all([
234
- urlExists(`${origin}/llms.txt`),
235
- urlExists(`${origin}/llms-full.txt`),
250
+ isTextFileServed(`${origin}/llms.txt`, request),
251
+ isTextFileServed(`${origin}/llms-full.txt`, request),
236
252
  ]);
237
253
 
238
254
  log.debug('llms.txt check completed', { origin, llmsTxt, llmsFullTxt });
@@ -240,21 +256,25 @@ export const checkLlmsTxt = async (
240
256
  return { llmsTxt, llmsFullTxt };
241
257
  };
242
258
 
243
- const urlExists = async (url: string): Promise<boolean> => {
259
+ const isTextFileServed = async (
260
+ url: string,
261
+ request: SiteRequest,
262
+ ): Promise<boolean> => {
244
263
  try {
245
- const response = await fetch(url, {
246
- signal: AbortSignal.timeout(fetchTimeoutMs),
247
- headers: { 'user-agent': 'literally-aeo-audit/1.0' },
264
+ const response = await request({
265
+ url,
266
+ timeoutInMs: requestTimeoutInMs,
267
+ userAgent: auditUserAgent,
268
+ accept: 'text/plain,text/markdown,*/*',
269
+ redirects: pageRedirects,
248
270
  });
249
271
 
250
- if (!response.ok) {
272
+ if (response.status < 200 || response.status >= 300) {
251
273
  return false;
252
274
  }
253
275
 
254
276
  // Some sites soft-404 to an HTML page; llms.txt is plain text.
255
- const contentType = response.headers.get('content-type') ?? '';
256
-
257
- return !contentType.includes('text/html');
277
+ return !response.contentType.includes('text/html');
258
278
  } catch {
259
279
  // An unreachable file is reported as missing, which is what the check asks.
260
280
  return false;