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
@@ -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
  }
@@ -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;
@@ -1,7 +1,16 @@
1
1
  import { load } from 'cheerio';
2
- import type { Browser } from 'playwright';
3
- import type { AeoTechnicalChecks } from '../schema';
2
+ import type { BrowserContext } from 'playwright';
3
+ import {
4
+ withBoundedPage,
5
+ withGuardedChromium,
6
+ } from '../grounding/chromium-guard';
7
+ import {
8
+ describeSiteError,
9
+ type HostPacer,
10
+ type SiteRequest,
11
+ } from '../grounding/guarded-request';
4
12
  import { createLog } from '../lib/log';
13
+ import type { AeoTechnicalChecks } from '../schema';
5
14
 
6
15
  const log = createLog('Renderability');
7
16
 
@@ -9,16 +18,21 @@ const log = createLog('Renderability');
9
18
  // Renderability check (spec §7.4): for each money page, compare the text a
10
19
  // no-JS fetch yields against a Playwright-rendered version. Most AI retrieval
11
20
  // bots don't execute JS — pages whose substance only exists after JS are
12
- // invisible to them. Playwright is already a devDependency via the migration
13
- // tooling; it is imported lazily so `--dry-run` and probe-only runs never
14
- // need a browser installed.
21
+ // invisible to them. Playwright is imported lazily, so a run without money
22
+ // pages never needs a browser installed. Both fetches pass the guard: the
23
+ // static one through guardedRequest, the browser through the guarding
24
+ // proxy (withGuardedChromium).
15
25
  // ============================================================================
16
26
 
17
- const fetchTimeoutMs = 20_000;
18
- const renderTimeoutMs = 45_000;
27
+ const fetchTimeoutInMs = 20_000;
28
+ const renderTimeoutInMs = 45_000;
19
29
  // How long a loaded page gets to go network-idle before its text is read as
20
30
  // it stands.
21
- const settleTimeoutMs = 8_000;
31
+ const settleTimeoutInMs = 8_000;
32
+ // The whole render, reading the text included: past it the page is closed.
33
+ const renderDeadlineInMs = 60_000;
34
+ const staticMaxBytes = 10 * 1024 * 1024;
35
+ const pageRedirects = 5;
22
36
  // Flag when more than 40% of the rendered text is missing statically AND the
23
37
  // absolute gap is large enough to be substance, not a cookie banner.
24
38
  const missingRatioThreshold = 0.4;
@@ -28,95 +42,114 @@ type RenderabilityResult = NonNullable<
28
42
  AeoTechnicalChecks['renderability']
29
43
  >[number];
30
44
 
