@smthrs/harness 0.0.0-stage → 1.0.0-rc.4

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 (476) hide show
  1. package/CHANGELOG.md +387 -0
  2. package/LICENSE +21 -0
  3. package/README.md +138 -2
  4. package/dist/cjs/AgentEvent.d.ts +3092 -0
  5. package/dist/cjs/AgentEvent.d.ts.map +1 -0
  6. package/dist/cjs/AgentEvent.js +1116 -0
  7. package/dist/cjs/AgentEvent.js.map +7 -0
  8. package/dist/cjs/CallLedger.d.ts +378 -0
  9. package/dist/cjs/CallLedger.d.ts.map +1 -0
  10. package/dist/cjs/CallLedger.js +240 -0
  11. package/dist/cjs/CallLedger.js.map +7 -0
  12. package/dist/cjs/Cell.d.ts +774 -0
  13. package/dist/cjs/Cell.d.ts.map +1 -0
  14. package/dist/cjs/Cell.js +431 -0
  15. package/dist/cjs/Cell.js.map +7 -0
  16. package/dist/cjs/CellCalls.d.ts +115 -0
  17. package/dist/cjs/CellCalls.d.ts.map +1 -0
  18. package/dist/cjs/CellCalls.js +98 -0
  19. package/dist/cjs/CellCalls.js.map +7 -0
  20. package/dist/cjs/CellHistory.d.ts +102 -0
  21. package/dist/cjs/CellHistory.d.ts.map +1 -0
  22. package/dist/cjs/CellHistory.js +54 -0
  23. package/dist/cjs/CellHistory.js.map +7 -0
  24. package/dist/cjs/CellTurn.d.ts +1071 -0
  25. package/dist/cjs/CellTurn.d.ts.map +1 -0
  26. package/dist/cjs/CellTurn.js +2618 -0
  27. package/dist/cjs/CellTurn.js.map +7 -0
  28. package/dist/cjs/CellValidation.d.ts +94 -0
  29. package/dist/cjs/CellValidation.d.ts.map +1 -0
  30. package/dist/cjs/CellValidation.js +218 -0
  31. package/dist/cjs/CellValidation.js.map +7 -0
  32. package/dist/cjs/Compaction.d.ts +158 -0
  33. package/dist/cjs/Compaction.d.ts.map +1 -0
  34. package/dist/cjs/Compaction.js +189 -0
  35. package/dist/cjs/Compaction.js.map +7 -0
  36. package/dist/cjs/CompletionClaim.d.ts +801 -0
  37. package/dist/cjs/CompletionClaim.d.ts.map +1 -0
  38. package/dist/cjs/CompletionClaim.js +303 -0
  39. package/dist/cjs/CompletionClaim.js.map +7 -0
  40. package/dist/cjs/ContextWindow.d.ts +435 -0
  41. package/dist/cjs/ContextWindow.d.ts.map +1 -0
  42. package/dist/cjs/ContextWindow.js +319 -0
  43. package/dist/cjs/ContextWindow.js.map +7 -0
  44. package/dist/cjs/EngineLike.d.ts +546 -0
  45. package/dist/cjs/EngineLike.d.ts.map +1 -0
  46. package/dist/cjs/EngineLike.js +114 -0
  47. package/dist/cjs/EngineLike.js.map +7 -0
  48. package/dist/cjs/ExternalTranscript.d.ts +349 -0
  49. package/dist/cjs/ExternalTranscript.d.ts.map +1 -0
  50. package/dist/cjs/ExternalTranscript.js +826 -0
  51. package/dist/cjs/ExternalTranscript.js.map +7 -0
  52. package/dist/cjs/FailedCall.d.ts +132 -0
  53. package/dist/cjs/FailedCall.d.ts.map +1 -0
  54. package/dist/cjs/FailedCall.js +53 -0
  55. package/dist/cjs/FailedCall.js.map +7 -0
  56. package/dist/cjs/FlowBinding.d.ts +289 -0
  57. package/dist/cjs/FlowBinding.d.ts.map +1 -0
  58. package/dist/cjs/FlowBinding.js +251 -0
  59. package/dist/cjs/FlowBinding.js.map +7 -0
  60. package/dist/cjs/HarnessError.d.ts +57 -0
  61. package/dist/cjs/HarnessError.d.ts.map +1 -0
  62. package/dist/cjs/HarnessError.js +75 -0
  63. package/dist/cjs/HarnessError.js.map +7 -0
  64. package/dist/cjs/Judgement.d.ts +289 -0
  65. package/dist/cjs/Judgement.d.ts.map +1 -0
  66. package/dist/cjs/Judgement.js +240 -0
  67. package/dist/cjs/Judgement.js.map +7 -0
  68. package/dist/cjs/Monitor.d.ts +374 -0
  69. package/dist/cjs/Monitor.d.ts.map +1 -0
  70. package/dist/cjs/Monitor.js +233 -0
  71. package/dist/cjs/Monitor.js.map +7 -0
  72. package/dist/cjs/NarrowedCheck.d.ts +523 -0
  73. package/dist/cjs/NarrowedCheck.d.ts.map +1 -0
  74. package/dist/cjs/NarrowedCheck.js +263 -0
  75. package/dist/cjs/NarrowedCheck.js.map +7 -0
  76. package/dist/cjs/Notifications.d.ts +42 -0
  77. package/dist/cjs/Notifications.d.ts.map +1 -0
  78. package/dist/cjs/Notifications.js +177 -0
  79. package/dist/cjs/Notifications.js.map +7 -0
  80. package/dist/cjs/Plan.d.ts +127 -0
  81. package/dist/cjs/Plan.d.ts.map +1 -0
  82. package/dist/cjs/Plan.js +77 -0
  83. package/dist/cjs/Plan.js.map +7 -0
  84. package/dist/cjs/QuickJSSandbox.d.ts +151 -0
  85. package/dist/cjs/QuickJSSandbox.d.ts.map +1 -0
  86. package/dist/cjs/QuickJSSandbox.js +987 -0
  87. package/dist/cjs/QuickJSSandbox.js.map +7 -0
  88. package/dist/cjs/Relevance.d.ts +213 -0
  89. package/dist/cjs/Relevance.d.ts.map +1 -0
  90. package/dist/cjs/Relevance.js +183 -0
  91. package/dist/cjs/Relevance.js.map +7 -0
  92. package/dist/cjs/Sandbox.d.ts +637 -0
  93. package/dist/cjs/Sandbox.d.ts.map +1 -0
  94. package/dist/cjs/Sandbox.js +260 -0
  95. package/dist/cjs/Sandbox.js.map +7 -0
  96. package/dist/cjs/Steering.d.ts +464 -0
  97. package/dist/cjs/Steering.d.ts.map +1 -0
  98. package/dist/cjs/Steering.js +153 -0
  99. package/dist/cjs/Steering.js.map +7 -0
  100. package/dist/cjs/StructuredOutput.d.ts +252 -0
  101. package/dist/cjs/StructuredOutput.d.ts.map +1 -0
  102. package/dist/cjs/StructuredOutput.js +266 -0
  103. package/dist/cjs/StructuredOutput.js.map +7 -0
  104. package/dist/cjs/Sufficiency.d.ts +195 -0
  105. package/dist/cjs/Sufficiency.d.ts.map +1 -0
  106. package/dist/cjs/Sufficiency.js +110 -0
  107. package/dist/cjs/Sufficiency.js.map +7 -0
  108. package/dist/cjs/Supervisor.d.ts +719 -0
  109. package/dist/cjs/Supervisor.d.ts.map +1 -0
  110. package/dist/cjs/Supervisor.js +313 -0
  111. package/dist/cjs/Supervisor.js.map +7 -0
  112. package/dist/cjs/Tokens.d.ts +86 -0
  113. package/dist/cjs/Tokens.d.ts.map +1 -0
  114. package/dist/cjs/Tokens.js +72 -0
  115. package/dist/cjs/Tokens.js.map +7 -0
  116. package/dist/cjs/Transcript.d.ts +171 -0
  117. package/dist/cjs/Transcript.d.ts.map +1 -0
  118. package/dist/cjs/Transcript.js +342 -0
  119. package/dist/cjs/Transcript.js.map +7 -0
  120. package/dist/cjs/TruncatedOutput.d.ts +186 -0
  121. package/dist/cjs/TruncatedOutput.d.ts.map +1 -0
  122. package/dist/cjs/TruncatedOutput.js +143 -0
  123. package/dist/cjs/TruncatedOutput.js.map +7 -0
  124. package/dist/cjs/UnmovedTree.d.ts +113 -0
  125. package/dist/cjs/UnmovedTree.d.ts.map +1 -0
  126. package/dist/cjs/UnmovedTree.js +38 -0
  127. package/dist/cjs/UnmovedTree.js.map +7 -0
  128. package/dist/cjs/UnresolvedFailure.d.ts +196 -0
  129. package/dist/cjs/UnresolvedFailure.d.ts.map +1 -0
  130. package/dist/cjs/UnresolvedFailure.js +77 -0
  131. package/dist/cjs/UnresolvedFailure.js.map +7 -0
  132. package/dist/cjs/VacuousVerification.d.ts +237 -0
  133. package/dist/cjs/VacuousVerification.d.ts.map +1 -0
  134. package/dist/cjs/VacuousVerification.js +91 -0
  135. package/dist/cjs/VacuousVerification.js.map +7 -0
  136. package/dist/cjs/VariablesPanel.d.ts +117 -0
  137. package/dist/cjs/VariablesPanel.d.ts.map +1 -0
  138. package/dist/cjs/VariablesPanel.js +108 -0
  139. package/dist/cjs/VariablesPanel.js.map +7 -0
  140. package/dist/cjs/index.d.ts +172 -0
  141. package/dist/cjs/index.d.ts.map +1 -0
  142. package/dist/cjs/index.js +99 -0
  143. package/dist/cjs/index.js.map +7 -0
  144. package/dist/cjs/internal/bytes.d.ts +36 -0
  145. package/dist/cjs/internal/bytes.d.ts.map +1 -0
  146. package/dist/cjs/internal/bytes.js +57 -0
  147. package/dist/cjs/internal/bytes.js.map +7 -0
  148. package/dist/cjs/internal/cellPrompt.d.ts +122 -0
  149. package/dist/cjs/internal/cellPrompt.d.ts.map +1 -0
  150. package/dist/cjs/internal/cellPrompt.js +146 -0
  151. package/dist/cjs/internal/cellPrompt.js.map +7 -0
  152. package/dist/cjs/internal/compactable.d.ts +44 -0
  153. package/dist/cjs/internal/compactable.d.ts.map +1 -0
  154. package/dist/cjs/internal/compactable.js +56 -0
  155. package/dist/cjs/internal/compactable.js.map +7 -0
  156. package/dist/cjs/internal/compactionMarks.d.ts +278 -0
  157. package/dist/cjs/internal/compactionMarks.d.ts.map +1 -0
  158. package/dist/cjs/internal/compactionMarks.js +212 -0
  159. package/dist/cjs/internal/compactionMarks.js.map +7 -0
  160. package/dist/cjs/internal/demandText.d.ts +95 -0
  161. package/dist/cjs/internal/demandText.d.ts.map +1 -0
  162. package/dist/cjs/internal/demandText.js +70 -0
  163. package/dist/cjs/internal/demandText.js.map +7 -0
  164. package/dist/cjs/internal/elide.d.ts +109 -0
  165. package/dist/cjs/internal/elide.d.ts.map +1 -0
  166. package/dist/cjs/internal/elide.js +59 -0
  167. package/dist/cjs/internal/elide.js.map +7 -0
  168. package/dist/cjs/internal/frame.d.ts +463 -0
  169. package/dist/cjs/internal/frame.d.ts.map +1 -0
  170. package/dist/cjs/internal/frame.js +514 -0
  171. package/dist/cjs/internal/frame.js.map +7 -0
  172. package/dist/cjs/internal/nonNegativeSafeInt.d.ts +20 -0
  173. package/dist/cjs/internal/nonNegativeSafeInt.d.ts.map +1 -0
  174. package/dist/cjs/internal/nonNegativeSafeInt.js +29 -0
  175. package/dist/cjs/internal/nonNegativeSafeInt.js.map +7 -0
  176. package/dist/cjs/internal/paidUsage.d.ts +52 -0
  177. package/dist/cjs/internal/paidUsage.d.ts.map +1 -0
  178. package/dist/cjs/internal/paidUsage.js +70 -0
  179. package/dist/cjs/internal/paidUsage.js.map +7 -0
  180. package/dist/cjs/internal/printChannel.d.ts +233 -0
  181. package/dist/cjs/internal/printChannel.d.ts.map +1 -0
  182. package/dist/cjs/internal/printChannel.js +165 -0
  183. package/dist/cjs/internal/printChannel.js.map +7 -0
  184. package/dist/cjs/internal/printsObservation.d.ts +26 -0
  185. package/dist/cjs/internal/printsObservation.d.ts.map +1 -0
  186. package/dist/cjs/internal/printsObservation.js +27 -0
  187. package/dist/cjs/internal/printsObservation.js.map +7 -0
  188. package/dist/cjs/internal/refusal.d.ts +40 -0
  189. package/dist/cjs/internal/refusal.d.ts.map +1 -0
  190. package/dist/cjs/internal/refusal.js +45 -0
  191. package/dist/cjs/internal/refusal.js.map +7 -0
  192. package/dist/cjs/internal/supervision.d.ts +174 -0
  193. package/dist/cjs/internal/supervision.d.ts.map +1 -0
  194. package/dist/cjs/internal/supervision.js +402 -0
  195. package/dist/cjs/internal/supervision.js.map +7 -0
  196. package/dist/cjs/internal/unfinishedWork.d.ts +99 -0
  197. package/dist/cjs/internal/unfinishedWork.d.ts.map +1 -0
  198. package/dist/cjs/internal/unfinishedWork.js +80 -0
  199. package/dist/cjs/internal/unfinishedWork.js.map +7 -0
  200. package/dist/cjs/internal/unobservedCall.d.ts +112 -0
  201. package/dist/cjs/internal/unobservedCall.d.ts.map +1 -0
  202. package/dist/cjs/internal/unobservedCall.js +345 -0
  203. package/dist/cjs/internal/unobservedCall.js.map +7 -0
  204. package/dist/cjs/internal/untrustedData.d.ts +14 -0
  205. package/dist/cjs/internal/untrustedData.d.ts.map +1 -0
  206. package/dist/cjs/internal/untrustedData.js +30 -0
  207. package/dist/cjs/internal/untrustedData.js.map +7 -0
  208. package/dist/cjs/package.json +1 -0
  209. package/dist/esm/AgentEvent.d.ts +3092 -0
  210. package/dist/esm/AgentEvent.d.ts.map +1 -0
  211. package/dist/esm/AgentEvent.js +1610 -0
  212. package/dist/esm/AgentEvent.js.map +1 -0
  213. package/dist/esm/CallLedger.d.ts +378 -0
  214. package/dist/esm/CallLedger.d.ts.map +1 -0
  215. package/dist/esm/CallLedger.js +506 -0
  216. package/dist/esm/CallLedger.js.map +1 -0
  217. package/dist/esm/Cell.d.ts +774 -0
  218. package/dist/esm/Cell.d.ts.map +1 -0
  219. package/dist/esm/Cell.js +772 -0
  220. package/dist/esm/Cell.js.map +1 -0
  221. package/dist/esm/CellCalls.d.ts +115 -0
  222. package/dist/esm/CellCalls.d.ts.map +1 -0
  223. package/dist/esm/CellCalls.js +97 -0
  224. package/dist/esm/CellCalls.js.map +1 -0
  225. package/dist/esm/CellHistory.d.ts +102 -0
  226. package/dist/esm/CellHistory.d.ts.map +1 -0
  227. package/dist/esm/CellHistory.js +91 -0
  228. package/dist/esm/CellHistory.js.map +1 -0
  229. package/dist/esm/CellTurn.d.ts +1071 -0
  230. package/dist/esm/CellTurn.d.ts.map +1 -0
  231. package/dist/esm/CellTurn.js +3410 -0
  232. package/dist/esm/CellTurn.js.map +1 -0
  233. package/dist/esm/CellValidation.d.ts +94 -0
  234. package/dist/esm/CellValidation.d.ts.map +1 -0
  235. package/dist/esm/CellValidation.js +335 -0
  236. package/dist/esm/CellValidation.js.map +1 -0
  237. package/dist/esm/Compaction.d.ts +158 -0
  238. package/dist/esm/Compaction.d.ts.map +1 -0
  239. package/dist/esm/Compaction.js +216 -0
  240. package/dist/esm/Compaction.js.map +1 -0
  241. package/dist/esm/CompletionClaim.d.ts +801 -0
  242. package/dist/esm/CompletionClaim.d.ts.map +1 -0
  243. package/dist/esm/CompletionClaim.js +833 -0
  244. package/dist/esm/CompletionClaim.js.map +1 -0
  245. package/dist/esm/ContextWindow.d.ts +435 -0
  246. package/dist/esm/ContextWindow.d.ts.map +1 -0
  247. package/dist/esm/ContextWindow.js +427 -0
  248. package/dist/esm/ContextWindow.js.map +1 -0
  249. package/dist/esm/EngineLike.d.ts +546 -0
  250. package/dist/esm/EngineLike.d.ts.map +1 -0
  251. package/dist/esm/EngineLike.js +218 -0
  252. package/dist/esm/EngineLike.js.map +1 -0
  253. package/dist/esm/ExternalTranscript.d.ts +349 -0
  254. package/dist/esm/ExternalTranscript.d.ts.map +1 -0
  255. package/dist/esm/ExternalTranscript.js +985 -0
  256. package/dist/esm/ExternalTranscript.js.map +1 -0
  257. package/dist/esm/FailedCall.d.ts +132 -0
  258. package/dist/esm/FailedCall.d.ts.map +1 -0
  259. package/dist/esm/FailedCall.js +131 -0
  260. package/dist/esm/FailedCall.js.map +1 -0
  261. package/dist/esm/FlowBinding.d.ts +289 -0
  262. package/dist/esm/FlowBinding.d.ts.map +1 -0
  263. package/dist/esm/FlowBinding.js +376 -0
  264. package/dist/esm/FlowBinding.js.map +1 -0
  265. package/dist/esm/HarnessError.d.ts +57 -0
  266. package/dist/esm/HarnessError.d.ts.map +1 -0
  267. package/dist/esm/HarnessError.js +85 -0
  268. package/dist/esm/HarnessError.js.map +1 -0
  269. package/dist/esm/Judgement.d.ts +289 -0
  270. package/dist/esm/Judgement.d.ts.map +1 -0
  271. package/dist/esm/Judgement.js +305 -0
  272. package/dist/esm/Judgement.js.map +1 -0
  273. package/dist/esm/Monitor.d.ts +374 -0
  274. package/dist/esm/Monitor.d.ts.map +1 -0
  275. package/dist/esm/Monitor.js +370 -0
  276. package/dist/esm/Monitor.js.map +1 -0
  277. package/dist/esm/NarrowedCheck.d.ts +523 -0
  278. package/dist/esm/NarrowedCheck.d.ts.map +1 -0
  279. package/dist/esm/NarrowedCheck.js +612 -0
  280. package/dist/esm/NarrowedCheck.js.map +1 -0
  281. package/dist/esm/Notifications.d.ts +42 -0
  282. package/dist/esm/Notifications.d.ts.map +1 -0
  283. package/dist/esm/Notifications.js +215 -0
  284. package/dist/esm/Notifications.js.map +1 -0
  285. package/dist/esm/Plan.d.ts +127 -0
  286. package/dist/esm/Plan.d.ts.map +1 -0
  287. package/dist/esm/Plan.js +97 -0
  288. package/dist/esm/Plan.js.map +1 -0
  289. package/dist/esm/QuickJSSandbox.d.ts +151 -0
  290. package/dist/esm/QuickJSSandbox.d.ts.map +1 -0
  291. package/dist/esm/QuickJSSandbox.js +1364 -0
  292. package/dist/esm/QuickJSSandbox.js.map +1 -0
  293. package/dist/esm/Relevance.d.ts +213 -0
  294. package/dist/esm/Relevance.d.ts.map +1 -0
  295. package/dist/esm/Relevance.js +254 -0
  296. package/dist/esm/Relevance.js.map +1 -0
  297. package/dist/esm/Sandbox.d.ts +637 -0
  298. package/dist/esm/Sandbox.d.ts.map +1 -0
  299. package/dist/esm/Sandbox.js +464 -0
  300. package/dist/esm/Sandbox.js.map +1 -0
  301. package/dist/esm/Steering.d.ts +464 -0
  302. package/dist/esm/Steering.d.ts.map +1 -0
  303. package/dist/esm/Steering.js +193 -0
  304. package/dist/esm/Steering.js.map +1 -0
  305. package/dist/esm/StructuredOutput.d.ts +252 -0
  306. package/dist/esm/StructuredOutput.d.ts.map +1 -0
  307. package/dist/esm/StructuredOutput.js +430 -0
  308. package/dist/esm/StructuredOutput.js.map +1 -0
  309. package/dist/esm/Sufficiency.d.ts +195 -0
  310. package/dist/esm/Sufficiency.d.ts.map +1 -0
  311. package/dist/esm/Sufficiency.js +207 -0
  312. package/dist/esm/Sufficiency.js.map +1 -0
  313. package/dist/esm/Supervisor.d.ts +719 -0
  314. package/dist/esm/Supervisor.d.ts.map +1 -0
  315. package/dist/esm/Supervisor.js +575 -0
  316. package/dist/esm/Supervisor.js.map +1 -0
  317. package/dist/esm/Tokens.d.ts +86 -0
  318. package/dist/esm/Tokens.d.ts.map +1 -0
  319. package/dist/esm/Tokens.js +92 -0
  320. package/dist/esm/Tokens.js.map +1 -0
  321. package/dist/esm/Transcript.d.ts +171 -0
  322. package/dist/esm/Transcript.d.ts.map +1 -0
  323. package/dist/esm/Transcript.js +424 -0
  324. package/dist/esm/Transcript.js.map +1 -0
  325. package/dist/esm/TruncatedOutput.d.ts +186 -0
  326. package/dist/esm/TruncatedOutput.d.ts.map +1 -0
  327. package/dist/esm/TruncatedOutput.js +257 -0
  328. package/dist/esm/TruncatedOutput.js.map +1 -0
  329. package/dist/esm/UnmovedTree.d.ts +113 -0
  330. package/dist/esm/UnmovedTree.d.ts.map +1 -0
  331. package/dist/esm/UnmovedTree.js +90 -0
  332. package/dist/esm/UnmovedTree.js.map +1 -0
  333. package/dist/esm/UnresolvedFailure.d.ts +196 -0
  334. package/dist/esm/UnresolvedFailure.d.ts.map +1 -0
  335. package/dist/esm/UnresolvedFailure.js +218 -0
  336. package/dist/esm/UnresolvedFailure.js.map +1 -0
  337. package/dist/esm/VacuousVerification.d.ts +237 -0
  338. package/dist/esm/VacuousVerification.d.ts.map +1 -0
  339. package/dist/esm/VacuousVerification.js +245 -0
  340. package/dist/esm/VacuousVerification.js.map +1 -0
  341. package/dist/esm/VariablesPanel.d.ts +117 -0
  342. package/dist/esm/VariablesPanel.d.ts.map +1 -0
  343. package/dist/esm/VariablesPanel.js +142 -0
  344. package/dist/esm/VariablesPanel.js.map +1 -0
  345. package/dist/esm/index.d.ts +172 -0
  346. package/dist/esm/index.d.ts.map +1 -0
  347. package/dist/esm/index.js +172 -0
  348. package/dist/esm/index.js.map +1 -0
  349. package/dist/esm/internal/bytes.d.ts +36 -0
  350. package/dist/esm/internal/bytes.d.ts.map +1 -0
  351. package/dist/esm/internal/bytes.js +70 -0
  352. package/dist/esm/internal/bytes.js.map +1 -0
  353. package/dist/esm/internal/cellPrompt.d.ts +122 -0
  354. package/dist/esm/internal/cellPrompt.d.ts.map +1 -0
  355. package/dist/esm/internal/cellPrompt.js +276 -0
  356. package/dist/esm/internal/cellPrompt.js.map +1 -0
  357. package/dist/esm/internal/compactable.d.ts +44 -0
  358. package/dist/esm/internal/compactable.d.ts.map +1 -0
  359. package/dist/esm/internal/compactable.js +71 -0
  360. package/dist/esm/internal/compactable.js.map +1 -0
  361. package/dist/esm/internal/compactionMarks.d.ts +278 -0
  362. package/dist/esm/internal/compactionMarks.d.ts.map +1 -0
  363. package/dist/esm/internal/compactionMarks.js +317 -0
  364. package/dist/esm/internal/compactionMarks.js.map +1 -0
  365. package/dist/esm/internal/demandText.d.ts +95 -0
  366. package/dist/esm/internal/demandText.d.ts.map +1 -0
  367. package/dist/esm/internal/demandText.js +128 -0
  368. package/dist/esm/internal/demandText.js.map +1 -0
  369. package/dist/esm/internal/elide.d.ts +109 -0
  370. package/dist/esm/internal/elide.d.ts.map +1 -0
  371. package/dist/esm/internal/elide.js +123 -0
  372. package/dist/esm/internal/elide.js.map +1 -0
  373. package/dist/esm/internal/frame.d.ts +463 -0
  374. package/dist/esm/internal/frame.d.ts.map +1 -0
  375. package/dist/esm/internal/frame.js +861 -0
  376. package/dist/esm/internal/frame.js.map +1 -0
  377. package/dist/esm/internal/nonNegativeSafeInt.d.ts +20 -0
  378. package/dist/esm/internal/nonNegativeSafeInt.d.ts.map +1 -0
  379. package/dist/esm/internal/nonNegativeSafeInt.js +20 -0
  380. package/dist/esm/internal/nonNegativeSafeInt.js.map +1 -0
  381. package/dist/esm/internal/paidUsage.d.ts +52 -0
  382. package/dist/esm/internal/paidUsage.d.ts.map +1 -0
  383. package/dist/esm/internal/paidUsage.js +72 -0
  384. package/dist/esm/internal/paidUsage.js.map +1 -0
  385. package/dist/esm/internal/printChannel.d.ts +233 -0
  386. package/dist/esm/internal/printChannel.d.ts.map +1 -0
  387. package/dist/esm/internal/printChannel.js +376 -0
  388. package/dist/esm/internal/printChannel.js.map +1 -0
  389. package/dist/esm/internal/printsObservation.d.ts +26 -0
  390. package/dist/esm/internal/printsObservation.d.ts.map +1 -0
  391. package/dist/esm/internal/printsObservation.js +29 -0
  392. package/dist/esm/internal/printsObservation.js.map +1 -0
  393. package/dist/esm/internal/refusal.d.ts +40 -0
  394. package/dist/esm/internal/refusal.d.ts.map +1 -0
  395. package/dist/esm/internal/refusal.js +47 -0
  396. package/dist/esm/internal/refusal.js.map +1 -0
  397. package/dist/esm/internal/supervision.d.ts +174 -0
  398. package/dist/esm/internal/supervision.d.ts.map +1 -0
  399. package/dist/esm/internal/supervision.js +485 -0
  400. package/dist/esm/internal/supervision.js.map +1 -0
  401. package/dist/esm/internal/unfinishedWork.d.ts +99 -0
  402. package/dist/esm/internal/unfinishedWork.d.ts.map +1 -0
  403. package/dist/esm/internal/unfinishedWork.js +85 -0
  404. package/dist/esm/internal/unfinishedWork.js.map +1 -0
  405. package/dist/esm/internal/unobservedCall.d.ts +112 -0
  406. package/dist/esm/internal/unobservedCall.d.ts.map +1 -0
  407. package/dist/esm/internal/unobservedCall.js +501 -0
  408. package/dist/esm/internal/unobservedCall.js.map +1 -0
  409. package/dist/esm/internal/untrustedData.d.ts +14 -0
  410. package/dist/esm/internal/untrustedData.d.ts.map +1 -0
  411. package/dist/esm/internal/untrustedData.js +15 -0
  412. package/dist/esm/internal/untrustedData.js.map +1 -0
  413. package/docs/README.md +129 -0
  414. package/docs/api.md +1869 -0
  415. package/docs/concepts.md +238 -0
  416. package/docs/external-transcripts.md +245 -0
  417. package/docs/guides/bind-flows.md +167 -0
  418. package/docs/guides/drive-the-loop.md +265 -0
  419. package/docs/guides/run-cells.md +262 -0
  420. package/docs/guides/workerd.md +144 -0
  421. package/docs/installation.md +69 -0
  422. package/docs/quickstart.md +121 -0
  423. package/docs/reference.md +954 -0
  424. package/docs/troubleshooting.md +177 -0
  425. package/package.json +463 -3
  426. package/src/AgentEvent.ts +1772 -0
  427. package/src/CallLedger.ts +560 -0
  428. package/src/Cell.ts +926 -0
  429. package/src/CellCalls.ts +198 -0
  430. package/src/CellHistory.ts +128 -0
  431. package/src/CellTurn.ts +4450 -0
  432. package/src/CellValidation.ts +382 -0
  433. package/src/Compaction.ts +330 -0
  434. package/src/CompletionClaim.ts +1013 -0
  435. package/src/ContextWindow.ts +669 -0
  436. package/src/EngineLike.ts +614 -0
  437. package/src/ExternalTranscript.ts +1142 -0
  438. package/src/FailedCall.ts +163 -0
  439. package/src/FlowBinding.ts +603 -0
  440. package/src/HarnessError.ts +98 -0
  441. package/src/Judgement.ts +526 -0
  442. package/src/Monitor.ts +579 -0
  443. package/src/NarrowedCheck.ts +694 -0
  444. package/src/Notifications.ts +262 -0
  445. package/src/Plan.ts +113 -0
  446. package/src/QuickJSSandbox.ts +1557 -0
  447. package/src/Relevance.ts +352 -0
  448. package/src/Sandbox.ts +908 -0
  449. package/src/Steering.ts +405 -0
  450. package/src/StructuredOutput.ts +484 -0
  451. package/src/Sufficiency.ts +247 -0
  452. package/src/Supervisor.ts +798 -0
  453. package/src/Tokens.ts +108 -0
  454. package/src/Transcript.ts +513 -0
  455. package/src/TruncatedOutput.ts +297 -0
  456. package/src/UnmovedTree.ts +121 -0
  457. package/src/UnresolvedFailure.ts +240 -0
  458. package/src/VacuousVerification.ts +280 -0
  459. package/src/VariablesPanel.ts +165 -0
  460. package/src/index.ts +204 -0
  461. package/src/internal/bytes.ts +70 -0
  462. package/src/internal/cellPrompt.ts +337 -0
  463. package/src/internal/compactable.ts +76 -0
  464. package/src/internal/compactionMarks.ts +454 -0
  465. package/src/internal/demandText.ts +145 -0
  466. package/src/internal/elide.ts +130 -0
  467. package/src/internal/frame.ts +1178 -0
  468. package/src/internal/nonNegativeSafeInt.ts +24 -0
  469. package/src/internal/paidUsage.ts +90 -0
  470. package/src/internal/printChannel.ts +434 -0
  471. package/src/internal/printsObservation.ts +31 -0
  472. package/src/internal/refusal.ts +53 -0
  473. package/src/internal/supervision.ts +652 -0
  474. package/src/internal/unfinishedWork.ts +123 -0
  475. package/src/internal/unobservedCall.ts +536 -0
  476. package/src/internal/untrustedData.ts +19 -0
