literally-aeo 0.2.2 → 0.3.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 (304) hide show
  1. package/dist/cli.mjs +6031 -5158
  2. package/dist/lib/agents/author-schema.js +5 -5
  3. package/dist/lib/agents/author-validation.js +7 -7
  4. package/dist/lib/agents/copy-validation.js +9 -9
  5. package/dist/lib/agents/copywriter-input.js +8 -8
  6. package/dist/lib/agents/facts.js +7 -7
  7. package/dist/lib/agents/narrative-facts.js +6 -6
  8. package/dist/lib/agents/verifier.js +13 -12
  9. package/dist/lib/analysis/domain-classifier.js +12 -10
  10. package/dist/lib/analysis/domain-labels.js +4 -4
  11. package/dist/lib/analysis/outreach.js +2 -2
  12. package/dist/lib/analysis/progress.js +8 -8
  13. package/dist/lib/analysis/retrieval.js +5 -5
  14. package/dist/lib/analysis/scoring.js +5 -5
  15. package/dist/lib/analysis/search-analyzer.js +6 -6
  16. package/dist/lib/analysis/sentiment.js +12 -10
  17. package/dist/lib/analysis/source-mix.js +2 -2
  18. package/dist/lib/author/examples.js +6 -6
  19. package/dist/lib/bundle/contracts.js +6 -6
  20. package/dist/lib/bundle/export.js +18 -18
  21. package/dist/lib/bundle/journal.js +7 -7
  22. package/dist/lib/bundle/project-journal.js +10 -10
  23. package/dist/lib/bundle/project.js +16 -16
  24. package/dist/lib/bundle/read.js +19 -19
  25. package/dist/lib/bundle/recorder.js +8 -8
  26. package/dist/lib/bundle/redact.js +7 -7
  27. package/dist/lib/bundle/trace-coverage.js +7 -7
  28. package/dist/lib/bundle/verify-integrity.js +9 -9
  29. package/dist/lib/bundle/verify-measurement.js +22 -13
  30. package/dist/lib/bundle/verify-report.js +23 -15
  31. package/dist/lib/bundle/verify.js +31 -23
  32. package/dist/lib/capture-manifest.js +6 -6
  33. package/dist/lib/checks/crawler-access.js +2 -2
  34. package/dist/lib/checks/renderability.js +2 -2
  35. package/dist/lib/checks/run-checks.js +12 -12
  36. package/dist/lib/chunks/{chunk-3CMPR6ZZ.js → chunk-2C723CW7.js} +1 -1
  37. package/dist/lib/chunks/chunk-2FDSOZ6Q.js +287 -0
  38. package/dist/lib/chunks/{chunk-PWOYEIPF.js → chunk-2U5QSA6Q.js} +7 -7
  39. package/dist/lib/chunks/{chunk-6EI4CVRW.js → chunk-3ESH5NDR.js} +5 -1
  40. package/dist/lib/chunks/{chunk-VHKHYAC5.js → chunk-3S2FAVRE.js} +2 -2
  41. package/dist/lib/chunks/{chunk-LR27H2HZ.js → chunk-44NSZBCP.js} +6 -6
  42. package/dist/lib/chunks/{chunk-JBOOD6MU.js → chunk-4AWFF53U.js} +12 -4
  43. package/dist/lib/chunks/{chunk-MENTBQGB.js → chunk-4HPMLJKC.js} +4 -4
  44. package/dist/lib/chunks/{chunk-S6QOXJAL.js → chunk-4Q2WFZ5J.js} +11 -4
  45. package/dist/lib/chunks/{chunk-7DNLRXEY.js → chunk-5JU2Y2I6.js} +2 -2
  46. package/dist/lib/chunks/{chunk-KFAT65P7.js → chunk-64JFN2Q5.js} +1 -1
  47. package/dist/lib/chunks/chunk-66UE4TT2.js +245 -0
  48. package/dist/lib/chunks/chunk-6N3C6E3D.js +105 -0
  49. package/dist/lib/chunks/{chunk-F2NSJ6PG.js → chunk-6RED3G6K.js} +7 -3
  50. package/dist/lib/chunks/{chunk-HCUJ2J7P.js → chunk-7KLTOVIY.js} +9 -9
  51. package/dist/lib/chunks/{chunk-EOO5RBUW.js → chunk-7ZR3WDF2.js} +38 -5
  52. package/dist/lib/chunks/chunk-A5PF7UE2.js +86 -0
  53. package/dist/lib/chunks/{chunk-PKNODC6Y.js → chunk-AB7DUTX5.js} +1 -1
  54. package/dist/lib/chunks/{chunk-WDT2Y7D7.js → chunk-AQCWKHTE.js} +11 -7
  55. package/dist/lib/chunks/{chunk-UNCUG2YS.js → chunk-ASHFEFCU.js} +3 -3
  56. package/dist/lib/chunks/{chunk-BYHXNFWN.js → chunk-ASIFUJG2.js} +1 -1
  57. package/dist/lib/chunks/{chunk-ZSEY7AHQ.js → chunk-BBK54RVK.js} +14 -11
  58. package/dist/lib/chunks/chunk-BQMUZLHO.js +17 -0
  59. package/dist/lib/chunks/{chunk-QD3JXA3Y.js → chunk-CQNIPZH3.js} +18 -18
  60. package/dist/lib/chunks/{chunk-7HM6IZ3L.js → chunk-CVEXMYPW.js} +2 -2
  61. package/dist/lib/chunks/chunk-CXZIHHLJ.js +95 -0
  62. package/dist/lib/chunks/{chunk-75DMLOQ7.js → chunk-CYJNBVQB.js} +1 -1
  63. package/dist/lib/chunks/{chunk-FAUFE7MI.js → chunk-D7N5OLYL.js} +1 -1
  64. package/dist/lib/chunks/{chunk-E2YTTB6Q.js → chunk-DSK3PM4Z.js} +1 -1
  65. package/dist/lib/chunks/{chunk-TNL2GWYR.js → chunk-EUXNCXCR.js} +22 -0
  66. package/dist/lib/chunks/{chunk-FJL2V6P5.js → chunk-F4EQULFR.js} +6 -6
  67. package/dist/lib/chunks/{chunk-QGZ4QSUE.js → chunk-FHV4PBYG.js} +1 -1
  68. package/dist/lib/chunks/{chunk-K2FZFESR.js → chunk-FONFW67K.js} +4 -4
  69. package/dist/lib/chunks/{chunk-PIFTG6YW.js → chunk-FPPHYGIO.js} +2 -2
  70. package/dist/lib/chunks/{chunk-VXYQWE45.js → chunk-FYE4R5TY.js} +2 -2
  71. package/dist/lib/chunks/{chunk-JYCVBFH5.js → chunk-H2DOBJZC.js} +2 -2
  72. package/dist/lib/chunks/{chunk-XA27KAUV.js → chunk-HEWHNSDP.js} +68 -36
  73. package/dist/lib/chunks/{chunk-RXSHKWZJ.js → chunk-HLC6OHGO.js} +2 -2
  74. package/dist/lib/chunks/{chunk-6HMHXSCS.js → chunk-HXXFRZTJ.js} +2 -2
  75. package/dist/lib/chunks/{chunk-R5UPOEWE.js → chunk-HYMWNGOK.js} +10 -3
  76. package/dist/lib/chunks/chunk-IH67TEGY.js +73 -0
  77. package/dist/lib/chunks/{chunk-JKPBXPCW.js → chunk-IMADI2YP.js} +1 -1
  78. package/dist/lib/chunks/{chunk-AT3XMGES.js → chunk-JBGQFPTY.js} +4 -4
  79. package/dist/lib/chunks/{chunk-JQDQVG3D.js → chunk-JDU3ZCKO.js} +1 -1
  80. package/dist/lib/chunks/{chunk-2KH7LNK7.js → chunk-JGIX427K.js} +7 -7
  81. package/dist/lib/chunks/{chunk-7CW6U5WJ.js → chunk-JIE2ANVD.js} +1 -1
  82. package/dist/lib/chunks/{chunk-YEUCAPKP.js → chunk-JJFOILZK.js} +2 -2
  83. package/dist/lib/chunks/{chunk-F7DBTXKG.js → chunk-JMIK2QN3.js} +4 -3
  84. package/dist/lib/chunks/chunk-JW7DTYSI.js +116 -0
  85. package/dist/lib/chunks/{chunk-BFWK3TBN.js → chunk-JXLCKACO.js} +2 -2
  86. package/dist/lib/chunks/{chunk-7WO3FFPS.js → chunk-K5NQDJLE.js} +1 -1
  87. package/dist/lib/chunks/{chunk-BXF4OC74.js → chunk-KI2FB4Y3.js} +30 -16
  88. package/dist/lib/chunks/{chunk-Y2CZ6FZY.js → chunk-KRWDELRS.js} +30 -7
  89. package/dist/lib/chunks/{chunk-SIJOQRRK.js → chunk-KRXOJJR7.js} +1 -1
  90. package/dist/lib/chunks/chunk-KSUI4DAY.js +15 -0
  91. package/dist/lib/chunks/chunk-KXFZ3CH3.js +98 -0
  92. package/dist/lib/chunks/{chunk-XSER7WEB.js → chunk-LJCWZ5SZ.js} +14 -14
  93. package/dist/lib/chunks/{chunk-HGGRPOSA.js → chunk-LNYQMWJO.js} +3 -3
  94. package/dist/lib/chunks/{chunk-DL6YQDTE.js → chunk-LOIAGEKN.js} +2 -2
  95. package/dist/lib/chunks/{chunk-I3UE52ZV.js → chunk-LPOIMPJK.js} +2 -2
  96. package/dist/lib/chunks/{chunk-66T7JC57.js → chunk-LUKP64NX.js} +2 -2
  97. package/dist/lib/chunks/chunk-MNG5TZRW.js +208 -0
  98. package/dist/lib/chunks/{chunk-HGGOGCPX.js → chunk-MPQXB7HN.js} +7 -7
  99. package/dist/lib/chunks/{chunk-YGLWQFKL.js → chunk-MZ2KN3IH.js} +3 -3
  100. package/dist/lib/chunks/chunk-N62G4EWT.js +91 -0
  101. package/dist/lib/chunks/{chunk-7YDXD4MD.js → chunk-ODIXZHHX.js} +1 -1
  102. package/dist/lib/chunks/{chunk-GLUGYZQO.js → chunk-OTVHGRCO.js} +8 -8
  103. package/dist/lib/chunks/{chunk-RIJERFGU.js → chunk-OVF27NAO.js} +69 -17
  104. package/dist/lib/chunks/chunk-P6LHGBYU.js +90 -0
  105. package/dist/lib/chunks/{chunk-U5USH2HB.js → chunk-PAL5SXIP.js} +1 -1
  106. package/dist/lib/chunks/{chunk-W5XYW6ZM.js → chunk-PT6PK2MJ.js} +26 -19
  107. package/dist/lib/chunks/{chunk-OD36HUXA.js → chunk-Q22FCF4A.js} +6 -7
  108. package/dist/lib/chunks/chunk-QKTKQSPS.js +292 -0
  109. package/dist/lib/chunks/{chunk-K4Y5NT4M.js → chunk-QO5TPMWS.js} +2 -2
  110. package/dist/lib/chunks/{chunk-4GLW3ZRO.js → chunk-QUZYFAGP.js} +4 -4
  111. package/dist/lib/chunks/{chunk-T6XZQOXS.js → chunk-QVMPTT7R.js} +5 -5
  112. package/dist/lib/chunks/{chunk-OOLWU667.js → chunk-RGZY6YUQ.js} +5 -5
  113. package/dist/lib/chunks/{chunk-U6BW6LGX.js → chunk-RM2VVR7Y.js} +1 -1
  114. package/dist/lib/chunks/{chunk-AJO7XVXK.js → chunk-RMSH7RUG.js} +6 -6
  115. package/dist/lib/chunks/{chunk-V5B6UZ3E.js → chunk-RQGEPR6V.js} +1 -0
  116. package/dist/lib/chunks/{chunk-V5JJEEBT.js → chunk-RYB77E7O.js} +6 -5
  117. package/dist/lib/chunks/chunk-S24JGY7B.js +97 -0
  118. package/dist/lib/chunks/{chunk-6GKKALCI.js → chunk-SF4UJ2AY.js} +1 -1
  119. package/dist/lib/chunks/chunk-SJCUR4QX.js +94 -0
  120. package/dist/lib/chunks/{chunk-XAN4CRFP.js → chunk-SQ55KGHO.js} +1 -1
  121. package/dist/lib/chunks/{chunk-ZOGIJGU3.js → chunk-TKOQMB6A.js} +7 -7
  122. package/dist/lib/chunks/{chunk-UYDQXXDQ.js → chunk-TWK6IA4P.js} +1 -1
  123. package/dist/lib/chunks/{chunk-DVFFYY5G.js → chunk-U42I3SBR.js} +13 -9
  124. package/dist/lib/chunks/{chunk-PIF3GL62.js → chunk-UECQONVZ.js} +5 -5
  125. package/dist/lib/chunks/{chunk-FDM2YNQL.js → chunk-VTY53IFN.js} +1 -1
  126. package/dist/lib/chunks/chunk-VYUC772A.js +338 -0
  127. package/dist/lib/chunks/{chunk-WCLKIPJV.js → chunk-WPCBE2NZ.js} +1 -1
  128. package/dist/lib/chunks/{chunk-3OE4UQIB.js → chunk-WRHGLRUK.js} +5 -5
  129. package/dist/lib/chunks/{chunk-J7QKT5E7.js → chunk-WUIY7BXR.js} +34 -17
  130. package/dist/lib/chunks/{chunk-7YYDUHJG.js → chunk-WZA4H4TG.js} +39 -13
  131. package/dist/lib/chunks/{chunk-NH4QGBJV.js → chunk-XBSA7MNJ.js} +7 -2
  132. package/dist/lib/chunks/chunk-XTBCXEH7.js +243 -0
  133. package/dist/lib/chunks/{chunk-ZQ3ER7JD.js → chunk-YPVJAXPP.js} +1 -1
  134. package/dist/lib/chunks/{chunk-SASE7U6E.js → chunk-YQD5ITKI.js} +1 -1
  135. package/dist/lib/chunks/{chunk-LTCDLURT.js → chunk-YY4BH5XM.js} +6 -6
  136. package/dist/lib/chunks/{chunk-J5NPHPXY.js → chunk-Z3BZRBQF.js} +36 -2
  137. package/dist/lib/chunks/{chunk-XFUYEFQP.js → chunk-ZBQU2VU3.js} +1 -1
  138. package/dist/lib/chunks/{chunk-7YZPEX3T.js → chunk-ZHGABG7L.js} +2 -2
  139. package/dist/lib/chunks/chunk-ZZCRYG36.js +31 -0
  140. package/dist/lib/cli/bundle-commands.js +89 -73
  141. package/dist/lib/cli/run-commands.js +136 -92
  142. package/dist/lib/cli/status-command.js +75 -59
  143. package/dist/lib/codex-workflow/aggregate.js +20 -12
  144. package/dist/lib/codex-workflow/author-tools.js +7 -7
  145. package/dist/lib/codex-workflow/author.js +23 -22
  146. package/dist/lib/codex-workflow/capture.js +38 -17
  147. package/dist/lib/codex-workflow/checkpoint.js +7 -7
  148. package/dist/lib/codex-workflow/checks.js +9 -9
  149. package/dist/lib/codex-workflow/copy-editor.js +19 -18
  150. package/dist/lib/codex-workflow/copy-recovery.js +4 -4
  151. package/dist/lib/codex-workflow/copy.js +16 -15
  152. package/dist/lib/codex-workflow/finish.js +28 -24
  153. package/dist/lib/codex-workflow/host-models.js +2 -2
  154. package/dist/lib/codex-workflow/loop.js +51 -46
  155. package/dist/lib/codex-workflow/quality.js +4 -4
  156. package/dist/lib/codex-workflow/run-inputs.js +6 -6
  157. package/dist/lib/codex-workflow/run-source.js +16 -16
  158. package/dist/lib/codex-workflow/schemas.js +6 -6
  159. package/dist/lib/codex-workflow/session.js +8 -8
  160. package/dist/lib/codex-workflow/stage.js +30 -28
  161. package/dist/lib/codex-workflow/workdir.js +18 -11
  162. package/dist/lib/engine/audit-file.js +7 -7
  163. package/dist/lib/engine/author.js +38 -36
  164. package/dist/lib/engine/cost-estimate.js +37 -9
  165. package/dist/lib/engine/local-run.js +74 -58
  166. package/dist/lib/engine/preflight.js +37 -9
  167. package/dist/lib/engine/rejudge.js +80 -64
  168. package/dist/lib/engine/run-bindings.js +62 -0
  169. package/dist/lib/engine/run-status.js +75 -59
  170. package/dist/lib/engine/templates.js +8 -8
  171. package/dist/lib/grounding/controller.js +8 -7
  172. package/dist/lib/grounding/extract.js +8 -6
  173. package/dist/lib/grounding/grounding-runtime.js +22 -21
  174. package/dist/lib/grounding/model-usage.js +2 -2
  175. package/dist/lib/grounding/model.js +7 -5
  176. package/dist/lib/grounding/recorded-tools.js +9 -9
  177. package/dist/lib/harness/report/artifacts.js +5 -5
  178. package/dist/lib/lib/checkpoint.js +5 -5
  179. package/dist/lib/lib/log.js +1 -1
  180. package/dist/lib/models/accounting.js +1 -1
  181. package/dist/lib/models/batching.js +6 -4
  182. package/dist/lib/models/budget-protection.js +1 -1
  183. package/dist/lib/models/cost-coefficients.js +2 -1
  184. package/dist/lib/models/gateway-cost.js +7 -0
  185. package/dist/lib/models/structured.js +5 -3
  186. package/dist/lib/models/supported-models.js +1 -1
  187. package/dist/lib/pipeline.js +36 -17
  188. package/dist/lib/probes/adapter.js +6 -0
  189. package/dist/lib/probes/adapters/cli-agents.js +44 -0
  190. package/dist/lib/probes/adapters/cli-claude-code.js +21 -0
  191. package/dist/lib/probes/adapters/cli-codex.js +23 -0
  192. package/dist/lib/probes/adapters/cli-cursor.js +21 -0
  193. package/dist/lib/probes/adapters/cli-process.js +34 -0
  194. package/dist/lib/probes/adapters/dataforseo-ai-overview.js +20 -0
  195. package/dist/lib/probes/adapters/gateway-chat.js +30 -0
  196. package/dist/lib/probes/adapters/gateway-perplexity.js +19 -0
  197. package/dist/lib/probes/agent-cli-parsers.js +2 -2
  198. package/dist/lib/probes/agent-clis.js +26 -11
  199. package/dist/lib/probes/answer-text.js +21 -0
  200. package/dist/lib/probes/attempt.js +28 -0
  201. package/dist/lib/probes/bindings.js +69 -0
  202. package/dist/lib/probes/charged-trace.js +47 -3
  203. package/dist/lib/probes/dataforseo-locale.js +1 -1
  204. package/dist/lib/probes/dataforseo.js +8 -5
  205. package/dist/lib/probes/grounding-urls.js +6 -4
  206. package/dist/lib/probes/legacy-bindings.js +7 -0
  207. package/dist/lib/probes/limits.js +1 -1
  208. package/dist/lib/probes/probes.js +33 -12
  209. package/dist/lib/runner.js +17 -14
  210. package/dist/lib/schema.js +4 -4
  211. package/dist/lib/section-result.js +6 -6
  212. package/dist/lib/stores/artifacts.js +7 -7
  213. package/dist/lib/stores/files.js +19 -17
  214. package/dist/lib/stores/local-versions.js +5 -5
  215. package/dist/lib/stores/memory.js +19 -14
  216. package/dist/lib/stores/publication.js +10 -10
  217. package/dist/lib/stores/unit-record.js +28 -0
  218. package/dist/lib/viewer/server.js +32 -24
  219. package/dist/lib/workflow/schema.js +3 -3
  220. package/dist/types/bundle/contracts.d.ts +1 -1
  221. package/dist/types/capture-manifest.d.ts +1 -0
  222. package/dist/types/codex-workflow/capture.d.ts +13 -0
  223. package/dist/types/codex-workflow/workdir.d.ts +0 -1
  224. package/dist/types/engine/cost-estimate.d.ts +5 -1
  225. package/dist/types/engine/preflight.d.ts +6 -1
  226. package/dist/types/engine/run-bindings.d.ts +25 -0
  227. package/dist/types/models/accounting.d.ts +7 -0
  228. package/dist/types/models/cost-coefficients.d.ts +5 -5
  229. package/dist/types/models/gateway-cost.d.ts +3 -0
  230. package/dist/types/pipeline.d.ts +2 -0
  231. package/dist/types/probes/adapter.d.ts +112 -0
  232. package/dist/types/probes/adapters/cli-agents.d.ts +19 -0
  233. package/dist/types/probes/adapters/cli-claude-code.d.ts +4 -0
  234. package/dist/types/probes/adapters/cli-codex.d.ts +10 -0
  235. package/dist/types/probes/adapters/cli-cursor.d.ts +4 -0
  236. package/dist/types/probes/adapters/cli-process.d.ts +86 -0
  237. package/dist/types/probes/adapters/dataforseo-ai-overview.d.ts +12 -0
  238. package/dist/types/probes/adapters/gateway-chat.d.ts +32 -0
  239. package/dist/types/probes/adapters/gateway-perplexity.d.ts +10 -0
  240. package/dist/types/probes/agent-clis.d.ts +7 -49
  241. package/dist/types/probes/answer-text.d.ts +20 -0
  242. package/dist/types/probes/attempt.d.ts +113 -0
  243. package/dist/types/probes/bindings.d.ts +79 -0
  244. package/dist/types/probes/charged-trace.d.ts +2 -1
  245. package/dist/types/probes/dataforseo.d.ts +24 -1
  246. package/dist/types/probes/grounding-urls.d.ts +18 -5
  247. package/dist/types/probes/legacy-bindings.d.ts +36 -0
  248. package/dist/types/probes/limits.d.ts +12 -6
  249. package/dist/types/probes/probe-trace.d.ts +10 -0
  250. package/dist/types/probes/probes.d.ts +5 -3
  251. package/dist/types/stores/ports.d.ts +1 -0
  252. package/dist/types/stores/unit-record.d.ts +11 -0
  253. package/package.json +6 -6
  254. package/src/analysis/progress.ts +10 -1
  255. package/src/bundle/contracts.ts +1 -1
  256. package/src/bundle/recorder.ts +47 -1
  257. package/src/capture-manifest.ts +6 -0
  258. package/src/cli/run-commands.ts +37 -1
  259. package/src/codex-workflow/capture.ts +60 -0
  260. package/src/codex-workflow/workdir.ts +3 -4
  261. package/src/engine/cost-estimate.ts +10 -4
  262. package/src/engine/local-run.ts +21 -2
  263. package/src/engine/preflight.ts +113 -17
  264. package/src/engine/rejudge.ts +5 -0
  265. package/src/engine/run-bindings.ts +142 -0
  266. package/src/grounding/extract.ts +1 -0
  267. package/src/grounding/model-usage.ts +4 -0
  268. package/src/lib/log.ts +17 -15
  269. package/src/models/accounting.ts +34 -0
  270. package/src/models/budget-protection.ts +1 -0
  271. package/src/models/cost-coefficients.ts +17 -13
  272. package/src/models/gateway-cost.ts +32 -0
  273. package/src/models/structured.ts +2 -10
  274. package/src/models/supported-models.ts +2 -2
  275. package/src/pipeline.ts +36 -17
  276. package/src/probes/adapter.ts +122 -0
  277. package/src/probes/adapters/cli-agents.ts +123 -0
  278. package/src/probes/adapters/cli-claude-code.ts +119 -0
  279. package/src/probes/adapters/cli-codex.ts +145 -0
  280. package/src/probes/adapters/cli-cursor.ts +95 -0
  281. package/src/probes/adapters/cli-process.ts +522 -0
  282. package/src/probes/adapters/dataforseo-ai-overview.ts +106 -0
  283. package/src/probes/adapters/gateway-chat.ts +339 -0
  284. package/src/probes/adapters/gateway-perplexity.ts +104 -0
  285. package/src/probes/agent-clis.ts +151 -1088
  286. package/src/probes/answer-text.ts +153 -0
  287. package/src/probes/attempt.ts +462 -0
  288. package/src/probes/bindings.ts +344 -0
  289. package/src/probes/charged-trace.ts +54 -13
  290. package/src/probes/dataforseo-locale.ts +13 -2
  291. package/src/probes/dataforseo.ts +265 -188
  292. package/src/probes/grounding-urls.ts +68 -19
  293. package/src/probes/legacy-bindings.ts +40 -0
  294. package/src/probes/limits.ts +31 -18
  295. package/src/probes/probe-trace.ts +10 -0
  296. package/src/probes/probes.ts +64 -736
  297. package/src/runner.ts +13 -0
  298. package/src/stores/files.ts +78 -54
  299. package/src/stores/memory.ts +4 -1
  300. package/src/stores/ports.ts +3 -0
  301. package/src/stores/unit-record.ts +151 -0
  302. package/dist/lib/chunks/chunk-BGAHZIL3.js +0 -563
  303. package/dist/lib/chunks/chunk-IB6RROHE.js +0 -204
  304. package/dist/lib/chunks/chunk-WZGI7UVM.js +0 -937