45
+ /** The phase's guarded request and the pacer behind it: a page's static
46
+ * fetch and its render are spaced like any other request to its host. */
47
+ export type PagedSite = { request: SiteRequest; pace: HostPacer };
48
+
31
49
  export const runRenderabilityCheck = async (
32
50
  moneyPages: readonly string[],
51
+ site: PagedSite,
33
52
  ): Promise<RenderabilityResult[]> => {
34
53
  if (moneyPages.length === 0) {
35
54
  return [];
36
55
  }
37
56
 
38
- const { chromium } = await import('playwright');
39
- const browser = await chromium.launch();
40
-
41
- try {
42
- const results: RenderabilityResult[] = [];
43
-
44
- // Sequential on purpose: one browser page, no hammering the client's site.
45
- for (const url of moneyPages) {
46
- const pageStartedAt = Date.now();
47
- const result = await checkPage(url, browser);
48
-
49
- results.push(result);
50
- log.debug('Renderability page checked', {
51
- url,
52
- durationMs: Date.now() - pageStartedAt,
53
- staticTextChars: result.staticTextChars,
54
- renderedTextChars: result.renderedTextChars,
55
- flagged: result.flagged,
56
- error: result.error,
57
- });
58
- }
57
+ const { result: results, connections } = await withGuardedChromium(
58
+ async (context) => {
59
+ const checked: RenderabilityResult[] = [];
60
+
61
+ // Sequential on purpose: one browser page, no hammering the client's site.
62
+ for (const url of moneyPages) {
63
+ const pageStartedAt = Date.now();
64
+ const result = await checkPage(url, context, site);
65
+
66
+ checked.push(result);
67
+ log.debug('Renderability page checked', {
68
+ url,
69
+ durationMs: Date.now() - pageStartedAt,
70
+ staticTextChars: result.staticTextChars,
71
+ renderedTextChars: result.renderedTextChars,
72
+ flagged: result.flagged,
73
+ error: result.error,
74
+ });
75
+ }
76
+
77
+ return checked;
78
+ },
79
+ );
80
+
81
+ log.info('Renderability check completed', {
82
+ pages: results.length,
83
+ flagged: results.filter((r) => r.flagged).length,
84
+ errors: results.filter((r) => r.error).length,
85
+ connections,
86
+ });
87
+
88
+ return results;
89
+ };
59
90
 
60
- log.info('Renderability check completed', {
61
- pages: results.length,
62
- flagged: results.filter((r) => r.flagged).length,
63
- errors: results.filter((r) => r.error).length,
64
- });
91
+ const failedPage = (url: string, error: string): RenderabilityResult => {
92
+ return {
93
+ url,
94
+ staticTextChars: 0,
95
+ renderedTextChars: 0,
96
+ missingRatio: 0,
97
+ flagged: false,
98
+ error,
99
+ };
100
+ };
65
101
 
66
- return results;
67
- } finally {
68
- await browser.close();
69
- }
102
+ const renderText = (url: string, context: BrowserContext): Promise<string> => {
103
+ return withBoundedPage(context, renderDeadlineInMs, async (page) => {
104
+ // Load, then give the page a bounded moment to settle. Waiting for a
105
+ // fully idle network is a trap on documentation sites, which keep a
106
+ // connection open (live reload, search index, analytics) long after
107
+ // the text is drawn: one never went idle in 45 s, and the report said
108
+ // "could not check" for exactly the pages that matter most. The text
109
+ // is there long before.
110
+ await page.goto(url, { waitUntil: 'load', timeout: renderTimeoutInMs });
111
+ await page
112
+ .waitForLoadState('networkidle', { timeout: settleTimeoutInMs })
113
+ // A page that never settles is read as it stands, as explained above.
114
+ .catch(() => undefined);
115
+
116
+ // A document can lack a body at runtime although the DOM types say
117
+ // otherwise; querySelector keeps that case typed.
118
+ const text = await page.evaluate(
119
+ () => document.querySelector('body')?.innerText ?? '',
120
+ );
121
+
122
+ return normalizeWhitespace(text);
123
+ });
70
124
  };
71
125
 
