@stigmer/runner 3.14.1 → 3.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/dist/.build-fingerprint +1 -1
  2. package/dist/__test-utils__/execution-record-fixture.d.ts +47 -0
  3. package/dist/__test-utils__/execution-record-fixture.js +68 -0
  4. package/dist/__test-utils__/execution-record-fixture.js.map +1 -0
  5. package/dist/__test-utils__/harness-contract/types.d.ts +166 -0
  6. package/dist/__test-utils__/harness-contract/types.js +49 -0
  7. package/dist/__test-utils__/harness-contract/types.js.map +1 -0
  8. package/dist/__test-utils__/hermetic-activity.d.ts +28 -5
  9. package/dist/__test-utils__/hermetic-activity.js +23 -7
  10. package/dist/__test-utils__/hermetic-activity.js.map +1 -1
  11. package/dist/__test-utils__/mock-workspace.d.ts +15 -0
  12. package/dist/__test-utils__/mock-workspace.js +21 -0
  13. package/dist/__test-utils__/mock-workspace.js.map +1 -0
  14. package/dist/__test-utils__/model-registry-fixture.d.ts +56 -0
  15. package/dist/__test-utils__/model-registry-fixture.js +66 -0
  16. package/dist/__test-utils__/model-registry-fixture.js.map +1 -0
  17. package/dist/__test-utils__/turn-input-fixture.d.ts +60 -0
  18. package/dist/__test-utils__/turn-input-fixture.js +118 -0
  19. package/dist/__test-utils__/turn-input-fixture.js.map +1 -0
  20. package/dist/activities/execute-cursor/__test-utils__/contract-subject.d.ts +107 -0
  21. package/dist/activities/execute-cursor/__test-utils__/contract-subject.js +344 -0
  22. package/dist/activities/execute-cursor/__test-utils__/contract-subject.js.map +1 -0
  23. package/dist/activities/execute-cursor/__test-utils__/cursor-hook-harness.d.ts +20 -0
  24. package/dist/activities/execute-cursor/__test-utils__/cursor-hook-harness.js +58 -0
  25. package/dist/activities/execute-cursor/__test-utils__/cursor-hook-harness.js.map +1 -1
  26. package/dist/activities/execute-cursor/__test-utils__/gateway-substrate.js +2 -32
  27. package/dist/activities/execute-cursor/__test-utils__/gateway-substrate.js.map +1 -1
  28. package/dist/activities/execute-cursor/__test-utils__/hermetic-cursor.d.ts +38 -62
  29. package/dist/activities/execute-cursor/__test-utils__/hermetic-cursor.js +47 -121
  30. package/dist/activities/execute-cursor/__test-utils__/hermetic-cursor.js.map +1 -1
  31. package/dist/activities/execute-cursor/__test-utils__/scripted-agent.d.ts +17 -1
  32. package/dist/activities/execute-cursor/__test-utils__/scripted-agent.js +27 -4
  33. package/dist/activities/execute-cursor/__test-utils__/scripted-agent.js.map +1 -1
  34. package/dist/activities/execute-cursor/__test-utils__/scripted-sdk.d.ts +52 -11
  35. package/dist/activities/execute-cursor/__test-utils__/scripted-sdk.js +66 -7
  36. package/dist/activities/execute-cursor/__test-utils__/scripted-sdk.js.map +1 -1
  37. package/dist/activities/execute-cursor/adapter.d.ts +55 -0
  38. package/dist/activities/execute-cursor/adapter.js +119 -0
  39. package/dist/activities/execute-cursor/adapter.js.map +1 -0
  40. package/dist/activities/execute-cursor/approval-state.d.ts +2 -2
  41. package/dist/activities/execute-cursor/approval-state.js.map +1 -1
  42. package/dist/activities/execute-cursor/capture-flow.d.ts +15 -30
  43. package/dist/activities/execute-cursor/capture-flow.js +17 -26
  44. package/dist/activities/execute-cursor/capture-flow.js.map +1 -1
  45. package/dist/activities/execute-cursor/cursor-capabilities.d.ts +23 -0
  46. package/dist/activities/execute-cursor/cursor-capabilities.js +33 -0
  47. package/dist/activities/execute-cursor/cursor-capabilities.js.map +1 -0
  48. package/dist/activities/execute-cursor/cursor-mcp-config.d.ts +2 -2
  49. package/dist/activities/execute-cursor/cursor-mcp-config.js.map +1 -1
  50. package/dist/activities/execute-cursor/fetch-interceptor.d.ts +15 -25
  51. package/dist/activities/execute-cursor/fetch-interceptor.js +39 -33
  52. package/dist/activities/execute-cursor/fetch-interceptor.js.map +1 -1
  53. package/dist/activities/execute-cursor/http2-interceptor.d.ts +21 -17
  54. package/dist/activities/execute-cursor/http2-interceptor.js +38 -31
  55. package/dist/activities/execute-cursor/http2-interceptor.js.map +1 -1
  56. package/dist/activities/execute-cursor/message-translator.d.ts +28 -19
  57. package/dist/activities/execute-cursor/message-translator.js +76 -27
  58. package/dist/activities/execute-cursor/message-translator.js.map +1 -1
  59. package/dist/activities/execute-cursor/prompt-builder.d.ts +180 -11
  60. package/dist/activities/execute-cursor/prompt-builder.js +171 -0
  61. package/dist/activities/execute-cursor/prompt-builder.js.map +1 -1
  62. package/dist/activities/execute-cursor/rejection-capture.d.ts +3 -6
  63. package/dist/activities/execute-cursor/rejection-capture.js +5 -7
  64. package/dist/activities/execute-cursor/rejection-capture.js.map +1 -1
  65. package/dist/activities/execute-cursor/session-lifecycle.d.ts +1 -4
  66. package/dist/activities/execute-cursor/session-lifecycle.js.map +1 -1
  67. package/dist/activities/execute-cursor/turn-boundary.d.ts +1 -1
  68. package/dist/activities/execute-cursor/turn-settle.d.ts +49 -0
  69. package/dist/activities/execute-cursor/turn-settle.js +507 -0
  70. package/dist/activities/execute-cursor/turn-settle.js.map +1 -0
  71. package/dist/activities/execute-cursor/turn-setup.d.ts +173 -0
  72. package/dist/activities/execute-cursor/turn-setup.js +496 -0
  73. package/dist/activities/execute-cursor/turn-setup.js.map +1 -0
  74. package/dist/activities/execute-cursor/turn-stream.d.ts +41 -71
  75. package/dist/activities/execute-cursor/turn-stream.js +70 -135
  76. package/dist/activities/execute-cursor/turn-stream.js.map +1 -1
  77. package/dist/activities/execute-cursor/turn.d.ts +43 -0
  78. package/dist/activities/execute-cursor/turn.js +222 -0
  79. package/dist/activities/execute-cursor/turn.js.map +1 -0
  80. package/dist/activities/execute-cursor/usage-pricing.d.ts +38 -0
  81. package/dist/activities/execute-cursor/usage-pricing.js +50 -0
  82. package/dist/activities/execute-cursor/usage-pricing.js.map +1 -0
  83. package/dist/activities/execute-deep-agent/approval-file-change.d.ts +1 -1
  84. package/dist/activities/execute-deep-agent/approval-file-change.js +1 -1
  85. package/dist/activities/execute-deep-agent/environment.js +1 -1
  86. package/dist/activities/execute-deep-agent/environment.js.map +1 -1
  87. package/dist/activities/execute-deep-agent/setup.js +3 -2
  88. package/dist/activities/execute-deep-agent/setup.js.map +1 -1
  89. package/dist/activities/hydrate-workflow-execution.js +1 -1
  90. package/dist/activities/hydrate-workflow-execution.js.map +1 -1
  91. package/dist/config.d.ts +15 -0
  92. package/dist/config.js.map +1 -1
  93. package/dist/harness/capabilities.d.ts +16 -0
  94. package/dist/harness/capabilities.js +1 -0
  95. package/dist/harness/capabilities.js.map +1 -1
  96. package/dist/harness/persist-chokepoint.d.ts +74 -0
  97. package/dist/harness/persist-chokepoint.js +88 -0
  98. package/dist/harness/persist-chokepoint.js.map +1 -0
  99. package/dist/harness/registry.d.ts +44 -5
  100. package/dist/harness/registry.js +61 -5
  101. package/dist/harness/registry.js.map +1 -1
  102. package/dist/harness/run-turn.d.ts +53 -0
  103. package/dist/harness/run-turn.js +528 -0
  104. package/dist/harness/run-turn.js.map +1 -0
  105. package/dist/harness/stop-controller.d.ts +50 -0
  106. package/dist/harness/stop-controller.js +62 -0
  107. package/dist/harness/stop-controller.js.map +1 -0
  108. package/dist/harness/terminal-table.d.ts +141 -0
  109. package/dist/harness/terminal-table.js +239 -0
  110. package/dist/harness/terminal-table.js.map +1 -0
  111. package/dist/harness/turn-context.d.ts +523 -0
  112. package/dist/harness/turn-context.js +739 -0
  113. package/dist/harness/turn-context.js.map +1 -0
  114. package/dist/harness/types.d.ts +232 -52
  115. package/dist/harness/types.js +17 -8
  116. package/dist/harness/types.js.map +1 -1
  117. package/dist/harness/usage-accumulator.d.ts +68 -0
  118. package/dist/harness/usage-accumulator.js +101 -0
  119. package/dist/harness/usage-accumulator.js.map +1 -0
  120. package/dist/harness-adapters.d.ts +27 -0
  121. package/dist/harness-adapters.js +28 -0
  122. package/dist/harness-adapters.js.map +1 -0
  123. package/dist/main.js.map +1 -1
  124. package/dist/runner-manager.js +64 -48
  125. package/dist/runner-manager.js.map +1 -1
  126. package/dist/runner.d.ts +5 -4
  127. package/dist/runner.js +65 -64
  128. package/dist/runner.js.map +1 -1
  129. package/dist/shared/approval-policy.d.ts +1 -1
  130. package/dist/shared/approval-policy.js.map +1 -1
  131. package/dist/{activities/execute-cursor → shared}/attachment-resolver.d.ts +2 -2
  132. package/dist/{activities/execute-cursor → shared}/attachment-resolver.js +5 -5
  133. package/dist/shared/attachment-resolver.js.map +1 -0
  134. package/dist/{activities/execute-cursor → shared}/blueprint-resolver.d.ts +7 -5
  135. package/dist/{activities/execute-cursor → shared}/blueprint-resolver.js +3 -63
  136. package/dist/shared/blueprint-resolver.js.map +1 -0
  137. package/dist/shared/channel-attachment.d.ts +1 -1
  138. package/dist/shared/channel-attachment.js.map +1 -1
  139. package/dist/{activities/execute-cursor → shared}/cost-guard.d.ts +5 -1
  140. package/dist/{activities/execute-cursor → shared}/cost-guard.js +5 -1
  141. package/dist/shared/cost-guard.js.map +1 -0
  142. package/dist/{activities/execute-cursor → shared}/env-resolver.d.ts +1 -1
  143. package/dist/shared/env-resolver.js.map +1 -0
  144. package/dist/{activities/execute-cursor → shared}/exact-apply.d.ts +1 -1
  145. package/dist/{activities/execute-cursor → shared}/exact-apply.js +6 -6
  146. package/dist/shared/exact-apply.js.map +1 -0
  147. package/dist/shared/execution-context.d.ts +35 -0
  148. package/dist/shared/execution-context.js +38 -0
  149. package/dist/shared/execution-context.js.map +1 -0
  150. package/dist/{activities/execute-cursor → shared}/extract-structured-output.d.ts +5 -2
  151. package/dist/{activities/execute-cursor → shared}/extract-structured-output.js +9 -6
  152. package/dist/shared/extract-structured-output.js.map +1 -0
  153. package/dist/shared/filereview/capture.d.ts +1 -1
  154. package/dist/shared/filereview/capture.js +1 -1
  155. package/dist/shared/heartbeat.d.ts +13 -11
  156. package/dist/shared/heartbeat.js +14 -29
  157. package/dist/shared/heartbeat.js.map +1 -1
  158. package/dist/{activities/execute-cursor → shared}/persist-decision.d.ts +5 -2
  159. package/dist/{activities/execute-cursor → shared}/persist-decision.js +4 -1
  160. package/dist/shared/persist-decision.js.map +1 -0
  161. package/dist/{activities/execute-cursor → shared}/skill-resolver.d.ts +16 -3
  162. package/dist/{activities/execute-cursor → shared}/skill-resolver.js +12 -4
  163. package/dist/shared/skill-resolver.js.map +1 -0
  164. package/dist/shared/subagent-rows.d.ts +21 -0
  165. package/dist/shared/subagent-rows.js +34 -0
  166. package/dist/shared/subagent-rows.js.map +1 -0
  167. package/dist/shared/worker-shutdown.d.ts +43 -16
  168. package/dist/shared/worker-shutdown.js +28 -13
  169. package/dist/shared/worker-shutdown.js.map +1 -1
  170. package/dist/shared/workspace/platform-dir.d.ts +1 -1
  171. package/dist/shared/workspace/platform-dir.js +1 -1
  172. package/dist/shared/workspace/session-provision.d.ts +54 -0
  173. package/dist/{activities/execute-cursor/workspace-provision.js → shared/workspace/session-provision.js} +15 -12
  174. package/dist/shared/workspace/session-provision.js.map +1 -0
  175. package/package.json +4 -4
  176. package/src/__test-utils__/__tests__/harness-contract-self-check.test.ts +110 -14
  177. package/src/__test-utils__/execution-record-fixture.ts +104 -0
  178. package/src/__test-utils__/harness-boot-order-child.ts +58 -0
  179. package/src/__test-utils__/harness-contract/contract.ts +128 -83
  180. package/src/__test-utils__/harness-contract/recording-sink.ts +15 -4
  181. package/src/__test-utils__/harness-contract/runtime-contract.ts +666 -0
  182. package/src/__test-utils__/harness-contract/scripted-adapter.ts +92 -32
  183. package/src/__test-utils__/harness-contract/types.ts +85 -9
  184. package/src/__test-utils__/hermetic-activity.ts +33 -8
  185. package/src/__test-utils__/model-registry-fixture.ts +72 -0
  186. package/src/__test-utils__/module-specifiers.ts +82 -0
  187. package/src/__test-utils__/turn-input-fixture.ts +155 -0
  188. package/src/__tests__/harness-boot-order.test.ts +77 -0
  189. package/src/__tests__/harness-contract.test.ts +7 -5
  190. package/src/__tests__/runner-manager.test.ts +18 -0
  191. package/src/activities/execute-cursor/__test-utils__/__tests__/scripted-double.test.ts +102 -0
  192. package/src/activities/execute-cursor/__test-utils__/contract-subject.ts +396 -0
  193. package/src/activities/execute-cursor/__test-utils__/cursor-hook-harness.ts +66 -0
  194. package/src/activities/execute-cursor/__test-utils__/gateway-substrate.ts +2 -43
  195. package/src/activities/execute-cursor/__test-utils__/hermetic-cursor.ts +65 -145
  196. package/src/activities/execute-cursor/__test-utils__/scripted-agent.ts +30 -4
  197. package/src/activities/execute-cursor/__test-utils__/scripted-sdk.ts +96 -8
  198. package/src/activities/execute-cursor/__tests__/adapter-is-temporal-free.test.ts +45 -0
  199. package/src/activities/execute-cursor/__tests__/approval-decisions-agree.test.ts +90 -0
  200. package/src/activities/execute-cursor/__tests__/build-prompt.test.ts +7 -8
  201. package/src/activities/execute-cursor/__tests__/capture-flow.test.ts +28 -1
  202. package/src/activities/execute-cursor/__tests__/deny-gate-exact-apply.test.ts +1 -1
  203. package/src/activities/execute-cursor/__tests__/fetch-interceptor.test.ts +64 -6
  204. package/src/activities/execute-cursor/__tests__/hermetic/deny-and-retry.test.ts +1 -1
  205. package/src/activities/execute-cursor/__tests__/hermetic/file-review-capture.test.ts +1 -1
  206. package/src/activities/execute-cursor/__tests__/hermetic/goldens/cost-cap.status.json +53 -0
  207. package/src/activities/execute-cursor/__tests__/hermetic/goldens/pause.status.json +1 -6
  208. package/src/activities/execute-cursor/__tests__/hermetic/goldens/platform-stop.status.json +56 -0
  209. package/src/activities/execute-cursor/__tests__/hermetic/goldens/recovery-transport-timeout.status.json +48 -0
  210. package/src/activities/execute-cursor/__tests__/hermetic/goldens/resolution-error.status.json +18 -0
  211. package/src/activities/execute-cursor/__tests__/hermetic/goldens/run-cancelled.status.json +36 -0
  212. package/src/activities/execute-cursor/__tests__/hermetic/goldens/run-error-non-retryable.status.json +37 -0
  213. package/src/activities/execute-cursor/__tests__/hermetic/goldens/sdk-error-at-create.status.json +38 -0
  214. package/src/activities/execute-cursor/__tests__/hermetic/goldens/stall.status.json +59 -0
  215. package/src/activities/execute-cursor/__tests__/hermetic/goldens/unattributed-hook-block.status.json +79 -0
  216. package/src/activities/execute-cursor/__tests__/hermetic/goldens/worker-shutdown.status.json +2 -7
  217. package/src/activities/execute-cursor/__tests__/hermetic/harness-contract.test.ts +170 -0
  218. package/src/activities/execute-cursor/__tests__/hermetic/pause-vs-shutdown.test.ts +22 -18
  219. package/src/activities/execute-cursor/__tests__/hermetic/plain-turn.test.ts +1 -1
  220. package/src/activities/execute-cursor/__tests__/hermetic/recovery-fresh-agent.test.ts +1 -1
  221. package/src/activities/execute-cursor/__tests__/hermetic/run-wait-arms.test.ts +286 -0
  222. package/src/activities/execute-cursor/__tests__/hermetic/stream-self-stop-arms.test.ts +332 -0
  223. package/src/activities/execute-cursor/__tests__/hermetic/thrown-error-arms.test.ts +193 -0
  224. package/src/activities/execute-cursor/__tests__/hermetic/tool-call.test.ts +1 -1
  225. package/src/activities/execute-cursor/__tests__/hermetic/unattributed-hook-block.test.ts +185 -0
  226. package/src/activities/execute-cursor/__tests__/hermetic/workspace-lock-timeout.test.ts +151 -0
  227. package/src/activities/execute-cursor/__tests__/http2-interceptor.test.ts +65 -35
  228. package/src/activities/execute-cursor/__tests__/message-translator.test.ts +0 -40
  229. package/src/activities/execute-cursor/__tests__/same-identity-reproposal.test.ts +171 -0
  230. package/src/activities/execute-cursor/__tests__/turn-stream.test.ts +118 -243
  231. package/src/activities/execute-cursor/__tests__/usage-pricing.test.ts +84 -0
  232. package/src/activities/execute-cursor/adapter.ts +138 -0
  233. package/src/activities/execute-cursor/approval-state.ts +2 -2
  234. package/src/activities/execute-cursor/capture-flow.ts +18 -41
  235. package/src/activities/execute-cursor/cursor-capabilities.ts +35 -0
  236. package/src/activities/execute-cursor/cursor-mcp-config.ts +2 -2
  237. package/src/activities/execute-cursor/fetch-interceptor.ts +48 -45
  238. package/src/activities/execute-cursor/http2-interceptor.ts +47 -34
  239. package/src/activities/execute-cursor/message-translator.ts +90 -45
  240. package/src/activities/execute-cursor/prompt-builder.ts +327 -12
  241. package/src/activities/execute-cursor/rejection-capture.ts +5 -12
  242. package/src/activities/execute-cursor/session-lifecycle.ts +1 -5
  243. package/src/activities/execute-cursor/turn-boundary.ts +1 -1
  244. package/src/activities/execute-cursor/turn-settle.ts +601 -0
  245. package/src/activities/execute-cursor/turn-setup.ts +645 -0
  246. package/src/activities/execute-cursor/turn-stream.ts +84 -210
  247. package/src/activities/execute-cursor/turn.ts +240 -0
  248. package/src/activities/execute-cursor/usage-pricing.ts +67 -0
  249. package/src/activities/execute-deep-agent/approval-file-change.ts +1 -1
  250. package/src/activities/execute-deep-agent/environment.ts +1 -1
  251. package/src/activities/execute-deep-agent/setup.ts +3 -2
  252. package/src/activities/hydrate-workflow-execution.ts +1 -1
  253. package/src/config.ts +13 -0
  254. package/src/harness/__tests__/import-direction.test.ts +168 -0
  255. package/src/harness/__tests__/persist-chokepoint.test.ts +146 -0
  256. package/src/harness/__tests__/registry.test.ts +1 -0
  257. package/src/harness/__tests__/run-turn.test.ts +165 -0
  258. package/src/harness/__tests__/stop-controller.test.ts +49 -0
  259. package/src/harness/__tests__/turn-context.test.ts +178 -0
  260. package/src/harness/__tests__/usage-accumulator.test.ts +83 -0
  261. package/src/harness/capabilities.ts +17 -0
  262. package/src/harness/persist-chokepoint.ts +112 -0
  263. package/src/harness/registry.ts +79 -5
  264. package/src/harness/run-turn.ts +618 -0
  265. package/src/harness/stop-controller.ts +83 -0
  266. package/src/harness/terminal-table.ts +276 -0
  267. package/src/harness/turn-context.ts +1028 -0
  268. package/src/harness/types.ts +248 -53
  269. package/src/harness/usage-accumulator.ts +122 -0
  270. package/src/harness-adapters.ts +30 -0
  271. package/src/main.ts +1 -1
  272. package/src/runner-manager.ts +68 -61
  273. package/src/runner.ts +67 -78
  274. package/src/shared/__tests__/attachment-naming.test.ts +1 -1
  275. package/src/{activities/execute-cursor → shared}/__tests__/attachment-resolver.test.ts +6 -4
  276. package/src/{activities/execute-cursor → shared}/__tests__/cost-guard.test.ts +2 -1
  277. package/src/{activities/execute-cursor → shared}/__tests__/exact-apply.test.ts +3 -3
  278. package/src/{activities/execute-cursor → shared}/__tests__/extract-structured-output.test.ts +8 -8
  279. package/src/{activities/execute-cursor → shared}/__tests__/persist-decision.test.ts +4 -2
  280. package/src/{activities/execute-cursor → shared}/__tests__/skill-resolver.test.ts +1 -1
  281. package/src/shared/__tests__/subagent-rows.test.ts +34 -0
  282. package/src/shared/__tests__/worker-shutdown.test.ts +44 -39
  283. package/src/shared/approval-policy.ts +1 -1
  284. package/src/{activities/execute-cursor → shared}/attachment-resolver.ts +6 -6
  285. package/src/{activities/execute-cursor → shared}/blueprint-resolver.ts +7 -78
  286. package/src/shared/channel-attachment.ts +1 -1
  287. package/src/{activities/execute-cursor → shared}/cost-guard.ts +5 -1
  288. package/src/{activities/execute-cursor → shared}/env-resolver.ts +1 -1
  289. package/src/{activities/execute-cursor → shared}/exact-apply.ts +7 -7
  290. package/src/shared/execution-context.ts +45 -0
  291. package/src/{activities/execute-cursor → shared}/extract-structured-output.ts +10 -7
  292. package/src/shared/filereview/capture.ts +1 -1
  293. package/src/shared/heartbeat.ts +13 -33
  294. package/src/{activities/execute-cursor → shared}/persist-decision.ts +5 -2
  295. package/src/{activities/execute-cursor → shared}/skill-resolver.ts +20 -6
  296. package/src/shared/subagent-rows.ts +39 -0
  297. package/src/shared/worker-shutdown.ts +55 -25
  298. package/src/{activities/execute-cursor/__tests__/workspace-provision.test.ts → shared/workspace/__tests__/session-provision.test.ts} +25 -28
  299. package/src/shared/workspace/platform-dir.ts +1 -1
  300. package/src/{activities/execute-cursor/workspace-provision.ts → shared/workspace/session-provision.ts} +29 -16
  301. package/dist/activities/execute-cursor/attachment-resolver.js.map +0 -1
  302. package/dist/activities/execute-cursor/blueprint-resolver.js.map +0 -1
  303. package/dist/activities/execute-cursor/cost-guard.js.map +0 -1
  304. package/dist/activities/execute-cursor/env-resolver.js.map +0 -1
  305. package/dist/activities/execute-cursor/exact-apply.js.map +0 -1
  306. package/dist/activities/execute-cursor/extract-structured-output.js.map +0 -1
  307. package/dist/activities/execute-cursor/index.d.ts +0 -209
  308. package/dist/activities/execute-cursor/index.js +0 -2345
  309. package/dist/activities/execute-cursor/index.js.map +0 -1
  310. package/dist/activities/execute-cursor/persist-decision.js.map +0 -1
  311. package/dist/activities/execute-cursor/skill-resolver.js.map +0 -1
  312. package/dist/activities/execute-cursor/usage-accumulator.d.ts +0 -89
  313. package/dist/activities/execute-cursor/usage-accumulator.js +0 -121
  314. package/dist/activities/execute-cursor/usage-accumulator.js.map +0 -1
  315. package/dist/activities/execute-cursor/workspace-provision.d.ts +0 -42
  316. package/dist/activities/execute-cursor/workspace-provision.js.map +0 -1
  317. package/src/activities/execute-cursor/__tests__/usage-accumulator.test.ts +0 -164
  318. package/src/activities/execute-cursor/index.ts +0 -2876
  319. package/src/activities/execute-cursor/usage-accumulator.ts +0 -169
  320. /package/dist/{activities/execute-cursor → shared}/env-resolver.js +0 -0
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Two readers of one fact must agree: the turn runtime reads the adjudicated
3
+ * approvals as the VERDICT (`harness/turn-context.ts` `approvalDecisionsOf`,
4
+ * the `TurnInput.approvalDecisions` the contract carries) and this adapter
5
+ * reads the same rows for the FACTS beside the verdict (the pending-approval
6
+ * protos the grant builder and the reinvocation prompt render, the content
7
+ * digest that authorizes an approved edit by its exact bytes —
8
+ * `reconstructAdjudicatedApprovals`). The contract's rule is that an adapter
9
+ * never re-derives the verdict itself, so the two functions must select the
10
+ * same rows in the same order or the grants would be minted for a different
11
+ * set than the runtime decided on.
12
+ *
13
+ * Lives on the adapter's side because `src/harness/` never imports
14
+ * `src/activities/`, tests included (`harness/__tests__/import-direction.test.ts`).
15
+ */
16
+
17
+ import { describe, expect, it } from "vitest";
18
+ import { create } from "@bufbuild/protobuf";
19
+ import { AgentExecutionStatusSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
20
+ import { AgentMessageSchema, ToolCallSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
21
+ import { ApprovalAction, MessageType, ToolCallStatus } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
22
+
23
+ import { approvalDecisionsOf } from "../../../harness/turn-context.js";
24
+ import { reconstructAdjudicatedApprovals } from "../approval-state.js";
25
+
26
+ describe("the runtime's approvalDecisionsOf and the adapter's reconstructAdjudicatedApprovals", () => {
27
+ it("select the same rows in the same order over every row shape a transcript carries", () => {
28
+ const status = create(AgentExecutionStatusSchema, {
29
+ messages: [
30
+ create(AgentMessageSchema, {
31
+ type: MessageType.MESSAGE_AI,
32
+ toolCalls: [
33
+ create(ToolCallSchema, {
34
+ id: "tc-approved",
35
+ name: "Shell",
36
+ status: ToolCallStatus.TOOL_CALL_WAITING_APPROVAL,
37
+ approvalAction: ApprovalAction.APPROVE,
38
+ approvalContentDigest: "sha256:approved",
39
+ }),
40
+ create(ToolCallSchema, {
41
+ id: "tc-undecided",
42
+ name: "Shell",
43
+ status: ToolCallStatus.TOOL_CALL_WAITING_APPROVAL,
44
+ approvalAction: ApprovalAction.UNSPECIFIED,
45
+ }),
46
+ ],
47
+ }),
48
+ create(AgentMessageSchema, {
49
+ type: MessageType.MESSAGE_AI,
50
+ toolCalls: [
51
+ create(ToolCallSchema, {
52
+ id: "tc-completed",
53
+ name: "Read",
54
+ status: ToolCallStatus.TOOL_CALL_COMPLETED,
55
+ approvalAction: ApprovalAction.APPROVE,
56
+ }),
57
+ create(ToolCallSchema, {
58
+ id: "tc-skipped",
59
+ name: "Write",
60
+ status: ToolCallStatus.TOOL_CALL_WAITING_APPROVAL,
61
+ approvalAction: ApprovalAction.SKIP,
62
+ }),
63
+ create(ToolCallSchema, {
64
+ id: "tc-rejected",
65
+ name: "Write",
66
+ status: ToolCallStatus.TOOL_CALL_WAITING_APPROVAL,
67
+ approvalAction: ApprovalAction.REJECT,
68
+ }),
69
+ ],
70
+ }),
71
+ ],
72
+ });
73
+
74
+ const runtime = approvalDecisionsOf(status);
75
+ const adapter = reconstructAdjudicatedApprovals(status.messages);
76
+
77
+ expect([...runtime.entries()]).toEqual([...adapter.decisions.entries()]);
78
+ expect(
79
+ adapter.pendingApprovals.map((pa) => pa.toolCallId),
80
+ "the adapter's row facts cover exactly the rows the runtime decided on",
81
+ ).toEqual([...runtime.keys()]);
82
+ expect([...runtime.keys()]).toEqual(["tc-approved", "tc-skipped", "tc-rejected"]);
83
+ });
84
+
85
+ it("both read nothing from a fresh transcript", () => {
86
+ const status = create(AgentExecutionStatusSchema, {});
87
+ expect(approvalDecisionsOf(status).size).toBe(0);
88
+ expect(reconstructAdjudicatedApprovals(status.messages).decisions.size).toBe(0);
89
+ });
90
+ });
@@ -12,8 +12,8 @@ import { create } from "@bufbuild/protobuf";
12
12
  import { ApprovalAction, InteractionMode } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
13
13
  import { PendingApprovalSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/approval_pb";
14
14
 
15
- import { appendStructuredOutputDirective, buildPrompt, isHitlReinvocation, primarySendCarriesImages, promptCarriesStandingContext } from "../index.js";
16
- import type { BuildPromptInput } from "../index.js";
15
+ import { appendStructuredOutputDirective, buildPrompt, isHitlReinvocation, primarySendCarriesImages, promptCarriesStandingContext } from "../prompt-builder.js";
16
+ import type { BuildPromptInput } from "../prompt-builder.js";
17
17
  import { buildReinvocationPrompt, formatInteractionModePrefix, formatImplementPlanSection, formatToolApprovalProtocol, buildToolApprovalRuleFile } from "../prompt-builder.js";
18
18
  import { PLAN_MODE_DIRECTIVE } from "../../../shared/plan-mode-prompt.js";
19
19
  import type { AgentResolution, AgentResolutionReason } from "../session-lifecycle.js";
@@ -38,7 +38,7 @@ function resolution(
38
38
  function input(overrides: Partial<BuildPromptInput>): BuildPromptInput {
39
39
  return {
40
40
  resolution: resolution("local", "resumed_successfully"),
41
- approvalDecisions: undefined,
41
+ approvalDecisions: new Map(),
42
42
  instructions: "You are a test agent.",
43
43
  userMessage: USER_MESSAGE,
44
44
  skills: [],
@@ -357,7 +357,7 @@ describe("buildPrompt", () => {
357
357
  const prompt = buildPrompt(
358
358
  input({
359
359
  resolution: resolution("local", reason),
360
- approvalDecisions: hitl ? hitlDecisions : undefined,
360
+ approvalDecisions: hitl ? hitlDecisions : new Map(),
361
361
  pendingApprovals: hitl ? hitlApprovals : [],
362
362
  recalledMemories: { facts: ["Prefers OpenTofu."] },
363
363
  }),
@@ -395,8 +395,7 @@ describe("buildPrompt", () => {
395
395
  });
396
396
 
397
397
  describe("isHitlReinvocation (paired with resolution.reason at every consumer — issue #366)", () => {
398
- it("is false with no decisions and false with an empty map", () => {
399
- expect(isHitlReinvocation(undefined)).toBe(false);
398
+ it("is false with an empty map (the shape a turn with no adjudicated approvals carries)", () => {
400
399
  expect(isHitlReinvocation(new Map())).toBe(false);
401
400
  });
402
401
 
@@ -504,8 +503,8 @@ describe("HITL recovery — fresh agent mid-HITL (issue #366)", () => {
504
503
  // resolution-time resume failure.
505
504
  expect(primarySendCarriesImages(decisions(), "created_after_resume_failure")).toBe(true);
506
505
  // Non-HITL turns always carry the message's images, resumed or not.
507
- expect(primarySendCarriesImages(undefined, "resumed_successfully")).toBe(true);
508
- expect(primarySendCarriesImages(undefined, "created_first_execution")).toBe(true);
506
+ expect(primarySendCarriesImages(new Map(), "resumed_successfully")).toBe(true);
507
+ expect(primarySendCarriesImages(new Map(), "created_first_execution")).toBe(true);
509
508
  });
510
509
 
511
510
  it("the structured-output directive is a pure append shared by the primary and recovery sends — absent schema, absent suffix", () => {
@@ -44,7 +44,7 @@ import {
44
44
  ToolCallStatus,
45
45
  } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
46
46
  import {
47
- applyCaptureDecisions,
47
+ CURSOR_FILE_REVIEW_IDENTITY,
48
48
  captureBaselineToLedger,
49
49
  captureTurnToLedger,
50
50
  } from "../capture-flow.js";
@@ -52,6 +52,33 @@ import { toolIdentity, primaryToken } from "../approval-state.js";
52
52
  import { contentDigest } from "../../../shared/file-tools.js";
53
53
  import { buildObservationStagingScript, casObservationsDir } from "../cas-observations.js";
54
54
  import { makeInMemoryArtifactStorage } from "../../../__test-utils__/fake-artifact-storage.js";
55
+ import { applyCaptureDecisions as sharedApplyCaptureDecisions } from "../../../shared/filereview/capture.js";
56
+ import { casBlobReader } from "../../../shared/filereview/cas-substrate.js";
57
+ import type { ArtifactStorage } from "../../../shared/artifact-storage.js";
58
+ import type { FileChangeSet } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/filereview_pb";
59
+
60
+ /**
61
+ * The resume reconcile as the turn runtime runs it for this harness
62
+ * (`harness/turn-context.ts` `reconcileReinvocation`): the shared reconcile
63
+ * under Cursor's file-review identity, with the CAS blob reader derived from
64
+ * the same storage. Bound here so every resume case below proves the Cursor
65
+ * pair (harness id, excluded gate paths) over the shared code, exactly as
66
+ * production composes it.
67
+ */
68
+ function applyCaptureDecisions(opts: {
69
+ readonly status: AgentExecutionStatus;
70
+ readonly gitRoot: string;
71
+ readonly executionId: string;
72
+ readonly changeSet: FileChangeSet;
73
+ readonly storage?: ArtifactStorage;
74
+ readonly gitWorkspace?: boolean;
75
+ }) {
76
+ return sharedApplyCaptureDecisions({
77
+ ...opts,
78
+ ...CURSOR_FILE_REVIEW_IDENTITY,
79
+ readBlob: opts.storage ? casBlobReader(opts.storage) : undefined,
80
+ });
81
+ }
55
82
 
56
83
  const execFileAsync = promisify(execFile);
57
84
  const EXEC_ID = "exec-capflow-1";
@@ -50,7 +50,7 @@ import { existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
50
50
  import { tmpdir } from "node:os";
51
51
  import { join } from "node:path";
52
52
 
53
- import { applyApprovedWholeFileWrites, excludeAppliedFromGrants } from "../exact-apply.js";
53
+ import { applyApprovedWholeFileWrites, excludeAppliedFromGrants } from "../../../shared/exact-apply.js";
54
54
  import { reconstructAdjudicatedApprovals, buildApprovalGrants } from "../approval-state.js";
55
55
  import type { ApprovalGrant } from "../approval-state.js";
56
56
  import { LocalWorkspaceBackend } from "../../../shared/workspace/local-backend.js";
@@ -19,7 +19,7 @@ describe("fetch-interceptor", () => {
19
19
  let calls: CapturedCall[];
20
20
  let installFetchInterceptor: typeof import("../fetch-interceptor.js").installFetchInterceptor;
21
21
  let uninstallFetchInterceptor: typeof import("../fetch-interceptor.js").uninstallFetchInterceptor;
22
- let getExecutionContext: typeof import("../fetch-interceptor.js").getExecutionContext;
22
+ let getExecutionContext: typeof import("../../../shared/execution-context.js").getExecutionContext;
23
23
 
24
24
  beforeEach(async () => {
25
25
  calls = [];
@@ -40,7 +40,9 @@ describe("fetch-interceptor", () => {
40
40
  const mod = await import("../fetch-interceptor.js");
41
41
  installFetchInterceptor = mod.installFetchInterceptor;
42
42
  uninstallFetchInterceptor = mod.uninstallFetchInterceptor;
43
- getExecutionContext = mod.getExecutionContext;
43
+ // The store lives in shared/ and must be the SAME fresh instance the
44
+ // interceptor just imported, so it is resolved after the reset too.
45
+ getExecutionContext = (await import("../../../shared/execution-context.js")).getExecutionContext;
44
46
  });
45
47
 
46
48
  afterEach(() => {
@@ -50,7 +52,7 @@ describe("fetch-interceptor", () => {
50
52
 
51
53
  describe("Connect-RPC paths via fetch (BiDi proxy auth injection)", () => {
52
54
  beforeEach(() => {
53
- installFetchInterceptor({ proxyEndpoint: PROXY_ENDPOINT, stigmerToken: STIGMER_TOKEN });
55
+ installFetchInterceptor({ proxyEndpoint: PROXY_ENDPOINT, proxyTokenRef: { current: STIGMER_TOKEN } });
54
56
  });
55
57
 
56
58
  it("injects x-stigmer-auth on /aiserver.v1 path targeting proxy endpoint", async () => {
@@ -139,7 +141,7 @@ describe("fetch-interceptor", () => {
139
141
 
140
142
  describe("REST path URL rewriting (existing behavior)", () => {
141
143
  beforeEach(() => {
142
- installFetchInterceptor({ proxyEndpoint: PROXY_ENDPOINT, stigmerToken: STIGMER_TOKEN });
144
+ installFetchInterceptor({ proxyEndpoint: PROXY_ENDPOINT, proxyTokenRef: { current: STIGMER_TOKEN } });
143
145
  });
144
146
 
145
147
  it("rewrites Cursor-domain REST URLs and replaces auth", async () => {
@@ -171,9 +173,65 @@ describe("fetch-interceptor", () => {
171
173
  });
172
174
  });
173
175
 
176
+ describe("the token ref is read per request (the root rotates it in place; Q-S2-7)", () => {
177
+ let proxyTokenRef: { current: string | null };
178
+
179
+ beforeEach(() => {
180
+ proxyTokenRef = { current: STIGMER_TOKEN };
181
+ installFetchInterceptor({ proxyEndpoint: PROXY_ENDPOINT, proxyTokenRef });
182
+ });
183
+
184
+ it("a rotation reaches the next REST rewrite and the next BiDi-auth fetch without a call into the module", async () => {
185
+ proxyTokenRef.current = "refreshed-stigmer-jwt-token";
186
+
187
+ await globalThis.fetch("https://api.cursor.com/v1/models", { headers: { authorization: "Bearer original-key" } });
188
+ await globalThis.fetch(`${PROXY_ENDPOINT}/aiserver.v1.AnalyticsService/BootstrapStatsig`, { method: "POST" });
189
+
190
+ expect(calls).toHaveLength(2);
191
+ expect(new Headers(calls[0].init?.headers).get("authorization")).toBe("Bearer refreshed-stigmer-jwt-token");
192
+ expect(new Headers(calls[1].init?.headers).get("x-stigmer-auth")).toBe("Bearer refreshed-stigmer-jwt-token");
193
+ });
194
+
195
+ it("an emptied ref sends no proxy credential and never leaks the SDK's own authorization to the proxy", async () => {
196
+ proxyTokenRef.current = null;
197
+
198
+ await globalThis.fetch("https://api.cursor.com/v1/models", { headers: { authorization: "Bearer cursor-secret" } });
199
+ await globalThis.fetch(`${PROXY_ENDPOINT}/aiserver.v1.AnalyticsService/BootstrapStatsig`, { method: "POST" });
200
+
201
+ expect(new Headers(calls[0].init?.headers).get("authorization")).toBeNull();
202
+ expect(new Headers(calls[1].init?.headers).get("x-stigmer-auth")).toBeNull();
203
+ });
204
+ });
205
+
206
+ describe("install guard", () => {
207
+ it("a proxy endpoint with no bound ref fails the install, as a missing token always has, and leaves fetch untouched", () => {
208
+ const before = globalThis.fetch;
209
+ expect(() => installFetchInterceptor({ proxyEndpoint: PROXY_ENDPOINT, proxyTokenRef: undefined })).toThrow(
210
+ /STIGMER_TOKEN is required when STIGMER_PROXY_ENDPOINT is set/,
211
+ );
212
+ expect(() => installFetchInterceptor({ proxyEndpoint: PROXY_ENDPOINT, proxyTokenRef: { current: null } })).toThrow(
213
+ /STIGMER_TOKEN is required when STIGMER_PROXY_ENDPOINT is set/,
214
+ );
215
+ expect(globalThis.fetch).toBe(before);
216
+ });
217
+
218
+ it("is idempotent: a second install rebinds the ref and keeps delegating to the fetch captured at load", async () => {
219
+ const first = { current: "first-token" };
220
+ const second = { current: "second-token" };
221
+ installFetchInterceptor({ proxyEndpoint: PROXY_ENDPOINT, proxyTokenRef: first });
222
+ installFetchInterceptor({ proxyEndpoint: PROXY_ENDPOINT, proxyTokenRef: second });
223
+
224
+ await globalThis.fetch(`${PROXY_ENDPOINT}/aiserver.v1.AnalyticsService/BootstrapStatsig`, { method: "POST" });
225
+
226
+ // One hop to the captured fetch (a self-capture would recurse or double-wrap).
227
+ expect(calls).toHaveLength(1);
228
+ expect(new Headers(calls[0].init?.headers).get("x-stigmer-auth")).toBe("Bearer second-token");
229
+ });
230
+ });
231
+
174
232
  describe("timed REST path timing", () => {
175
233
  beforeEach(() => {
176
- installFetchInterceptor({ proxyEndpoint: PROXY_ENDPOINT, stigmerToken: STIGMER_TOKEN });
234
+ installFetchInterceptor({ proxyEndpoint: PROXY_ENDPOINT, proxyTokenRef: { current: STIGMER_TOKEN } });
177
235
  });
178
236
 
179
237
  /**
@@ -284,7 +342,7 @@ describe("fetch-interceptor", () => {
284
342
 
285
343
  describe("passthrough (no interception)", () => {
286
344
  beforeEach(() => {
287
- installFetchInterceptor({ proxyEndpoint: PROXY_ENDPOINT, stigmerToken: STIGMER_TOKEN });
345
+ installFetchInterceptor({ proxyEndpoint: PROXY_ENDPOINT, proxyTokenRef: { current: STIGMER_TOKEN } });
288
346
  });
289
347
 
290
348
  it("does NOT intercept Connect-RPC paths on non-proxy hosts", async () => {
@@ -69,8 +69,8 @@ import {
69
69
  runCursorTurn,
70
70
  runWorkspaceHook,
71
71
  sessionWorkspaceDir,
72
- stubRegistryFetch,
73
72
  } from "../../__test-utils__/hermetic-cursor.js";
73
+ import { stubRegistryFetch } from "../../../../__test-utils__/model-registry-fixture.js";
74
74
 
75
75
  const AGENT_ID = "agent-hermetic-deny-0001";
76
76
  const RUN_1 = "run-hermetic-deny-0001";
@@ -62,8 +62,8 @@ import {
62
62
  localPathEntry,
63
63
  runCursorTurn,
64
64
  runWorkspaceHook,
65
- stubRegistryFetch,
66
65
  } from "../../__test-utils__/hermetic-cursor.js";
66
+ import { stubRegistryFetch } from "../../../../__test-utils__/model-registry-fixture.js";
67
67
 
68
68
  const AGENT_ID = "agent-hermetic-capture-0001";
69
69
  const RUN_ID = "run-hermetic-capture-0001";
@@ -0,0 +1,53 @@
1
+ {
2
+ "messages": [
3
+ {
4
+ "type": "MESSAGE_AI",
5
+ "content": "Reading the whole repository first.",
6
+ "timestamp": "2026-01-01T00:00:02.000Z"
7
+ },
8
+ {
9
+ "type": "MESSAGE_SYSTEM",
10
+ "content": "The agent reached the cost limit for this message. Work completed so far has been saved. Send another message to continue where the agent left off.",
11
+ "timestamp": "2026-01-01T00:00:03.000Z"
12
+ }
13
+ ],
14
+ "phase": "EXECUTION_TERMINATED",
15
+ "error": "Agent reached the cost limit for this message (~$0.6000 of the $0.50 budget). Send another message to continue.",
16
+ "startedAt": "2026-01-01T00:00:00.000Z",
17
+ "completedAt": "2026-01-01T00:00:03.000Z",
18
+ "streamingUsage": {
19
+ "inputTokens": "600000",
20
+ "totalTokens": "600000",
21
+ "turnCount": 1,
22
+ "estimatedCostUsd": 0.6,
23
+ "model": "composer-2.5",
24
+ "observedAt": "2026-01-01T00:00:03.000Z",
25
+ "requestedServiceTier": "SERVICE_TIER_STANDARD",
26
+ "requestedModelParams": "[{\"id\":\"fast\",\"value\":\"false\"},{\"id\":\"thinking\",\"value\":\"false\"}]",
27
+ "requestedThinkingMode": "THINKING_MODE_DISABLED"
28
+ },
29
+ "fileReviewEventStream": {
30
+ "executionId": "aex_hermetic_0001",
31
+ "events": [
32
+ {
33
+ "eventId": "aex_hermetic_0001:0:aex_hermetic_0001:0:FILE_REVIEW_EVENT_TYPE_BASELINE_CAPTURED",
34
+ "changeSetId": "aex_hermetic_0001:0",
35
+ "eventType": "FILE_REVIEW_EVENT_TYPE_BASELINE_CAPTURED",
36
+ "timestamp": "2026-01-01T00:00:00.000Z",
37
+ "actor": "runner",
38
+ "baselineCaptured": {
39
+ "changeSetId": "aex_hermetic_0001:0",
40
+ "turnId": "aex_hermetic_0001:0",
41
+ "harnessId": "cursor",
42
+ "baselineSnapshot": {
43
+ "kind": "SNAPSHOT_KIND_CAS_MANIFEST"
44
+ }
45
+ }
46
+ }
47
+ ]
48
+ },
49
+ "fileChangeProgress": {
50
+ "changeSetId": "aex_hermetic_0001:0",
51
+ "capturedAt": "2026-01-01T00:00:01.000Z"
52
+ }
53
+ }
@@ -8,12 +8,7 @@
8
8
  {
9
9
  "type": "MESSAGE_SYSTEM",
10
10
  "content": "Execution paused by user. Use resume to continue.",
11
- "timestamp": "2026-01-01T00:00:04.000Z"
12
- },
13
- {
14
- "type": "MESSAGE_SYSTEM",
15
- "content": "Execution paused by user. Use resume to continue.",
16
- "timestamp": "2026-01-01T00:00:04.000Z"
11
+ "timestamp": "2026-01-01T00:00:03.000Z"
17
12
  }
18
13
  ],
19
14
  "phase": "EXECUTION_PAUSED",
@@ -0,0 +1,56 @@
1
+ {
2
+ "messages": [
3
+ {
4
+ "type": "MESSAGE_AI",
5
+ "content": "Starting the suite.",
6
+ "timestamp": "2026-01-01T00:00:02.000Z",
7
+ "toolCalls": [
8
+ {
9
+ "id": "call-hermetic-platformstop-0001",
10
+ "name": "read",
11
+ "args": {
12
+ "path": "package.json"
13
+ },
14
+ "result": "{\"name\":\"demo\"}",
15
+ "status": "TOOL_CALL_COMPLETED",
16
+ "startedAt": "2026-01-01T00:00:03.000Z",
17
+ "completedAt": "2026-01-01T00:00:04.000Z",
18
+ "argsPreview": "{\"path\":\"package.json\"}",
19
+ "toolKind": "TOOL_KIND_FILE_READ"
20
+ }
21
+ ]
22
+ },
23
+ {
24
+ "type": "MESSAGE_SYSTEM",
25
+ "content": "Execution stopped by the platform.",
26
+ "timestamp": "2026-01-01T00:00:04.000Z"
27
+ }
28
+ ],
29
+ "phase": "EXECUTION_COMPLETED",
30
+ "startedAt": "2026-01-01T00:00:00.000Z",
31
+ "completedAt": "2026-01-01T00:00:04.000Z",
32
+ "fileReviewEventStream": {
33
+ "executionId": "aex_hermetic_0001",
34
+ "events": [
35
+ {
36
+ "eventId": "aex_hermetic_0001:0:aex_hermetic_0001:0:FILE_REVIEW_EVENT_TYPE_BASELINE_CAPTURED",
37
+ "changeSetId": "aex_hermetic_0001:0",
38
+ "eventType": "FILE_REVIEW_EVENT_TYPE_BASELINE_CAPTURED",
39
+ "timestamp": "2026-01-01T00:00:00.000Z",
40
+ "actor": "runner",
41
+ "baselineCaptured": {
42
+ "changeSetId": "aex_hermetic_0001:0",
43
+ "turnId": "aex_hermetic_0001:0",
44
+ "harnessId": "cursor",
45
+ "baselineSnapshot": {
46
+ "kind": "SNAPSHOT_KIND_CAS_MANIFEST"
47
+ }
48
+ }
49
+ }
50
+ ]
51
+ },
52
+ "fileChangeProgress": {
53
+ "changeSetId": "aex_hermetic_0001:0",
54
+ "capturedAt": "2026-01-01T00:00:01.000Z"
55
+ }
56
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "messages": [
3
+ {
4
+ "type": "MESSAGE_AI",
5
+ "content": "There are three open pull requests: #12, #15 and #18.",
6
+ "timestamp": "2026-01-01T00:00:05.000Z"
7
+ }
8
+ ],
9
+ "phase": "EXECUTION_COMPLETED",
10
+ "startedAt": "2026-01-01T00:00:00.000Z",
11
+ "completedAt": "2026-01-01T00:00:07.000Z",
12
+ "streamingUsage": {
13
+ "inputTokens": "2200",
14
+ "outputTokens": "30",
15
+ "totalTokens": "2230",
16
+ "turnCount": 1,
17
+ "estimatedCostUsd": 0.00232,
18
+ "model": "composer-2.5",
19
+ "observedAt": "2026-01-01T00:00:06.000Z",
20
+ "requestedServiceTier": "SERVICE_TIER_STANDARD",
21
+ "requestedModelParams": "[{\"id\":\"fast\",\"value\":\"false\"},{\"id\":\"thinking\",\"value\":\"false\"}]",
22
+ "requestedThinkingMode": "THINKING_MODE_DISABLED"
23
+ },
24
+ "fileReviewEventStream": {
25
+ "executionId": "aex_hermetic_0001",
26
+ "events": [
27
+ {
28
+ "eventId": "aex_hermetic_0001:0:aex_hermetic_0001:0:FILE_REVIEW_EVENT_TYPE_BASELINE_CAPTURED",
29
+ "changeSetId": "aex_hermetic_0001:0",
30
+ "eventType": "FILE_REVIEW_EVENT_TYPE_BASELINE_CAPTURED",
31
+ "timestamp": "2026-01-01T00:00:00.000Z",
32
+ "actor": "runner",
33
+ "baselineCaptured": {
34
+ "changeSetId": "aex_hermetic_0001:0",
35
+ "turnId": "aex_hermetic_0001:0",
36
+ "harnessId": "cursor",
37
+ "baselineSnapshot": {
38
+ "kind": "SNAPSHOT_KIND_CAS_MANIFEST"
39
+ }
40
+ }
41
+ }
42
+ ]
43
+ },
44
+ "fileChangeProgress": {
45
+ "changeSetId": "aex_hermetic_0001:0",
46
+ "capturedAt": "2026-01-01T00:00:01.000Z"
47
+ }
48
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "messages": [
3
+ {
4
+ "type": "MESSAGE_SYSTEM",
5
+ "content": "Internal system error occurred. Please contact support if this issue persists.",
6
+ "timestamp": "2026-01-01T00:00:00.000Z"
7
+ },
8
+ {
9
+ "type": "MESSAGE_SYSTEM",
10
+ "content": "Error details: [Error] hermetic fault injected at getAgent",
11
+ "timestamp": "2026-01-01T00:00:00.000Z"
12
+ }
13
+ ],
14
+ "phase": "EXECUTION_FAILED",
15
+ "error": "Execution failed: [Error] hermetic fault injected at getAgent",
16
+ "startedAt": "2026-01-01T00:00:00.000Z",
17
+ "completedAt": "2026-01-01T00:00:00.000Z"
18
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "messages": [
3
+ {
4
+ "type": "MESSAGE_AI",
5
+ "content": "Looking at the pull requests.",
6
+ "timestamp": "2026-01-01T00:00:02.000Z"
7
+ }
8
+ ],
9
+ "phase": "EXECUTION_CANCELLED",
10
+ "startedAt": "2026-01-01T00:00:00.000Z",
11
+ "completedAt": "2026-01-01T00:00:03.000Z",
12
+ "fileReviewEventStream": {
13
+ "executionId": "aex_hermetic_0001",
14
+ "events": [
15
+ {
16
+ "eventId": "aex_hermetic_0001:0:aex_hermetic_0001:0:FILE_REVIEW_EVENT_TYPE_BASELINE_CAPTURED",
17
+ "changeSetId": "aex_hermetic_0001:0",
18
+ "eventType": "FILE_REVIEW_EVENT_TYPE_BASELINE_CAPTURED",
19
+ "timestamp": "2026-01-01T00:00:00.000Z",
20
+ "actor": "runner",
21
+ "baselineCaptured": {
22
+ "changeSetId": "aex_hermetic_0001:0",
23
+ "turnId": "aex_hermetic_0001:0",
24
+ "harnessId": "cursor",
25
+ "baselineSnapshot": {
26
+ "kind": "SNAPSHOT_KIND_CAS_MANIFEST"
27
+ }
28
+ }
29
+ }
30
+ ]
31
+ },
32
+ "fileChangeProgress": {
33
+ "changeSetId": "aex_hermetic_0001:0",
34
+ "capturedAt": "2026-01-01T00:00:01.000Z"
35
+ }
36
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "messages": [
3
+ {
4
+ "type": "MESSAGE_AI",
5
+ "content": "Checking the repository.",
6
+ "timestamp": "2026-01-01T00:00:02.000Z"
7
+ }
8
+ ],
9
+ "phase": "EXECUTION_FAILED",
10
+ "error": "UNAUTHENTICATED: invalid api key [category=auth, source=sdk, retryable=false]",
11
+ "startedAt": "2026-01-01T00:00:00.000Z",
12
+ "completedAt": "2026-01-01T00:00:03.000Z",
13
+ "fileReviewEventStream": {
14
+ "executionId": "aex_hermetic_0001",
15
+ "events": [
16
+ {
17
+ "eventId": "aex_hermetic_0001:0:aex_hermetic_0001:0:FILE_REVIEW_EVENT_TYPE_BASELINE_CAPTURED",
18
+ "changeSetId": "aex_hermetic_0001:0",
19
+ "eventType": "FILE_REVIEW_EVENT_TYPE_BASELINE_CAPTURED",
20
+ "timestamp": "2026-01-01T00:00:00.000Z",
21
+ "actor": "runner",
22
+ "baselineCaptured": {
23
+ "changeSetId": "aex_hermetic_0001:0",
24
+ "turnId": "aex_hermetic_0001:0",
25
+ "harnessId": "cursor",
26
+ "baselineSnapshot": {
27
+ "kind": "SNAPSHOT_KIND_CAS_MANIFEST"
28
+ }
29
+ }
30
+ }
31
+ ]
32
+ },
33
+ "fileChangeProgress": {
34
+ "changeSetId": "aex_hermetic_0001:0",
35
+ "capturedAt": "2026-01-01T00:00:01.000Z"
36
+ }
37
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "messages": [
3
+ {
4
+ "type": "MESSAGE_SYSTEM",
5
+ "content": "Internal system error occurred. Please contact support if this issue persists.",
6
+ "timestamp": "2026-01-01T00:00:00.000Z"
7
+ },
8
+ {
9
+ "type": "MESSAGE_SYSTEM",
10
+ "content": "Error details: Cursor API rejected the request: invalid API key [category=auth, source=sdk, retryable=false]",
11
+ "timestamp": "2026-01-01T00:00:00.000Z"
12
+ }
13
+ ],
14
+ "phase": "EXECUTION_FAILED",
15
+ "error": "Cursor API rejected the request: invalid API key [category=auth, source=sdk, retryable=false]",
16
+ "startedAt": "2026-01-01T00:00:00.000Z",
17
+ "completedAt": "2026-01-01T00:00:00.000Z",
18
+ "fileReviewEventStream": {
19
+ "executionId": "aex_hermetic_0001",
20
+ "events": [
21
+ {
22
+ "eventId": "aex_hermetic_0001:0:aex_hermetic_0001:0:FILE_REVIEW_EVENT_TYPE_BASELINE_CAPTURED",
23
+ "changeSetId": "aex_hermetic_0001:0",
24
+ "eventType": "FILE_REVIEW_EVENT_TYPE_BASELINE_CAPTURED",
25
+ "timestamp": "2026-01-01T00:00:00.000Z",
26
+ "actor": "runner",
27
+ "baselineCaptured": {
28
+ "changeSetId": "aex_hermetic_0001:0",
29
+ "turnId": "aex_hermetic_0001:0",
30
+ "harnessId": "cursor",
31
+ "baselineSnapshot": {
32
+ "kind": "SNAPSHOT_KIND_CAS_MANIFEST"
33
+ }
34
+ }
35
+ }
36
+ ]
37
+ }
38
+ }