@@ -9,9 +9,9 @@ var levelOrder = {
9
9
  warn: 30,
10
10
  error: 40
11
11
  };
12
- var NO_COLOR = readEnv("NO_COLOR");
13
- var AEO_DEBUG = readEnv("AEO_DEBUG");
14
- var useColor = Boolean(process.stdout.isTTY) && !NO_COLOR;
12
+ var useColor = () => {
13
+ return Boolean(process.stdout.isTTY) && !readEnv("NO_COLOR");
14
+ };
15
15
  var ansi = {
16
16
  reset: "\x1B[0m",
17
17
  dim: "\x1B[2m",
@@ -21,13 +21,13 @@ var ansi = {
21
21
  gray: "\x1B[90m"
22
22
  };
23
23
  var paint = (text, color) => {
24
- return useColor ? `${color}${text}${ansi.reset}` : text;
24
+ return useColor() ? `${color}${text}${ansi.reset}` : text;
25
25
  };
26
26
  var levelTags = {
27
- debug: paint("DEBUG", ansi.gray),
28
- info: paint("INFO ", ansi.cyan),
29
- warn: paint("WARN ", ansi.yellow),
30
- error: paint("ERROR", ansi.red)
27
+ debug: { text: "DEBUG", color: ansi.gray },
28
+ info: { text: "INFO ", color: ansi.cyan },
29
+ warn: { text: "WARN ", color: ansi.yellow },
30
+ error: { text: "ERROR", color: ansi.red }
31
31
  };
32
32
  var formatClockTime = (date) => {
33
33
  return date.toTimeString().slice(0, 8);
@@ -50,12 +50,15 @@ var formatFields = (fields) => {
50
50
  });
51
51
  return ` ${parts.join(" ")}`;
52
52
  };