@@ -0,0 +1,463 @@
1
+ /**
2
+ * The decisions one controller frame takes from what it measured.
3
+ *
4
+ * `CellTurn` seals a model step and runs a cell, and both need a model, a
5
+ * sandbox and an engine. What the frame decides from the result needs none of
6
+ * them: what it did to the run's ledgers, whether a completion is handed back,
7
+ * and which interventions the next frame is handed are functions of the state
8
+ * the frame opened on and the facts it measured. Each phase here returns a
9
+ * value, events included, instead of writing a variable a later exit reads, so
10
+ * each one is read and tested without running a frame.
11
+ *
12
+ * @since 1.0.0-rc.0
13
+ * @private
14
+ */
15
+ import { ModelRequest } from "@smthrs/model";
16
+ import type * as Evaluator from "@smthrs/model/Evaluator";
17
+ import { Effect, Option, type Schema } from "effect";
18
+ import * as AgentEvent from "../AgentEvent.ts";
19
+ import type { State } from "../CellTurn.ts";
20
+ import * as CompletionClaim from "../CompletionClaim.ts";
21
+ import type * as ContextWindow from "../ContextWindow.ts";
22
+ import type * as EngineLike from "../EngineLike.ts";
23
+ import type * as HarnessError from "../HarnessError.ts";
24
+ import * as NarrowedCheck from "../NarrowedCheck.ts";
25
+ import * as TruncatedOutput from "../TruncatedOutput.ts";
26
+ import * as VariablesPanel from "../VariablesPanel.ts";
27
+ /**
28
+ * The fields of controller state one step changes; everything else is carried.
29
+ *
30
+ * @since 1.0.0-rc.0
31
+ * @private
32
+ */
33
+ export type StateChanges = Partial<ConstructorParameters<typeof State>[0]>;
34
+ /**
35
+ * Whether the frame budget leaves a frame after this one.
36
+ *
37
+ * @since 1.0.0-rc.0
38
+ * @private
39
+ */
40
+ export declare const hasNextFrame: (state: State) => boolean;
41
+ /**
42
+ * Whether a completion can be handed back: a frame is left to answer in, and
43
+ * spending it cannot end the run at the read-only cap. See `judgeCompletion`.
44
+ *
45
+ * @since 1.0.0-rc.1
46
+ * @private
47
+ */
48
+ export declare const handBackRoom: (state: State, readOnlyFrames: number) => boolean;
49
+ /**
50
+ * One call a cell made this frame, as the frame's accounting reads it.
51
+ *
52
+ * Every call the frame settles is remembered so a raise can hand the model its
53
+ * partial work. Without this, one uncaught throw discarded the frame's reads
54
+ * and the next cell re-did them — often raising the same way again. Prime
55
+ * Agent's tool errors return stdout-so-far plus the traceback for exactly this
56
+ * reason.
57
+ *
58
+ * @since 1.0.0-rc.0
59
+ * @private
60
+ */
61
+ export interface ObservedCall {
62
+ readonly flow: string;
63
+ readonly ok: boolean;
64
+ readonly summary: string;
65
+ /** Where this call lands in the run's ledger, so a salvage line can name it. */
66
+ readonly ordinal: number;
67
+ /**
68
+ * Whether the call reached the engine declaring a write, which is what
69
+ * breaks a read-only run. A call the boundary refused is not one: it
70
+ * declared a write and performed none.
71
+ */
72
+ readonly mutates: boolean;
73
+ /**
74
+ * Whether the write behind `mutates` was measured on a tree the host's
75
+ * workspace walk does not cover: the result carried the reserved `mutated`
76
+ * key, which `bash` sets by fingerprinting a container's working directory
77
+ * either side of the command. The read-only cap counts such a write like
78
+ * any other; the unmoved-tree demand and the claim judge need to know that
79
+ * the host digests holding still says nothing about it.
80
+ */
81
+ readonly remote: boolean;
82
+ /**
83
+ * What this invocation asked for, as `CellTurn`'s `signatureOf` names it,
84
+ * with the tree it asked about folded in.
85
+ *
86
+ * The repeat ledger reads this one, because the identical command against
87
+ * a pinned tree and against the live tree are two different questions and
88
+ * a run that asks both has learned twice.
89
+ */
90
+ readonly signature: string;
91
+ /**
92
+ * The same, with the tree left out: what the call asked, of whatever
93
+ * tree.
94
+ *
95
+ * The check ledgers read this one, because `Sufficiency` matches a
96
+ * failing reading against the passing reading that answered it, and the
97
+ * whole shape this surface exists for takes those two readings of one
98
+ * command over two different trees. Keyed on the tree they would never
99
+ * meet. For a call on the live tree the two are the same string, so
100
+ * nothing that existed before checkpoints re-keys.
101
+ */
102
+ readonly subject: string;
103
+ /** The checkpoint this call ran against, when it named one. */
104
+ readonly at: string | undefined;
105
+ /** What this invocation asked for, verbatim, for the narrowing ledger. */
106
+ readonly input: Schema.Json;
107
+ /** What the call resolved with, verbatim, for the call ledger's digest. */
108
+ readonly value: Schema.Json;
109
+ /** What the flow said about a failure, for the call ledger's digest. */
110
+ readonly message: string | undefined;
111
+ /** What the flow said about its own failure, when it said it ran nothing. */
112
+ readonly invalidProbe: {
113
+ readonly reason: string;
114
+ readonly message: string;
115
+ } | undefined;
116
+ /**
117
+ * Whether the result reported a failing exit status about its subject.
118
+ *
119
+ * A call that declared an invalid probe is never failing here, whatever
120
+ * its exit status: the flow itself said the failure was about the command
121
+ * and not about the code, so the result is not a statement about the tree
122
+ * at all. See `UnresolvedFailure` `failed`.
123
+ */
124
+ readonly failing: boolean;
125
+ /**
126
+ * Whether the result reported a passing exit status about its subject.
127
+ *
128
+ * Not the negation of `failing`: a flow that reports no exit status is
129
+ * neither, and `Sufficiency` needs the difference between a check that
130
+ * passed and a call that never checked anything. An invalid probe is
131
+ * neither either, for the same reason it is never failing — the flow
132
+ * itself said the result is not a statement about the tree.
133
+ */
134
+ readonly passing: boolean;
135
+ }
136
+ /**
137
+ * The frame's own record of what it did to the world, computed once and
138
+ * carried out through every exit that continues the run.
139
+ *
140
+ * @since 1.0.0-rc.0
141
+ * @private
142
+ */
143
+ export interface Accounting {
144
+ /** Whether the frame changed the workspace, by declaration or by measurement. */
145
+ readonly mutated: boolean;
146
+ /** The journal's record of how that answer was reached. */
147
+ readonly observed: AgentEvent.MutationObserved;
148
+ /**
149
+ * The digest the frame closed on, when its closing measurement covered the
150
+ * tree; empty otherwise, which makes every demand that reads it inert.
151
+ */
152
+ readonly workspaceDigest: string;
153
+ /** This frame's readings of the live tree, in the order they settled. */
154
+ readonly frameChecks: ReadonlyArray<NarrowedCheck.Check>;
155
+ /**
156
+ * Every call the frame settled, verbatim, in the order they settled.
157
+ *
158
+ * The ledgers above are what a run carries forward, and they are bounded
159
+ * and lossy on purpose: a durable check entry keeps a clipped label and two
160
+ * exit-status flags, never a result. This is the one place the whole result
161
+ * of a call still exists, and it exists for one frame. `CompletionClaim`
162
+ * quotes the last check out of it; nothing else reads it.
163
+ */
164
+ readonly calls: ReadonlyArray<ObservedCall>;
165
+ /** The cell the frame ran, verbatim, for `FailedCall`. */
166
+ readonly source: string;
167
+ /** The frame's own broken probes, stated once for whichever exit it takes. */
168
+ readonly probeNotice: string | undefined;
169
+ /**
170
+ * Every state field the frame's measurements settle.
171
+ *
172
+ * A continuing exit states only what it changes on top of these, so a field
173
+ * measured here is carried whichever exit the frame leaves by. The read-only
174
+ * streak is one of them: when each exit passed it by hand, the frame's
175
+ * accounting was only as complete as the exit that remembered to.
176
+ */
177
+ readonly facts: StateChanges & Required<Pick<StateChanges, "readOnlyFrames" | "repeatFrames" | "checks" | "failures" | "mutations" | "remoteMutations">> & Required<Pick<StateChanges, "openingDigest" | "callLedger" | "reported">>;
178
+ }
179
+ /**
180
+ * What one frame that ran a cell did to the run's ledgers.
181
+ *
182
+ * Read off the calls the cell made and the two workspace measurements either
183
+ * side of them, and nothing else: no model, sandbox or engine is consulted, so
184
+ * a replayed frame accounts exactly as its original attempt did.
185
+ *
186
+ * @since 1.0.0-rc.0
187
+ * @private
188
+ */
189
+ export declare const account: (options: {
190
+ /** The state the frame opened on. */
191
+ readonly state: State;
192
+ /** Every call the cell made, in the order they settled. */
193
+ readonly calls: ReadonlyArray<ObservedCall>;
194
+ /** The workspace before the frame's calls. */
195
+ readonly opened: Option.Option<EngineLike.Observation>;
196
+ /** The workspace after them. */
197
+ readonly closed: Option.Option<EngineLike.Observation>;
198
+ /** Ids of the trees the frame pinned, oldest first. */
199
+ readonly minted: ReadonlyArray<string>;
200
+ /** What the realm holds after the frame, for the variables panel. */
201
+ readonly bindings: ReadonlyArray<VariablesPanel.Binding>;
202
+ /** Output the run has been handed as a fragment, this frame's included. */
203
+ readonly captures: ReadonlyArray<TruncatedOutput.Capture>;
204
+ /** The cell the frame ran, verbatim; omitted reads as a cell that inspects nothing. */
205
+ readonly source?: string | undefined;
206
+ }) => Accounting;
207
+ /**
208
+ * One completion handed back, and what handing it back costs.
209
+ *
210
+ * @since 1.0.0-rc.0
211
+ * @private
212
+ */
213
+ export interface CompletionDemand {
214
+ /** The control event that names the demand in the journal. */
215
+ readonly event: AgentEvent.UnmovedDemanded | AgentEvent.UnresolvedDemanded | AgentEvent.FailedCallDemanded | AgentEvent.UnobservedDemanded | AgentEvent.NarrowedDemanded | AgentEvent.NarrowOnlyDemanded | AgentEvent.ClaimDemanded;
216
+ /** The in-frame observation the next frame answers. */
217
+ readonly note: string;
218
+ /**
219
+ * Whether the answer this demand takes away may come back as the run's
220
+ * answer when the frame budget runs out; see `CellTurn.budgetMessage`.
221
+ *
222
+ * True for the measured demands except `FailedCall`, whose answer was
223
+ * written over a call that failed. `UnobservedCall` keeps its answer: the
224
+ * brake reads the source, not the sentence, so an answer it refused may be
225
+ * right, and a run that ends on the budget should end on it rather than on
226
+ * a bare notice. Each of the others says the record is
227
+ * missing a fact, not that the sentence is wrong, so a run that spends its
228
+ * last frame and never completes again is better served by the answer it
229
+ * wrote than by a bare budget notice.
230
+ *
231
+ * For the claim brake it depends on which of its two heights fired, because
232
+ * they mean different things. A reading between `CompletionClaim.unsupportedAt`
233
+ * and `CompletionClaim.inventedAt` is a bounce that would let the same
234
+ * sentence stand if the run re-stated it, so discarding it against an
235
+ * exhausted budget would throw away an answer the brake was never going to
236
+ * refuse. A reading at or above `inventedAt` is one the brake *would* refuse:
237
+ * restoring that sentence on the budget notice is how one measured run turned
238
+ * a bounced "the tests pass" into its final answer with a `stop` finish over a
239
+ * repository whose test exits 1. A bounce that cannot be re-judged must not be
240
+ * undone by the budget. See `CompletionClaim.unrecorded`.
241
+ */
242
+ readonly keeps: boolean;
243
+ /** The cap the demand spends. */
244
+ readonly spent: StateChanges;
245
+ }
246
+ /**
247
+ * What judging one completion produced: at most one demand, and at most one
248
+ * reading to journal whichever way it went.
249
+ *
250
+ * `observed` exists for the sixth brake alone. The five before it are derived
251
+ * from measurements the journal already carries, so a grader recomputes them
252
+ * and there is nothing to write when they stay silent; the claim brake asks a
253
+ * model, and a reading nobody records is a reading nobody can grade. It is set
254
+ * only where that brake ran and issued no demand — when it does demand, the
255
+ * same event travels on `demand.event`, so exactly one `claim-demanded` is
256
+ * written per evaluation.
257
+ *
258
+ * @since 1.0.0-rc.0
259
+ * @private
260
+ */
261
+ export interface CompletionJudgement {
262
+ /** The claim brake's reading, when it ran and issued no demand. */
263
+ readonly observed: AgentEvent.ClaimDemanded | undefined;
264
+ /** The demand that hands the completion back, when one of the six issued. */
265
+ readonly demand: CompletionDemand | undefined;
266
+ /**
267
+ * The failure the run ends with when the claim brake read a claim the
268
+ * evidence does not support and no bounce was left to spend. It travels on
269
+ * the judgement rather than as the effect's own failure so the caller
270
+ * journals `observed` first: a reading that ends a run is the one a grader
271
+ * most needs, and an effect that failed would take it with it.
272
+ */
273
+ readonly unproven: HarnessError.HarnessError | undefined;
274
+ /**
275
+ * The claim brake's whole decision, whenever it read one: the evidence, the
276
+ * questions and the answers behind the three numbers `observed` or the
277
+ * demand carries. Set on every way a reading comes out, because the record a
278
+ * reader reopens a decision from is needed most for the one that acted.
279
+ */
280
+ readonly decision: AgentEvent.DecisionSettled | undefined;
281
+ /** The per-sentence decision, when the brake asked for one. */
282
+ readonly sentenceDecision?: AgentEvent.DecisionSettled | undefined;
283
+ /**
284
+ * Whether the completion reported its own work unfinished, when the verdict
285
+ * asked. See `UnfinishedWork`.
286
+ */
287
+ readonly unfinishedDecision?: AgentEvent.DecisionSettled | undefined;
288
+ }
289
+ /**
290
+ * The prose the harness itself put in front of the run as its task.
291
+ *
292
+ * The `instructions` segments of the prefix zone and nothing else: `Agent`
293
+ * writes the task there, while the cell contract, the flow catalog, the
294
+ * project's instructions and the host's memory go in as `system` and the
295
+ * transcript goes in the tail. So this is the closest thing the controller holds to the task as
296
+ * the person stated it, and it cannot pick up a sentence the model wrote.
297
+ *
298
+ * @since 1.0.0-rc.0
299
+ * @private
300
+ */
301
+ export declare const taskText: (window: ContextWindow.ContextWindow) => string;
302
+ /**
303
+ * Whether a `complete` transition stands, or which demand hands it back.
304
+ *
305
+ * The completion's own evidence, judged once per demand. A run gets exactly
306
+ * one frame wrong for free — the last one — and five things can be wrong with
307
+ * it, four of them read off measurements the controller already took, under
308
+ * four caps:
309
+ *
310
+ * 1. `UnmovedTree`: the tree it is completing on is the tree it opened on, so
311
+ * there is no change for any evidence to be about. This one is not read
312
+ * alone: a question is answered on the tree it was asked on, so it is
313
+ * issued only where the claim brake (5) found the completion unsupported,
314
+ * and then in the brake's place;
315
+ * 2. `UnresolvedFailure`: a check over this exact tree reported a failing exit
316
+ * status and the run answered it with a different reading of the same
317
+ * subject rather than with the check itself;
318
+ * 3. `NarrowedCheck.find`: this frame's check repeats an earlier, broader one
319
+ * and adds conditions to it, run after a change the broader one never saw;
320
+ * 4. `NarrowedCheck.findOnly`: the check this frame ended on is the run's only
321
+ * reading of what it names — nothing broader was ever taken, so there was
322
+ * no broader check for (3) to find — and it carries a condition the run
323
+ * itself added, one taught neither by the prefix this harness wrote nor by
324
+ * the run's own other checks.
325
+ *
326
+ * Demands 3 and 4 share one cap. They are two readings of one question —
327
+ * whether the evidence covers what it looks like it covers — and a run that
328
+ * answers either has answered the question; a second bounce would be the loop
329
+ * asking it twice in different words.
330
+ *
331
+ * 5. `CompletionClaim`: the last brake and the only one that is not a
332
+ * measurement. The four above have said nothing, which means the tree
333
+ * moved, no check was stepped around, and whatever the run checked it
334
+ * checked whole — and none of that reads the sentence the run wrote. So
335
+ * the claim, the task, the tree fact, every check the run took over this
336
+ * tree and the verbatim result of the last one go to Jev, and a claim that
337
+ * reports a command or a result none of that records hands the frame back
338
+ * from a cap of its own. It is last because it is the only one
339
+ * that costs a request, and because a run one of the four already named
340
+ * has a demand to answer: asking a model to add a second one would hand
341
+ * the frame two questions. It never falls back: a completion Jev could
342
+ * not judge — no evaluator on the host, a refusal, a deadline, an answer
343
+ * that does not decode — fails the turn as `completion_unjudged` carrying
344
+ * the reason, the way `read_only_cap` ends a run, rather than standing.
345
+ * `Evaluator` is therefore a required service of this function and of
346
+ * every turn above it.
347
+ *
348
+ * The fifth is the one that is read on *every* completion, and the three
349
+ * things below that take a demand away do not take the reading away. The
350
+ * others are recomputable from the journal, so skipping them costs a grader
351
+ * nothing and a skipped one lets a completion stand that the truth bar still
352
+ * judges. This one is a sentence being checked against the record, it is what
353
+ * the server banner and the operator docs promise happens to every completion,
354
+ * and the run's answer is the product. So when there is no bounce left to
355
+ * spend — the cap is used up, or none of the room below exists — a claim that
356
+ * reports work the record does not record ends the run as `claim_unproven`
357
+ * instead of standing. That is the shape `read_only_cap` already uses, and it
358
+ * is the only shape that keeps the promise: a cap that stops at the bounce
359
+ * means the second identical claim is accepted unread, which is what a live
360
+ * run did.
361
+ *
362
+ * The verdict is narrower than the bounce, and that is the whole of what this
363
+ * lane changed. A completion the brake merely finds thin is handed back once
364
+ * and then stands; only a completion at `CompletionClaim.inventedAt` — a
365
+ * sentence reporting a command or a result nothing in the run produced — is
366
+ * refused. Arming the verdict on "is the task done" instead killed roughly one
367
+ * honest run in four, including five question-shaped turns in a row and one
368
+ * live CI dispatch whose planted bug was fixed. `CompletionClaim`'s header
369
+ * carries the eighteen-state corpus that measured it.
370
+ *
371
+ * A thin completion that stands is still not a success when it says so
372
+ * itself. Where the verdict is reached on a completion read as not done, one
373
+ * more question asks whether the completion reports its own work unfinished,
374
+ * and one that does ends the run as `completion_incomplete` quoting that
375
+ * report, so a host never settles "I could not finish" as a completed run.
376
+ * See `UnfinishedWork`.
377
+ *
378
+ * At most one is named, in that order, because they are in descending order of
379
+ * how fundamental the missing thing is: there is nothing to check, then the
380
+ * check said no, then the check said less than it looks like it said, then
381
+ * nothing in the record matches what the run said it did. Naming two at once
382
+ * would ask the run to answer a question it has not been given a frame for.
383
+ *
384
+ * The loop names what is missing and hands the frame back; it does not re-run
385
+ * anything, and it does not judge the answer that comes back.
386
+ *
387
+ * Asking costs the run a frame it can answer in, so a demand is issued only
388
+ * where that frame exists, and three separate things take it away (and leave
389
+ * the claim brake reading anyway, as above):
390
+ *
391
+ * - the frame budget, which has no frame left to spend, and turning a
392
+ * completion into an exhausted budget would lose the run's answer to make a
393
+ * point about it;
394
+ * - the read-only cap, which is the other budget that ends a run and ends it as
395
+ * a typed failure carrying nothing. A run that changed nothing is exactly the
396
+ * run `UnmovedTree` fires on, so a completion one frame short of twice the
397
+ * cap would be bounced, spend that frame reading, and die as `read_only_cap`
398
+ * with the answer it had already written discarded — a demand turning a
399
+ * finished run into a failure, which is the one outcome none of these may
400
+ * produce;
401
+ * - a demand this run has already answered. Each demand ends by promising that
402
+ * what comes back next is the answer that stands, and three of them fire on
403
+ * one transition, so the frame written to answer one is never judged by the
404
+ * next. See `State.demandedFrame`.
405
+ *
406
+ * @since 1.0.0-rc.0
407
+ * @private
408
+ */
409
+ export declare const judgeCompletion: (state: State, accounting: Accounting, contextWindow: ContextWindow.ContextWindow, claim: string, read?: typeof CompletionClaim.read) => Effect.Effect<CompletionJudgement, HarnessError.HarnessError, Evaluator.Evaluator>;
410
+ /**
411
+ * The interventions one ordinary continuing frame hands to the next.
412
+ *
413
+ * @since 1.0.0-rc.0
414
+ * @private
415
+ */
416
+ export interface Discipline {
417
+ /** The control events that issue them, in journal order. */
418
+ readonly events: ReadonlyArray<AgentEvent.AgentEvent>;
419
+ /** The messages the next frame reads after the steering it was sent. */
420
+ readonly messages: ReadonlyArray<ModelRequest.Message>;
421
+ /** What issuing them changes on top of the frame's facts. */
422
+ readonly changes: StateChanges;
423
+ }
424
+ /**
425
+ * The read-only, repeat and sufficiency interventions for a frame that settled
426
+ * a `continue` transition and has a frame after it.
427
+ *
428
+ * The read-only intervention. At the cap the next frame is told, structurally,
429
+ * that it must write something or say why it cannot; a justification is typed
430
+ * data on the transition, is recorded, and buys a bounded quiet spell without
431
+ * resetting the counter that ends the run at twice the cap.
432
+ *
433
+ * A justification buys that spell only when it *answers* a demand this frame
434
+ * was handed. A justification volunteered by a frame nobody asked is recorded —
435
+ * it is a field on the transition and the journal writes the whole transition —
436
+ * and buys nothing. The two cannot be the same price, because the counter runs
437
+ * regardless of which one is written: a run that volunteers one every few
438
+ * frames used to renew the quiet spell before the streak could ever hand the
439
+ * demand out, so the demand was never issued, never journaled, and never got
440
+ * its one chance to redirect the run, while the hard stop at twice the cap —
441
+ * which no grace touches — killed the run anyway. Two SWE-bench waves lost
442
+ * `pydata__xarray-7393` exactly so: ten volunteered justifications, zero
443
+ * `read-only-demanded` events, and death at 24 frames against a cap of 12
444
+ * without the control ever speaking.
445
+ *
446
+ * The convergence intervention. It is journaled when it is *issued* rather than
447
+ * when the next frame answers it, because what answers it is the shape of that
448
+ * frame's calls — which the journal already writes one by one — and not a
449
+ * field on a transition the controller has to wait for. Issuing it restarts the
450
+ * count, so a run that keeps repeating is told once every `repeatCap` frames
451
+ * instead of every frame.
452
+ *
453
+ * The counterweight, and the only notice here that asks for nothing. It is
454
+ * written on the frame that completes the pair rather than at a completion,
455
+ * because its whole purpose is to reach a run that is still deciding whether to
456
+ * keep working — a run at its `complete` transition has already decided. See
457
+ * `Sufficiency`.
458
+ *
459
+ * @since 1.0.0-rc.0
460
+ * @private
461
+ */
462
+ export declare const discipline: (state: State, accounting: Accounting, justification: string | undefined) => Discipline;
463
+ //# sourceMappingURL=frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../../src/internal/frame.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,KAAK,SAAS,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,KAAK,aAAa,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAEnD,OAAO,KAAK,KAAK,YAAY,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAA;AAEpD,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAA;AAGxD,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAA;AAWtD;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC,OAAO,KAAK,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