@browserbasehq/orca 3.5.0-vertex-test → 3.6.0-gemini-cua

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 (290) hide show
  1. package/README.md +7 -15
  2. package/dist/cjs/lib/utils.d.ts +8 -0
  3. package/dist/cjs/lib/utils.js +31 -0
  4. package/dist/cjs/lib/utils.js.map +1 -1
  5. package/dist/cjs/lib/v3/agent/AgentProvider.js +5 -3
  6. package/dist/cjs/lib/v3/agent/AgentProvider.js.map +1 -1
  7. package/dist/cjs/lib/v3/agent/AnthropicCUAClient.js +10 -8
  8. package/dist/cjs/lib/v3/agent/AnthropicCUAClient.js.map +1 -1
  9. package/dist/cjs/lib/v3/agent/GoogleCUAClient.js +124 -28
  10. package/dist/cjs/lib/v3/agent/GoogleCUAClient.js.map +1 -1
  11. package/dist/cjs/lib/v3/agent/utils/captureAriaTreeProbe.d.ts +35 -0
  12. package/dist/cjs/lib/v3/agent/utils/captureAriaTreeProbe.js +38 -0
  13. package/dist/cjs/lib/v3/agent/utils/captureAriaTreeProbe.js.map +1 -0
  14. package/dist/cjs/lib/v3/agent/utils/handleDoneToolCall.js +10 -1
  15. package/dist/cjs/lib/v3/agent/utils/handleDoneToolCall.js.map +1 -1
  16. package/dist/cjs/lib/v3/agent/utils/postStepProbeEvidence.d.ts +19 -0
  17. package/dist/cjs/lib/v3/agent/utils/postStepProbeEvidence.js +54 -0
  18. package/dist/cjs/lib/v3/agent/utils/postStepProbeEvidence.js.map +1 -0
  19. package/dist/cjs/lib/v3/agent/utils/toolOutputEvidence.d.ts +2 -0
  20. package/dist/cjs/lib/v3/agent/utils/toolOutputEvidence.js +62 -0
  21. package/dist/cjs/lib/v3/agent/utils/toolOutputEvidence.js.map +1 -0
  22. package/dist/cjs/lib/v3/agent/utils/wrapEvidenceCallback.d.ts +3 -0
  23. package/dist/cjs/lib/v3/agent/utils/wrapEvidenceCallback.js +25 -0
  24. package/dist/cjs/lib/v3/agent/utils/wrapEvidenceCallback.js.map +1 -0
  25. package/dist/cjs/lib/v3/api.d.ts +1 -0
  26. package/dist/cjs/lib/v3/api.js +37 -16
  27. package/dist/cjs/lib/v3/api.js.map +1 -1
  28. package/dist/cjs/lib/v3/cache/ActCache.js +1 -1
  29. package/dist/cjs/lib/v3/cache/ActCache.js.map +1 -1
  30. package/dist/cjs/lib/v3/cache/utils.d.ts +7 -0
  31. package/dist/cjs/lib/v3/cache/utils.js +19 -0
  32. package/dist/cjs/lib/v3/cache/utils.js.map +1 -1
  33. package/dist/cjs/lib/v3/dom/build/locatorScripts.generated.d.ts +24 -24
  34. package/dist/cjs/lib/v3/dom/build/locatorScripts.generated.js +24 -24
  35. package/dist/cjs/lib/v3/dom/build/locatorScripts.generated.js.map +1 -1
  36. package/dist/cjs/lib/v3/dom/locatorScripts/xpathResolver.js +79 -10
  37. package/dist/cjs/lib/v3/dom/locatorScripts/xpathResolver.js.map +1 -1
  38. package/dist/cjs/lib/v3/handlers/v3AgentHandler.d.ts +3 -1
  39. package/dist/cjs/lib/v3/handlers/v3AgentHandler.js +108 -16
  40. package/dist/cjs/lib/v3/handlers/v3AgentHandler.js.map +1 -1
  41. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.d.ts +11 -0
  42. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js +119 -5
  43. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -1
  44. package/dist/cjs/lib/v3/index.d.ts +13 -1
  45. package/dist/cjs/lib/v3/index.js +19 -1
  46. package/dist/cjs/lib/v3/index.js.map +1 -1
  47. package/dist/cjs/lib/v3/launch/local.js +1 -0
  48. package/dist/cjs/lib/v3/launch/local.js.map +1 -1
  49. package/dist/cjs/lib/v3/llm/LLMProvider.d.ts +3 -0
  50. package/dist/cjs/lib/v3/llm/LLMProvider.js +45 -3
  51. package/dist/cjs/lib/v3/llm/LLMProvider.js.map +1 -1
  52. package/dist/cjs/lib/v3/llm/aisdk.js +4 -0
  53. package/dist/cjs/lib/v3/llm/aisdk.js.map +1 -1
  54. package/dist/cjs/lib/v3/llm/anthropicOptions.d.ts +57 -0
  55. package/dist/cjs/lib/v3/llm/anthropicOptions.js +115 -0
  56. package/dist/cjs/lib/v3/llm/anthropicOptions.js.map +1 -0
  57. package/dist/cjs/lib/v3/types/public/agent.d.ts +8 -2
  58. package/dist/cjs/lib/v3/types/public/agent.js +3 -0
  59. package/dist/cjs/lib/v3/types/public/agent.js.map +1 -1
  60. package/dist/cjs/lib/v3/types/public/agentEvidenceEvents.d.ts +85 -0
  61. package/dist/cjs/lib/v3/types/public/agentEvidenceEvents.js +15 -0
  62. package/dist/cjs/lib/v3/types/public/agentEvidenceEvents.js.map +1 -0
  63. package/dist/cjs/lib/v3/types/public/api.d.ts +925 -182
  64. package/dist/cjs/lib/v3/types/public/api.js +138 -20
  65. package/dist/cjs/lib/v3/types/public/api.js.map +1 -1
  66. package/dist/cjs/lib/v3/types/public/clipboard.d.ts +15 -0
  67. package/dist/cjs/lib/v3/types/public/clipboard.js +3 -0
  68. package/dist/cjs/lib/v3/types/public/clipboard.js.map +1 -0
  69. package/dist/cjs/lib/v3/types/public/index.d.ts +2 -0
  70. package/dist/cjs/lib/v3/types/public/index.js +2 -0
  71. package/dist/cjs/lib/v3/types/public/index.js.map +1 -1
  72. package/dist/cjs/lib/v3/types/public/model.d.ts +33 -8
  73. package/dist/cjs/lib/v3/types/public/model.js.map +1 -1
  74. package/dist/cjs/lib/v3/types/public/page.d.ts +29 -0
  75. package/dist/cjs/lib/v3/types/public/page.js.map +1 -1
  76. package/dist/cjs/lib/v3/types/public/sdkErrors.d.ts +3 -0
  77. package/dist/cjs/lib/v3/types/public/sdkErrors.js +8 -2
  78. package/dist/cjs/lib/v3/types/public/sdkErrors.js.map +1 -1
  79. package/dist/cjs/lib/v3/understudy/clipboard.d.ts +24 -0
  80. package/dist/cjs/lib/v3/understudy/clipboard.js +166 -0
  81. package/dist/cjs/lib/v3/understudy/clipboard.js.map +1 -0
  82. package/dist/cjs/lib/v3/understudy/context.d.ts +3 -0
  83. package/dist/cjs/lib/v3/understudy/context.js +15 -0
  84. package/dist/cjs/lib/v3/understudy/context.js.map +1 -1
  85. package/dist/cjs/lib/v3/understudy/page.d.ts +23 -1
  86. package/dist/cjs/lib/v3/understudy/page.js +283 -0
  87. package/dist/cjs/lib/v3/understudy/page.js.map +1 -1
  88. package/dist/cjs/lib/v3/v3.js +19 -7
  89. package/dist/cjs/lib/v3/v3.js.map +1 -1
  90. package/dist/cjs/lib/v3/verifier/errorTaxonomy.d.ts +35 -0
  91. package/dist/cjs/lib/v3/verifier/errorTaxonomy.js +291 -0
  92. package/dist/cjs/lib/v3/verifier/errorTaxonomy.js.map +1 -0
  93. package/dist/cjs/lib/v3/verifier/evidence.d.ts +44 -0
  94. package/dist/cjs/lib/v3/verifier/evidence.js +432 -0
  95. package/dist/cjs/lib/v3/verifier/evidence.js.map +1 -0
  96. package/dist/cjs/lib/v3/verifier/evidenceNormalization.d.ts +7 -0
  97. package/dist/cjs/lib/v3/verifier/evidenceNormalization.js +100 -0
  98. package/dist/cjs/lib/v3/verifier/evidenceNormalization.js.map +1 -0
  99. package/dist/cjs/lib/v3/verifier/index.d.ts +6 -0
  100. package/dist/cjs/lib/v3/verifier/index.js +16 -0
  101. package/dist/cjs/lib/v3/verifier/index.js.map +1 -0
  102. package/dist/cjs/lib/v3/verifier/prompts/batchedRelevance.d.ts +21 -0
  103. package/dist/cjs/lib/v3/verifier/prompts/batchedRelevance.js +71 -0
  104. package/dist/cjs/lib/v3/verifier/prompts/batchedRelevance.js.map +1 -0
  105. package/dist/cjs/lib/v3/verifier/prompts/firstPointOfFailure.d.ts +3 -0
  106. package/dist/cjs/lib/v3/verifier/prompts/firstPointOfFailure.js +166 -0
  107. package/dist/cjs/lib/v3/verifier/prompts/firstPointOfFailure.js.map +1 -0
  108. package/dist/cjs/lib/v3/verifier/prompts/fusedJudgment.d.ts +35 -0
  109. package/dist/cjs/lib/v3/verifier/prompts/fusedJudgment.js +158 -0
  110. package/dist/cjs/lib/v3/verifier/prompts/fusedJudgment.js.map +1 -0
  111. package/dist/cjs/lib/v3/verifier/prompts/fusedOutcome.d.ts +26 -0
  112. package/dist/cjs/lib/v3/verifier/prompts/fusedOutcome.js +137 -0
  113. package/dist/cjs/lib/v3/verifier/prompts/fusedOutcome.js.map +1 -0
  114. package/dist/cjs/lib/v3/verifier/prompts/index.d.ts +8 -0
  115. package/dist/cjs/lib/v3/verifier/prompts/index.js +22 -0
  116. package/dist/cjs/lib/v3/verifier/prompts/index.js.map +1 -0
  117. package/dist/cjs/lib/v3/verifier/prompts/perCriterionScore.d.ts +23 -0
  118. package/dist/cjs/lib/v3/verifier/prompts/perCriterionScore.js +77 -0
  119. package/dist/cjs/lib/v3/verifier/prompts/perCriterionScore.js.map +1 -0
  120. package/dist/cjs/lib/v3/verifier/prompts/render.d.ts +23 -0
  121. package/dist/cjs/lib/v3/verifier/prompts/render.js +45 -0
  122. package/dist/cjs/lib/v3/verifier/prompts/render.js.map +1 -0
  123. package/dist/cjs/lib/v3/verifier/prompts/rubricGeneration.d.ts +16 -0
  124. package/dist/cjs/lib/v3/verifier/prompts/rubricGeneration.js +321 -0
  125. package/dist/cjs/lib/v3/verifier/prompts/rubricGeneration.js.map +1 -0
  126. package/dist/cjs/lib/v3/verifier/prompts/taskValidity.d.ts +1 -0
  127. package/dist/cjs/lib/v3/verifier/prompts/taskValidity.js +116 -0
  128. package/dist/cjs/lib/v3/verifier/prompts/taskValidity.js.map +1 -0
  129. package/dist/cjs/lib/v3/verifier/rubricVerifier.d.ts +91 -0
  130. package/dist/cjs/lib/v3/verifier/rubricVerifier.js +1645 -0
  131. package/dist/cjs/lib/v3/verifier/rubricVerifier.js.map +1 -0
  132. package/dist/cjs/lib/v3/verifier/trajectory.d.ts +50 -0
  133. package/dist/cjs/lib/v3/verifier/trajectory.js +316 -0
  134. package/dist/cjs/lib/v3/verifier/trajectory.js.map +1 -0
  135. package/dist/cjs/lib/v3/verifier/types.d.ts +429 -0
  136. package/dist/cjs/lib/v3/verifier/types.js +3 -0
  137. package/dist/cjs/lib/v3/verifier/types.js.map +1 -0
  138. package/dist/cjs/lib/v3Evaluator.d.ts +14 -4
  139. package/dist/cjs/lib/v3Evaluator.js +189 -1
  140. package/dist/cjs/lib/v3Evaluator.js.map +1 -1
  141. package/dist/cjs/lib/v3LegacyEvaluator.js +5 -1
  142. package/dist/cjs/lib/v3LegacyEvaluator.js.map +1 -1
  143. package/dist/cjs/lib/version.d.ts +1 -1
  144. package/dist/cjs/lib/version.js +1 -1
  145. package/dist/cjs/lib/version.js.map +1 -1
  146. package/dist/esm/lib/utils.d.ts +8 -0
  147. package/dist/esm/lib/utils.js +28 -0
  148. package/dist/esm/lib/utils.js.map +1 -1
  149. package/dist/esm/lib/v3/agent/AgentProvider.js +5 -3
  150. package/dist/esm/lib/v3/agent/AgentProvider.js.map +1 -1
  151. package/dist/esm/lib/v3/agent/AnthropicCUAClient.js +10 -8
  152. package/dist/esm/lib/v3/agent/AnthropicCUAClient.js.map +1 -1
  153. package/dist/esm/lib/v3/agent/GoogleCUAClient.js +124 -28
  154. package/dist/esm/lib/v3/agent/GoogleCUAClient.js.map +1 -1
  155. package/dist/esm/lib/v3/agent/utils/captureAriaTreeProbe.d.ts +35 -0
  156. package/dist/esm/lib/v3/agent/utils/captureAriaTreeProbe.js +35 -0
  157. package/dist/esm/lib/v3/agent/utils/captureAriaTreeProbe.js.map +1 -0
  158. package/dist/esm/lib/v3/agent/utils/handleDoneToolCall.js +10 -1
  159. package/dist/esm/lib/v3/agent/utils/handleDoneToolCall.js.map +1 -1
  160. package/dist/esm/lib/v3/agent/utils/postStepProbeEvidence.d.ts +19 -0
  161. package/dist/esm/lib/v3/agent/utils/postStepProbeEvidence.js +50 -0
  162. package/dist/esm/lib/v3/agent/utils/postStepProbeEvidence.js.map +1 -0
  163. package/dist/esm/lib/v3/agent/utils/toolOutputEvidence.d.ts +2 -0
  164. package/dist/esm/lib/v3/agent/utils/toolOutputEvidence.js +59 -0
  165. package/dist/esm/lib/v3/agent/utils/toolOutputEvidence.js.map +1 -0
  166. package/dist/esm/lib/v3/agent/utils/wrapEvidenceCallback.d.ts +3 -0
  167. package/dist/esm/lib/v3/agent/utils/wrapEvidenceCallback.js +22 -0
  168. package/dist/esm/lib/v3/agent/utils/wrapEvidenceCallback.js.map +1 -0
  169. package/dist/esm/lib/v3/api.d.ts +1 -0
  170. package/dist/esm/lib/v3/api.js +38 -17
  171. package/dist/esm/lib/v3/api.js.map +1 -1
  172. package/dist/esm/lib/v3/cache/ActCache.js +2 -2
  173. package/dist/esm/lib/v3/cache/ActCache.js.map +1 -1
  174. package/dist/esm/lib/v3/cache/utils.d.ts +7 -0
  175. package/dist/esm/lib/v3/cache/utils.js +18 -0
  176. package/dist/esm/lib/v3/cache/utils.js.map +1 -1
  177. package/dist/esm/lib/v3/dom/build/locatorScripts.generated.d.ts +24 -24
  178. package/dist/esm/lib/v3/dom/build/locatorScripts.generated.js +24 -24
  179. package/dist/esm/lib/v3/dom/build/locatorScripts.generated.js.map +1 -1
  180. package/dist/esm/lib/v3/dom/locatorScripts/xpathResolver.js +79 -10
  181. package/dist/esm/lib/v3/dom/locatorScripts/xpathResolver.js.map +1 -1
  182. package/dist/esm/lib/v3/handlers/v3AgentHandler.d.ts +3 -1
  183. package/dist/esm/lib/v3/handlers/v3AgentHandler.js +108 -16
  184. package/dist/esm/lib/v3/handlers/v3AgentHandler.js.map +1 -1
  185. package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.d.ts +11 -0
  186. package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js +119 -5
  187. package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -1
  188. package/dist/esm/lib/v3/index.d.ts +13 -1
  189. package/dist/esm/lib/v3/index.js +10 -0
  190. package/dist/esm/lib/v3/index.js.map +1 -1
  191. package/dist/esm/lib/v3/launch/local.js +1 -0
  192. package/dist/esm/lib/v3/launch/local.js.map +1 -1
  193. package/dist/esm/lib/v3/llm/LLMProvider.d.ts +3 -0
  194. package/dist/esm/lib/v3/llm/LLMProvider.js +44 -3
  195. package/dist/esm/lib/v3/llm/LLMProvider.js.map +1 -1
  196. package/dist/esm/lib/v3/llm/aisdk.js +4 -0
  197. package/dist/esm/lib/v3/llm/aisdk.js.map +1 -1
  198. package/dist/esm/lib/v3/llm/anthropicOptions.d.ts +57 -0
  199. package/dist/esm/lib/v3/llm/anthropicOptions.js +106 -0
  200. package/dist/esm/lib/v3/llm/anthropicOptions.js.map +1 -0
  201. package/dist/esm/lib/v3/types/public/agent.d.ts +8 -2
  202. package/dist/esm/lib/v3/types/public/agent.js +3 -0
  203. package/dist/esm/lib/v3/types/public/agent.js.map +1 -1
  204. package/dist/esm/lib/v3/types/public/agentEvidenceEvents.d.ts +85 -0
  205. package/dist/esm/lib/v3/types/public/agentEvidenceEvents.js +14 -0
  206. package/dist/esm/lib/v3/types/public/agentEvidenceEvents.js.map +1 -0
  207. package/dist/esm/lib/v3/types/public/api.d.ts +925 -182
  208. package/dist/esm/lib/v3/types/public/api.js +136 -18
  209. package/dist/esm/lib/v3/types/public/api.js.map +1 -1
  210. package/dist/esm/lib/v3/types/public/clipboard.d.ts +15 -0
  211. package/dist/esm/lib/v3/types/public/clipboard.js +2 -0
  212. package/dist/esm/lib/v3/types/public/clipboard.js.map +1 -0
  213. package/dist/esm/lib/v3/types/public/index.d.ts +2 -0
  214. package/dist/esm/lib/v3/types/public/index.js +2 -0
  215. package/dist/esm/lib/v3/types/public/index.js.map +1 -1
  216. package/dist/esm/lib/v3/types/public/model.d.ts +33 -8
  217. package/dist/esm/lib/v3/types/public/model.js.map +1 -1
  218. package/dist/esm/lib/v3/types/public/page.d.ts +29 -0
  219. package/dist/esm/lib/v3/types/public/page.js.map +1 -1
  220. package/dist/esm/lib/v3/types/public/sdkErrors.d.ts +3 -0
  221. package/dist/esm/lib/v3/types/public/sdkErrors.js +5 -0
  222. package/dist/esm/lib/v3/types/public/sdkErrors.js.map +1 -1
  223. package/dist/esm/lib/v3/understudy/clipboard.d.ts +24 -0
  224. package/dist/esm/lib/v3/understudy/clipboard.js +163 -0
  225. package/dist/esm/lib/v3/understudy/clipboard.js.map +1 -0
  226. package/dist/esm/lib/v3/understudy/context.d.ts +3 -0
  227. package/dist/esm/lib/v3/understudy/context.js +15 -0
  228. package/dist/esm/lib/v3/understudy/context.js.map +1 -1
  229. package/dist/esm/lib/v3/understudy/page.d.ts +23 -1
  230. package/dist/esm/lib/v3/understudy/page.js +284 -1
  231. package/dist/esm/lib/v3/understudy/page.js.map +1 -1
  232. package/dist/esm/lib/v3/v3.js +20 -8
  233. package/dist/esm/lib/v3/v3.js.map +1 -1
  234. package/dist/esm/lib/v3/verifier/errorTaxonomy.d.ts +35 -0
  235. package/dist/esm/lib/v3/verifier/errorTaxonomy.js +285 -0
  236. package/dist/esm/lib/v3/verifier/errorTaxonomy.js.map +1 -0
  237. package/dist/esm/lib/v3/verifier/evidence.d.ts +44 -0
  238. package/dist/esm/lib/v3/verifier/evidence.js +393 -0
  239. package/dist/esm/lib/v3/verifier/evidence.js.map +1 -0
  240. package/dist/esm/lib/v3/verifier/evidenceNormalization.d.ts +7 -0
  241. package/dist/esm/lib/v3/verifier/evidenceNormalization.js +93 -0
  242. package/dist/esm/lib/v3/verifier/evidenceNormalization.js.map +1 -0
  243. package/dist/esm/lib/v3/verifier/index.d.ts +6 -0
  244. package/dist/esm/lib/v3/verifier/index.js +3 -0
  245. package/dist/esm/lib/v3/verifier/index.js.map +1 -0
  246. package/dist/esm/lib/v3/verifier/prompts/batchedRelevance.d.ts +21 -0
  247. package/dist/esm/lib/v3/verifier/prompts/batchedRelevance.js +68 -0
  248. package/dist/esm/lib/v3/verifier/prompts/batchedRelevance.js.map +1 -0
  249. package/dist/esm/lib/v3/verifier/prompts/firstPointOfFailure.d.ts +3 -0
  250. package/dist/esm/lib/v3/verifier/prompts/firstPointOfFailure.js +162 -0
  251. package/dist/esm/lib/v3/verifier/prompts/firstPointOfFailure.js.map +1 -0
  252. package/dist/esm/lib/v3/verifier/prompts/fusedJudgment.d.ts +35 -0
  253. package/dist/esm/lib/v3/verifier/prompts/fusedJudgment.js +155 -0
  254. package/dist/esm/lib/v3/verifier/prompts/fusedJudgment.js.map +1 -0
  255. package/dist/esm/lib/v3/verifier/prompts/fusedOutcome.d.ts +26 -0
  256. package/dist/esm/lib/v3/verifier/prompts/fusedOutcome.js +134 -0
  257. package/dist/esm/lib/v3/verifier/prompts/fusedOutcome.js.map +1 -0
  258. package/dist/esm/lib/v3/verifier/prompts/index.d.ts +8 -0
  259. package/dist/esm/lib/v3/verifier/prompts/index.js +9 -0
  260. package/dist/esm/lib/v3/verifier/prompts/index.js.map +1 -0
  261. package/dist/esm/lib/v3/verifier/prompts/perCriterionScore.d.ts +23 -0
  262. package/dist/esm/lib/v3/verifier/prompts/perCriterionScore.js +74 -0
  263. package/dist/esm/lib/v3/verifier/prompts/perCriterionScore.js.map +1 -0
  264. package/dist/esm/lib/v3/verifier/prompts/render.d.ts +23 -0
  265. package/dist/esm/lib/v3/verifier/prompts/render.js +41 -0
  266. package/dist/esm/lib/v3/verifier/prompts/render.js.map +1 -0
  267. package/dist/esm/lib/v3/verifier/prompts/rubricGeneration.d.ts +16 -0
  268. package/dist/esm/lib/v3/verifier/prompts/rubricGeneration.js +318 -0
  269. package/dist/esm/lib/v3/verifier/prompts/rubricGeneration.js.map +1 -0
  270. package/dist/esm/lib/v3/verifier/prompts/taskValidity.d.ts +1 -0
  271. package/dist/esm/lib/v3/verifier/prompts/taskValidity.js +113 -0
  272. package/dist/esm/lib/v3/verifier/prompts/taskValidity.js.map +1 -0
  273. package/dist/esm/lib/v3/verifier/rubricVerifier.d.ts +91 -0
  274. package/dist/esm/lib/v3/verifier/rubricVerifier.js +1640 -0
  275. package/dist/esm/lib/v3/verifier/rubricVerifier.js.map +1 -0
  276. package/dist/esm/lib/v3/verifier/trajectory.d.ts +50 -0
  277. package/dist/esm/lib/v3/verifier/trajectory.js +273 -0
  278. package/dist/esm/lib/v3/verifier/trajectory.js.map +1 -0
  279. package/dist/esm/lib/v3/verifier/types.d.ts +429 -0
  280. package/dist/esm/lib/v3/verifier/types.js +2 -0
  281. package/dist/esm/lib/v3/verifier/types.js.map +1 -0
  282. package/dist/esm/lib/v3Evaluator.d.ts +14 -4
  283. package/dist/esm/lib/v3Evaluator.js +189 -1
  284. package/dist/esm/lib/v3Evaluator.js.map +1 -1
  285. package/dist/esm/lib/v3LegacyEvaluator.js +5 -1
  286. package/dist/esm/lib/v3LegacyEvaluator.js.map +1 -1
  287. package/dist/esm/lib/version.d.ts +1 -1
  288. package/dist/esm/lib/version.js +1 -1
  289. package/dist/esm/lib/version.js.map +1 -1
  290. package/package.json +18 -12
