literally-aeo 0.3.0 → 0.4.0

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 (421) hide show
  1. package/README.md +183 -14
  2. package/dist/author-tools.js +386 -283
  3. package/dist/cli.mjs +19634 -17096
  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 +13 -13
  7. package/dist/lib/agents/copy-validation.js +16 -15
  8. package/dist/lib/agents/copywriter-input.js +14 -13
  9. package/dist/lib/agents/credentials.js +1 -1
  10. package/dist/lib/agents/facts.js +13 -12
  11. package/dist/lib/agents/methodology.js +56 -0
  12. package/dist/lib/agents/narrative-facts.js +11 -11
  13. package/dist/lib/agents/verifier.js +18 -17
  14. package/dist/lib/analysis/domain-classifier.js +16 -16
  15. package/dist/lib/analysis/domain-labels.js +10 -10
  16. package/dist/lib/analysis/progress-schema.js +6 -2
  17. package/dist/lib/analysis/progress.js +15 -14
  18. package/dist/lib/analysis/rate-evidence.js +6 -0
  19. package/dist/lib/analysis/retrieval.js +10 -10
  20. package/dist/lib/analysis/scoring.js +10 -10
  21. package/dist/lib/analysis/search-analyzer.js +10 -10
  22. package/dist/lib/analysis/sentiment.js +16 -16
  23. package/dist/lib/author/examples.js +11 -11
  24. package/dist/lib/bundle/contracts.js +17 -11
  25. package/dist/lib/bundle/export.js +84 -29
  26. package/dist/lib/bundle/isolation.js +2 -2
  27. package/dist/lib/bundle/journal.js +12 -12
  28. package/dist/lib/bundle/project-journal.js +16 -16
  29. package/dist/lib/bundle/project.js +85 -28
  30. package/dist/lib/bundle/read.js +85 -30
  31. package/dist/lib/bundle/recorder.js +14 -14
  32. package/dist/lib/bundle/redact.js +12 -12
  33. package/dist/lib/bundle/trace-coverage.js +12 -12
  34. package/dist/lib/bundle/verify-integrity.js +15 -15
  35. package/dist/lib/bundle/verify-measurement.js +23 -23
  36. package/dist/lib/bundle/verify-report.js +29 -27
  37. package/dist/lib/bundle/verify.js +38 -36
  38. package/dist/lib/capture-manifest.js +11 -11
  39. package/dist/lib/checks/run-checks.js +15 -15
  40. package/dist/lib/chunks/{chunk-4XIAXX7K.js → chunk-2A327DMI.js} +1 -1
  41. package/dist/lib/chunks/{chunk-K5NQDJLE.js → chunk-2FK6QVU6.js} +3 -3
  42. package/dist/lib/chunks/{chunk-6RED3G6K.js → chunk-2WS6RC35.js} +2 -2
  43. package/dist/lib/chunks/{chunk-WIBMVNIH.js → chunk-3F5ZP2EO.js} +4 -4
  44. package/dist/lib/chunks/{chunk-ZXQPD4OC.js → chunk-3TF4JGQA.js} +126 -5
  45. package/dist/lib/chunks/{chunk-JXLCKACO.js → chunk-3YPAIXFG.js} +6 -6
  46. package/dist/lib/chunks/{chunk-FPPHYGIO.js → chunk-4332MUTU.js} +4 -4
  47. package/dist/lib/chunks/{chunk-FONFW67K.js → chunk-4MOZ3DVS.js} +5 -4
  48. package/dist/lib/chunks/{chunk-64JFN2Q5.js → chunk-4SCPKDJV.js} +1 -1
  49. package/dist/lib/chunks/{chunk-HXXFRZTJ.js → chunk-4ZR2LPUD.js} +2 -2
  50. package/dist/lib/chunks/{chunk-FHV4PBYG.js → chunk-55KFAM4X.js} +36 -5
  51. package/dist/lib/chunks/{chunk-F4EQULFR.js → chunk-66OL2XA6.js} +13 -8
  52. package/dist/lib/chunks/{chunk-4QQJXCD2.js → chunk-6FRZN5SA.js} +13 -28
  53. package/dist/lib/chunks/{chunk-WRHGLRUK.js → chunk-6FXNXXY7.js} +115 -6
  54. package/dist/lib/chunks/{chunk-P6LHGBYU.js → chunk-6TJXJZUL.js} +13 -6
  55. package/dist/lib/chunks/{chunk-YKJHFD64.js → chunk-72ZLXWD4.js} +21 -4
  56. package/dist/lib/chunks/{chunk-2FOKEIIN.js → chunk-744YWRX7.js} +1 -1
  57. package/dist/lib/chunks/{chunk-LPOIMPJK.js → chunk-77EQ3RT6.js} +4 -4
  58. package/dist/lib/chunks/{chunk-RMSH7RUG.js → chunk-7GHR6MOG.js} +10 -10
  59. package/dist/lib/chunks/{chunk-H2DOBJZC.js → chunk-7GJTWUI4.js} +2 -2
  60. package/dist/lib/chunks/{chunk-ASHFEFCU.js → chunk-7NQOQNE7.js} +1 -1
  61. package/dist/lib/chunks/chunk-7Y3S7LD5.js +160 -0
  62. package/dist/lib/chunks/{chunk-U64NCRRR.js → chunk-7ZQAAEOK.js} +7 -6
  63. package/dist/lib/chunks/{chunk-4HPMLJKC.js → chunk-A4QTI7FN.js} +78 -19
  64. package/dist/lib/chunks/{chunk-KRWDELRS.js → chunk-ADNYALFZ.js} +10 -4
  65. package/dist/lib/chunks/{chunk-CH7OCYDL.js → chunk-B5ZAFK6T.js} +1 -1
  66. package/dist/lib/chunks/{chunk-AQCWKHTE.js → chunk-B6YKBZXD.js} +15 -10
  67. package/dist/lib/chunks/{chunk-MZ2KN3IH.js → chunk-BE7EDOJY.js} +3 -3
  68. package/dist/lib/chunks/{chunk-Q22FCF4A.js → chunk-BECSPYFC.js} +1 -1
  69. package/dist/lib/chunks/{chunk-MPQXB7HN.js → chunk-BNKNZTYH.js} +16 -13
  70. package/dist/lib/chunks/{chunk-JGIX427K.js → chunk-BOLZJBPS.js} +54 -13
  71. package/dist/lib/chunks/chunk-C22Q3TKU.js +90 -0
  72. package/dist/lib/chunks/chunk-C3AZMWQJ.js +109 -0
  73. package/dist/lib/chunks/{chunk-QVMPTT7R.js → chunk-CCSF7LP5.js} +7 -7
  74. package/dist/lib/chunks/{chunk-4AWFF53U.js → chunk-CHDK5EQK.js} +52 -19
  75. package/dist/lib/chunks/{chunk-NZFMOQHU.js → chunk-CWEVVIZI.js} +11 -1
  76. package/dist/lib/chunks/{chunk-LUKP64NX.js → chunk-CZRHH5HF.js} +85 -5
  77. package/dist/lib/chunks/{chunk-IH67TEGY.js → chunk-DBQ3HVPX.js} +4 -4
  78. package/dist/lib/chunks/{chunk-AB7DUTX5.js → chunk-DC6CS6GC.js} +1 -1
  79. package/dist/lib/chunks/{chunk-ODIXZHHX.js → chunk-DHQKAIOP.js} +2 -2
  80. package/dist/lib/chunks/{chunk-YY4BH5XM.js → chunk-DIR4UIRF.js} +73 -24
  81. package/dist/lib/chunks/{chunk-66UE4TT2.js → chunk-DWOTAT7R.js} +84 -17
  82. package/dist/lib/chunks/chunk-E2JICEL3.js +446 -0
  83. package/dist/lib/chunks/{chunk-HXHFMFQU.js → chunk-E5COBP7A.js} +13 -2
  84. package/dist/lib/chunks/{chunk-SQ55KGHO.js → chunk-EUHVUF7I.js} +1 -1
  85. package/dist/lib/chunks/{chunk-S24JGY7B.js → chunk-F3MHGDZG.js} +5 -5
  86. package/dist/lib/chunks/chunk-F7LCGM6W.js +120 -0
  87. package/dist/lib/chunks/{chunk-XTBCXEH7.js → chunk-FJAZEGU6.js} +133 -22
  88. package/dist/lib/chunks/{chunk-N62G4EWT.js → chunk-FOJVAGAD.js} +3 -3
  89. package/dist/lib/chunks/chunk-FXR6P7HY.js +14 -0
  90. package/dist/lib/chunks/chunk-GC4XJYQW.js +145 -0
  91. package/dist/lib/chunks/chunk-GQZHZSAQ.js +108 -0
  92. package/dist/lib/chunks/{chunk-BRENK356.js → chunk-GZC3ASNL.js} +1 -1
  93. package/dist/lib/chunks/{chunk-2C723CW7.js → chunk-H2JJCIZW.js} +1 -1
  94. package/dist/lib/chunks/{chunk-LJCWZ5SZ.js → chunk-H33MFLSH.js} +14 -14
  95. package/dist/lib/chunks/chunk-H4IE2JE6.js +118 -0
  96. package/dist/lib/chunks/{chunk-ZZCRYG36.js → chunk-H4LZ3U26.js} +1 -1
  97. package/dist/lib/chunks/{chunk-ZBQU2VU3.js → chunk-HHGLGVOZ.js} +1 -1
  98. package/dist/lib/chunks/{chunk-52F5XYOW.js → chunk-I2KRWXXO.js} +15 -7
  99. package/dist/lib/chunks/chunk-IDNT2WBK.js +27 -0
  100. package/dist/lib/chunks/{chunk-HYMWNGOK.js → chunk-IUQ6C4Y6.js} +6 -3
  101. package/dist/lib/chunks/chunk-IXYVHA7C.js +101 -0
  102. package/dist/lib/chunks/{chunk-VTY53IFN.js → chunk-J3BZ3WPV.js} +1 -1
  103. package/dist/lib/chunks/{chunk-RM2VVR7Y.js → chunk-J63WQUKR.js} +10 -3
  104. package/dist/lib/chunks/{chunk-RGZY6YUQ.js → chunk-JBEKIT7Z.js} +10 -10
  105. package/dist/lib/chunks/{chunk-SJCUR4QX.js → chunk-JEAZREDN.js} +1 -1
  106. package/dist/lib/chunks/{chunk-2B5QF6UQ.js → chunk-JFUWSJZT.js} +46 -5
  107. package/dist/lib/chunks/{chunk-KRXOJJR7.js → chunk-JHOLYLI4.js} +4 -2
  108. package/dist/lib/chunks/chunk-JOLIDHZV.js +39 -0
  109. package/dist/lib/chunks/{chunk-7KLTOVIY.js → chunk-JWH33YCK.js} +16 -15
  110. package/dist/lib/chunks/{chunk-LNYQMWJO.js → chunk-K5K27WBZ.js} +10 -9
  111. package/dist/lib/chunks/{chunk-CVEXMYPW.js → chunk-KU53HTUY.js} +2 -2
  112. package/dist/lib/chunks/{chunk-UECQONVZ.js → chunk-LJTFZ52Y.js} +24 -12
  113. package/dist/lib/chunks/chunk-LMUTZ6O2.js +335 -0
  114. package/dist/lib/chunks/chunk-LTPLZSXI.js +86 -0
  115. package/dist/lib/chunks/{chunk-HLC6OHGO.js → chunk-M3WZCV65.js} +3 -3
  116. package/dist/lib/chunks/{chunk-TKOQMB6A.js → chunk-MN3YGXJH.js} +17 -17
  117. package/dist/lib/chunks/{chunk-YPVJAXPP.js → chunk-MSEGYN6W.js} +32 -14
  118. package/dist/lib/chunks/{chunk-JDU3ZCKO.js → chunk-MWZIVYMK.js} +1 -1
  119. package/dist/lib/chunks/{chunk-WPCBE2NZ.js → chunk-MX6YA6YH.js} +1 -1
  120. package/dist/lib/chunks/{chunk-GEFKDW7X.js → chunk-N4PQ6RPQ.js} +14 -2
  121. package/dist/lib/chunks/{chunk-EDQTINTL.js → chunk-N5IAPSLM.js} +52 -6
  122. package/dist/lib/chunks/{chunk-RYB77E7O.js → chunk-NAPYHYA5.js} +2 -2
  123. package/dist/lib/chunks/{chunk-44NSZBCP.js → chunk-NWUZJUJX.js} +7 -7
  124. package/dist/lib/chunks/{chunk-PAL5SXIP.js → chunk-NZTOOSLX.js} +3 -3
  125. package/dist/lib/chunks/{chunk-4Q2WFZ5J.js → chunk-OQVEYTVV.js} +12 -10
  126. package/dist/lib/chunks/{chunk-OTVHGRCO.js → chunk-OXPPUUIO.js} +48 -60
  127. package/dist/lib/chunks/{chunk-CXZIHHLJ.js → chunk-PPTUCXWS.js} +4 -4
  128. package/dist/lib/chunks/{chunk-5JU2Y2I6.js → chunk-PUZBLM7E.js} +9 -6
  129. package/dist/lib/chunks/{chunk-ZHGABG7L.js → chunk-PVW5W2MX.js} +9 -4
  130. package/dist/lib/chunks/{chunk-JJFOILZK.js → chunk-QFIJSLAR.js} +26 -6
  131. package/dist/lib/chunks/{chunk-Z3BZRBQF.js → chunk-QTUWCZ3X.js} +16 -15
  132. package/dist/lib/chunks/{chunk-SF4UJ2AY.js → chunk-R4BFYHLK.js} +1 -1
  133. package/dist/lib/chunks/chunk-R75F4MKU.js +162 -0
  134. package/dist/lib/chunks/{chunk-TAPVCSCR.js → chunk-SCZ7PA4T.js} +1 -1
  135. package/dist/lib/chunks/{chunk-QO5TPMWS.js → chunk-SFPPZGTA.js} +112 -26
  136. package/dist/lib/chunks/chunk-SN3DKEOY.js +11 -0
  137. package/dist/lib/chunks/{chunk-TWK6IA4P.js → chunk-ST6IVXHT.js} +1 -1
  138. package/dist/lib/chunks/{chunk-JW7DTYSI.js → chunk-SXCTAL6V.js} +4 -4
  139. package/dist/lib/chunks/{chunk-2FDSOZ6Q.js → chunk-SXVKFPC4.js} +2 -1
  140. package/dist/lib/chunks/{chunk-QKTKQSPS.js → chunk-T4Z3GAEH.js} +1 -1
  141. package/dist/lib/chunks/{chunk-RK57YZKM.js → chunk-T7DNKNMG.js} +81 -26
  142. package/dist/lib/chunks/{chunk-LOIAGEKN.js → chunk-TPPBTN3E.js} +48 -19
  143. package/dist/lib/chunks/{chunk-WUIY7BXR.js → chunk-UBH2P5IR.js} +82 -40
  144. package/dist/lib/chunks/{chunk-ASIFUJG2.js → chunk-UIXTXI7P.js} +9 -7
  145. package/dist/lib/chunks/chunk-UWXR24TV.js +38 -0
  146. package/dist/lib/chunks/{chunk-A5PF7UE2.js → chunk-V57HW7T4.js} +4 -4
  147. package/dist/lib/chunks/{chunk-HEWHNSDP.js → chunk-VCFLUGLQ.js} +19 -19
  148. package/dist/lib/chunks/{chunk-VL253W5C.js → chunk-VMDGYDZW.js} +3 -1
  149. package/dist/lib/chunks/{chunk-OVF27NAO.js → chunk-W6TGEP5C.js} +32 -14
  150. package/dist/lib/chunks/{chunk-VYUC772A.js → chunk-WB4ZBRF6.js} +4 -4
  151. package/dist/lib/chunks/{chunk-JMIK2QN3.js → chunk-WQTDLVKV.js} +2 -2
  152. package/dist/lib/chunks/{chunk-FYE4R5TY.js → chunk-WRH4CIFQ.js} +3 -3
  153. package/dist/lib/chunks/{chunk-IMADI2YP.js → chunk-WSFXGX7S.js} +3 -3
  154. package/dist/lib/chunks/{chunk-KI2FB4Y3.js → chunk-WSWQCHSW.js} +12 -11
  155. package/dist/lib/chunks/{chunk-7ZR3WDF2.js → chunk-WTAIFAQV.js} +6 -3
  156. package/dist/lib/chunks/{chunk-RYCRL3YA.js → chunk-X3HRV5CF.js} +12 -4
  157. package/dist/lib/chunks/{chunk-S2SFHTJD.js → chunk-XPUCJQIB.js} +39 -1
  158. package/dist/lib/chunks/{chunk-2U5QSA6Q.js → chunk-Y2NZTYKV.js} +8 -8
  159. package/dist/lib/chunks/{chunk-6N3C6E3D.js → chunk-YLS4XX7B.js} +2 -2
  160. package/dist/lib/chunks/{chunk-JIE2ANVD.js → chunk-YPMRZX4U.js} +1 -1
  161. package/dist/lib/chunks/{chunk-LTI2YYU3.js → chunk-YTEUQEJE.js} +1 -1
  162. package/dist/lib/chunks/{chunk-QUZYFAGP.js → chunk-YYP547FI.js} +145 -21
  163. package/dist/lib/chunks/{chunk-CQNIPZH3.js → chunk-ZDCKZEDJ.js} +51 -31
  164. package/dist/lib/chunks/{chunk-JBGQFPTY.js → chunk-ZWTNELCS.js} +12 -6
  165. package/dist/lib/chunks/{chunk-3S2FAVRE.js → chunk-ZWWIXFCV.js} +3 -3
  166. package/dist/lib/chunks/{chunk-MA27TFEY.js → chunk-ZXL6FZX4.js} +8 -1
  167. package/dist/lib/cli/bundle-commands.js +130 -120
  168. package/dist/lib/cli/guide-command.js +1 -1
  169. package/dist/lib/cli/io.js +1 -1
  170. package/dist/lib/cli/run-commands.js +319 -182
  171. package/dist/lib/cli/status-command.js +107 -96
  172. package/dist/lib/codex-workflow/aggregate.js +34 -25
  173. package/dist/lib/codex-workflow/author-search.js +1 -1
  174. package/dist/lib/codex-workflow/author-tools.js +12 -12
  175. package/dist/lib/codex-workflow/author.js +30 -28
  176. package/dist/lib/codex-workflow/capture.js +45 -41
  177. package/dist/lib/codex-workflow/checkpoint.js +12 -12
  178. package/dist/lib/codex-workflow/checks.js +14 -14
  179. package/dist/lib/codex-workflow/copy-editor.js +24 -22
  180. package/dist/lib/codex-workflow/copy-recovery.js +11 -11
  181. package/dist/lib/codex-workflow/copy.js +27 -19
  182. package/dist/lib/codex-workflow/finish.js +61 -35
  183. package/dist/lib/codex-workflow/loop.js +90 -71
  184. package/dist/lib/codex-workflow/prompts.js +1 -1
  185. package/dist/lib/codex-workflow/quality.js +11 -11
  186. package/dist/lib/codex-workflow/run-inputs.js +11 -11
  187. package/dist/lib/codex-workflow/run-source.js +19 -19
  188. package/dist/lib/codex-workflow/schemas.js +11 -11
  189. package/dist/lib/codex-workflow/session.js +13 -13
  190. package/dist/lib/codex-workflow/stage.js +44 -43
  191. package/dist/lib/codex-workflow/workdir.js +14 -14
  192. package/dist/lib/engine/audit-file.js +48 -14
  193. package/dist/lib/engine/author.js +72 -54
  194. package/dist/lib/engine/budget.js +3 -1
  195. package/dist/lib/engine/cost-estimate.js +36 -34
  196. package/dist/lib/engine/local-run.js +104 -92
  197. package/dist/lib/engine/preflight.js +35 -33
  198. package/dist/lib/engine/rejudge.js +112 -99
  199. package/dist/lib/engine/run-bindings.js +35 -31
  200. package/dist/lib/engine/run-configuration.js +3 -1
  201. package/dist/lib/engine/run-method.js +67 -0
  202. package/dist/lib/engine/run-models.js +48 -0
  203. package/dist/lib/engine/run-status.js +103 -92
  204. package/dist/lib/engine/templates.js +45 -15
  205. package/dist/lib/grounding/controller.js +6 -6
  206. package/dist/lib/grounding/extract.js +6 -6
  207. package/dist/lib/grounding/grounding-runtime.js +26 -26
  208. package/dist/lib/grounding/model.js +5 -5
  209. package/dist/lib/grounding/recorded-tools.js +15 -15
  210. package/dist/lib/grounding/tools.js +5 -1
  211. package/dist/lib/harness/report/artifacts.js +10 -10
  212. package/dist/lib/harness/report/capture-coverage.js +4 -4
  213. package/dist/lib/lib/checkpoint.js +10 -10
  214. package/dist/lib/lib/compare.js +6 -0
  215. package/dist/lib/lib/progress-comparison.js +3 -2
  216. package/dist/lib/models/batching.js +4 -4
  217. package/dist/lib/models/catalog.js +16 -0
  218. package/dist/lib/models/cost-coefficients.js +12 -2
  219. package/dist/lib/models/local-profile.js +2 -2
  220. package/dist/lib/models/open-model.js +7 -0
  221. package/dist/lib/models/profiles.js +3 -1
  222. package/dist/lib/models/structured.js +3 -3
  223. package/dist/lib/models/supported-models.js +2 -2
  224. package/dist/lib/pipeline.js +43 -39
  225. package/dist/lib/probes/adapter.js +1 -1
  226. package/dist/lib/probes/adapters/cli-agents.js +18 -18
  227. package/dist/lib/probes/adapters/cli-claude-code.js +8 -7
  228. package/dist/lib/probes/adapters/cli-codex.js +8 -7
  229. package/dist/lib/probes/adapters/cli-cursor.js +8 -7
  230. package/dist/lib/probes/adapters/cli-process.js +5 -4
  231. package/dist/lib/probes/adapters/dataforseo-ai-mode.js +24 -0
  232. package/dist/lib/probes/adapters/dataforseo-ai-overview.js +8 -7
  233. package/dist/lib/probes/adapters/dataforseo-chatgpt-app.js +22 -0
  234. package/dist/lib/probes/adapters/gateway-chat.js +8 -5
  235. package/dist/lib/probes/adapters/gateway-perplexity.js +7 -6
  236. package/dist/lib/probes/agent-cli-parsers.js +3 -2
  237. package/dist/lib/probes/agent-clis.js +22 -22
  238. package/dist/lib/probes/answer-text.js +4 -3
  239. package/dist/lib/probes/attempt.js +5 -4
  240. package/dist/lib/probes/bindings.js +62 -30
  241. package/dist/lib/probes/charged-trace.js +31 -29
  242. package/dist/lib/probes/chat-retrieval.js +7 -2
  243. package/dist/lib/probes/dataforseo-locale.js +9 -3
  244. package/dist/lib/probes/dataforseo.js +9 -1
  245. package/dist/lib/probes/legacy-bindings.js +2 -2
  246. package/dist/lib/probes/probes.js +33 -31
  247. package/dist/lib/probes/web-tool-guard.js +3 -3
  248. package/dist/lib/report/contracts.js +7 -7
  249. package/dist/lib/report/core/progress-comparison.js +3 -2
  250. package/dist/lib/report/core/progress-schema.js +6 -2
  251. package/dist/lib/report/core/progress-statistics.js +8 -0
  252. package/dist/lib/report/core/rate-interval.js +6 -0
  253. package/dist/lib/report/core/retrieval.js +4 -1
  254. package/dist/lib/report/core/schema.js +23 -3
  255. package/dist/lib/report/core/surfaces.js +23 -1
  256. package/dist/lib/retrieval.js +4 -1
  257. package/dist/lib/runner.js +23 -23
  258. package/dist/lib/schema.js +35 -11
  259. package/dist/lib/section-result.js +13 -11
  260. package/dist/lib/stores/artifacts.js +13 -13
  261. package/dist/lib/stores/files.js +28 -26
  262. package/dist/lib/stores/local-versions.js +10 -10
  263. package/dist/lib/stores/memory.js +26 -25
  264. package/dist/lib/stores/publication.js +17 -16
  265. package/dist/lib/stores/unit-record.js +10 -10
  266. package/dist/lib/surfaces.js +23 -1
  267. package/dist/lib/viewer/page.js +1 -1
  268. package/dist/lib/viewer/server.js +40 -38
  269. package/dist/lib/workflow/schema.js +8 -8
  270. package/dist/types/agents/author-schema.d.ts +10 -10
  271. package/dist/types/agents/facts.d.ts +1 -1
  272. package/dist/types/agents/methodology.d.ts +26 -0
  273. package/dist/types/agents/verifier.d.ts +1 -1
  274. package/dist/types/analysis/domain-labels.d.ts +1 -1
  275. package/dist/types/analysis/rate-evidence.d.ts +11 -0
  276. package/dist/types/analysis/scoring.d.ts +17 -0
  277. package/dist/types/analysis/sentiment.d.ts +8 -4
  278. package/dist/types/bundle/contracts.d.ts +42 -20
  279. package/dist/types/bundle/project.d.ts +6 -0
  280. package/dist/types/bundle/recorder.d.ts +1 -1
  281. package/dist/types/bundle/trace-coverage.d.ts +4 -2
  282. package/dist/types/capture-manifest.d.ts +8 -4
  283. package/dist/types/codex-workflow/aggregate.d.ts +90 -12
  284. package/dist/types/codex-workflow/copy-editor.d.ts +40 -1
  285. package/dist/types/codex-workflow/copy.d.ts +136 -1
  286. package/dist/types/codex-workflow/run-inputs.d.ts +138 -32
  287. package/dist/types/codex-workflow/schemas.d.ts +20 -20
  288. package/dist/types/codex-workflow/stage.d.ts +7 -1
  289. package/dist/types/engine/audit-file.d.ts +96 -6
  290. package/dist/types/engine/budget.d.ts +19 -6
  291. package/dist/types/engine/cost-estimate.d.ts +11 -2
  292. package/dist/types/engine/local-run.d.ts +12 -2
  293. package/dist/types/engine/preflight.d.ts +21 -5
  294. package/dist/types/engine/run-bindings.d.ts +34 -7
  295. package/dist/types/engine/run-configuration.d.ts +15 -3
  296. package/dist/types/engine/run-method.d.ts +58 -0
  297. package/dist/types/engine/run-models.d.ts +89 -0
  298. package/dist/types/engine/templates.d.ts +3 -1
  299. package/dist/types/grounding/tools.d.ts +10 -0
  300. package/dist/types/harness/report/artifacts.d.ts +48 -24
  301. package/dist/types/lib/compare.d.ts +3 -0
  302. package/dist/types/models/catalog.d.ts +52 -0
  303. package/dist/types/models/cost-coefficients.d.ts +73 -20
  304. package/dist/types/models/local-profile.d.ts +5 -1
  305. package/dist/types/models/open-model.d.ts +10 -0
  306. package/dist/types/models/profiles.d.ts +113 -14
  307. package/dist/types/models/supported-models.d.ts +13 -3
  308. package/dist/types/pipeline.d.ts +1 -1
  309. package/dist/types/probes/adapter.d.ts +10 -1
  310. package/dist/types/probes/adapters/dataforseo-ai-mode.d.ts +16 -0
  311. package/dist/types/probes/adapters/dataforseo-ai-overview.d.ts +2 -2
  312. package/dist/types/probes/adapters/dataforseo-chatgpt-app.d.ts +12 -0
  313. package/dist/types/probes/adapters/gateway-chat.d.ts +33 -4
  314. package/dist/types/probes/adapters/gateway-perplexity.d.ts +2 -2
  315. package/dist/types/probes/bindings.d.ts +99 -10
  316. package/dist/types/probes/charged-trace.d.ts +7 -1
  317. package/dist/types/probes/chat-retrieval.d.ts +2 -0
  318. package/dist/types/probes/dataforseo-locale.d.ts +16 -0
  319. package/dist/types/probes/dataforseo.d.ts +43 -1
  320. package/dist/types/probes/probe-trace.d.ts +3 -0
  321. package/dist/types/probes/probes.d.ts +3 -3
  322. package/dist/types/report/contracts.d.ts +184 -30
  323. package/dist/types/report/core/progress-comparison.d.ts +19 -2
  324. package/dist/types/report/core/progress-schema.d.ts +13 -5
  325. package/dist/types/report/core/progress-statistics.d.ts +28 -0
  326. package/dist/types/report/core/rate-interval.d.ts +10 -0
  327. package/dist/types/report/core/retrieval.d.ts +5 -2
  328. package/dist/types/report/core/schema.d.ts +190 -30
  329. package/dist/types/report/core/surfaces.d.ts +38 -4
  330. package/dist/types/runner.d.ts +5 -0
  331. package/dist/types/schema.d.ts +126 -21
  332. package/dist/types/section-result.d.ts +7 -2
  333. package/dist/types/workflow/schema.d.ts +121 -41
  334. package/package.json +1 -1
  335. package/resources/guide/OPERATOR.md +35 -7
  336. package/src/agents/author-schema.ts +7 -0
  337. package/src/agents/credentials.ts +18 -3
  338. package/src/agents/facts.ts +116 -3
  339. package/src/agents/methodology.ts +168 -0
  340. package/src/agents/narrative-facts.ts +50 -13
  341. package/src/agents/verifier.ts +2 -1
  342. package/src/analysis/progress.ts +4 -1
  343. package/src/analysis/rate-evidence.ts +74 -0
  344. package/src/analysis/scoring.ts +53 -10
  345. package/src/bundle/contracts.ts +42 -5
  346. package/src/bundle/export.ts +24 -4
  347. package/src/bundle/project-journal.ts +7 -1
  348. package/src/bundle/project.ts +76 -7
  349. package/src/bundle/recorder.ts +3 -0
  350. package/src/bundle/trace-coverage.ts +13 -6
  351. package/src/bundle/verify-integrity.ts +1 -0
  352. package/src/bundle/verify-report.ts +9 -3
  353. package/src/cli/io.ts +2 -0
  354. package/src/cli/literally-aeo.ts +10 -6
  355. package/src/cli/run-commands.ts +238 -45
  356. package/src/codex-workflow/aggregate.ts +108 -15
  357. package/src/codex-workflow/capture.ts +10 -13
  358. package/src/codex-workflow/copy-editor.ts +13 -2
  359. package/src/codex-workflow/copy.ts +171 -2
  360. package/src/codex-workflow/finish.ts +39 -0
  361. package/src/codex-workflow/loop.ts +23 -2
  362. package/src/codex-workflow/prompts.ts +32 -42
  363. package/src/codex-workflow/schemas.ts +3 -1
  364. package/src/codex-workflow/stage.ts +40 -45
  365. package/src/engine/audit-file.ts +186 -13
  366. package/src/engine/author.ts +5 -2
  367. package/src/engine/budget.ts +70 -10
  368. package/src/engine/cost-estimate.ts +31 -7
  369. package/src/engine/guide/OPERATOR.md +35 -7
  370. package/src/engine/local-run.ts +98 -21
  371. package/src/engine/preflight.ts +59 -15
  372. package/src/engine/rejudge.ts +3 -2
  373. package/src/engine/run-bindings.ts +87 -40
  374. package/src/engine/run-configuration.ts +36 -6
  375. package/src/engine/run-method.ts +230 -0
  376. package/src/engine/run-models.ts +276 -0
  377. package/src/engine/run-status.ts +9 -4
  378. package/src/engine/templates.ts +7 -2
  379. package/src/grounding/controller.ts +2 -1
  380. package/src/grounding/tools.ts +18 -1
  381. package/src/lib/compare.ts +9 -0
  382. package/src/models/catalog.ts +500 -0
  383. package/src/models/cost-coefficients.ts +101 -16
  384. package/src/models/local-profile.ts +14 -8
  385. package/src/models/open-model.ts +70 -0
  386. package/src/models/profiles.ts +17 -4
  387. package/src/models/supported-models.ts +7 -5
  388. package/src/pipeline.ts +14 -7
  389. package/src/probes/adapter.ts +17 -1
  390. package/src/probes/adapters/dataforseo-ai-mode.ts +146 -0
  391. package/src/probes/adapters/dataforseo-ai-overview.ts +2 -2
  392. package/src/probes/adapters/dataforseo-chatgpt-app.ts +115 -0
  393. package/src/probes/adapters/gateway-chat.ts +132 -18
  394. package/src/probes/adapters/gateway-perplexity.ts +2 -2
  395. package/src/probes/attempt.ts +1 -0
  396. package/src/probes/bindings.ts +484 -67
  397. package/src/probes/charged-trace.ts +19 -4
  398. package/src/probes/chat-retrieval.ts +67 -0
  399. package/src/probes/dataforseo-locale.ts +140 -20
  400. package/src/probes/dataforseo.ts +245 -26
  401. package/src/probes/legacy-bindings.ts +5 -4
  402. package/src/probes/probe-trace.ts +3 -0
  403. package/src/probes/probes.ts +30 -20
  404. package/src/probes/web-tool-guard.ts +18 -8
  405. package/src/report/core/progress-comparison.ts +158 -44
  406. package/src/report/core/progress-schema.ts +25 -3
  407. package/src/report/core/progress-statistics.ts +194 -0
  408. package/src/report/core/rate-interval.ts +24 -0
  409. package/src/report/core/retrieval.ts +18 -4
  410. package/src/report/core/schema.ts +79 -4
  411. package/src/report/core/surfaces.ts +100 -9
  412. package/src/runner.ts +65 -10
  413. package/src/schema.ts +78 -17
  414. package/src/section-result.ts +141 -23
  415. package/src/viewer/page.ts +126 -5
  416. package/dist/lib/chunks/chunk-AASWJR7Q.js +0 -42
  417. package/dist/lib/chunks/chunk-KSUI4DAY.js +0 -15
  418. package/dist/lib/chunks/chunk-KXFZ3CH3.js +0 -98
  419. package/dist/lib/chunks/chunk-MNG5TZRW.js +0 -208
  420. package/dist/lib/chunks/chunk-U42I3SBR.js +0 -78
  421. package/dist/lib/chunks/chunk-XBSA7MNJ.js +0 -66