72
126
  const checkPage = async (
73
127
  url: string,
74
- browser: Browser,
128
+ context: BrowserContext,
129
+ site: PagedSite,
75
130
  ): Promise<RenderabilityResult> => {
76
131
  try {
77
- const response = await fetch(url, {
78
- signal: AbortSignal.timeout(fetchTimeoutMs),
79
- headers: { 'user-agent': 'literally-aeo-audit/1.0' },
132
+ const response = await site.request({
133
+ url,
134
+ timeoutInMs: fetchTimeoutInMs,
135
+ userAgent: 'literally-aeo-audit/1.0',
136
+ accept: 'text/html,application/xhtml+xml',
137
+ redirects: pageRedirects,
138
+ body: {
139
+ contentTypes: /^(text\/html|application\/xhtml\+xml|text\/plain)(;|$)/i,
140
+ maxBytes: staticMaxBytes,
141
+ oversize: 'refuse',
142
+ },
80
143
  });
81
144
 
82
- if (!response.ok) {
83
- return {
84
- url,
85
- staticTextChars: 0,
86
- renderedTextChars: 0,
87
- missingRatio: 0,
88
- flagged: false,
89
- error: `Static fetch failed: HTTP ${response.status}`,
90
- };
145
+ if (response.status < 200 || response.status >= 300) {
146
+ return failedPage(url, `Static fetch failed: HTTP ${response.status}`);
91
147
  }
92
148
 
93
- const staticText = extractText(await response.text());
94
-
95
- const page = await browser.newPage();
96
- let renderedText: string;
97
-
98
- try {
99
- // Load, then give the page a bounded moment to settle. Waiting for a
100
- // fully idle network is a trap on documentation sites, which keep a
101
- // connection open (live reload, search index, analytics) long after
102
- // the text is drawn: botpress.com/docs never went idle in 45 s and
103
- // the report said "could not check" for exactly the pages that
104
- // matter most (2026-09-15). The text is there long before.
105
- await page.goto(url, { waitUntil: 'load', timeout: renderTimeoutMs });
106
- await page
107
- .waitForLoadState('networkidle', { timeout: settleTimeoutMs })
108
- // A page that never settles is read as it stands, as explained above.
109
- .catch(() => undefined);
110
- // A document can lack a body at runtime although the DOM types say
111
- // otherwise; querySelector keeps that case typed.
112
- renderedText = normalizeWhitespace(
113
- await page.evaluate(
114
- () => document.querySelector('body')?.innerText ?? '',
115
- ),
116
- );
117
- } finally {
118
- await page.close();
119
- }
149
+ const staticText = extractText(response.body?.toString('utf8') ?? '');
150
+ const renderedText = await site.pace(new URL(url), () => {
151
+ return renderText(url, context);
152
+ });
120
153
 
121
154
  const staticChars = staticText.length;
122
155
  const renderedChars = renderedText.length;
@@ -137,17 +170,10 @@ const checkPage = async (
137
170
  } catch (error) {
138
171
  log.warn('Renderability check failed for page', {
139
172
  url,
140
- error: String(error),
173
+ error: describeSiteError(error),
141
174
  });
142
175
 
143
- return {
144
- url,
145
- staticTextChars: 0,
146
- renderedTextChars: 0,
147
- missingRatio: 0,
148
- flagged: false,
149
- error: error instanceof Error ? error.message : String(error),
150
- };
176
+ return failedPage(url, describeSiteError(error));
151
177
  }
152
178
  };
153
179
 
@@ -1,4 +1,9 @@
1
1
  import { recorded, type ExecutionRecorder } from '../bundle/recorder';
2
+ import {
3
+ createHostPacer,
4
+ guardedRequest,
5
+ type SiteRequest,
6
+ } from '../grounding/guarded-request';
2
7
  import type { AeoAuditConfig, AeoTechnicalChecks } from '../schema';
3
8
  import type { PartialFailure } from '../probes/web-tool-guard';
4
9
  import { checkLlmsTxt, runCrawlerAccessCheck } from './crawler-access';
@@ -11,6 +16,10 @@ import { runRenderabilityCheck } from './renderability';
11
16
  // run with a stub — checks are live fetches and a Playwright browser.
12
17
  // ============================================================================
13
18
 
19
+ // At most one request at a time per host, this far apart, across every check
20
+ // of the phase (specs/aeo-checks-and-reach-spec.md §3.1).
21
+ const hostIntervalInMs = 1000;
22
+
14
23
  export type CheckPhaseResult = {
15
24
  checks: AeoTechnicalChecks;
16
25
  failures: PartialFailure[];
@@ -21,6 +30,10 @@ export const runTechnicalChecks = async (
21
30
  recorder?: ExecutionRecorder,
22
31
  ): Promise<CheckPhaseResult> => {
23
32
  const failures: PartialFailure[] = [];
33
+ const pace = createHostPacer(hostIntervalInMs);
34
+ const request: SiteRequest = (options) => {
35
+ return guardedRequest({ ...options, pace });
36
+ };
24
37
 
25
38
  // One operation per check, with its parameters and its extracted result
26
39
  // (spec §7.2). The checks' own HTTP requests and raw bodies stay inside
@@ -52,13 +65,13 @@ export const runTechnicalChecks = async (
52
65
 
53
66
  const [crawlerAccess, llmsTxt, renderability] = await Promise.all([
54
67
  check('crawler_access', { domain: config.brand.domain }, () =>
55
- runCrawlerAccessCheck(config.brand.domain),
68
+ runCrawlerAccessCheck(config.brand.domain, request),
56
69
  ),
57
70
  check('llms_txt', { domain: config.brand.domain }, () =>
58
- checkLlmsTxt(config.brand.domain),
71
+ checkLlmsTxt(config.brand.domain, request),
59
72
  ),
60
73
  check('renderability', { moneyPages: config.moneyPages }, () =>
61
- runRenderabilityCheck(config.moneyPages),
74
+ runRenderabilityCheck(config.moneyPages, { request, pace }),
62
75
  ),
63
76
  ]);
64
77
 
@@ -174,6 +174,7 @@ export const runDoctor = async (flags: Flags) => {
174
174
  dir: runDirOf(flags),
175
175
  model: file.model,
176
176
  groundingSearch: usesGroundingSearch(request),
177
+ rendersPages: file.moneyPages.length > 0,
177
178
  });
178
179
  const ok = checks.every((check) => check.ok);
179
180
 
@@ -307,6 +308,7 @@ export const runRun = async (flags: Flags) => {
307
308
  dir,
308
309
  model: file.model,
309
310
  groundingSearch: usesGroundingSearch(request),
311
+ rendersPages: file.moneyPages.length > 0,
310
312
  });
311
313
  const failing = checks.filter((check) => !check.ok);
312
314
 
@@ -234,6 +234,7 @@ export const aggregateJudgments = (
234
234
  prompts: section.prompts,
235
235
  surfaces: inputs.surfaces,
236
236
  agentProbes: config.agentProbes,
237
+ chatProbes: config.chatProbes,
237
238
  },
238
239
  {
239
240
  probeCount: sectionCapture.units.length,