@@ -0,0 +1,318 @@
1
+ /**
2
+ * Rubric generation prompt — Step 0a of the rubric verifier pipeline.
3
+ *
4
+ * Used when a task has no precomputed_rubric (i.e., everything except
5
+ * upstream WebTailBench). The LLM generates a structured rubric of criteria
6
+ * from the task description alone, which gets cached to disk per task id.
7
+ *
8
+ * Variables:
9
+ * - task_id — the task instruction string
10
+ * - init_url_context — optional "Starting URL: ..." appendix (use buildInitUrlContext)
11
+ *
12
+ * Note on `$$`: Python's `string.Template` treats `$$` as a literal `$`.
13
+ * The renderPrompt() helper preserves that semantics — `$$200` in the
14
+ * template renders as `$200` in the final prompt sent to the model.
15
+ */
16
+ export const RUBRIC_GENERATION_PROMPT = `Task: $task_id$init_url_context
17
+ You are an expert tasked with analyzing a given task to identify the key points and sub-goals explicitly stated in the task description to create a rubric for evaluation.
18
+
19
+ **Objective**: Carefully analyze the task and extract the critical elements/goals/success criteria **explicitly** mentioned in the task for achieving its goal. Output a set of criteria that can be used to evaluate how well an Agent completed the task, along with descriptions of how to award points for each criterion.
20
+
21
+ **Critical Point Definition**
22
+ NOTE: The rubric should **not** contain criteria that violate a "Critical Point" or penalize scores for not crossing a Critical Point. A Critical Point, e.g. involving 'Checkout', 'Book', 'Purchase', 'Call', 'Email', etc, is a binding transaction/agreement that would require the user's permission to use personal or sensitive information (name, email, credit card, address, email, resume, etc) in order to complete a transaction (purchase, reservation, etc) or enter into a communication that a human would be expected to do (e.g. call or email).
23
+ - For example, when purchasing a product, it is acceptable have a criterion to "Add to Cart", or select the desired timeslot to book a reservation, but it **NOT** acceptable to propose a criteria to actually complete the checkout process (requiring entering the user's name, address, credit card, or sign into their account, etc unless specified in the Task). Stopping on the "Customer Details" is generally acceptable. If some stores/restaurants require a location before showing the product or reservation, the agent can enter a location (e.g. city) if known, but should not enter any personal information (e.g. name, email, phone number, etc).
24
+ - For example, if the task is to "call a restaurant to make a reservation," the success criteria should not say to make the call but rather to **find** the phone number.
25
+ - Similarly, if the task is to "order new size 12 running shoes" the criteria should not say place the order but instead find the right shoes and add them to the cart.
26
+ - If the task contains user information like name/email/address/etc, make a criterion stating that **other** user information not provided in the task is not "made up", and only what is given is reflected accurately in e.g. the checkout process.
27
+
28
+ **Controllable vs. Uncontrollable Factors** (Critical for Fair Evaluation):
29
+ When creating rubric criteria, distinguish between factors within and outside the agent's control. The agent should receive full credit for accurately identifying and reporting uncontrollable blockers, OR for achieving the primary intent through reasonable alternatives when specified methods fail.
30
+
31
+ **UNCONTROLLABLE FACTORS** (Full credit for identifying/reporting these):
32
+ 1. **Platform/Infrastructure Issues**: Website down, blocked by CAPTCHA, login walls (without credentials), server errors, missing functionality
33
+ 2. **Entity Non-Existence**: Restaurant/business closed or doesn't exist, product discontinued, service no longer available, person/entity not in directory
34
+ 3. **Availability/Inventory Constraints**: No reservations/flights on requested date, out of stock, sold out, seasonal unavailability
35
+ 4. **Search Result Limitations**: No exact match exists, requested attribute combination impossible, empty result sets
36
+ 5. **Platform Capability Limitations**: Platform doesn't list the entity, platform doesn't support required action, platform requires critical point crossing to proceed, but perhaps another platform does.
37
+ 6. **Information Accuracy Issues Beyond Agent Control**: Third-party data outdated, price/availability changed during browsing, conflicting information across sources
38
+
39
+ **CONTROLLABLE FACTORS** (Should be penalized):
40
+ 1. **Primary Intent Violations**: Wrong entity (restaurant/product name), wrong critical attributes (date/location) when correct ones available, ignoring explicit constraints when alternatives exist
41
+ 2. **Navigation and Search Errors**: Not attempting specified platform when accessible, poor search strategy, not using available filters
42
+ 3. **Execution Errors**: Incorrect data entry, skipping required steps, wrong selections from available options
43
+ 4. **Communication Failures**: Not reporting blockers encountered, hallucinations (claiming success without evidence), incomplete reporting, false unavailability claims
44
+ 5. **Insufficient Effort**: Premature abandonment after single attempt, not trying alternatives when appropriate, immediately using alternatives without attempting specified approach
45
+ 6. **Misunderstanding Task Requirements**: Crossing critical points unnecessarily, adding unrequested steps, ignoring task scope
46
+
47
+ **Interpret Task Verbs Charitably (Do NOT Over-Literalize)**:
48
+ Many tasks use casual, everyday language. Interpret task verbs as a reasonable user would intend them, NOT in an overly literal or academic sense. The agent is a web navigation assistant — the user wants the agent to find things, navigate to pages, and report back useful information. They are NOT asking for formal academic outputs unless explicitly stated.
49
+
50
+ Common examples of verbs and similar subjective terms that should be interpreted charitably:
51
+ - **"Locate"**, **"find"**, **"pull up"**, **"look up"**, **"check"**: Navigate to the relevant page/content and report the key information. Do NOT require the agent to output a URL unless explicitly asked.
52
+ - **"Review"**, **"read"**, **"look at"**, **"go through"**: Navigate to the content and provide a reasonable summary or overview of what was found. Do NOT require a formal structured review, literary critique, or exhaustive analysis. A brief summary of the key points visible on the page is sufficient.
53
+ - **"Show me"**, **"get me"**: Find and present the relevant information. The user wants to see the content, not a URL.
54
+ - **"Research"**, **"explore"**: Browse relevant sources and report findings. Do NOT require academic-level depth unless explicitly stated.
55
+
56
+ When creating rubric criteria for these or similar kinds of subjective verbs, the success criteria should focus on whether the agent **found the right content and reported useful information**, NOT on the depth, format, or presentation style of the output.
57
+
58
+ **SubGoal Definition**:
59
+ A **subgoal** is a critical element, condition, or step **explicitly** mentioned in the task description required for success.
60
+ - Do not infer or add any unstated subgoals or criteria, e.g. if the task is "what standard length of vinyl outside corner trim does HomeDepot sell?", do NOT add a criterion requiring the URL of the product, because it was not asked.
61
+ - **Intermediate Discovery vs. Required Output**: Criteria may verify that the agent *found, viewed, or interacted with* the correct intermediate results during navigation (e.g., "searched for and reviewed relevant Azure courses on Coursera"), but should NOT require the agent to *output or list* those intermediate results unless the task explicitly asks for them. For example, if the task is "find which Azure course on Coursera has the most flexible schedule," the agent should receive credit for browsing and reviewing multiple Azure courses (visible in screenshots/actions), but should NOT be penalized for only reporting the most flexible one in its final answer — that is all the task asked for.
62
+ - Do not make redundant or overlapping criteria (e.g. for the task "book a flight on air asia", do NOT make separate criteria for "access airasia.com" and "ensure AirAsia as the booking platform" since they are redundant)
63
+ - Separate **what** the subgoals are from **how** to evaluate them
64
+
65
+ **CRITICAL: Handling Conditional Criteria**:
66
+
67
+ Some tasks contain **conditional requirements** that only apply when specific conditions are met. These must be modeled explicitly using a "condition" field.
68
+
69
+ **When to create a conditional criterion**:
70
+ - Task contains phrases like "if...", "let me know if...", "report any issues", "in case of unavailability"
71
+ - The requirement only applies when a specific trigger condition occurs
72
+ - Examples:
73
+ * "Add flour to cart. Let me know if there are availability issues." → Reporting is conditional on encountering issues
74
+ * "Book a direct flight, or if none available, book a one-stop flight." → One-stop criterion is conditional on no direct flights existing
75
+ * "Buy organic blueberries, or if unavailable, buy non-organic." → Non-organic criterion is conditional on organic being unavailable
76
+
77
+ **How to structure conditional criteria**:
78
+ 1. Add a "condition" field (string) that describes the triggering condition
79
+ 2. In the "description" field, explain both the condition AND how to score if condition is met
80
+ 3. Make it clear that points are ONLY counted if the condition is met
81
+
82
+ **Schema for conditional criteria**:
83
+ {{
84
+ "criterion": "Brief name of what's being evaluated",
85
+ "condition": "Clear description of when this criterion applies (e.g., 'Only applies if organic blueberries are unavailable')",
86
+ "task_span": "Verbatim substring of the original task that THIS criterion is evaluating (e.g., 'organic blueberries')",
87
+ "description": "What to evaluate and how to score IF the condition is met. Full credit for..., partial credit for...",
88
+ "max_points": N,
89
+ "justification": "",
90
+ "earned_points": ""
91
+ }}
92
+
93
+ **Schema for non-conditional criteria** (most criteria):
94
+ {{
95
+ "criterion": "Brief name of what's being evaluated",
96
+ "task_span": "Verbatim substring of the original task that THIS criterion is evaluating (e.g., 'add flour to cart')",
97
+ "description": "What to evaluate and how to score. Full credit for..., partial credit for...",
98
+ "max_points": N,
99
+ "justification": "",
100
+ "earned_points": ""
101
+ }}
102
+ (Note: No "condition" field means the criterion always applies)
103
+
104
+ **task_span — ANTI-HALLUCINATION ANCHOR (REQUIRED)**:
105
+ Every criterion **must** include a "task_span" field whose value is a **verbatim substring** of the original task description (the text after "Task:" above). This is the literal phrase from the task that justifies including this criterion.
106
+ - If you cannot copy a contiguous substring of the task that justifies the criterion, **the criterion does not belong in the rubric** — the task did not ask for it. Drop it.
107
+ - Substrings shorter than 3 words are not enough — pick a span that makes the connection unambiguous.
108
+ - Do NOT paraphrase, summarize, or normalize the span. Copy it character-for-character so a downstream check can verify it is a substring of the task.
109
+ - For setup/platform criteria implied by the task's specified platform, copy the platform name verbatim (e.g., task_span: "drugssquare.com").
110
+ - For Critical Point boundary criteria, you may use the special token "<critical-point>" — this is the ONE permitted non-substring value, since the Critical Point rule is supplied by these instructions, not the task text.
111
+
112
+ **Important**: Do NOT create conditional criteria for requirements that are implicitly satisfied by successful task completion.
113
+ - Example: "Add flour to cart. Let me know if unavailable."
114
+ * WRONG: Separate conditional criterion "Report unavailability (condition: flour unavailable)"
115
+ * RIGHT: Single criterion "Add flour to cart" with description: "Full credit if flour added to cart successfully OR if flour is unavailable and agent reports this"
116
+ - Why? Because successful addition implies availability, and we want to avoid the agent needing to explicitly state the obvious.
117
+
118
+ **When TO create a conditional criterion**:
119
+ - When the task explicitly requests an alternative action or fallback behavior
120
+ - When you have mutually exclusive options (only one should be counted based on circumstances)
121
+
122
+ **IMPORTANT: Mutually Exclusive Conditionals**:
123
+ When a task has mutually exclusive alternatives (only one should apply), make ALL alternatives conditional with opposite conditions. This ensures only ONE is counted.
124
+
125
+ Common pattern example: "do X, or if X unavailable, do Y"
126
+ - Make BOTH X and Y conditional with opposite conditions
127
+ - Only the applicable one will be counted during scoring
128
+
129
+ Concrete example: "Buy organic blueberries, or if unavailable, buy non-organic"
130
+ - Criterion 1: "Buy organic blueberries" (condition: "Only applies if organic blueberries are available")
131
+ - Criterion 2: "Buy non-organic blueberries" (condition: "Only applies if organic blueberries are unavailable")
132
+ - During scoring: Only ONE will have is_condition_met=true, so only ONE is counted
133
+
134
+ **Examples**:
135
+
136
+ Example 1: "Add flour and vegetable oil to cart at Ralphs. Let me know if there are availability issues."
137
+ - Criterion 1: Add flour to cart [no condition field] - Description includes: "Full credit if flour added OR if unavailable and agent reports this"
138
+ - Criterion 2: Add vegetable oil to cart [no condition field] - Description includes: "Full credit if oil added OR if unavailable and agent reports this"
139
+ - Do NOT create separate conditional criteria for reporting, since successful addition implies availability
140
+
141
+ Example 2: "Buy organic blueberries at Whole Foods. If they don't have organic, buy non-organic ones. If they don't have any blueberries at all, let me know."
142
+ - Criterion 1: Buy organic blueberries [condition: "Only applies if organic blueberries are available"]
143
+ - Criterion 2: Buy non-organic blueberries [condition: "Only applies if organic blueberries are unavailable but non-organic are available"]
144
+ - Criterion 3: Report complete unavailability [condition: "Only applies if neither organic nor non-organic blueberries are available"]
145
+ - Note: Exactly ONE of these three criteria will have is_condition_met=true during scoring
146
+
147
+ **Ensure Criterion Disjointness (Avoid Double-Penalty Structures)**:
148
+ Make criteria as disjoint and non-overlapping as possible to avoid penalizing the same mistake multiple times.
149
+
150
+ **Key Principle**: If criterion A penalizes for not using platform/method X, then other criteria should evaluate task completion aspects (finding entities, making selections, progressing workflows) **independently** of whether platform/method X was used.
151
+
152
+ **Pattern to AVOID** (Double-penalty):
153
+ - Criterion 1: "Identify a Mexican restaurant on gayot.com"
154
+ - Criterion 2: "Reach reservation interface on gayot.com"
155
+ - Problem: Both penalize for not using gayot.com → agent loses points twice for same mistake
156
+
157
+ **Pattern to FOLLOW** (Disjoint):
158
+ - Criterion 1: "Attempt gayot.com as the specified platform" (evaluates platform usage)
159
+ - Criterion 2: "Identify a Mexican restaurant in Chicago's Northside" (evaluates entity identification, independent of platform)
160
+ - Criterion 3: "Reach a reservation booking interface for the restaurant" (evaluates workflow progress, independent of platform)
161
+ - Result: If gayot.com fails, agent only loses points on Criterion 1, not on 2 and 3
162
+
163
+ **Do Not Create Duplicate Criteria**:
164
+ Do NOT create multiple criteria that penalize the same mistake. Duplicate criteria create "double jeopardy" — the agent is unfairly penalized twice for a single error, which distorts scores. If two candidate criteria would both deduct points for the same failure, either combine them into a single criterion or restructure them so each evaluates a truly independent aspect.
165
+
166
+ **Examples of duplicates to avoid**:
167
+ - "Progress booking flow up to Critical Point" + "Respect Critical Point and avoid personal info"
168
+ → Instead, create ONE criterion: "Progress booking flow up to (but not beyond) the Critical Point, stopping before entering personal/payment information"
169
+ - "Add product to cart" + "Do not complete checkout"
170
+ → Instead, create ONE criterion: "Add product to cart and stop before entering personal/payment details"
171
+ - "Add the liquid ingredients to the Target cart" + "Ensure only liquid ingredients are added to the cart"
172
+ → Instead, create ONE criterion: "Add only the liquid ingredients to the Target cart" — the action and the constraint evaluate the same thing: whether the correct items (and only the correct items) were added. Adding a wrong item should be penalized once, not twice.
173
+ - "Identify suitable online purchase options for each listed spice/seasoning" + "Limit purchasing scope to spices/seasonings only"
174
+ → Instead, create ONE criterion: "Identify suitable online purchase options for only the listed spices/seasonings" — the scope constraint is already implicit in the action: if the agent correctly identifies options for each listed spice, it has necessarily limited scope to spices.
175
+
176
+ **Test for duplication**: Ask yourself: "If the agent makes mistake X, would it lose points in multiple criteria?" If YES, either combine those criteria into one or restructure them so each criterion evaluates a genuinely independent aspect of the task.
177
+
178
+ **Decompose List-Style Tasks into Per-Item Criteria**:
179
+ When a task contains a "laundry list" of items to perform the same action on (e.g., "add ground beef, onion, garlic, black beans, corn, tomato sauce, chili powder, cumin, cheddar cheese, and cornbread mix to my cart"), create a **separate criterion for each item** rather than a single criterion for all items combined.
180
+
181
+ **When to apply this rule**:
182
+ - The task lists 3 or more items/entities that all require the same type of action (e.g., add to cart, search for, book, find, look up, etc.)
183
+ - The items are independently actionable (success/failure on one item does not inherently depend on another)
184
+
185
+ **Why**: Each item may have independent failure modes (out of stock, not found, wrong product selected, different availability). A single combined criterion cannot fairly award partial credit when some items succeed and others fail. Separate criteria allow precise, per-item scoring.
186
+
187
+ **How**: Create one criterion per item, each with its own max_points and description including item-specific partial credit guidance (e.g., out of stock, wrong variant selected, not found after reasonable search).
188
+
189
+ **Example**: Task: "Add ground beef, onion, garlic, black beans, and corn to my cart on Stop & Shop"
190
+ - WRONG: Single criterion "Add all grocery items to cart" [10 points]
191
+ - RIGHT: Separate criteria:
192
+ * "Add ground beef to cart" [2 points] — Full credit if added, or if unavailable and agent reports this. Partial credit for wrong cut/variant when correct one is available.
193
+ * "Add onion to cart" [2 points] — Full credit if added, or if unavailable and agent reports this.
194
+ * "Add garlic to cart" [2 points] — Full credit if added, or if unavailable and agent reports this.
195
+ * "Add black beans to cart" [2 points] — Full credit if added, or if unavailable and agent reports this.
196
+ * "Add corn to cart" [2 points] — Full credit if added, or if unavailable and agent reports this.
197
+
198
+ **Note**: You may still have additional criteria for platform access (e.g., "Access the Stop & Shop website") or Critical Point boundaries, separate from the per-item criteria.
199
+
200
+ **Partial Credit Guidance** (to be incorporated into the "description" field of each criterion):
201
+ Each criterion's "description" field must specify how to handle both successful completion AND common failure modes caused by external factors. Use the framework below:
202
+
203
+ **1. Primary Intent vs. Secondary Constraints**:
204
+ - **Primary intent**: The core objective that defines task success (e.g., "book reservation at Restaurant X on date Z")
205
+ - **Secondary constraints**: Preferred methods/platforms (e.g., "using platform Y")
206
+ - Award **FULL credit** if primary intent is achieved through reasonable alternatives when secondary constraints are impossible due to uncontrollable factors
207
+ - Award **PARTIAL credit** if secondary constraints are ignored without attempting them first, but primary intent is still achieved
208
+ - Award **NO credit** if primary intent is violated (e.g., booking wrong restaurant name or wrong date when correct ones are available)
209
+
210
+ **2. Entity Non-Existence Scenarios**:
211
+ - If a specified entity (restaurant, product, business, service) no longer exists or cannot be found after reasonable search, award **FULL credit** for clearly reporting this finding
212
+ - If an entity doesn't exist, award **FULL credit** for either: (a) reporting non-existence OR (b) identifying a reasonable alternative that matches the primary intent
213
+ - Examples: Restaurant closed permanently, product discontinued, airline no longer operates that route, person not in directory
214
+
215
+ **3. Availability and Inventory Constraints**:
216
+ - For time-sensitive requests (dates, times, reservation slots), award **FULL credit** for accurately reporting unavailability when the requested option genuinely doesn't exist
217
+ - Award **FULL credit** for either: (a) clearly stating unavailability OR (b) selecting the best available alternative that matches primary intent
218
+ - Examples: No direct flights on requested date, restaurant fully booked, product out of stock, hotel no vacancy
219
+
220
+ **4. Platform Capability Limitations**:
221
+ - If a specified platform cannot support the required action (e.g., platform doesn't list the entity, platform blocks access, platform requires critical point crossing), award **FULL credit** for either: (a) reporting this limitation OR (b) achieving the goal through an alternative platform
222
+ - Do NOT penalize for using alternative platforms when the specified platform is genuinely incapable or inaccessible
223
+ - Example: Platform Y doesn't have Restaurant X listed → full credit for booking Restaurant X on Platform Z instead
224
+
225
+ **5. Search Results and Filtering Constraints**:
226
+ - When a task involves multiple filtering criteria but no result satisfies them all, award **FULL credit** if the agent: (a) identifies the best available option matching the **primary intent**, OR (b) states that no exact match exists, OR (c) both
227
+ - For subjective tasks (e.g., "find the best new sushi restaurant"), award **FULL credit** for consulting authoritative sources and making reasonable selections
228
+ - Example: Task requests "100% cotton Power Rangers hoodie" but only polyester hoodie exists → full credit for recommending the hoodie OR stating no exact match
229
+
230
+ **6. Reasonable Effort Requirements**:
231
+ - Award **FULL credit** only if the agent demonstrates reasonable effort before resorting to alternatives (attempting the specified approach, encountering genuine blocker, THEN reporting/finding alternative)
232
+ - Award **PARTIAL credit** if agent immediately defaults to alternatives without attempting the specified approach when it was accessible
233
+ - Award **NO credit** for premature abandonment without reasonable attempt
234
+
235
+ **Instructions**:
236
+ 1. Read the task description carefully.
237
+ 2. Identify and extract **subgoals** directly stated in the task, and describe how to evaluate each subgoal, including how to award partial credit for common failure modes or external dependencies outside the agent's control.
238
+ 3. Output a minimal rubric to grade how well an Agent completed the subgoals. You will format your output as a rubric with the following elements/fields
239
+
240
+ The rubric must be:
241
+ 1. Formatted as json dictionary of a (possibly nested) list of "items"
242
+ 2. Each Item in the rubric must contain the following fields IN ORDER:
243
+ - For CONDITIONAL criteria: ["criterion", "condition", "task_span", "description", "max_points", "justification", "earned_points"]
244
+ - For NON-CONDITIONAL criteria: ["criterion", "task_span", "description", "max_points", "justification", "earned_points"]
245
+ - The "condition" field should ONLY be present for conditional criteria (criteria that only apply when specific conditions are met)
246
+ - The "task_span" field is REQUIRED on every criterion (verbatim substring of the task, or "<critical-point>" for Critical Point boundary criteria only)
247
+ 3. Choose the "max_points" judiciously to account for possible failure modes that could earn partial credit: goals that would have more failure modes deserve higher max_points.
248
+ 4. The "description" should explain *what* goal the criteria is evaluating and *how* partial credit could be awarded to fairly penalize the agent's mistakes while accounting for external dependencies outside the agent's control.
249
+ 5. For conditional criteria, the "condition" field must clearly state when the criterion applies (e.g., "Only applies if organic blueberries are unavailable")
250
+ 6. Leave the "earned_points" and "justification" fields **empty** (since this rubric isn't being evaluated right now).
251
+ 7. Do not make criteria for formatting/style unless stated explicitly in the Task.
252
+ 8. Keep the rubric simple, following ONLY the main keypoints the task required. Do not overcomplicate the criteria or include optional items that were not explicitly mentioned.
253
+
254
+ **ANTI-PATTERN — Over-Specification / Hallucinated Sub-Goals**:
255
+ A common failure mode is inventing criteria that the task never asked for. If a criterion's task_span isn't a substring of the original task description (and it isn't the Critical Point boundary), the criterion is over-specifying.
256
+
257
+ Anti-example task: "Find the citation page for the City of Vancouver."
258
+ - WRONG criterion: "Display the citation number, fine amount, and payment due date" — the task did not ask for any of these specific fields. There is no "citation number" or "fine amount" in the task text.
259
+ * task_span: <none possible> → drop.
260
+ - WRONG criterion: "Provide instructions for paying the citation online" — the task did not ask for payment instructions.
261
+ * task_span: <none possible> → drop.
262
+ - RIGHT criterion: "Locate the citation page on the City of Vancouver site" [3 points]
263
+ * task_span: "citation page for the City of Vancouver"
264
+ * Description: Full credit if agent navigates to the citation/ticket page on the official cityofvancouver site, or if no such page exists and agent reports this. Partial credit for finding an unrelated city services page.
265
+
266
+ Anti-example task: "Search arXiv for the most recent paper on retrieval-augmented generation."
267
+ - WRONG criterion: "Output the abstract and author list of the paper" — task didn't ask for abstract or author list. The agent just needs to identify and report the paper.
268
+ * task_span: <none possible> → drop.
269
+ - RIGHT criterion: "Identify the most recent arXiv paper on retrieval-augmented generation" [4 points]
270
+ * task_span: "most recent paper on retrieval-augmented generation"
271
+
272
+ **The test**: For each criterion you draft, ask: "Can I copy a contiguous substring of the task that this criterion is evaluating?" If no, the criterion is over-specifying and must be dropped.
273
+
274
+ ==================
275
+ Example 1 (high level): "Book a reservation at a Mexican restaurant in the Northside of Chicago on 09/29/2025 for 2:45 PM at gayot.com."
276
+ High level rubric:
277
+ - Start on gayot.com as the specified platform [2 points] //Full credit if: (a) agent attempts gayot.com but it's blocked/unavailable and clearly reports this, OR (b) agent successfully completes the booking through an alternative platform after determining gayot.com cannot complete the booking
278
+ - Identify a Mexican restaurant in Chicago's Northside [3 points] //Full credit for correct identification. Partial credit if restaurant location is ambiguous or not clearly in Northside. No credit if wrong cuisine type when Mexican options exist
279
+ - Reach a reservation booking interface for the restaurant [2 points] //Full credit for ANY reservation booking interface (decoupled from platform criterion to avoid double-penalizing). Full credit if restaurant doesn't offer online booking and agent reports this
280
+ - Attempt date/time selection for 09/29/2025 at 2:45 PM [3 points] //Full credit if: (a) correct date/time selected, OR (b) that date/time is unavailable and agent clearly indicates this, OR (c) agent selects closest available alternative and explains why. No credit if wrong date selected when correct date is available
281
+ - Respect Critical Point boundaries (no personal info or final booking) [2 points] //Full credit for stopping before entering personal information. Deduct if agent unnecessarily crosses critical point
282
+
283
+ Takeaway: Make criteria as disjoint and non-overlapping as possible, e.g. do NOT make "Reach the reservation interface starting from gayot.com" a criterion bc this overlaps with the first criterion. Each criterion should clearly specify full credit scenarios for both success AND uncontrollable failure modes.
284
+
285
+ ==================
286
+ Example 2 (detailed): Help purchase 'Fosbait: Lanthanum Carbonate 500mg Tablets' for kidney diseases on drugssquare.com.
287
+
288
+ Example Output Rubric:
289
+ {{
290
+ "items": [
291
+ {{
292
+ "criterion": "Access drugssquare.com website",
293
+ "task_span": "drugssquare.com",
294
+ "description": "Successfully navigate to or access the drugssquare.com website as specified in the task. Full credit if: (a) site is successfully accessed, OR (b) site is inaccessible (blocked, down, error) and agent clearly indicates this and either stops or attempts alternative source. Partial credit if agent immediately uses alternative without attempting drugssquare.com first.",
295
+ "max_points": 2,
296
+ "justification": "",
297
+ "earned_points": ""
298
+ }},
299
+ {{
300
+ "criterion": "Locate the specific product",
301
+ "task_span": "Fosbait: Lanthanum Carbonate 500mg Tablets",
302
+ "description": "Find and identify the exact product 'Fosbait: Lanthanum Carbonate 500mg Tablets' on the website. Full credit if: (a) exact product found, OR (b) product is discontinued/out of stock/not found after reasonable search and agent clearly reports this, OR (c) agent identifies closest alternative (different dosage of same medication) when exact product unavailable and explains the substitution. Partial credit for selecting different dosage when the intended 500mg dosage IS available on the site. No credit for selecting entirely different medication when Fosbait is available.",
303
+ "max_points": 3,
304
+ "justification": "",
305
+ "earned_points": ""
306
+ }},
307
+ {{
308
+ "criterion": "Facilitate the purchase process until a Critical Point",
309
+ "task_span": "<critical-point>",
310
+ "description": "Help complete the purchase of the identified product up to but not crossing the Critical Point. Full credit if: (a) product is successfully added to cart and agent stops before entering personal/payment information, OR (b) the website's purchase flow is broken/unavailable and agent reports this, OR (c) website requires account creation or payment info before allowing add-to-cart and agent reports this limitation. Partial credit if agent proceeds partially but makes errors in the purchase flow (wrong quantity, wrong shipping option, etc.). No credit if agent either skips the cart entirely OR unnecessarily enters personal information when not required.",
311
+ "max_points": 3,
312
+ "justification": "",
313
+ "earned_points": ""
314
+ }}
315
+ ]
316
+ }}
317
+ Please output an answer in pure JSON format according to the following schema. The JSON object must be parsable as-is. DO NOT OUTPUT ANYTHING OTHER THAN JSON, AND DO NOT DEVIATE FROM THE ABOVE SCHEMA:`;
318
+ //# sourceMappingURL=rubricGeneration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rubricGeneration.js","sourceRoot":"","sources":["../../../../../../lib/v3/verifier/prompts/rubricGeneration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6MA6SqK,CAAC","sourcesContent":["/**\n * Rubric generation prompt — Step 0a of the rubric verifier pipeline.\n *\n * Used when a task has no precomputed_rubric (i.e., everything except\n * upstream WebTailBench). The LLM generates a structured rubric of criteria\n * from the task description alone, which gets cached to disk per task id.\n *\n * Variables:\n * - task_id — the task instruction string\n * - init_url_context — optional \"Starting URL: ...\" appendix (use buildInitUrlContext)\n *\n * Note on `$$`: Python's `string.Template` treats `$$` as a literal `$`.\n * The renderPrompt() helper preserves that semantics — `$$200` in the\n * template renders as `$200` in the final prompt sent to the model.\n */\nexport const RUBRIC_GENERATION_PROMPT = `Task: $task_id$init_url_context\n You are an expert tasked with analyzing a given task to identify the key points and sub-goals explicitly stated in the task description to create a rubric for evaluation.\n\n **Objective**: Carefully analyze the task and extract the critical elements/goals/success criteria **explicitly** mentioned in the task for achieving its goal. Output a set of criteria that can be used to evaluate how well an Agent completed the task, along with descriptions of how to award points for each criterion.\n\n **Critical Point Definition**\n NOTE: The rubric should **not** contain criteria that violate a \"Critical Point\" or penalize scores for not crossing a Critical Point. A Critical Point, e.g. involving 'Checkout', 'Book', 'Purchase', 'Call', 'Email', etc, is a binding transaction/agreement that would require the user's permission to use personal or sensitive information (name, email, credit card, address, email, resume, etc) in order to complete a transaction (purchase, reservation, etc) or enter into a communication that a human would be expected to do (e.g. call or email).\n - For example, when purchasing a product, it is acceptable have a criterion to \"Add to Cart\", or select the desired timeslot to book a reservation, but it **NOT** acceptable to propose a criteria to actually complete the checkout process (requiring entering the user's name, address, credit card, or sign into their account, etc unless specified in the Task). Stopping on the \"Customer Details\" is generally acceptable. If some stores/restaurants require a location before showing the product or reservation, the agent can enter a location (e.g. city) if known, but should not enter any personal information (e.g. name, email, phone number, etc).\n - For example, if the task is to \"call a restaurant to make a reservation,\" the success criteria should not say to make the call but rather to **find** the phone number.\n - Similarly, if the task is to \"order new size 12 running shoes\" the criteria should not say place the order but instead find the right shoes and add them to the cart.\n - If the task contains user information like name/email/address/etc, make a criterion stating that **other** user information not provided in the task is not \"made up\", and only what is given is reflected accurately in e.g. the checkout process.\n\n **Controllable vs. Uncontrollable Factors** (Critical for Fair Evaluation):\n When creating rubric criteria, distinguish between factors within and outside the agent's control. The agent should receive full credit for accurately identifying and reporting uncontrollable blockers, OR for achieving the primary intent through reasonable alternatives when specified methods fail.\n\n **UNCONTROLLABLE FACTORS** (Full credit for identifying/reporting these):\n 1. **Platform/Infrastructure Issues**: Website down, blocked by CAPTCHA, login walls (without credentials), server errors, missing functionality\n 2. **Entity Non-Existence**: Restaurant/business closed or doesn't exist, product discontinued, service no longer available, person/entity not in directory\n 3. **Availability/Inventory Constraints**: No reservations/flights on requested date, out of stock, sold out, seasonal unavailability\n 4. **Search Result Limitations**: No exact match exists, requested attribute combination impossible, empty result sets\n 5. **Platform Capability Limitations**: Platform doesn't list the entity, platform doesn't support required action, platform requires critical point crossing to proceed, but perhaps another platform does.\n 6. **Information Accuracy Issues Beyond Agent Control**: Third-party data outdated, price/availability changed during browsing, conflicting information across sources\n\n **CONTROLLABLE FACTORS** (Should be penalized):\n 1. **Primary Intent Violations**: Wrong entity (restaurant/product name), wrong critical attributes (date/location) when correct ones available, ignoring explicit constraints when alternatives exist\n 2. **Navigation and Search Errors**: Not attempting specified platform when accessible, poor search strategy, not using available filters\n 3. **Execution Errors**: Incorrect data entry, skipping required steps, wrong selections from available options\n 4. **Communication Failures**: Not reporting blockers encountered, hallucinations (claiming success without evidence), incomplete reporting, false unavailability claims\n 5. **Insufficient Effort**: Premature abandonment after single attempt, not trying alternatives when appropriate, immediately using alternatives without attempting specified approach\n 6. **Misunderstanding Task Requirements**: Crossing critical points unnecessarily, adding unrequested steps, ignoring task scope\n\n **Interpret Task Verbs Charitably (Do NOT Over-Literalize)**:\n Many tasks use casual, everyday language. Interpret task verbs as a reasonable user would intend them, NOT in an overly literal or academic sense. The agent is a web navigation assistant — the user wants the agent to find things, navigate to pages, and report back useful information. They are NOT asking for formal academic outputs unless explicitly stated.\n\n Common examples of verbs and similar subjective terms that should be interpreted charitably:\n - **\"Locate\"**, **\"find\"**, **\"pull up\"**, **\"look up\"**, **\"check\"**: Navigate to the relevant page/content and report the key information. Do NOT require the agent to output a URL unless explicitly asked.\n - **\"Review\"**, **\"read\"**, **\"look at\"**, **\"go through\"**: Navigate to the content and provide a reasonable summary or overview of what was found. Do NOT require a formal structured review, literary critique, or exhaustive analysis. A brief summary of the key points visible on the page is sufficient.\n - **\"Show me\"**, **\"get me\"**: Find and present the relevant information. The user wants to see the content, not a URL.\n - **\"Research\"**, **\"explore\"**: Browse relevant sources and report findings. Do NOT require academic-level depth unless explicitly stated.\n\n When creating rubric criteria for these or similar kinds of subjective verbs, the success criteria should focus on whether the agent **found the right content and reported useful information**, NOT on the depth, format, or presentation style of the output.\n\n **SubGoal Definition**:\n A **subgoal** is a critical element, condition, or step **explicitly** mentioned in the task description required for success.\n - Do not infer or add any unstated subgoals or criteria, e.g. if the task is \"what standard length of vinyl outside corner trim does HomeDepot sell?\", do NOT add a criterion requiring the URL of the product, because it was not asked.\n - **Intermediate Discovery vs. Required Output**: Criteria may verify that the agent *found, viewed, or interacted with* the correct intermediate results during navigation (e.g., \"searched for and reviewed relevant Azure courses on Coursera\"), but should NOT require the agent to *output or list* those intermediate results unless the task explicitly asks for them. For example, if the task is \"find which Azure course on Coursera has the most flexible schedule,\" the agent should receive credit for browsing and reviewing multiple Azure courses (visible in screenshots/actions), but should NOT be penalized for only reporting the most flexible one in its final answer — that is all the task asked for.\n - Do not make redundant or overlapping criteria (e.g. for the task \"book a flight on air asia\", do NOT make separate criteria for \"access airasia.com\" and \"ensure AirAsia as the booking platform\" since they are redundant)\n - Separate **what** the subgoals are from **how** to evaluate them\n\n **CRITICAL: Handling Conditional Criteria**:\n\n Some tasks contain **conditional requirements** that only apply when specific conditions are met. These must be modeled explicitly using a \"condition\" field.\n\n **When to create a conditional criterion**:\n - Task contains phrases like \"if...\", \"let me know if...\", \"report any issues\", \"in case of unavailability\"\n - The requirement only applies when a specific trigger condition occurs\n - Examples:\n * \"Add flour to cart. Let me know if there are availability issues.\" → Reporting is conditional on encountering issues\n * \"Book a direct flight, or if none available, book a one-stop flight.\" → One-stop criterion is conditional on no direct flights existing\n * \"Buy organic blueberries, or if unavailable, buy non-organic.\" → Non-organic criterion is conditional on organic being unavailable\n\n **How to structure conditional criteria**:\n 1. Add a \"condition\" field (string) that describes the triggering condition\n 2. In the \"description\" field, explain both the condition AND how to score if condition is met\n 3. Make it clear that points are ONLY counted if the condition is met\n\n **Schema for conditional criteria**:\n {{\n \"criterion\": \"Brief name of what's being evaluated\",\n \"condition\": \"Clear description of when this criterion applies (e.g., 'Only applies if organic blueberries are unavailable')\",\n \"task_span\": \"Verbatim substring of the original task that THIS criterion is evaluating (e.g., 'organic blueberries')\",\n \"description\": \"What to evaluate and how to score IF the condition is met. Full credit for..., partial credit for...\",\n \"max_points\": N,\n \"justification\": \"\",\n \"earned_points\": \"\"\n }}\n\n **Schema for non-conditional criteria** (most criteria):\n {{\n \"criterion\": \"Brief name of what's being evaluated\",\n \"task_span\": \"Verbatim substring of the original task that THIS criterion is evaluating (e.g., 'add flour to cart')\",\n \"description\": \"What to evaluate and how to score. Full credit for..., partial credit for...\",\n \"max_points\": N,\n \"justification\": \"\",\n \"earned_points\": \"\"\n }}\n (Note: No \"condition\" field means the criterion always applies)\n\n **task_span — ANTI-HALLUCINATION ANCHOR (REQUIRED)**:\n Every criterion **must** include a \"task_span\" field whose value is a **verbatim substring** of the original task description (the text after \"Task:\" above). This is the literal phrase from the task that justifies including this criterion.\n - If you cannot copy a contiguous substring of the task that justifies the criterion, **the criterion does not belong in the rubric** — the task did not ask for it. Drop it.\n - Substrings shorter than 3 words are not enough — pick a span that makes the connection unambiguous.\n - Do NOT paraphrase, summarize, or normalize the span. Copy it character-for-character so a downstream check can verify it is a substring of the task.\n - For setup/platform criteria implied by the task's specified platform, copy the platform name verbatim (e.g., task_span: \"drugssquare.com\").\n - For Critical Point boundary criteria, you may use the special token \"<critical-point>\" — this is the ONE permitted non-substring value, since the Critical Point rule is supplied by these instructions, not the task text.\n\n **Important**: Do NOT create conditional criteria for requirements that are implicitly satisfied by successful task completion.\n - Example: \"Add flour to cart. Let me know if unavailable.\"\n * WRONG: Separate conditional criterion \"Report unavailability (condition: flour unavailable)\"\n * RIGHT: Single criterion \"Add flour to cart\" with description: \"Full credit if flour added to cart successfully OR if flour is unavailable and agent reports this\"\n - Why? Because successful addition implies availability, and we want to avoid the agent needing to explicitly state the obvious.\n\n **When TO create a conditional criterion**:\n - When the task explicitly requests an alternative action or fallback behavior\n - When you have mutually exclusive options (only one should be counted based on circumstances)\n\n **IMPORTANT: Mutually Exclusive Conditionals**:\n When a task has mutually exclusive alternatives (only one should apply), make ALL alternatives conditional with opposite conditions. This ensures only ONE is counted.\n\n Common pattern example: \"do X, or if X unavailable, do Y\"\n - Make BOTH X and Y conditional with opposite conditions\n - Only the applicable one will be counted during scoring\n\n Concrete example: \"Buy organic blueberries, or if unavailable, buy non-organic\"\n - Criterion 1: \"Buy organic blueberries\" (condition: \"Only applies if organic blueberries are available\")\n - Criterion 2: \"Buy non-organic blueberries\" (condition: \"Only applies if organic blueberries are unavailable\")\n - During scoring: Only ONE will have is_condition_met=true, so only ONE is counted\n\n **Examples**:\n\n Example 1: \"Add flour and vegetable oil to cart at Ralphs. Let me know if there are availability issues.\"\n - Criterion 1: Add flour to cart [no condition field] - Description includes: \"Full credit if flour added OR if unavailable and agent reports this\"\n - Criterion 2: Add vegetable oil to cart [no condition field] - Description includes: \"Full credit if oil added OR if unavailable and agent reports this\"\n - Do NOT create separate conditional criteria for reporting, since successful addition implies availability\n\n Example 2: \"Buy organic blueberries at Whole Foods. If they don't have organic, buy non-organic ones. If they don't have any blueberries at all, let me know.\"\n - Criterion 1: Buy organic blueberries [condition: \"Only applies if organic blueberries are available\"]\n - Criterion 2: Buy non-organic blueberries [condition: \"Only applies if organic blueberries are unavailable but non-organic are available\"]\n - Criterion 3: Report complete unavailability [condition: \"Only applies if neither organic nor non-organic blueberries are available\"]\n - Note: Exactly ONE of these three criteria will have is_condition_met=true during scoring\n\n **Ensure Criterion Disjointness (Avoid Double-Penalty Structures)**:\n Make criteria as disjoint and non-overlapping as possible to avoid penalizing the same mistake multiple times.\n\n **Key Principle**: If criterion A penalizes for not using platform/method X, then other criteria should evaluate task completion aspects (finding entities, making selections, progressing workflows) **independently** of whether platform/method X was used.\n\n **Pattern to AVOID** (Double-penalty):\n - Criterion 1: \"Identify a Mexican restaurant on gayot.com\"\n - Criterion 2: \"Reach reservation interface on gayot.com\"\n - Problem: Both penalize for not using gayot.com → agent loses points twice for same mistake\n\n **Pattern to FOLLOW** (Disjoint):\n - Criterion 1: \"Attempt gayot.com as the specified platform\" (evaluates platform usage)\n - Criterion 2: \"Identify a Mexican restaurant in Chicago's Northside\" (evaluates entity identification, independent of platform)\n - Criterion 3: \"Reach a reservation booking interface for the restaurant\" (evaluates workflow progress, independent of platform)\n - Result: If gayot.com fails, agent only loses points on Criterion 1, not on 2 and 3\n\n **Do Not Create Duplicate Criteria**:\n Do NOT create multiple criteria that penalize the same mistake. Duplicate criteria create \"double jeopardy\" — the agent is unfairly penalized twice for a single error, which distorts scores. If two candidate criteria would both deduct points for the same failure, either combine them into a single criterion or restructure them so each evaluates a truly independent aspect.\n\n **Examples of duplicates to avoid**:\n - \"Progress booking flow up to Critical Point\" + \"Respect Critical Point and avoid personal info\"\n → Instead, create ONE criterion: \"Progress booking flow up to (but not beyond) the Critical Point, stopping before entering personal/payment information\"\n - \"Add product to cart\" + \"Do not complete checkout\"\n → Instead, create ONE criterion: \"Add product to cart and stop before entering personal/payment details\"\n - \"Add the liquid ingredients to the Target cart\" + \"Ensure only liquid ingredients are added to the cart\"\n → Instead, create ONE criterion: \"Add only the liquid ingredients to the Target cart\" — the action and the constraint evaluate the same thing: whether the correct items (and only the correct items) were added. Adding a wrong item should be penalized once, not twice.\n - \"Identify suitable online purchase options for each listed spice/seasoning\" + \"Limit purchasing scope to spices/seasonings only\"\n → Instead, create ONE criterion: \"Identify suitable online purchase options for only the listed spices/seasonings\" — the scope constraint is already implicit in the action: if the agent correctly identifies options for each listed spice, it has necessarily limited scope to spices.\n\n **Test for duplication**: Ask yourself: \"If the agent makes mistake X, would it lose points in multiple criteria?\" If YES, either combine those criteria into one or restructure them so each criterion evaluates a genuinely independent aspect of the task.\n\n **Decompose List-Style Tasks into Per-Item Criteria**:\n When a task contains a \"laundry list\" of items to perform the same action on (e.g., \"add ground beef, onion, garlic, black beans, corn, tomato sauce, chili powder, cumin, cheddar cheese, and cornbread mix to my cart\"), create a **separate criterion for each item** rather than a single criterion for all items combined.\n\n **When to apply this rule**:\n - The task lists 3 or more items/entities that all require the same type of action (e.g., add to cart, search for, book, find, look up, etc.)\n - The items are independently actionable (success/failure on one item does not inherently depend on another)\n\n **Why**: Each item may have independent failure modes (out of stock, not found, wrong product selected, different availability). A single combined criterion cannot fairly award partial credit when some items succeed and others fail. Separate criteria allow precise, per-item scoring.\n\n **How**: Create one criterion per item, each with its own max_points and description including item-specific partial credit guidance (e.g., out of stock, wrong variant selected, not found after reasonable search).\n\n **Example**: Task: \"Add ground beef, onion, garlic, black beans, and corn to my cart on Stop & Shop\"\n - WRONG: Single criterion \"Add all grocery items to cart\" [10 points]\n - RIGHT: Separate criteria:\n * \"Add ground beef to cart\" [2 points] — Full credit if added, or if unavailable and agent reports this. Partial credit for wrong cut/variant when correct one is available.\n * \"Add onion to cart\" [2 points] — Full credit if added, or if unavailable and agent reports this.\n * \"Add garlic to cart\" [2 points] — Full credit if added, or if unavailable and agent reports this.\n * \"Add black beans to cart\" [2 points] — Full credit if added, or if unavailable and agent reports this.\n * \"Add corn to cart\" [2 points] — Full credit if added, or if unavailable and agent reports this.\n\n **Note**: You may still have additional criteria for platform access (e.g., \"Access the Stop & Shop website\") or Critical Point boundaries, separate from the per-item criteria.\n\n **Partial Credit Guidance** (to be incorporated into the \"description\" field of each criterion):\n Each criterion's \"description\" field must specify how to handle both successful completion AND common failure modes caused by external factors. Use the framework below:\n\n **1. Primary Intent vs. Secondary Constraints**:\n - **Primary intent**: The core objective that defines task success (e.g., \"book reservation at Restaurant X on date Z\")\n - **Secondary constraints**: Preferred methods/platforms (e.g., \"using platform Y\")\n - Award **FULL credit** if primary intent is achieved through reasonable alternatives when secondary constraints are impossible due to uncontrollable factors\n - Award **PARTIAL credit** if secondary constraints are ignored without attempting them first, but primary intent is still achieved\n - Award **NO credit** if primary intent is violated (e.g., booking wrong restaurant name or wrong date when correct ones are available)\n\n **2. Entity Non-Existence Scenarios**:\n - If a specified entity (restaurant, product, business, service) no longer exists or cannot be found after reasonable search, award **FULL credit** for clearly reporting this finding\n - If an entity doesn't exist, award **FULL credit** for either: (a) reporting non-existence OR (b) identifying a reasonable alternative that matches the primary intent\n - Examples: Restaurant closed permanently, product discontinued, airline no longer operates that route, person not in directory\n\n **3. Availability and Inventory Constraints**:\n - For time-sensitive requests (dates, times, reservation slots), award **FULL credit** for accurately reporting unavailability when the requested option genuinely doesn't exist\n - Award **FULL credit** for either: (a) clearly stating unavailability OR (b) selecting the best available alternative that matches primary intent\n - Examples: No direct flights on requested date, restaurant fully booked, product out of stock, hotel no vacancy\n\n **4. Platform Capability Limitations**:\n - If a specified platform cannot support the required action (e.g., platform doesn't list the entity, platform blocks access, platform requires critical point crossing), award **FULL credit** for either: (a) reporting this limitation OR (b) achieving the goal through an alternative platform\n - Do NOT penalize for using alternative platforms when the specified platform is genuinely incapable or inaccessible\n - Example: Platform Y doesn't have Restaurant X listed → full credit for booking Restaurant X on Platform Z instead\n\n **5. Search Results and Filtering Constraints**:\n - When a task involves multiple filtering criteria but no result satisfies them all, award **FULL credit** if the agent: (a) identifies the best available option matching the **primary intent**, OR (b) states that no exact match exists, OR (c) both\n - For subjective tasks (e.g., \"find the best new sushi restaurant\"), award **FULL credit** for consulting authoritative sources and making reasonable selections\n - Example: Task requests \"100% cotton Power Rangers hoodie\" but only polyester hoodie exists → full credit for recommending the hoodie OR stating no exact match\n\n **6. Reasonable Effort Requirements**:\n - Award **FULL credit** only if the agent demonstrates reasonable effort before resorting to alternatives (attempting the specified approach, encountering genuine blocker, THEN reporting/finding alternative)\n - Award **PARTIAL credit** if agent immediately defaults to alternatives without attempting the specified approach when it was accessible\n - Award **NO credit** for premature abandonment without reasonable attempt\n\n **Instructions**:\n 1. Read the task description carefully.\n 2. Identify and extract **subgoals** directly stated in the task, and describe how to evaluate each subgoal, including how to award partial credit for common failure modes or external dependencies outside the agent's control.\n 3. Output a minimal rubric to grade how well an Agent completed the subgoals. You will format your output as a rubric with the following elements/fields\n\n The rubric must be:\n 1. Formatted as json dictionary of a (possibly nested) list of \"items\"\n 2. Each Item in the rubric must contain the following fields IN ORDER:\n - For CONDITIONAL criteria: [\"criterion\", \"condition\", \"task_span\", \"description\", \"max_points\", \"justification\", \"earned_points\"]\n - For NON-CONDITIONAL criteria: [\"criterion\", \"task_span\", \"description\", \"max_points\", \"justification\", \"earned_points\"]\n - The \"condition\" field should ONLY be present for conditional criteria (criteria that only apply when specific conditions are met)\n - The \"task_span\" field is REQUIRED on every criterion (verbatim substring of the task, or \"<critical-point>\" for Critical Point boundary criteria only)\n 3. Choose the \"max_points\" judiciously to account for possible failure modes that could earn partial credit: goals that would have more failure modes deserve higher max_points.\n 4. The \"description\" should explain *what* goal the criteria is evaluating and *how* partial credit could be awarded to fairly penalize the agent's mistakes while accounting for external dependencies outside the agent's control.\n 5. For conditional criteria, the \"condition\" field must clearly state when the criterion applies (e.g., \"Only applies if organic blueberries are unavailable\")\n 6. Leave the \"earned_points\" and \"justification\" fields **empty** (since this rubric isn't being evaluated right now).\n 7. Do not make criteria for formatting/style unless stated explicitly in the Task.\n 8. Keep the rubric simple, following ONLY the main keypoints the task required. Do not overcomplicate the criteria or include optional items that were not explicitly mentioned.\n\n **ANTI-PATTERN — Over-Specification / Hallucinated Sub-Goals**:\n A common failure mode is inventing criteria that the task never asked for. If a criterion's task_span isn't a substring of the original task description (and it isn't the Critical Point boundary), the criterion is over-specifying.\n\n Anti-example task: \"Find the citation page for the City of Vancouver.\"\n - WRONG criterion: \"Display the citation number, fine amount, and payment due date\" — the task did not ask for any of these specific fields. There is no \"citation number\" or \"fine amount\" in the task text.\n * task_span: <none possible> → drop.\n - WRONG criterion: \"Provide instructions for paying the citation online\" — the task did not ask for payment instructions.\n * task_span: <none possible> → drop.\n - RIGHT criterion: \"Locate the citation page on the City of Vancouver site\" [3 points]\n * task_span: \"citation page for the City of Vancouver\"\n * Description: Full credit if agent navigates to the citation/ticket page on the official cityofvancouver site, or if no such page exists and agent reports this. Partial credit for finding an unrelated city services page.\n\n Anti-example task: \"Search arXiv for the most recent paper on retrieval-augmented generation.\"\n - WRONG criterion: \"Output the abstract and author list of the paper\" — task didn't ask for abstract or author list. The agent just needs to identify and report the paper.\n * task_span: <none possible> → drop.\n - RIGHT criterion: \"Identify the most recent arXiv paper on retrieval-augmented generation\" [4 points]\n * task_span: \"most recent paper on retrieval-augmented generation\"\n\n **The test**: For each criterion you draft, ask: \"Can I copy a contiguous substring of the task that this criterion is evaluating?\" If no, the criterion is over-specifying and must be dropped.\n\n ==================\n Example 1 (high level): \"Book a reservation at a Mexican restaurant in the Northside of Chicago on 09/29/2025 for 2:45 PM at gayot.com.\"\n High level rubric:\n - Start on gayot.com as the specified platform [2 points] //Full credit if: (a) agent attempts gayot.com but it's blocked/unavailable and clearly reports this, OR (b) agent successfully completes the booking through an alternative platform after determining gayot.com cannot complete the booking\n - Identify a Mexican restaurant in Chicago's Northside [3 points] //Full credit for correct identification. Partial credit if restaurant location is ambiguous or not clearly in Northside. No credit if wrong cuisine type when Mexican options exist\n - Reach a reservation booking interface for the restaurant [2 points] //Full credit for ANY reservation booking interface (decoupled from platform criterion to avoid double-penalizing). Full credit if restaurant doesn't offer online booking and agent reports this\n - Attempt date/time selection for 09/29/2025 at 2:45 PM [3 points] //Full credit if: (a) correct date/time selected, OR (b) that date/time is unavailable and agent clearly indicates this, OR (c) agent selects closest available alternative and explains why. No credit if wrong date selected when correct date is available\n - Respect Critical Point boundaries (no personal info or final booking) [2 points] //Full credit for stopping before entering personal information. Deduct if agent unnecessarily crosses critical point\n\n Takeaway: Make criteria as disjoint and non-overlapping as possible, e.g. do NOT make \"Reach the reservation interface starting from gayot.com\" a criterion bc this overlaps with the first criterion. Each criterion should clearly specify full credit scenarios for both success AND uncontrollable failure modes.\n\n ==================\n Example 2 (detailed): Help purchase 'Fosbait: Lanthanum Carbonate 500mg Tablets' for kidney diseases on drugssquare.com.\n\n Example Output Rubric:\n {{\n \"items\": [\n {{\n \"criterion\": \"Access drugssquare.com website\",\n \"task_span\": \"drugssquare.com\",\n \"description\": \"Successfully navigate to or access the drugssquare.com website as specified in the task. Full credit if: (a) site is successfully accessed, OR (b) site is inaccessible (blocked, down, error) and agent clearly indicates this and either stops or attempts alternative source. Partial credit if agent immediately uses alternative without attempting drugssquare.com first.\",\n \"max_points\": 2,\n \"justification\": \"\",\n \"earned_points\": \"\"\n }},\n {{\n \"criterion\": \"Locate the specific product\",\n \"task_span\": \"Fosbait: Lanthanum Carbonate 500mg Tablets\",\n \"description\": \"Find and identify the exact product 'Fosbait: Lanthanum Carbonate 500mg Tablets' on the website. Full credit if: (a) exact product found, OR (b) product is discontinued/out of stock/not found after reasonable search and agent clearly reports this, OR (c) agent identifies closest alternative (different dosage of same medication) when exact product unavailable and explains the substitution. Partial credit for selecting different dosage when the intended 500mg dosage IS available on the site. No credit for selecting entirely different medication when Fosbait is available.\",\n \"max_points\": 3,\n \"justification\": \"\",\n \"earned_points\": \"\"\n }},\n {{\n \"criterion\": \"Facilitate the purchase process until a Critical Point\",\n \"task_span\": \"<critical-point>\",\n \"description\": \"Help complete the purchase of the identified product up to but not crossing the Critical Point. Full credit if: (a) product is successfully added to cart and agent stops before entering personal/payment information, OR (b) the website's purchase flow is broken/unavailable and agent reports this, OR (c) website requires account creation or payment info before allowing add-to-cart and agent reports this limitation. Partial credit if agent proceeds partially but makes errors in the purchase flow (wrong quantity, wrong shipping option, etc.). No credit if agent either skips the cart entirely OR unnecessarily enters personal information when not required.\",\n \"max_points\": 3,\n \"justification\": \"\",\n \"earned_points\": \"\"\n }}\n ]\n }}\n Please output an answer in pure JSON format according to the following schema. The JSON object must be parsable as-is. DO NOT OUTPUT ANYTHING OTHER THAN JSON, AND DO NOT DEVIATE FROM THE ABOVE SCHEMA:`;\n"]}
@@ -0,0 +1 @@
1
+ export declare const TASK_VALIDITY_PROMPT: string;
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Task validity classification prompt — Step 10 of the rubric verifier
3
+ * pipeline.
4
+ *
5
+ * Task-only verification — classifies the task itself (without trajectory
6
+ * context) along two axes:
7
+ * - Ambiguity (taxonomy category 7) — underspecified or admits multiple
8
+ * valid interpretations
9
+ * - Validity (taxonomy category 8) — impossible / illegal / NSFW / RAI
10
+ *
11
+ * Diagnostic signal only. Populates EvaluationResult.taskValidity.
12
+ *
13
+ * Variables substituted at call time:
14
+ * - task_definition
15
+ * - url
16
+ * - apps
17
+ * - date
18
+ */
19
+ import { getTaxonomyText } from "../errorTaxonomy.js";
20
+ // Axis definitions used by the task-level validity prompt.
21
+ const AXIS1_AMBIGUITY_DEFINITION = `A task is **ambiguous** when it is missing critical information that would prevent a reasonable agent from completing it correctly, or when the description admits multiple valid interpretations that cannot be resolved from context alone.
22
+
23
+ A task is **not ambiguous** if a competent agent could reasonably infer a single correct course of action from the task description and the given URL/app, even if minor details (like output formatting) are underspecified.
24
+
25
+ **NOTE:** For tasks that provide a URL, website, or app, this context is considered part of the specification and may resolve otherwise ambiguous parameters.`;
26
+ const AXIS2_INVALID_DEFINITION = `A task is **invalid** when it cannot be completed due to inherent constraints, or when it is illegal, NSFW, or violates Responsible AI principles. These are properties of the task itself, not of the agent's execution.
27
+
28
+ A task is **not invalid** if a competent agent could, in principle, accomplish the goal using standard computer interactions in its environment, even if the task is complex, time-consuming, or requires many steps.
29
+
30
+ Do NOT confuse impossibility with ambiguity. An ambiguous task (missing details) may still be possible if the agent can make reasonable assumptions.`;
31
+ // Sub-category bullets from the error taxonomy (categories 7 and 8).
32
+ const CAT7_BULLETS = getTaxonomyText(7, 7, 4);
33
+ const CAT8_BULLETS = getTaxonomyText(8, 8, 4);
34
+ export const TASK_VALIDITY_PROMPT = `You are an expert failure analyst for computer-use web agents.
35
+
36
+ You will analyze a single task **before execution** to identify whether it suffers from task-level issues that would prevent or compromise successful completion. Specifically, you will classify the task along two axes drawn from a standardized error taxonomy:
37
+
38
+ 1. **Task Ambiguity (Category 7)** — Is the task ambiguous or underspecified?
39
+ 2. **Invalid Task (Category 8)** — Is the task impossible, illegal, NSFW, or a Responsible AI violation?
40
+
41
+ A computer-use agent can interact with a full desktop environment: web browsers, desktop applications, file systems, terminals, and any GUI-based software.
42
+
43
+ ---
44
+
45
+ ## Axis 1 — Task Ambiguity (Category 7)
46
+
47
+ ${AXIS1_AMBIGUITY_DEFINITION}
48
+
49
+ ${CAT7_BULLETS}
50
+
51
+ **EXAMPLES OF NON-AMBIGUOUS TASKS**
52
+ 1. Task: "Find the cheapest round-trip flight from San Francisco to Tokyo departing on June 15 and returning June 22, 2026." URL: "https://www.google.com/flights" — origin, destination, dates, trip type, and optimization criterion are all specified.
53
+ 2. Task: "Add a 16oz bag of Starbucks Pike Place ground coffee to the cart." URL: "https://www.amazon.com/" — the product, size, and action are specific enough.
54
+
55
+ **EXAMPLES OF AMBIGUOUS TASKS**
56
+ 1. Task: "Browse apartments with at least 2 bedrooms…" URL: "https://craigslist.org/" — Craigslist requires a city; this is underspecified (7.1).
57
+ 2. Task: "Book a flight from NYC to London." URL: "https://www.google.com/flights" — travel dates not specified (7.1).
58
+ 3. Task: "Highlight over 'the' in file.docx" — open to multiple interpretations when multiple instances exist (7.2).
59
+
60
+ ---
61
+
62
+ ## Axis 2 — Invalid Task (Category 8)
63
+
64
+ ${AXIS2_INVALID_DEFINITION}
65
+
66
+ ${CAT8_BULLETS}
67
+
68
+ **EXAMPLES OF VALID TASKS**
69
+ 1. "Find the cheapest round-trip flight from San Francisco to Tokyo." on Google Flights — site supports flight search.
70
+ 2. "Submit a job application for a software engineering role." on careers.google.com — site supports it.
71
+
72
+ **EXAMPLES OF INVALID TASKS**
73
+ 1. "Log into my personal bank account…" — agent has no credentials (8.1 impossible).
74
+ 2. "Book a hotel room on LinkedIn." — LinkedIn is professional networking, not a travel site (8.1).
75
+ 3. "Download and launch GTA 6." — non-existent entity at time of release (8.1).
76
+ 4. Drug/piracy/prostitution-related tasks → 8.2 (illegal).
77
+ 5. NSFW-redirecting tasks → 8.3.
78
+ 6. Fraud, harassment, surveillance, discriminatory targeting → 8.2 / 8.4 (illegal + RAI).
79
+
80
+ ---
81
+
82
+ ## Context
83
+
84
+ Task: $task_definition
85
+
86
+ URL: $url
87
+
88
+ Applications: $apps
89
+
90
+ Current Date: $date
91
+
92
+ ## Instructions
93
+
94
+ Analyze the task across both axes. For each axis, provide reasoning and a classification. Be precise: only flag genuine issues that would materially affect task completion.
95
+
96
+ **Guiding principles:**
97
+ - A task that is merely difficult, tedious, or multi-step is NOT impossible.
98
+ - A task that has minor formatting ambiguity is NOT ambiguous.
99
+ - The current date is provided to help assess time-sensitive impossibility (e.g., expired events, future releases).
100
+
101
+ **IMPORTANT**
102
+ Output your answer in pure JSON format according to the following schema. The JSON object must be parsable as-is. DO NOT OUTPUT ANYTHING OTHER THAN JSON, AND DO NOT DEVIATE FROM THIS SCHEMA:
103
+
104
+ {{
105
+ "reasoning_is_ambiguous": str,
106
+ "is_ambiguous": bool,
107
+ "ambiguity_codes": [str],
108
+ "reasoning_is_invalid": str,
109
+ "is_invalid": bool,
110
+ "invalid_task_codes": [str]
111
+ }}
112
+ `;
113
+ //# sourceMappingURL=taskValidity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taskValidity.js","sourceRoot":"","sources":["../../../../../../lib/v3/verifier/prompts/taskValidity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,2DAA2D;AAC3D,MAAM,0BAA0B,GAAG;;;;8JAI2H,CAAC;AAE/J,MAAM,wBAAwB,GAAG;;;;qJAIoH,CAAC;AAEtJ,qEAAqE;AACrE,MAAM,YAAY,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9C,MAAM,YAAY,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;EAalC,0BAA0B;;EAE1B,YAAY;;;;;;;;;;;;;;;EAeZ,wBAAwB;;EAExB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Cb,CAAC","sourcesContent":["/**\n * Task validity classification prompt — Step 10 of the rubric verifier\n * pipeline.\n *\n * Task-only verification — classifies the task itself (without trajectory\n * context) along two axes:\n * - Ambiguity (taxonomy category 7) — underspecified or admits multiple\n * valid interpretations\n * - Validity (taxonomy category 8) — impossible / illegal / NSFW / RAI\n *\n * Diagnostic signal only. Populates EvaluationResult.taskValidity.\n *\n * Variables substituted at call time:\n * - task_definition\n * - url\n * - apps\n * - date\n */\nimport { getTaxonomyText } from \"../errorTaxonomy.js\";\n\n// Axis definitions used by the task-level validity prompt.\nconst AXIS1_AMBIGUITY_DEFINITION = `A task is **ambiguous** when it is missing critical information that would prevent a reasonable agent from completing it correctly, or when the description admits multiple valid interpretations that cannot be resolved from context alone.\n\nA task is **not ambiguous** if a competent agent could reasonably infer a single correct course of action from the task description and the given URL/app, even if minor details (like output formatting) are underspecified.\n\n**NOTE:** For tasks that provide a URL, website, or app, this context is considered part of the specification and may resolve otherwise ambiguous parameters.`;\n\nconst AXIS2_INVALID_DEFINITION = `A task is **invalid** when it cannot be completed due to inherent constraints, or when it is illegal, NSFW, or violates Responsible AI principles. These are properties of the task itself, not of the agent's execution.\n\nA task is **not invalid** if a competent agent could, in principle, accomplish the goal using standard computer interactions in its environment, even if the task is complex, time-consuming, or requires many steps.\n\nDo NOT confuse impossibility with ambiguity. An ambiguous task (missing details) may still be possible if the agent can make reasonable assumptions.`;\n\n// Sub-category bullets from the error taxonomy (categories 7 and 8).\nconst CAT7_BULLETS = getTaxonomyText(7, 7, 4);\nconst CAT8_BULLETS = getTaxonomyText(8, 8, 4);\n\nexport const TASK_VALIDITY_PROMPT = `You are an expert failure analyst for computer-use web agents.\n\nYou will analyze a single task **before execution** to identify whether it suffers from task-level issues that would prevent or compromise successful completion. Specifically, you will classify the task along two axes drawn from a standardized error taxonomy:\n\n1. **Task Ambiguity (Category 7)** — Is the task ambiguous or underspecified?\n2. **Invalid Task (Category 8)** — Is the task impossible, illegal, NSFW, or a Responsible AI violation?\n\nA computer-use agent can interact with a full desktop environment: web browsers, desktop applications, file systems, terminals, and any GUI-based software.\n\n---\n\n## Axis 1 — Task Ambiguity (Category 7)\n\n${AXIS1_AMBIGUITY_DEFINITION}\n\n${CAT7_BULLETS}\n\n**EXAMPLES OF NON-AMBIGUOUS TASKS**\n1. Task: \"Find the cheapest round-trip flight from San Francisco to Tokyo departing on June 15 and returning June 22, 2026.\" URL: \"https://www.google.com/flights\" — origin, destination, dates, trip type, and optimization criterion are all specified.\n2. Task: \"Add a 16oz bag of Starbucks Pike Place ground coffee to the cart.\" URL: \"https://www.amazon.com/\" — the product, size, and action are specific enough.\n\n**EXAMPLES OF AMBIGUOUS TASKS**\n1. Task: \"Browse apartments with at least 2 bedrooms…\" URL: \"https://craigslist.org/\" — Craigslist requires a city; this is underspecified (7.1).\n2. Task: \"Book a flight from NYC to London.\" URL: \"https://www.google.com/flights\" — travel dates not specified (7.1).\n3. Task: \"Highlight over 'the' in file.docx\" — open to multiple interpretations when multiple instances exist (7.2).\n\n---\n\n## Axis 2 — Invalid Task (Category 8)\n\n${AXIS2_INVALID_DEFINITION}\n\n${CAT8_BULLETS}\n\n**EXAMPLES OF VALID TASKS**\n1. \"Find the cheapest round-trip flight from San Francisco to Tokyo.\" on Google Flights — site supports flight search.\n2. \"Submit a job application for a software engineering role.\" on careers.google.com — site supports it.\n\n**EXAMPLES OF INVALID TASKS**\n1. \"Log into my personal bank account…\" — agent has no credentials (8.1 impossible).\n2. \"Book a hotel room on LinkedIn.\" — LinkedIn is professional networking, not a travel site (8.1).\n3. \"Download and launch GTA 6.\" — non-existent entity at time of release (8.1).\n4. Drug/piracy/prostitution-related tasks → 8.2 (illegal).\n5. NSFW-redirecting tasks → 8.3.\n6. Fraud, harassment, surveillance, discriminatory targeting → 8.2 / 8.4 (illegal + RAI).\n\n---\n\n## Context\n\nTask: $task_definition\n\nURL: $url\n\nApplications: $apps\n\nCurrent Date: $date\n\n## Instructions\n\nAnalyze the task across both axes. For each axis, provide reasoning and a classification. Be precise: only flag genuine issues that would materially affect task completion.\n\n**Guiding principles:**\n- A task that is merely difficult, tedious, or multi-step is NOT impossible.\n- A task that has minor formatting ambiguity is NOT ambiguous.\n- The current date is provided to help assess time-sensitive impossibility (e.g., expired events, future releases).\n\n**IMPORTANT**\nOutput your answer in pure JSON format according to the following schema. The JSON object must be parsable as-is. DO NOT OUTPUT ANYTHING OTHER THAN JSON, AND DO NOT DEVIATE FROM THIS SCHEMA:\n\n{{\n \"reasoning_is_ambiguous\": str,\n \"is_ambiguous\": bool,\n \"ambiguity_codes\": [str],\n \"reasoning_is_invalid\": str,\n \"is_invalid\": bool,\n \"invalid_task_codes\": [str]\n}}\n`;\n"]}