@@ -746,6 +746,7 @@ var readBoundedBody = async (body) => {
746
746
  }
747
747
  return Buffer.concat(chunks);
748
748
  };
749
+ var searchTimeoutMs = 6e4;
749
750
  var createDataForSeoSearchAdapter = (args) => {
750
751
  if (!args.login || !args.password || !Number.isInteger(args.locationCode) || !args.languageCode) {
751
752
  throw new Error("Search credentials and locale are required.");
@@ -755,7 +756,7 @@ var createDataForSeoSearchAdapter = (args) => {
755
756
  search: async (query, signal) => {
756
757
  const boundedSignal = AbortSignal.any([
757
758
  signal,
758
- AbortSignal.timeout(15e3)
759
+ AbortSignal.timeout(searchTimeoutMs)
759
760
  ]);
760
761
  const response = await fetch(
761
762
  "https://api.dataforseo.com/v3/serp/google/organic/live/advanced",
@@ -1190,7 +1191,7 @@ import { z as z15 } from "zod";
1190
1191
  import { z as z14 } from "zod";
1191
1192
 
1192
1193
  // src/report/core/progress-schema.ts
1193
- import { z as z5 } from "zod";
1194
+ import { z as z6 } from "zod";
1194
1195
 
1195
1196
  // src/report/core/progress-slot-key.ts
1196
1197
  var progressSlotKey = (slot) => {
@@ -1202,6 +1203,9 @@ var progressSlotKey = (slot) => {
1202
1203
  ]);
1203
1204
  };
1204
1205
 
1206
+ // src/report/core/schema.ts
1207
+ import { z as z5 } from "zod";
1208
+
1205
1209
  // src/report/core/surfaces.ts
1206
1210
  var chatSurfaces = [
1207
1211
  "chatgpt",
@@ -1211,102 +1215,17 @@ var chatSurfaces = [
1211
1215
  "google_ai_overview"
1212
1216
  ];
1213
1217
  var agentSurfaces = ["claude_code", "codex", "cursor"];
1214
- var allSurfaces = [...chatSurfaces, ...agentSurfaces];
1215
-
1216
- // src/report/core/progress-schema.ts
1217
- var digest = z5.string().regex(/^[a-f0-9]{64}$/);
1218
- var runId = z5.string().regex(/^[a-zA-Z0-9_-]{1,180}$/);
1219
- var instant = z5.iso.datetime();
1220
- var questionSetNameSchema = z5.string().trim().min(1).max(120);
1221
- var warning = z5.enum([
1222
- "invalid_capture_manifest",
1223
- "historical_capture_metadata_unknown",
1224
- "artifact_identity_mismatch",
1225
- "plan_config_mismatch",
1226
- "duplicate_planned_slots",
1227
- "matrix_question_missing",
1228
- "historical_run_index_unknown",
1229
- "matrix_plan_mismatch",
1230
- "collection_metadata_unknown",
1231
- "includes_reused_captures",
1232
- "reused_measurement",
1233
- "analysis_replay"
1234
- ]);
1235
- var progressSlotSchema = z5.object({
1236
- sectionKey: z5.string().min(1).max(180),
1237
- questionKey: digest,
1238
- surface: z5.enum(allSurfaces),
1239
- runIndex: z5.number().int().positive(),
1240
- captured: z5.boolean(),
1241
- analyzed: z5.boolean(),
1242
- citationObserved: z5.boolean(),
1243
- captureId: digest.nullable(),
1244
- mentioned: z5.boolean(),
1245
- cited: z5.boolean(),
1246
- requestedModel: z5.string().min(1).max(256).nullable(),
1247
- cliVersion: z5.string().min(1).max(256).nullable(),
1248
- collectionMethodDigest: digest.nullable(),
1249
- collectionMetadataKnown: z5.boolean()
1250
- }).strict().superRefine((slot, context) => {
1251
- if (!slot.captured && (slot.analyzed || slot.citationObserved || slot.captureId !== null) || slot.mentioned && !slot.analyzed || slot.cited && !slot.citationObserved) {
1252
- context.addIssue({
1253
- code: "custom",
1254
- message: "Progress outcomes require their captured and analyzed evidence"
1255
- });
1256
- }
1257
- if (slot.collectionMetadataKnown !== (slot.collectionMethodDigest !== null) || !slot.collectionMetadataKnown && (slot.requestedModel !== null || slot.cliVersion !== null)) {
1258
- context.addIssue({
1259
- code: "custom",
1260
- message: "Progress collection metadata identity is inconsistent"
1261
- });
1262
- }
1263
- });
1264
- var progressMeasurementSchema = z5.object({
1265
- version: z5.literal(1),
1266
- runId,
1267
- // Presentation only, and only for consumers before 0.5.0, which label
1268
- // their question-set selector with it. Stored history keeps it.
1269
- questionSetName: questionSetNameSchema.optional(),
1270
- publishedAt: instant.nullable(),
1271
- captureWindow: z5.object({ start: instant.nullable(), end: instant.nullable() }).strict(),
1272
- measurementId: digest.nullable(),
1273
- state: z5.enum([
1274
- "independent",
1275
- "mixed",
1276
- "reused",
1277
- "derived",
1278
- "legacy",
1279
- "invalid"
1280
- ]),
1281
- warnings: z5.array(warning).max(50),
1282
- reusedCaptures: z5.number().int().nonnegative(),
1283
- brandIdentity: digest,
1284
- geography: z5.string().min(1).max(100),
1285
- language: z5.string().min(1).max(100),
1286
- analyzer: z5.object({
1287
- version: z5.number().int().positive().nullable(),
1288
- model: z5.string().min(1).max(256).nullable()
1289
- }).strict(),
1290
- slots: z5.array(progressSlotSchema).max(1e4)
1291
- }).strict().superRefine((point, context) => {
1292
- const { start, end } = point.captureWindow;
1293
- if (start === null !== (end === null) || start !== null && end !== null && Date.parse(start) > Date.parse(end)) {
1294
- context.addIssue({
1295
- code: "custom",
1296
- message: "Progress capture window is inconsistent"
1297
- });
1298
- }
1299
- const slots = point.slots.map(progressSlotKey);
1300
- if (new Set(slots).size !== slots.length || point.reusedCaptures > point.slots.length) {
1301
- context.addIssue({
1302
- code: "custom",
1303
- message: "Progress planned slots or reuse count are inconsistent"
1304
- });
1305
- }
1306
- });
1307
-
1308
- // src/report/core/schema.ts
1309
- import { z as z6 } from "zod";
1218
+ var consumerSurfaces = ["chatgpt_app", "google_ai_mode"];
1219
+ var defaultSurfaces = [...chatSurfaces, ...agentSurfaces];
1220
+ var allSurfaces = [...defaultSurfaces, ...consumerSurfaces];
1221
+ var customSurfacePrefix = "custom:";
1222
+ var customSurfaceKeyPattern = /^[a-z][a-z0-9_]{0,31}$/;
1223
+ var isCustomSurface = (surface) => {
1224
+ return surface.startsWith(customSurfacePrefix) && customSurfaceKeyPattern.test(surface.slice(customSurfacePrefix.length));
1225
+ };
1226
+ var isConsumerSurface = (surface) => {
1227
+ return consumerSurfaces.some((consumer) => consumer === surface);
1228
+ };
1310
1229
 
1311
1230
  // src/report/core/retrieval.ts
1312
1231
  var retrievalCallKinds = [
@@ -1325,55 +1244,62 @@ var retrievalExposures = [
1325
1244
  // src/report/core/schema.ts
1326
1245
  var aeoSnapshotVersion = 2;
1327
1246
  var maxReviewRounds = 5;
1328
- var aeoSurfaceSchema = z6.enum(allSurfaces);
1329
- var retrievalCallSchema = z6.object({
1330
- kind: z6.enum(retrievalCallKinds),
1247
+ var aeoSurfaceSchema = z5.union([
1248
+ z5.enum(allSurfaces),
1249
+ // The z.custom keeps the template type that z.string() would widen.
1250
+ z5.custom(
1251
+ (value) => typeof value === "string" && isCustomSurface(value),
1252
+ { error: "Expected a built-in surface or a custom surface ID." }
1253
+ )
1254
+ ]);
1255
+ var retrievalCallSchema = z5.object({
1256
+ kind: z5.enum(retrievalCallKinds),
1331
1257
  // Search term for `search`; null for the URL-driven kinds.
1332
- query: z6.string().nullable(),
1258
+ query: z5.string().nullable(),
1333
1259
  // Target for fetch / open_page / find_in_page; null for `search`.
1334
- url: z6.string().nullable(),
1260
+ url: z5.string().nullable(),
1335
1261
  // URLs the call returned to the model. Null when the surface does not
1336
1262
  // expose results for this call (Codex, Gemini queries) or the result
1337
1263
  // never arrived / could not be parsed.
1338
- resultUrls: z6.array(z6.string()).nullable(),
1264
+ resultUrls: z5.array(z5.string()).nullable(),
1339
1265
  // False when resultUrls is a cited subset rather than the full result
1340
1266
  // list (ChatGPT). Irrelevant when resultUrls is null.
1341
- resultsComplete: z6.boolean()
1267
+ resultsComplete: z5.boolean()
1342
1268
  });
1343
- var retrievalLogSchema = z6.object({
1344
- exposure: z6.enum(retrievalExposures),
1269
+ var retrievalLogSchema = z5.object({
1270
+ exposure: z5.enum(retrievalExposures),
1345
1271
  // In stream order. Empty is legal: the surface exposes retrieval and the
1346
1272
  // answer made no calls (an honest from-memory answer).
1347
- calls: z6.array(retrievalCallSchema)
1273
+ calls: z5.array(retrievalCallSchema)
1348
1274
  });
1349
- var retrievalCallSummarySchema = z6.object({
1350
- kind: z6.enum(retrievalCallKinds),
1351
- query: z6.string().nullable(),
1275
+ var retrievalCallSummarySchema = z5.object({
1276
+ kind: z5.enum(retrievalCallKinds),
1277
+ query: z5.string().nullable(),
1352
1278
  // search only
1353
- url: z6.string().nullable(),
1279
+ url: z5.string().nullable(),
1354
1280
  // fetch / open_page / find_in_page
1355
1281
  // search: the brand's domain is in the result set (null when the surface
1356
1282
  // exposes no result set, or when an incomplete result set cannot prove
1357
1283
  // absence). Other kinds: the opened URL is on the brand's domain.
1358
- brandFound: z6.boolean().nullable(),
1284
+ brandFound: z5.boolean().nullable(),
1359
1285
  // Same rule per competitor; normalized domains.
1360
- competitorsFound: z6.array(z6.string()),
1286
+ competitorsFound: z5.array(z5.string()),
1361
1287
  // search only; null when results are not exposed.
1362
- resultCount: z6.number().nullable()
1288
+ resultCount: z5.number().nullable()
1363
1289
  });
1364
- var citationAttributionSchema = z6.array(
1365
- z6.object({ url: z6.string(), callIndices: z6.array(z6.number().int()) })
1290
+ var citationAttributionSchema = z5.array(
1291
+ z5.object({ url: z5.string(), callIndices: z5.array(z5.number().int()) })
1366
1292
  );
1367
- var aeoPromptCategorySchema = z6.enum([
1293
+ var aeoPromptCategorySchema = z5.enum([
1368
1294
  "product_recommendation",
1369
1295
  "industry_expert",
1370
1296
  "comparison",
1371
1297
  "problem_solving",
1372
1298
  "general_knowledge"
1373
1299
  ]);
1374
- var aeoPromptSchema = z6.object({
1375
- id: z6.string().min(1),
1376
- text: z6.string().min(1),
1300
+ var aeoPromptSchema = z5.object({
1301
+ id: z5.string().min(1),
1302
+ text: z5.string().min(1),
1377
1303
  category: aeoPromptCategorySchema
1378
1304
  });
1379
1305
  var sourceCategories = [
@@ -1383,37 +1309,37 @@ var sourceCategories = [
1383
1309
  "institutional",
1384
1310
  "earned"
1385
1311
  ];
1386
- var sourceCategorySchema = z6.enum(sourceCategories);
1387
- var sourceMixCountsSchema = z6.object({
1388
- owned: z6.number(),
1389
- competitor: z6.number(),
1390
- social: z6.number(),
1391
- institutional: z6.number(),
1392
- earned: z6.number()
1312
+ var sourceCategorySchema = z5.enum(sourceCategories);
1313
+ var sourceMixCountsSchema = z5.object({
1314
+ owned: z5.number(),
1315
+ competitor: z5.number(),
1316
+ social: z5.number(),
1317
+ institutional: z5.number(),
1318
+ earned: z5.number()
1393
1319
  });
1394
- var brandSchema = z6.object({
1395
- name: z6.string(),
1396
- domain: z6.string(),
1397
- aliases: z6.array(z6.string()).default([])
1320
+ var brandSchema = z5.object({
1321
+ name: z5.string(),
1322
+ domain: z5.string(),
1323
+ aliases: z5.array(z5.string()).default([])
1398
1324
  });
1399
- var aeoMatrixRowSchema = z6.object({
1400
- promptIdx: z6.number(),
1325
+ var aeoMatrixRowSchema = z5.object({
1326
+ promptIdx: z5.number(),
1401
1327
  surface: aeoSurfaceSchema,
1402
- prospectMentioned: z6.boolean(),
1403
- prospectPosition: z6.enum(["primary", "secondary", "listed", "absent"]).nullable(),
1404
- contextSnippet: z6.string().nullable(),
1405
- runIndex: z6.number().optional(),
1406
- citedUrls: z6.array(z6.string().url()).optional(),
1407
- mentionedBrands: z6.array(z6.object({ name: z6.string(), domain: z6.string().nullable() })).optional(),
1328
+ prospectMentioned: z5.boolean(),
1329
+ prospectPosition: z5.enum(["primary", "secondary", "listed", "absent"]).nullable(),
1330
+ contextSnippet: z5.string().nullable(),
1331
+ runIndex: z5.number().optional(),
1332
+ citedUrls: z5.array(z5.string().url()).optional(),
1333
+ mentionedBrands: z5.array(z5.object({ name: z5.string(), domain: z5.string().nullable() })).optional(),
1408
1334
  // Section-aware buyer alternatives, qualified from saved answer context.
1409
1335
  // Absent = historical data; an empty array means none qualified. The raw
1410
1336
  // mentionedBrands inventory remains intact for inspecting the actual answer.
1411
- qualifiedCompetitors: z6.array(z6.object({ name: z6.string(), domain: z6.string().nullable() })).optional(),
1412
- competitors: z6.array(
1413
- z6.object({ domain: z6.string(), mentioned: z6.boolean() })
1337
+ qualifiedCompetitors: z5.array(z5.object({ name: z5.string(), domain: z5.string().nullable() })).optional(),
1338
+ competitors: z5.array(
1339
+ z5.object({ domain: z5.string(), mentioned: z5.boolean() })
1414
1340
  ),
1415
1341
  // Per-mention sentiment — the analyzer always extracted it; v2 persists it.
1416
- sentiment: z6.enum(["positive", "neutral", "negative"]).optional(),
1342
+ sentiment: z5.enum(["positive", "neutral", "negative"]).optional(),
1417
1343
  // Agent surfaces only: whether the CLI actually used web tools, and which
1418
1344
  // CLI version answered. Answers from model priors are honest data (§5).
1419
1345
  // Tri-state (correctness spec §3.1): true = a web search/fetch completed,
@@ -1421,90 +1347,119 @@ var aeoMatrixRowSchema = z6.object({
1421
1347
  // run's tool events could not be parsed (or were never captured — the
1422
1348
  // migrated pre-fix baselines), so retrieval is unknown. Never guessed
1423
1349
  // from the answer text.
1424
- usedWebSearch: z6.boolean().nullable().optional(),
1425
- agentCliVersion: z6.string().optional(),
1350
+ usedWebSearch: z5.boolean().nullable().optional(),
1351
+ agentCliVersion: z5.string().optional(),
1426
1352
  // Retrieval log summary (retrieval-log spec §4). Both absent = the log was
1427
1353
  // not captured for this run (a probe that predates the spec, or a parse
1428
1354
  // miss) — never a from-memory claim. Present on every fresh probe,
1429
1355
  // `exposure: 'none'` surfaces included (with an empty call list).
1430
1356
  retrievalExposure: retrievalLogSchema.shape.exposure.optional(),
1431
- retrievalCalls: z6.array(retrievalCallSummarySchema).optional(),
1357
+ retrievalCalls: z5.array(retrievalCallSummarySchema).optional(),
1432
1358
  // Google AI Overview only (hardening spec §4.1): the SERP carried no AI
1433
1359
  // Overview. A captured absence — counts against share of voice — with no
1434
1360
  // answer text behind it. Absent on every other surface.
1435
- noOverview: z6.literal(true).optional(),
1361
+ noOverview: z5.literal(true).optional(),
1436
1362
  // Path of this run's evidence chunk, relative to the report directory
1437
1363
  // (e.g. 'evidence/vector_search-0.json'). Null when no text was captured.
1438
- evidenceFile: z6.string().nullable().optional()
1364
+ evidenceFile: z5.string().nullable().optional()
1439
1365
  });
1440
- var aeoVisibilitySchema = z6.object({
1441
- prompts: z6.array(
1442
- z6.object({ text: z6.string(), category: aeoPromptCategorySchema })
1366
+ var aeoRateEvidenceSchema = z5.object({
1367
+ count: z5.number().int().nonnegative(),
1368
+ captured: z5.number().int().nonnegative(),
1369
+ planned: z5.number().int().positive(),
1370
+ low: z5.number().min(0).max(1),
1371
+ high: z5.number().min(0).max(1)
1372
+ });
1373
+ var aeoVisibilitySchema = z5.object({
1374
+ prompts: z5.array(
1375
+ z5.object({ text: z5.string(), category: aeoPromptCategorySchema })
1443
1376
  ),
1444
- surfaces: z6.array(aeoSurfaceSchema),
1445
- matrix: z6.array(aeoMatrixRowSchema),
1446
- summary: z6.object({
1377
+ surfaces: z5.array(aeoSurfaceSchema),
1378
+ matrix: z5.array(aeoMatrixRowSchema),
1379
+ summary: z5.object({
1447
1380
  // Headline scorecards — chat surfaces only, comparable with v1 baselines.
1448
1381
  // Null when the run measured no chat surfaces (agents-only iteration
1449
1382
  // runs): an unmeasured scope must never render as a measured 0%.
1450
- prospectShareOfVoice: z6.number().min(0).max(1).nullable(),
1451
- prospectCitationRate: z6.number().min(0).max(1).nullable(),
1383
+ prospectShareOfVoice: z5.number().min(0).max(1).nullable(),
1384
+ prospectCitationRate: z5.number().min(0).max(1).nullable(),
1452
1385
  // Agent scorecard pair over the agent-surface runs (Claude Code, Codex,
1453
1386
  // Cursor — §5). Null when the
1454
1387
  // agent surfaces weren't run.
1455
- agentShareOfVoice: z6.number().min(0).max(1).nullable(),
1456
- agentCitationRate: z6.number().min(0).max(1).nullable(),
1457
- byModel: z6.record(
1458
- z6.string(),
1459
- z6.object({ shareOfVoice: z6.number(), citationRate: z6.number() })
1388
+ agentShareOfVoice: z5.number().min(0).max(1).nullable(),
1389
+ agentCitationRate: z5.number().min(0).max(1).nullable(),
1390
+ // Consumer-app pair over the scraped products (method release spec
1391
+ // §5.5), never part of the chat headline. Present only when the run
1392
+ // planned a consumer app; null when it had no prompt left to score.
1393
+ consumerShareOfVoice: z5.number().min(0).max(1).nullable().optional(),
1394
+ consumerCitationRate: z5.number().min(0).max(1).nullable().optional(),
1395
+ // Beside each measured rate from calculation version 2.
1396
+ prospectShareOfVoiceEvidence: aeoRateEvidenceSchema.optional(),
1397
+ prospectCitationRateEvidence: aeoRateEvidenceSchema.optional(),
1398
+ agentShareOfVoiceEvidence: aeoRateEvidenceSchema.optional(),
1399
+ agentCitationRateEvidence: aeoRateEvidenceSchema.optional(),
1400
+ consumerShareOfVoiceEvidence: aeoRateEvidenceSchema.optional(),
1401
+ consumerCitationRateEvidence: aeoRateEvidenceSchema.optional(),
1402
+ byModel: z5.record(
1403
+ z5.string(),
1404
+ z5.object({
1405
+ shareOfVoice: z5.number(),
1406
+ citationRate: z5.number(),
1407
+ shareOfVoiceEvidence: aeoRateEvidenceSchema.optional(),
1408
+ citationRateEvidence: aeoRateEvidenceSchema.optional()
1409
+ })
1460
1410
  ),
1461
- byCompetitor: z6.array(
1462
- z6.object({
1463
- domain: z6.string(),
1464
- shareOfVoice: z6.number(),
1465
- citationRate: z6.number()
1411
+ // A split of captured answers, not a visibility claim: counts from
1412
+ // calculation version 2, no interval.
1413
+ byCompetitor: z5.array(
1414
+ z5.object({
1415
+ domain: z5.string(),
1416
+ shareOfVoice: z5.number(),
1417
+ citationRate: z5.number(),
1418
+ mentionedAnswers: z5.number().int().nonnegative().optional(),
1419
+ citedAnswers: z5.number().int().nonnegative().optional(),
1420
+ capturedAnswers: z5.number().int().nonnegative().optional()
1466
1421
  })
1467
1422
  ),
1468
- topCompetitorDomain: z6.string().nullable()
1423
+ topCompetitorDomain: z5.string().nullable()
1469
1424
  })
1470
1425
  });
1471
- var aeoSourceMixSchema = z6.object({
1472
- sections: z6.array(
1473
- z6.object({
1474
- key: z6.string(),
1475
- perSurface: z6.array(
1476
- z6.object({ surface: aeoSurfaceSchema, counts: sourceMixCountsSchema })
1426
+ var aeoSourceMixSchema = z5.object({
1427
+ sections: z5.array(
1428
+ z5.object({
1429
+ key: z5.string(),
1430
+ perSurface: z5.array(
1431
+ z5.object({ surface: aeoSurfaceSchema, counts: sourceMixCountsSchema })
1477
1432
  ),
1478
1433
  total: sourceMixCountsSchema
1479
1434
  })
1480
1435
  )
1481
1436
  });
1482
- var aeoPerceptionSchema = z6.object({
1483
- sections: z6.array(
1484
- z6.object({
1485
- key: z6.string(),
1437
+ var aeoPerceptionSchema = z5.object({
1438
+ sections: z5.array(
1439
+ z5.object({
1440
+ key: z5.string(),
1486
1441
  // Tallies over captured answers that mention the brand.
1487
- sentiment: z6.object({
1488
- positive: z6.number(),
1489
- neutral: z6.number(),
1490
- negative: z6.number()
1442
+ sentiment: z5.object({
1443
+ positive: z5.number(),
1444
+ neutral: z5.number(),
1445
+ negative: z5.number()
1491
1446
  }),
1492
1447
  // Narrative phrases AI attaches to the brand ("open-source",
1493
1448
  // "complex to set up"), with where they were said.
1494
- narratives: z6.array(
1495
- z6.object({
1496
- phrase: z6.string(),
1497
- promptIdx: z6.number(),
1449
+ narratives: z5.array(
1450
+ z5.object({
1451
+ phrase: z5.string(),
1452
+ promptIdx: z5.number(),
1498
1453
  surface: aeoSurfaceSchema
1499
1454
  })
1500
1455
  ),
1501
1456
  // Suspected factual errors vs the config's product brief — flagged for
1502
1457
  // human verification, never auto-published as fact (§7.2).
1503
- flaggedClaims: z6.array(
1504
- z6.object({
1505
- claim: z6.string(),
1506
- reason: z6.string(),
1507
- promptIdx: z6.number(),
1458
+ flaggedClaims: z5.array(
1459
+ z5.object({
1460
+ claim: z5.string(),
1461
+ reason: z5.string(),
1462
+ promptIdx: z5.number(),
1508
1463
  surface: aeoSurfaceSchema
1509
1464
  })
1510
1465
  )
@@ -1512,147 +1467,155 @@ var aeoPerceptionSchema = z6.object({
1512
1467
  )
1513
1468
  });
1514
1469
  var aiBotKinds = ["training", "search", "user_fetch"];
1515
- var aeoTechnicalChecksSchema = z6.object({
1516
- crawlerAccess: z6.object({
1517
- robotsUrl: z6.string(),
1518
- fetchedAt: z6.string(),
1519
- robotsFetchError: z6.string().nullable(),
1470
+ var aeoTechnicalChecksSchema = z5.object({
1471
+ crawlerAccess: z5.object({
1472
+ robotsUrl: z5.string(),
1473
+ fetchedAt: z5.string(),
1474
+ robotsFetchError: z5.string().nullable(),
1520
1475
  // True when robots.txt ran past the 500 KiB RFC 9309 asks a reader to
1521
1476
  // parse: the verdicts rest on that prefix. Absent on snapshots written
1522
1477
  // before the bound existed.
1523
- robotsTruncated: z6.boolean().optional(),
1524
- bots: z6.array(
1525
- z6.object({
1526
- bot: z6.string(),
1527
- kind: z6.enum(aiBotKinds),
1478
+ robotsTruncated: z5.boolean().optional(),
1479
+ bots: z5.array(
1480
+ z5.object({
1481
+ bot: z5.string(),
1482
+ kind: z5.enum(aiBotKinds),
1528
1483
  // Null when robots.txt could not be fetched or parsed.
1529
- robotsAllowed: z6.boolean().nullable(),
1484
+ robotsAllowed: z5.boolean().nullable(),
1530
1485
  // Live GET with the bot's UA — search/user-fetch bots only; catches
1531
1486
  // WAF-level blocks robots.txt doesn't show. Null when not probed.
1532
- liveStatus: z6.number().nullable(),
1533
- liveBlocked: z6.boolean().nullable(),
1487
+ liveStatus: z5.number().nullable(),
1488
+ liveBlocked: z5.boolean().nullable(),
1534
1489
  // What the live probe can honestly say. A request presenting as a
1535
1490
  // bot from the audit's own address is an impersonation to a site
1536
1491
  // that verifies bots by IP, so a 403 the site does not also give
1537
1492
  // a plain browser is `refused_as_bot`, never proof the real bot is
1538
1493
  // blocked; a 403 to the browser too says nothing about bots.
1539
1494
  // Absent on snapshots written before the control request existed.
1540
- liveVerdict: z6.enum(["ok", "refused_as_bot", "inconclusive"]).optional()
1495
+ liveVerdict: z5.enum(["ok", "refused_as_bot", "inconclusive"]).optional()
1541
1496
  })
1542
1497
  ),
1543
1498
  // The same page fetched with an ordinary browser agent from the same
1544
1499
  // address, right after the bot probes: the control the verdicts rest on.
1545
- controlStatus: z6.number().nullable().optional()
1500
+ controlStatus: z5.number().nullable().optional()
1546
1501
  }).nullable(),
1547
- renderability: z6.array(
1548
- z6.object({
1549
- url: z6.string(),
1550
- staticTextChars: z6.number(),
1551
- renderedTextChars: z6.number(),
1502
+ renderability: z5.array(
1503
+ z5.object({
1504
+ url: z5.string(),
1505
+ staticTextChars: z5.number(),
1506
+ renderedTextChars: z5.number(),
1552
1507
  // Fraction of rendered text missing from the no-JS fetch.
1553
- missingRatio: z6.number(),
1554
- flagged: z6.boolean(),
1555
- error: z6.string().nullable()
1508
+ missingRatio: z5.number(),
1509
+ flagged: z5.boolean(),
1510
+ error: z5.string().nullable()
1556
1511
  })
1557
1512
  ).nullable(),
1558
- llmsTxt: z6.object({ llmsTxt: z6.boolean(), llmsFullTxt: z6.boolean() }).nullable(),
1559
- agentReadiness: z6.object({ mcpServer: z6.boolean(), llmDocs: z6.boolean() }).nullable()
1513
+ llmsTxt: z5.object({ llmsTxt: z5.boolean(), llmsFullTxt: z5.boolean() }).nullable(),
1514
+ agentReadiness: z5.object({ mcpServer: z5.boolean(), llmDocs: z5.boolean() }).nullable()
1560
1515
  });
1561
- var aeoOutreachTargetsSchema = z6.array(
1562
- z6.object({
1563
- domain: z6.string(),
1564
- citations: z6.number(),
1516
+ var aeoOutreachTargetsSchema = z5.array(
1517
+ z5.object({
1518
+ domain: z5.string(),
1519
+ citations: z5.number(),
1565
1520
  // Prompts this domain wins while the client is absent — resolved to text
1566
1521
  // at render via sectionKey + promptIdx.
1567
- prompts: z6.array(
1568
- z6.object({ sectionKey: z6.string(), promptIdx: z6.number() })
1522
+ prompts: z5.array(
1523
+ z5.object({ sectionKey: z5.string(), promptIdx: z5.number() })
1569
1524
  ),
1570
- sampleUrls: z6.array(z6.string())
1525
+ sampleUrls: z5.array(z5.string())
1571
1526
  })
1572
1527
  );
1573
- var aeoSnapshotSchema = z6.object({
1574
- version: z6.literal(aeoSnapshotVersion),
1575
- reportKey: z6.string(),
1528
+ var aeoSnapshotSchema = z5.object({
1529
+ version: z5.literal(aeoSnapshotVersion),
1530
+ reportKey: z5.string(),
1576
1531
  brand: brandSchema,
1577
- competitors: z6.array(brandSchema),
1532
+ competitors: z5.array(brandSchema),
1578
1533
  // Array, not fixed keys: a section that failed entirely is omitted while
1579
1534
  // the others still render.
1580
- sections: z6.array(z6.object({ key: z6.string(), visibility: aeoVisibilitySchema })).min(1),
1535
+ sections: z5.array(z5.object({ key: z5.string(), visibility: aeoVisibilitySchema })).min(1),
1581
1536
  sourceMix: aeoSourceMixSchema.optional(),
1582
1537
  perception: aeoPerceptionSchema.optional(),
1583
1538
  technicalChecks: aeoTechnicalChecksSchema.optional(),
1584
1539
  outreachTargets: aeoOutreachTargetsSchema.optional(),
1585
- meta: z6.object({
1540
+ meta: z5.object({
1586
1541
  // Review is additive. Exhausting its rounds records remaining work;
1587
1542
  // it never prevents delivery of the measured report.
1588
- quality: z6.object({
1589
- needsImprovement: z6.boolean(),
1590
- reviewRounds: z6.number().int().min(0).max(maxReviewRounds),
1591
- issues: z6.array(
1592
- z6.object({
1593
- stage: z6.string(),
1594
- code: z6.string(),
1595
- message: z6.string(),
1596
- file: z6.string().nullable().optional(),
1597
- evidence: z6.string().optional()
1543
+ quality: z5.object({
1544
+ needsImprovement: z5.boolean(),
1545
+ reviewRounds: z5.number().int().min(0).max(maxReviewRounds),
1546
+ issues: z5.array(
1547
+ z5.object({
1548
+ stage: z5.string(),
1549
+ code: z5.string(),
1550
+ message: z5.string(),
1551
+ file: z5.string().nullable().optional(),
1552
+ evidence: z5.string().optional()
1598
1553
  })
1599
1554
  )
1600
1555
  }).optional(),
1601
- generatedAt: z6.string(),
1602
- promptCount: z6.number(),
1556
+ generatedAt: z5.string(),
1557
+ promptCount: z5.number(),
1603
1558
  // Successful probes across all sections.
1604
- probeCount: z6.number(),
1559
+ probeCount: z5.number(),
1605
1560
  // Present when the run reused checkpointed probes (resume / --redo):
1606
1561
  // the snapshot then mixes capture ages, and generatedAt alone would
1607
1562
  // overstate freshness. Absent = every probe was captured by this run.
1608
- reusedProbes: z6.object({
1609
- count: z6.number(),
1610
- oldestCapturedAt: z6.string().nullable()
1563
+ reusedProbes: z5.object({
1564
+ count: z5.number(),
1565
+ oldestCapturedAt: z5.string().nullable()
1611
1566
  }).optional(),
1612
- partialFailures: z6.array(z6.object({ step: z6.string(), error: z6.string() })),
1567
+ partialFailures: z5.array(z5.object({ step: z5.string(), error: z5.string() })),
1613
1568
  // The run's surface scope (correctness spec §3.6): with the pre-flight
1614
1569
  // CLI check, `agentClis.<cli>: null` can only mean "not in scope", and
1615
1570
  // this field says so explicitly. Optional: older snapshots lack it.
1616
- surfaces: z6.array(aeoSurfaceSchema).optional(),
1571
+ surfaces: z5.array(aeoSurfaceSchema).optional(),
1572
+ // The label of each surface that was not asked of its default model,
1573
+ // naming the model it was asked of. Absent on a run measured with the
1574
+ // defaults: readers fall back to the engine's own labels.
1575
+ surfaceLabels: z5.record(z5.string().min(1).max(60), z5.string().min(1).max(300)).optional(),
1576
+ // How the run measured, as fixed sentences the host built from what it
1577
+ // observed (method release spec §8): never written by a model. Absent
1578
+ // on a snapshot from before 0.4.0.
1579
+ methodology: z5.array(z5.string().min(1).max(1500)).max(20).optional(),
1617
1580
  // Which agent CLIs answered, for the methodology note. Null = not run.
1618
- agentClis: z6.object({
1619
- claudeCode: z6.string().nullable(),
1620
- codex: z6.string().nullable(),
1581
+ agentClis: z5.object({
1582
+ claudeCode: z5.string().nullable(),
1583
+ codex: z5.string().nullable(),
1621
1584
  // Optional: snapshots committed before the cursor surface existed
1622
1585
  // lack this key and must keep parsing.
1623
- cursor: z6.string().nullable().optional()
1586
+ cursor: z5.string().nullable().optional()
1624
1587
  }).optional(),
1625
1588
  // Answer-analyzer version that produced the matrix (correctness spec
1626
1589
  // §3.7); a bump invalidates every cached analysis.
1627
- analyzerVersion: z6.number().int().optional(),
1590
+ analyzerVersion: z5.number().int().optional(),
1628
1591
  // Domain-classifier version behind the source mix and outreach targets
1629
1592
  // (§7.1 amendment, 2026-09-04). Absent = static rules only (baselines
1630
1593
  // committed before the amendment).
1631
- domainClassifierVersion: z6.number().int().optional(),
1632
- competitorClassifierVersion: z6.number().int().optional(),
1594
+ domainClassifierVersion: z5.number().int().optional(),
1595
+ competitorClassifierVersion: z5.number().int().optional(),
1633
1596
  // One-off data migrations applied to this committed file (correctness
1634
1597
  // spec §3.8), so a rewritten value is visible in the file itself.
1635
- migrations: z6.array(z6.object({ id: z6.string(), appliedAt: z6.string() })).optional(),
1598
+ migrations: z5.array(z5.object({ id: z5.string(), appliedAt: z5.string() })).optional(),
1636
1599
  // The run that produced the snapshot (hardening spec §4.2); every unit
1637
1600
  // record, analysis entry and log event of the run carries the same id.
1638
1601
  // Optional: snapshots committed before run identity existed lack it.
1639
- runId: z6.string().optional(),
1640
- derivedFromRunId: z6.string().optional(),
1641
- replayKind: z6.enum(["grounding", "analysis"]).optional(),
1642
- groundingPolicyVersion: z6.number().int().positive().optional(),
1602
+ runId: z5.string().optional(),
1603
+ derivedFromRunId: z5.string().optional(),
1604
+ replayKind: z5.enum(["grounding", "analysis"]).optional(),
1605
+ groundingPolicyVersion: z5.number().int().positive().optional(),
1643
1606
  // The model ids behind the analyzer and perception passes (§2.11).
1644
- models: z6.object({ analyzer: z6.string(), perception: z6.string() }).optional()
1607
+ models: z5.object({ analyzer: z5.string(), perception: z5.string() }).optional()
1645
1608
  })
1646
1609
  });
1647
- var aeoEvidenceChunkSchema = z6.object({
1648
- sectionKey: z6.string(),
1649
- promptIdx: z6.number(),
1650
- promptText: z6.string(),
1651
- runs: z6.array(
1652
- z6.object({
1610
+ var aeoEvidenceChunkSchema = z5.object({
1611
+ sectionKey: z5.string(),
1612
+ promptIdx: z5.number(),
1613
+ promptText: z5.string(),
1614
+ runs: z5.array(
1615
+ z5.object({
1653
1616
  surface: aeoSurfaceSchema,
1654
- runIndex: z6.number(),
1655
- responseText: z6.string(),
1617
+ runIndex: z5.number(),
1618
+ responseText: z5.string(),
1656
1619
  // Raw retrieval log and the cited-URL → call attribution derived from
1657
1620
  // it (retrieval-log spec §4, §6). Absent = not captured for this run.
1658
1621
  retrieval: retrievalLogSchema.optional(),
@@ -1661,6 +1624,110 @@ var aeoEvidenceChunkSchema = z6.object({
1661
1624
  )
1662
1625
  });
1663
1626
 
1627
+ // src/report/core/progress-schema.ts
1628
+ var digest = z6.string().regex(/^[a-f0-9]{64}$/);
1629
+ var runId = z6.string().regex(/^[a-zA-Z0-9_-]{1,180}$/);
1630
+ var instant = z6.iso.datetime();
1631
+ var questionSetNameSchema = z6.string().trim().min(1).max(120);
1632
+ var warning = z6.enum([
1633
+ "invalid_capture_manifest",
1634
+ "historical_capture_metadata_unknown",
1635
+ "artifact_identity_mismatch",
1636
+ "plan_config_mismatch",
1637
+ "duplicate_planned_slots",
1638
+ "matrix_question_missing",
1639
+ "historical_run_index_unknown",
1640
+ "matrix_plan_mismatch",
1641
+ "collection_metadata_unknown",
1642
+ "includes_reused_captures",
1643
+ "reused_measurement",
1644
+ "analysis_replay"
1645
+ ]);
1646
+ var progressSlotSchema = z6.object({
1647
+ sectionKey: z6.string().min(1).max(180),
1648
+ questionKey: digest,
1649
+ surface: aeoSurfaceSchema,
1650
+ runIndex: z6.number().int().positive(),
1651
+ captured: z6.boolean(),
1652
+ analyzed: z6.boolean(),
1653
+ citationObserved: z6.boolean(),
1654
+ captureId: digest.nullable(),
1655
+ mentioned: z6.boolean(),
1656
+ cited: z6.boolean(),
1657
+ requestedModel: z6.string().min(1).max(256).nullable(),
1658
+ cliVersion: z6.string().min(1).max(256).nullable(),
1659
+ collectionMethodDigest: digest.nullable(),
1660
+ collectionMetadataKnown: z6.boolean()
1661
+ }).strict().superRefine((slot, context) => {
1662
+ if (!slot.captured && (slot.analyzed || slot.citationObserved || slot.captureId !== null) || slot.mentioned && !slot.analyzed || slot.cited && !slot.citationObserved) {
1663
+ context.addIssue({
1664
+ code: "custom",
1665
+ message: "Progress outcomes require their captured and analyzed evidence"
1666
+ });
1667
+ }
1668
+ if (slot.collectionMetadataKnown !== (slot.collectionMethodDigest !== null) || !slot.collectionMetadataKnown && (slot.requestedModel !== null || slot.cliVersion !== null)) {
1669
+ context.addIssue({
1670
+ code: "custom",
1671
+ message: "Progress collection metadata identity is inconsistent"
1672
+ });
1673
+ }
1674
+ });
1675
+ var isSurfaceSinceProgressVersion1 = (surface) => {
1676
+ return isCustomSurface(surface) || isConsumerSurface(surface);
1677
+ };
1678
+ var progressMeasurementSchema = z6.object({
1679
+ // Version 2 may hold a consumer app (method release spec §3.2) or a
1680
+ // custom surface (open models spec §5.4). A measurement without one is
1681
+ // still written as version 1, byte for byte.
1682
+ version: z6.union([z6.literal(1), z6.literal(2)]),
1683
+ runId,
1684
+ // Presentation only, and only for consumers before 0.5.0, which label
1685
+ // their question-set selector with it. Stored history keeps it.
1686
+ questionSetName: questionSetNameSchema.optional(),
1687
+ publishedAt: instant.nullable(),
1688
+ captureWindow: z6.object({ start: instant.nullable(), end: instant.nullable() }).strict(),
1689
+ measurementId: digest.nullable(),
1690
+ state: z6.enum([
1691
+ "independent",
1692
+ "mixed",
1693
+ "reused",
1694
+ "derived",
1695
+ "legacy",
1696
+ "invalid"
1697
+ ]),
1698
+ warnings: z6.array(warning).max(50),
1699
+ reusedCaptures: z6.number().int().nonnegative(),
1700
+ brandIdentity: digest,
1701
+ geography: z6.string().min(1).max(100),
1702
+ language: z6.string().min(1).max(100),
1703
+ analyzer: z6.object({
1704
+ version: z6.number().int().positive().nullable(),
1705
+ model: z6.string().min(1).max(256).nullable()
1706
+ }).strict(),
1707
+ slots: z6.array(progressSlotSchema).max(1e4)
1708
+ }).strict().superRefine((point, context) => {
1709
+ const { start, end } = point.captureWindow;
1710
+ if (start === null !== (end === null) || start !== null && end !== null && Date.parse(start) > Date.parse(end)) {
1711
+ context.addIssue({
1712
+ code: "custom",
1713
+ message: "Progress capture window is inconsistent"
1714
+ });
1715
+ }
1716
+ if (point.version === 1 && point.slots.some((slot) => isSurfaceSinceProgressVersion1(slot.surface))) {
1717
+ context.addIssue({
1718
+ code: "custom",
1719
+ message: "A version 1 progress measurement holds no consumer or custom surface"
1720
+ });
1721
+ }
1722
+ const slots = point.slots.map(progressSlotKey);
1723
+ if (new Set(slots).size !== slots.length || point.reusedCaptures > point.slots.length) {
1724
+ context.addIssue({
1725
+ code: "custom",
1726
+ message: "Progress planned slots or reuse count are inconsistent"
1727
+ });
1728
+ }
1729
+ });
1730
+
1664
1731
  // src/coverage-schema.ts
1665
1732
  import { z as z7 } from "zod";
1666
1733
  var coverageThresholdsSchema = z7.object({
@@ -1677,10 +1744,17 @@ var generationBackendSchema = z8.enum([
1677
1744
  "gateway"
1678
1745
  ]);
1679
1746
  var modelPricingSchema = z8.object({
1680
- input: z8.number().positive(),
1681
- output: z8.number().positive(),
1747
+ input: z8.number().nonnegative(),
1748
+ output: z8.number().nonnegative(),
1682
1749
  cachedInput: z8.number().nonnegative()
1683
1750
  }).strict();
1751
+ var reasoningEffortSchema = z8.enum([
1752
+ "low",
1753
+ "medium",
1754
+ "high",
1755
+ "xhigh",
1756
+ "max"
1757
+ ]);
1684
1758
  var internalModelRoleSchema = z8.object({
1685
1759
  /** The gateway model ID, such as `anthropic/claude-opus-5.5`. */
1686
1760
  model: z8.string().min(1),
@@ -1690,7 +1764,7 @@ var internalModelRoleSchema = z8.object({
1690
1764
  * sent: not every provider honours one. */
1691
1765
  gateway: z8.object({
1692
1766
  reasoning: z8.union([
1693
- z8.object({ effort: z8.literal("high") }).strict(),
1767
+ z8.object({ effort: reasoningEffortSchema }).strict(),
1694
1768
  /** Accepted so that a stored profile keeps parsing and
1695
1769
  * dispatching exactly as admitted; never built any more. */
1696
1770
  z8.object({ max_tokens: z8.number().int().positive() }).strict()
@@ -1714,7 +1788,7 @@ var internalModelRoleSchema = z8.object({
1714
1788
  }).strict();
1715
1789
  var codexStageModelSchema = z8.object({
1716
1790
  model: z8.string().min(1),
1717
- reasoningEffort: z8.enum(["medium", "high", "xhigh"]),
1791
+ reasoningEffort: reasoningEffortSchema,
1718
1792
  /** The context window Codex must be told: it has no metadata for
1719
1793
  * gateway models and otherwise compacts a session at its own default. */
1720
1794
  contextWindow: z8.number().int().positive(),
@@ -2061,6 +2135,16 @@ var ownedCompetitorDomainSchema = z14.string().trim().regex(
2061
2135
  /^(?=.{1,253}$)(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.?$/,
2062
2136
  "Expected a domain name without a URL, path or port"
2063
2137
  );
2138
+ var maxCustomSurfaces = 8;
2139
+ var surfaceDecisionShape = {
2140
+ codingAgents: z14.enum(["measure", "skip"]),
2141
+ because: z14.string().trim().min(12).max(300)
2142
+ };
2143
+ var defaultSurfaceDecision = {
2144
+ codingAgents: "measure",
2145
+ because: "Default: every surface is measured until the author decides otherwise."
2146
+ };
2147
+ var authoredSurfacesSchema = z14.object(surfaceDecisionShape).strict().prefault(defaultSurfaceDecision);
2064
2148
  var aeoAuditConfigSchema = z14.object({
2065
2149
  reportKey: z14.string().min(1),
2066
2150
  // Labels the console Dashboard's question-set selector until it adopts
@@ -2087,17 +2171,30 @@ var aeoAuditConfigSchema = z14.object({
2087
2171
  // Grounds accuracy flagging (§7.2): claims contradicting this brief are
2088
2172
  // flagged for human verification.
2089
2173
  productBrief: z14.string().min(1),
2090
- // Whether the coding agents are measured (specs/aeo-surface-selection-spec
2091
- // §3.1): the author decides from who the buyers are, with the reason the
2092
- // config gate shows. The default keeps every stored config measuring all
2093
- // eight surfaces.
2174
+ // The custom surfaces the audit declares (open models spec §5): the plan
2175
+ // needs their IDs and the facts their labels. Their models are bindings,
2176
+ // never configuration: a model is how a surface is asked, not what is
2177
+ // measured. Absent when none is declared, so a config without them
2178
+ // parses, and digests, exactly as before.
2179
+ customSurfaces: z14.array(
2180
+ z14.object({
2181
+ key: z14.string().regex(customSurfaceKeyPattern),
2182
+ label: z14.string().trim().min(1).max(60)
2183
+ }).strict()
2184
+ ).min(1).max(maxCustomSurfaces).optional(),
2094
2185
  surfaces: z14.object({
2095
- codingAgents: z14.enum(["measure", "skip"]),
2096
- because: z14.string().trim().min(12).max(300)
2097
- }).strict().prefault({
2098
- codingAgents: "measure",
2099
- because: "Default: every surface is measured until the author decides otherwise."
2100
- }),
2186
+ ...surfaceDecisionShape,
2187
+ // The consumer apps measured as well (method release spec §5.4), each
2188
+ // listed once. The operator's choice, never the author's. Absent when
2189
+ // none is, so a config without them parses, and digests, exactly as
2190
+ // before.
2191
+ consumerApps: z14.array(z14.enum(consumerSurfaces)).min(1).refine(
2192
+ (listed) => listed.join() === consumerSurfaces.filter((app) => listed.includes(app)).join(),
2193
+ {
2194
+ error: `Each consumer app is listed once, in this order: ${consumerSurfaces.join(", ")}.`
2195
+ }
2196
+ ).optional()
2197
+ }).strict().prefault(defaultSurfaceDecision),
2101
2198
  productGrounding: groundingBundleSchema.optional(),
2102
2199
  // Per-report domain classification overrides for §7.1.
2103
2200
  sourceOverrides: z14.record(z14.string(), sourceCategorySchema).optional(),
@@ -2160,8 +2257,14 @@ var authorOutputSchema = aeoAuditConfigSchema.omit({
2160
2257
  competitorQualification: true,
2161
2258
  // Depth decides what a run costs, so the operator sets it in audit.json
2162
2259
  // with the estimate in front of them, never the author.
2163
- chatProbes: true
2260
+ chatProbes: true,
2261
+ // A custom surface is a model the operator chooses and binds; the
2262
+ // author could name one and bind nothing.
2263
+ customSurfaces: true
2164
2264
  }).extend({
2265
+ // The author decides the coding agents. The consumer apps are opted
2266
+ // into by the operator, in audit.json or the hosted config.
2267
+ surfaces: authoredSurfacesSchema,
2165
2268
  // The agent batch the author could always propose: 1 or 2 runs per
2166
2269
  // prompt. A deeper one is the operator's call, as chat depth is.
2167
2270
  agentProbes: agentProbeConfigSchema.extend({ runsPerPrompt: z15.number().int().min(1).max(2).default(2) }).prefault({}),