53
- var consoleMinLevel = AEO_DEBUG ? "debug" : "info";
53
+ var consoleMinLevel = () => {
54
+ return readEnv("AEO_DEBUG") ? "debug" : "info";
55
+ };
54
56
  var emit = ({ level, component, message, fields }) => {
55
- if (levelOrder[level] < levelOrder[consoleMinLevel]) {
57
+ if (levelOrder[level] < levelOrder[consoleMinLevel()]) {
56
58
  return;
57
59
  }
58
- const line = `${paint(formatClockTime(/* @__PURE__ */ new Date()), ansi.dim)} ${levelTags[level]} ${paint(
60
+ const tag = levelTags[level];
61
+ const line = `${paint(formatClockTime(/* @__PURE__ */ new Date()), ansi.dim)} ${paint(tag.text, tag.color)} ${paint(
59
62
  `[${component}]`,
60
63
  ansi.dim
61
64
  )} ${message}${paint(formatFields(fields), ansi.dim)}`;
@@ -0,0 +1,17 @@
1
+ import {
2
+ isObject
3
+ } from "./chunk-7PLK6VGC.js";
4
+
5
+ // src/models/gateway-cost.ts
6
+ var reportedNumber = (value) => {
7
+ const number = typeof value === "string" && value.trim() ? Number(value) : value;
8
+ return typeof number === "number" && Number.isFinite(number) && number >= 0 ? number : void 0;
9
+ };
10
+ var gatewayCostUsd = (providerMetadata) => {
11
+ const cost = isObject(providerMetadata) && isObject(providerMetadata.gateway) ? providerMetadata.gateway.cost : void 0;
12
+ return reportedNumber(cost);
13
+ };
14
+
15
+ export {
16
+ gatewayCostUsd
17
+ };
@@ -4,11 +4,11 @@ import {
4
4
  partition,
5
5
  runStage,
6
6
  stageInputsDigest
7
- } from "./chunk-GLUGYZQO.js";
7
+ } from "./chunk-OTVHGRCO.js";
8
8
  import {
9
9
  finishRun,
10
10
  writeFinished
11
- } from "./chunk-2KH7LNK7.js";
11
+ } from "./chunk-JGIX427K.js";
12
12
  import {
13
13
  stableBatchLayout
14
14
  } from "./chunk-SBQ4TWGJ.js";
@@ -16,7 +16,7 @@ import {
16
16
  copyEditHistory,
17
17
  editCopyDraft,
18
18
  readCopyEdits
19
- } from "./chunk-FJL2V6P5.js";
19
+ } from "./chunk-F4EQULFR.js";
20
20
  import {
21
21
  CopyVerificationUnavailableError
22
22
  } from "./chunk-LTI2YYU3.js";
@@ -29,20 +29,20 @@ import {
29
29
  materializeCopyInputs,
30
30
  readSnapshot,
31
31
  validateCopyDraft
32
- } from "./chunk-3OE4UQIB.js";
32
+ } from "./chunk-WRHGLRUK.js";
33
33
  import {
34
34
  hostModels,
35
35
  pinnedProfileOf
36
- } from "./chunk-FAUFE7MI.js";
36
+ } from "./chunk-D7N5OLYL.js";
37
37
  import {
38
38
  aggregateWorkdir
39
- } from "./chunk-MENTBQGB.js";
39
+ } from "./chunk-4HPMLJKC.js";
40
40
  import {
41
41
  validateStage
42
- } from "./chunk-I3UE52ZV.js";
42
+ } from "./chunk-LPOIMPJK.js";
43
43
  import {
44
44
  materializeWorkdir
45
- } from "./chunk-V5JJEEBT.js";
45
+ } from "./chunk-RYB77E7O.js";
46
46
  import {
47
47
  acquireWriterLock
48
48
  } from "./chunk-6GOBBNDU.js";
@@ -51,30 +51,30 @@ import {
51
51
  } from "./chunk-MX6Y4RD2.js";
52
52
  import {
53
53
  writeRunInputs
54
- } from "./chunk-RXSHKWZJ.js";
54
+ } from "./chunk-HLC6OHGO.js";
55
55
  import {
56
56
  openRecorder,
57
57
  recordingAccounting
58
- } from "./chunk-EOO5RBUW.js";
58
+ } from "./chunk-7ZR3WDF2.js";
59
59
  import {
60
60
  RunOrigin,
61
61
  measurementDigest
62
- } from "./chunk-YEUCAPKP.js";
62
+ } from "./chunk-JJFOILZK.js";
63
63
  import {
64
64
  capturePlan
65
- } from "./chunk-F2NSJ6PG.js";
65
+ } from "./chunk-6RED3G6K.js";
66
66
  import {
67
67
  verdictSchemaFor
68
- } from "./chunk-7HM6IZ3L.js";
68
+ } from "./chunk-CVEXMYPW.js";
69
69
  import {
70
70
  classifyVerifierFailure
71
- } from "./chunk-LR27H2HZ.js";
72
- import {
73
- isObject
74
- } from "./chunk-7PLK6VGC.js";
71
+ } from "./chunk-44NSZBCP.js";
75
72
  import {
76
73
  structuredFailureDiagnostic
77
74
  } from "./chunk-NANJGMEJ.js";
75
+ import {
76
+ isObject
77
+ } from "./chunk-7PLK6VGC.js";
78
78
  import {
79
79
  GroundingIntegrityError
80
80
  } from "./chunk-KQCRJIEG.js";
@@ -83,7 +83,7 @@ import {
83
83
  } from "./chunk-H2KDLDK6.js";
84
84
  import {
85
85
  ModelBudgetError
86
- } from "./chunk-TNL2GWYR.js";
86
+ } from "./chunk-EUXNCXCR.js";
87
87
  import {
88
88
  aeoSnapshotSchema,
89
89
  maxReviewRounds
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  generateStructured,
3
3
  structuredCallReservation
4
- } from "./chunk-OD36HUXA.js";
4
+ } from "./chunk-Q22FCF4A.js";
5
5
  import {
6
6
  InvalidReviewError
7
- } from "./chunk-LR27H2HZ.js";
7
+ } from "./chunk-44NSZBCP.js";
8
8
 
9
9
  // src/agents/verifier.ts
10
10
  import { z } from "zod";
@@ -0,0 +1,95 @@
1
+ import {
2
+ attachCliOutput,
3
+ authSettingNames,
4
+ execCli,
5
+ withScratchDir
6
+ } from "./chunk-QKTKQSPS.js";
7
+ import {
8
+ parseClaudeCodeStream
9
+ } from "./chunk-SF4UJ2AY.js";
10
+ import {
11
+ childEnv
12
+ } from "./chunk-7QYZSP7Q.js";
13
+ import {
14
+ probeUsd
15
+ } from "./chunk-U42I3SBR.js";
16
+ import {
17
+ ProbeAdapterId
18
+ } from "./chunk-KSUI4DAY.js";
19
+
20
+ // src/probes/adapters/cli-claude-code.ts
21
+ import { writeFile } from "node:fs/promises";
22
+ import path from "node:path";
23
+ var claudeCodeProfile = {
24
+ id: ProbeAdapterId.CLI_CLAUDE_CODE,
25
+ observes: { retrieval: "full", servedModel: "raw" },
26
+ settings: [
27
+ { name: "CLAUDE_CODE_OAUTH_TOKEN", secret: true, group: "auth" },
28
+ {
29
+ name: "ANTHROPIC_API_KEY",
30
+ secret: true,
31
+ group: "auth",
32
+ billsAccount: "Anthropic"
33
+ }
34
+ ],
35
+ pool: "claude_code",
36
+ retry: "agent",
37
+ estimateUsd: probeUsd[ProbeAdapterId.CLI_CLAUDE_CODE],
38
+ billing: "subscription",
39
+ resolvesRedirects: false
40
+ };
41
+ var claudeEnvKeys = [
42
+ ...authSettingNames(claudeCodeProfile),
43
+ "CLAUDE_CONFIG_DIR"
44
+ ];
45
+ var runClaudeCodeProbe = async (promptText, runtime, signal) => {
46
+ return withScratchDir(runtime, "claude_code", async (dir) => {
47
+ const settingsPath = path.join(dir, "probe-settings.json");
48
+ await writeFile(
49
+ settingsPath,
50
+ JSON.stringify({
51
+ permissions: {
52
+ // Bare tool names allow every use of the tool — the documented rule
53
+ // form ('WebFetch(*)' is not valid rule syntax and would leave
54
+ // fetches auto-denied in headless mode; the parser now turns that
55
+ // denial into a loud rejected-tool failure).
56
+ allow: ["WebSearch", "WebFetch"],
57
+ deny: ["Bash", "Read", "Edit", "Write"]
58
+ }
59
+ }),
60
+ "utf8"
61
+ );
62
+ const output = await execCli("claude", {
63
+ cliArgs: [
64
+ "-p",
65
+ promptText,
66
+ "--output-format",
67
+ "stream-json",
68
+ "--verbose",
69
+ "--settings",
70
+ settingsPath,
71
+ "--strict-mcp-config",
72
+ "--setting-sources",
73
+ "project"
74
+ ],
75
+ cwd: dir,
76
+ runtime,
77
+ env: childEnv(
78
+ runtime.env,
79
+ claudeEnvKeys,
80
+ runtime.claudeConfigDir ? { CLAUDE_CONFIG_DIR: runtime.claudeConfigDir } : {}
81
+ ),
82
+ signal
83
+ });
84
+ try {
85
+ return parseClaudeCodeStream(output.stdout);
86
+ } catch (error) {
87
+ throw attachCliOutput(error, output);
88
+ }
89
+ });
90
+ };
91
+
92
+ export {
93
+ claudeCodeProfile,
94
+ runClaudeCodeProbe
95
+ };
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-K7YFL5KB.js";
5
5
  import {
6
6
  createLog
7
- } from "./chunk-ZSEY7AHQ.js";
7
+ } from "./chunk-BBK54RVK.js";
8
8
  import {
9
9
  describeSiteError
10
10
  } from "./chunk-ESEMYWUH.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createMemoryModelAccounting
3
- } from "./chunk-TNL2GWYR.js";
3
+ } from "./chunk-EUXNCXCR.js";
4
4
 
5
5
  // src/codex-workflow/host-models.ts
6
6
  var hostStepMaxUsd = 5;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createLog
3
- } from "./chunk-ZSEY7AHQ.js";
3
+ } from "./chunk-BBK54RVK.js";
4
4
  import {
5
5
  describeSiteError
6
6
  } from "./chunk-ESEMYWUH.js";
@@ -138,6 +138,17 @@ var settleCall = (state, { callId, usage }) => {
138
138
  const settled = { ...state, calls: next.calls };
139
139
  return settled;
140
140
  };
141
+ var releaseCall = (state, callId) => {
142
+ const call = state.calls[callId];
143
+ if (!call) {
144
+ throw new ModelBudgetError("Model call was not reserved");
145
+ }
146
+ if (call.usage) {
147
+ throw new ModelBudgetError("A settled model call cannot be released");
148
+ }
149
+ const { [callId]: _released, ...calls } = state.calls;
150
+ return { ...state, calls };
151
+ };
141
152
  var runAsPromise = (work) => {
142
153
  return new Promise((resolve) => {
143
154
  work();
@@ -159,6 +170,11 @@ var createMemoryModelAccounting = (limits, now = () => Date.now()) => {
159
170
  return runAsPromise(() => {
160
171
  state.calls = settleCall(state, { callId, usage }).calls;
161
172
  });
173
+ },
174
+ release: (callId) => {
175
+ return runAsPromise(() => {
176
+ state.calls = releaseCall(state, callId).calls;
177
+ });
162
178
  }
163
179
  };
164
180
  return accounting;
@@ -247,6 +263,9 @@ var createFileModelAccounting = (args) => {
247
263
  },
248
264
  settle: async (callId, usage) => {
249
265
  await update((state) => settleCall(state, { callId, usage }));
266
+ },
267
+ release: async (callId) => {
268
+ await update((state) => releaseCall(state, callId));
250
269
  }
251
270
  };
252
271
  return accounting;
@@ -328,6 +347,9 @@ var createPostgresModelAccounting = (args) => {
328
347
  },
329
348
  settle: async (callId, usage) => {
330
349
  await update((state) => settleCall(state, { callId, usage }));
350
+ },
351
+ release: async (callId) => {
352
+ await update((state) => releaseCall(state, callId));
331
353
  }
332
354
  };
333
355
  return accounting;
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  copywriterFiles
3
- } from "./chunk-3OE4UQIB.js";
3
+ } from "./chunk-WRHGLRUK.js";
4
4
  import {
5
5
  writePendingJson
6
6
  } from "./chunk-MX6Y4RD2.js";
7
7
  import {
8
8
  writeOutputSchema
9
- } from "./chunk-SIJOQRRK.js";
9
+ } from "./chunk-KRXOJJR7.js";
10
10
  import {
11
11
  premiseVerifierInstructions
12
- } from "./chunk-7HM6IZ3L.js";
12
+ } from "./chunk-CVEXMYPW.js";
13
13
  import {
14
14
  generateStructured,
15
15
  structuredCallReservation
16
- } from "./chunk-OD36HUXA.js";
16
+ } from "./chunk-Q22FCF4A.js";
17
17
  import {
18
18
  narrativeContextFactIds
19
- } from "./chunk-LR27H2HZ.js";
19
+ } from "./chunk-44NSZBCP.js";
20
20
  import {
21
21
  buildFactCatalog,
22
22
  projectWriterFactCatalog
23
- } from "./chunk-66T7JC57.js";
23
+ } from "./chunk-LUKP64NX.js";
24
24
  import {
25
25
  contentHash
26
26
  } from "./chunk-H2KDLDK6.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-QTXOW5XC.js";
4
4
  import {
5
5
  runsPerPromptOn
6
- } from "./chunk-DL6YQDTE.js";
6
+ } from "./chunk-LOIAGEKN.js";
7
7
 
8
8
  // src/analysis/scoring.ts
9
9
  var computeAISearchSummary = (args) => {
@@ -1,11 +1,11 @@
1
+ import {
2
+ proposedAssessmentSchema
3
+ } from "./chunk-HXXFRZTJ.js";
1
4
  import {
2
5
  ResearchLimitError,
3
6
  ResearchOwnershipError,
4
7
  researchCallCharge
5
8
  } from "./chunk-46PVVQYR.js";
6
- import {
7
- proposedAssessmentSchema
8
- } from "./chunk-6HMHXSCS.js";
9
9
  import {
10
10
  researchActionSchema,
11
11
  researchToolResultSchema
@@ -27,7 +27,7 @@ import {
27
27
  } from "./chunk-H2KDLDK6.js";
28
28
  import {
29
29
  ModelBudgetError
30
- } from "./chunk-TNL2GWYR.js";
30
+ } from "./chunk-EUXNCXCR.js";
31
31
  import {
32
32
  adjudicationVersion,
33
33
  claimCandidateSchema,
@@ -28,7 +28,7 @@ var supportedModels = [
28
28
  id: "anthropic/claude-opus-5.5",
29
29
  label: "Claude Opus 5.5",
30
30
  pricingUsdPerMillion: { input: 4, output: 20, cachedInput: 0.2 },
31
- pricingCheckedAt: "2026-11-08",
31
+ pricingCheckedAt: "2026-11-09",
32
32
  contextWindow: 1e6,
33
33
  maxOutputTokens: 128e3,
34
34
  thinkingInOutput: true,
@@ -40,7 +40,7 @@ var supportedModels = [
40
40
  id: "anthropic/claude-sonnet-5.5",
41
41
  label: "Claude Sonnet 5.5",
42
42
  pricingUsdPerMillion: { input: 2, output: 10, cachedInput: 0.1 },
43
- pricingCheckedAt: "2026-11-08",
43
+ pricingCheckedAt: "2026-11-09",
44
44
  contextWindow: 1e6,
45
45
  maxOutputTokens: 128e3,
46
46
  thinkingInOutput: true,
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-ZXQPD4OC.js";
4
4
  import {
5
5
  verifyBundle
6
- } from "./chunk-T6XZQOXS.js";
6
+ } from "./chunk-QVMPTT7R.js";
7
7
  import {
8
8
  RunOrigin,
9
9
  toolVersion
10
- } from "./chunk-YEUCAPKP.js";
10
+ } from "./chunk-JJFOILZK.js";
11
11
  import {
12
12
  parseBundleJson
13
13
  } from "./chunk-E6NQQU6V.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readFinalizedRevisions
3
- } from "./chunk-PIF3GL62.js";
3
+ } from "./chunk-UECQONVZ.js";
4
4
  import {
5
5
  BundleRefusedError,
6
6
  archiveLimits,
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-2QLAFBCG.js";
15
15
  import {
16
16
  bundlePaths
17
- } from "./chunk-YEUCAPKP.js";
17
+ } from "./chunk-JJFOILZK.js";
18
18
 
19
19
  // src/bundle/read.ts
20
20
  import { lstat, readdir, readFile } from "node:fs/promises";
@@ -11,13 +11,13 @@ import {
11
11
  import {
12
12
  assertPublishable,
13
13
  sameTriple
14
- } from "./chunk-7WO3FFPS.js";
14
+ } from "./chunk-K5NQDJLE.js";
15
15
  import {
16
16
  validateReportArtifacts
17
- } from "./chunk-U5USH2HB.js";
17
+ } from "./chunk-PAL5SXIP.js";
18
18
  import {
19
19
  openFileVersionStores
20
- } from "./chunk-7CW6U5WJ.js";
20
+ } from "./chunk-JIE2ANVD.js";
21
21
  import {
22
22
  aeoCheckpointDir,
23
23
  aeoContentDir
@@ -25,6 +25,10 @@ import {
25
25
  import {
26
26
  StoreConflictError
27
27
  } from "./chunk-FWBVTM7F.js";
28
+ import {
29
+ ProbeStoreIntegrityError,
30
+ parseUnitRecord
31
+ } from "./chunk-6N3C6E3D.js";
28
32
  import {
29
33
  UnitConflictError
30
34
  } from "./chunk-C6CMSW5J.js";
@@ -33,10 +37,10 @@ import {
33
37
  } from "./chunk-2QLAFBCG.js";
34
38
  import {
35
39
  projectProgressMeasurement
36
- } from "./chunk-R5UPOEWE.js";
40
+ } from "./chunk-HYMWNGOK.js";
37
41
  import {
38
42
  createLog
39
- } from "./chunk-ZSEY7AHQ.js";
43
+ } from "./chunk-BBK54RVK.js";
40
44
  import {
41
45
  domainLabelsFile,
42
46
  domainLabelsFileSchema
@@ -44,13 +48,13 @@ import {
44
48
  import {
45
49
  entryMatches,
46
50
  unitRecordKey
47
- } from "./chunk-7YDXD4MD.js";
51
+ } from "./chunk-ODIXZHHX.js";
48
52
  import {
49
53
  contentHash
50
54
  } from "./chunk-H2KDLDK6.js";
51
55
  import {
52
56
  aeoAuditConfigSchema
53
- } from "./chunk-DL6YQDTE.js";
57
+ } from "./chunk-LOIAGEKN.js";
54
58
  import {
55
59
  evaluateRunClaim,
56
60
  isTerminalRun,
@@ -73,6 +77,7 @@ import {
73
77
  mkdtemp,
74
78
  open,
75
79
  readFile,
80
+ truncate,
76
81
  readdir,
77
82
  rename,
78
83
  rm,
@@ -103,8 +108,13 @@ var readJsonl = async (filePath) => {
103
108
  var JsonlFile = class {
104
109
  filePath;
105
110
  #queue = Promise.resolve();
106
- constructor(filePath) {
111
+ // Where an unterminated last line starts: cut before the first append, so
112
+ // the append starts a line of its own instead of joining the torn bytes
113
+ // into a row no reader can parse. A reader never changes the file.
114
+ #tornTailAt;
115
+ constructor(filePath, { tornTailAt } = {}) {
107
116
  this.filePath = filePath;
117
+ this.#tornTailAt = tornTailAt;
108
118
  }
109
119
  append(line) {
110
120
  return this.#write(`${line}
@@ -119,6 +129,10 @@ var JsonlFile = class {
119
129
  const directory = path.dirname(this.filePath);
120
130
  await mkdir(directory, { recursive: true, mode: 448 });
121
131
  await chmod(directory, 448);
132
+ if (this.#tornTailAt !== void 0 && flag === "a") {
133
+ await truncate(this.filePath, this.#tornTailAt);
134
+ }
135
+ this.#tornTailAt = void 0;
122
136
  const file = await open(this.filePath, flag, 384);
123
137
  try {
124
138
  await file.chmod(384);
@@ -131,32 +145,43 @@ var JsonlFile = class {
131
145
  return write;
132
146
  }
133
147
  };
134
- var hasUnitKey = (row) => {
135
- return "sectionKey" in row && typeof row.sectionKey === "string" && "promptId" in row && typeof row.promptId === "string" && "promptText" in row && typeof row.promptText === "string" && "surface" in row && typeof row.surface === "string" && "runIndex" in row && typeof row.runIndex === "number";
136
- };
137
- var isFailedUnitLine = (row) => {
138
- return "status" in row && row.status === "failed";
139
- };
140
- var isCapturedUnitLine = (row) => {
141
- return "probe" in row && Boolean(row.probe) && "capturedAt" in row && typeof row.capturedAt === "string";
142
- };
143
- var parseUnitRecord = (row) => {
144
- if (!row || typeof row !== "object" || !hasUnitKey(row)) {
145
- return null;
146
- }
147
- if (isFailedUnitLine(row)) {
148
- return row;
149
- }
150
- if (isCapturedUnitLine(row)) {
151
- return { ...row, status: "captured" };
148
+ var readUnitRecords = async (filePath) => {
149
+ const raw = await readFile(filePath, "utf8").catch((err) => {
150
+ if (hasErrorCode(err, "ENOENT")) {
151
+ return "";
152
+ }
153
+ throw err;
154
+ });
155
+ const lines = raw.split("\n");
156
+ const records = [];
157
+ let tornTailAt;
158
+ for (const [index, line] of lines.entries()) {
159
+ if (!line.trim()) {
160
+ continue;
161
+ }
162
+ const where = `${filePath}:${index + 1}`;
163
+ let row;
164
+ try {
165
+ row = JSON.parse(line);
166
+ } catch {
167
+ if (index === lines.length - 1) {
168
+ log.warn("Cut an unterminated last probe store line", { where });
169
+ tornTailAt = Buffer.byteLength(raw) - Buffer.byteLength(line);
170
+ continue;
171
+ }
172
+ throw new ProbeStoreIntegrityError(
173
+ `Probe store row ${where} is not JSON. Please repair or remove the row; the run stops rather than probe a banked unit again.`
174
+ );
175
+ }
176
+ records.push(parseUnitRecord(row, where));
152
177
  }
153
- return null;
178
+ return { records, tornTailAt };
154
179
  };
155
180
  var FileProbeStore = class _FileProbeStore {
156
181
  #file;
157
182
  #records;
158
- constructor(filePath, records) {
159
- this.#file = new JsonlFile(filePath);
183
+ constructor(filePath, records, tornTailAt) {
184
+ this.#file = new JsonlFile(filePath, { tornTailAt });
160
185
  this.#records = records;
161
186
  }
162
187
  static async open(reportKey, opts = {}) {
@@ -165,13 +190,11 @@ var FileProbeStore = class _FileProbeStore {
165
190
  `${reportKey}.jsonl`
166
191
  );
167
192
  const records = /* @__PURE__ */ new Map();
168
- for (const row of await readJsonl(filePath)) {
169
- const record = parseUnitRecord(row);
170
- if (record) {
171
- records.set(unitRecordKey(record), record);
172
- }
193
+ const { records: read, tornTailAt } = await readUnitRecords(filePath);
194
+ for (const record of read) {
195
+ records.set(unitRecordKey(record), record);
173
196
  }
174
- return new _FileProbeStore(filePath, records);
197
+ return new _FileProbeStore(filePath, records, tornTailAt);
175
198
  }
176
199
  get size() {
177
200
  return this.#records.size;
@@ -189,7 +212,16 @@ var FileProbeStore = class _FileProbeStore {
189
212
  return;
190
213
  }
191
214
  this.#records.set(key, record);
192
- await this.#file.append(JSON.stringify(record));
215
+ try {
216
+ await this.#file.append(JSON.stringify(record));
217
+ } catch (error) {
218
+ if (existing) {
219
+ this.#records.set(key, existing);
220
+ } else {
221
+ this.#records.delete(key);
222
+ }
223
+ throw error;
224
+ }
193
225
  }
194
226
  async invalidate(match) {
195
227
  let removed = 0;
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-2QLAFBCG.js";
4
4
  import {
5
5
  captureArtifactSchema
6
- } from "./chunk-JKPBXPCW.js";
6
+ } from "./chunk-IMADI2YP.js";
7
7
  import {
8
8
  aeoAuditConfigSchema,
9
9
  runRequestSchema
10
- } from "./chunk-DL6YQDTE.js";
10
+ } from "./chunk-LOIAGEKN.js";
11
11
  import {
12
12
  aeoSurfaceSchema
13
13
  } from "./chunk-EDQTINTL.js";