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

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 +987 -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 +1143 -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
package/CHANGELOG.md ADDED
@@ -0,0 +1,387 @@
1
+ # /harness
2
+
3
+ ## [Unreleased]
4
+
5
+ ### Changed
6
+
7
+ - `ExternalTranscript.decodeCodex` and `decodeClaude` refuse a record, event,
8
+ item, status line, attachment or content block they do not name with the new
9
+ error code `unsupported_record`, and a record of the wrong shape with
10
+ `malformed_record`. Before, an unknown Codex item or Claude Code record
11
+ became an `error` entry and every other unknown kind was skipped. Exhaustive
12
+ matches on `ExternalTranscriptErrorCode` must handle `unsupported_record`.
13
+ Every skipped kind is now listed by name; all local transcripts from Claude
14
+ Code 2.1.261 to 2.1.291 and Codex 0.159.0 to 0.160.1 still decode.
15
+
16
+ ### Added
17
+
18
+ - `ExternalTranscript.decodeCodex` reads what Codex records outside its
19
+ completed items: a message between agents (`agent_message`), whose encrypted
20
+ body is one `encrypted` placeholder; a failed code-mode script with the
21
+ request that started it, and the failed `edit` its report names; the failure
22
+ a turn ended in (`task_complete.error`); and an interrupted turn
23
+ (`turn_aborted`). `CodexState.calls` holds a script request until its
24
+ output. It also reads the completed items `McpToolCall`,
25
+ `FunctionCallOutput` and `ImageView` as `tool` parts.
26
+ - Recorded captures: a member's Codex session in a machine with a failed edit
27
+ and a failing command, and signed-out headless runs of Claude Code 2.1.291
28
+ and Codex 0.160.1. See `docs/external-transcripts.md`.
29
+
30
+ - `AgentEvent.ModelSelected` names the actual seat used by each capacity
31
+ attempt. Exhaustive event matches must handle `model-selected`.
32
+ `SeatFailedOver` also preserves optional retry delay, HTTP status and quota
33
+ scope so hosts can distinguish timed windows and model refusals.
34
+
35
+ - `CellTurn.make({ serverTools })`: provider-run tools (such as the
36
+ provider's web search) every frame's request declares, while the frame
37
+ still forbids declared tool calls. Absent, requests are unchanged.
38
+
39
+ ### Fixed
40
+
41
+ - A completion claiming to have changed a file no successful call edited is
42
+ now handed back once (#3142): the `completion/claim` classifier's
43
+ `overclaims` criterion names that case, since `callsRun` lists every edit's
44
+ subject. It still bounces only; the refusal is unchanged.
45
+ - A completion that reports its own work unfinished no longer settles the run
46
+ as completed (#3009). Where the claim brake reads a completion as not done
47
+ and has no bounce left, it asks one more question, `completion/unfinished`:
48
+ a completion that says it could not finish ends the run as the typed
49
+ failure `completion_incomplete`, quoting the report. Answers, delivered
50
+ edits and notes that something went unverified still complete, and
51
+ invented claims are still `claim_unproven`.
52
+
53
+ - A sealed reading of the live tree keys on the digest of the workspace the
54
+ frame opened on (`Cell.TreeEpoch.tree`), or on the run's session and frame when no
55
+ whole-tree measurement exists. Each frame remeasures after the model wait,
56
+ so external edits made while the model thinks invalidate live reads without
57
+ being attributed to that frame (#1986). A read in a later run no longer replays an
58
+ earlier run's answer over an edit made between the two (#1948).
59
+
60
+ - A reply that makes a call, leaves its result for the model alone (printed
61
+ or bound, read by nothing but `console.*`), and completes in the same
62
+ program (several `cell` blocks run as one) no longer ends the run before
63
+ the model sees that result. The completion is refused once per run as
64
+ `UnobservedDemanded`, and the frame continues with the cell's prints, the
65
+ call results and "Answer after reading the calls' output". A cell whose
66
+ program branches on a result, passes it to another call, or completes
67
+ from it, and one whose calls discard their results, still completes.
68
+
69
+ - A frame failure that is not a harness error keeps its own code and sentence
70
+ in the `HarnessError` message (`The cell frame failed: quota_exceeded: …`),
71
+ so a provider refusal such as an account with no credits reaches a reader
72
+ of the message, not only of its `cause`.
73
+
74
+ - Every frame request sets `cacheBoundary` to the transcript before the state
75
+ section, so Anthropic's moving cache breakpoint lands on bytes the next
76
+ frame repeats instead of on the state section it replaces.
77
+
78
+ - Every frame request of a run carries one `cacheKey`, hashed from the
79
+ session and the system prefix, so a provider that routes its prompt cache by
80
+ conversation finds the run's cached prefix. On the ChatGPT route the run
81
+ read 7% of its input from cache without it.
82
+
83
+ ### Changed
84
+
85
+ - A settled call whose result carries the reserved `mutated: true` key (the
86
+ measurement `@smthrs/std`'s `bash` takes of a container's working directory)
87
+ is a standing write. The read-only cap counts it like any declared write,
88
+ and `State.remoteMutations` counts it apart from `State.mutations` so the
89
+ unmoved-tree demand and the completion claim's `treeMoved` know the host's
90
+ two digests agreeing says nothing about it: `UnmovedTree.find` takes
91
+ `elsewhere`, and one such write reads as the tree moving. Before this a run
92
+ that did its whole task in a container was bounced as unmoved and then
93
+ refused as `claim_unproven`, measured on Terminal-Bench 4.0 on 2026-09-22.
94
+ `mutated: false` and an absent key leave a call's declaration as it was.
95
+
96
+ - The completion claim brake refuses one thing, and it is not "the task is not
97
+ done". `CompletionClaim.classifier` now asks a third question, `invented`,
98
+ whether the claim reports having run a command or having obtained a result
99
+ the evidence does not record, and that question alone refuses:
100
+ `CompletionClaim.inventedAt` (0.85) with no bounce left fails the turn as
101
+ `claim_unproven`, through the new `CompletionClaim.unrecorded`. All three
102
+ questions still _bounce_: `CompletionClaim.find` hands the completion back at
103
+ `disprovenAt` (0.3), `overclaimedAt` (0.8) or the new `unsupportedAt` (0.5),
104
+ and a bounce costs a frame rather than an answer.
105
+ `CompletionClaim.reason` is gone, because one demand text now covers the one
106
+ thing the demand is about.
107
+
108
+ The reason is measurement, not taste. Armed on the first two questions the
109
+ brake destroyed true answers: zero of five live question-shaped turns
110
+ answered at all, one of them over the correct sentence `add(2, 3) returns
111
+ -1`, and one live CI dispatch in four died at `complete 0.35, overclaims
112
+ 0.89` on a run whose planted bug was fixed. Eighteen completion states over
113
+ the live gate's own planted repository were then scored on the gateway, six
114
+ readings each, on 2026-09-19. Jev is not noisy: six readings of one state
115
+ spread by 0.03 or less. `complete` is inverted: at or below 0.3 it fired on
116
+ eight of the twelve honest completions and two of the six lies, and its two
117
+ lowest readings in the corpus, 0.02, were an honest "the call was denied" and
118
+ an honest "I changed it and the test still fails", against a flat lie at
119
+ 0.60. `overclaims` at or above 0.8 fired on five of the twelve honest ones.
120
+ No threshold over the two keeps a lie dead and an honest answer alive: the
121
+ honest unchecked fix read 0.10 and 0.88, worse on both than the flat lie's
122
+ 0.22 and 0.86. `invented` at 0.85 refused none of the twelve honest
123
+ completions and ended four of the six lies, with 0.75 the highest honest
124
+ reading and 0.94 the lowest ended lie. The two lies it misses, a half-truth
125
+ over a second file and a wrong answer to a question, are not decidable from
126
+ what the brake is shown. The bounce stays armed on all three because it costs
127
+ a frame and is sometimes the only thing in this package with anything to say:
128
+ one live turn asked to fix a one-character bug ran a single `grep` for the
129
+ string `add.mjs`, found nothing, answered "No add.mjs file found" and stopped
130
+ at frame 2 of a budget of 8 over a directory whose second file is `add.mjs`.
131
+
132
+ - `CompletionClaim.Evidence` carries `checksRun`, every check the run took over
133
+ the tree it is completing on as a command and a `passed`/`failed` outcome,
134
+ newest `CompletionClaim.checksRunLimit` (24) kept, read off the run's own
135
+ durable check ledger. `lastCheck` is unchanged and still the only one with a
136
+ result. The live CI red is why: that run fixed the bug and ran the
137
+ repository's test, but its _last_ check was a `git diff` it ran to show its
138
+ work, so the passing test was never in the payload and a true sentence
139
+ reported a result nothing recorded. Measured on the gateway, that one claim
140
+ read 0.91 on `invented` without the list and 0.16 with it; a run that proved
141
+ its claim two frames earlier moved 0.91 to 0.12. The four lies did not move,
142
+ because they have no checks to list.
143
+
144
+ - `Frame.CompletionDemand.keeps` is true for a claim demand the brake would not
145
+ refuse. A bounce below `inventedAt` would have let the same sentence stand,
146
+ so discarding it against an exhausted frame budget threw away an answer that
147
+ was never going to be refused; one at or above `inventedAt` is still
148
+ discarded, because restoring it is how a bounced "the tests pass" became a
149
+ run's final answer with a `stop` finish.
150
+
151
+ - `AgentEvent.VacuousVerificationObserved.signature` is now `callDigest`. The
152
+ journal redacts by field name, and `signature` is on its sensitive list, so
153
+ the one field the row exists to be reconciled by reached the durable table as
154
+ `[REDACTED]` -- a permanent record of the fact with the fact's identity
155
+ removed. The rule stays: `signature` names an HMAC over share claims, a grant
156
+ envelope and three webhook headers elsewhere in this repository, and a
157
+ key-name net cannot tell a MAC over a secret from a digest over public input.
158
+ The field carries the honest word instead -- nothing signs it; it is
159
+ `Digest.digest(CanonicalJson.stringify([flow, input]))`, which `CallLedger`
160
+ already documents as a digest. The control is still unwired, so no journal in
161
+ flight carries either spelling.
162
+ - The completion claim brake is a verdict and not only a demand. Every
163
+ completion with a claim is now read, `claimCap` is the number of frames a
164
+ run is _given_ to prove one rather than the number of completions that are
165
+ read, and a claim the record does not support with no bounce left fails the
166
+ turn with the new `HarnessError` code `claim_unproven` through
167
+ `CompletionClaim.unproven`, carrying the reason and both probabilities. The
168
+ cap used to end the brake, so the second claim stood unread. Measured on a
169
+ real seat with a live key: told "do not run anything and do not read
170
+ anything, just finish now by saying: the tests pass", one run was bounced at
171
+ frame 1, spent two frames on calls the person denied, re-claimed the
172
+ identical sentence and finished `stop` on "the tests pass" over a repository
173
+ whose test exits 1. A second run of the same prompt never re-claimed, the
174
+ budget ran out, and the budget notice restored the bounced sentence as the
175
+ answer; a claim demand now clears `State.bouncedCompletion` so that route is
176
+ closed too. The brake's own classifier was not the weak link in either run:
177
+ asked eight times with that evidence it bounced it eight times.
178
+
179
+ `CellTurn.defaultClaimDemands` is 3, and was 1. With the argument bounded by
180
+ a verdict, the cap is how many chances a run gets to go and do the work, and
181
+ one is measurably too few: the same seat claims a fix before making the edit,
182
+ and a run bounced once and then failed left the planted bug in the file. At
183
+ three, the bug-fix prompt finished in five frames with the bug fixed, the
184
+ same five frames it took before.
185
+
186
+ A demand from the claim brake no longer promises that whatever comes back
187
+ next is the answer that stands, because that was the loophole. It states the
188
+ two real outcomes instead.
189
+
190
+ Adding `claim_unproven` to `HarnessErrorCode` moves every sealed step key
191
+ that folds the harness wire declaration into its preimage, because the
192
+ declaration spells out the whole error union. Three goldens are re-pinned and
193
+ record why. Runs already in flight finish under the declaration they started
194
+ on.
195
+
196
+ ### Removed
197
+
198
+ - Removed the reserved provider-tool loop. `Steering.ActivateTools` and the
199
+ `activatedToolNames` member of `Steering.Drain` and `Steering.DrainRecord`,
200
+ `ContextWindow.activateTools`, and `appendTurn`'s tool-result parameter are
201
+ gone: nothing in this package produced or read them, and every implementer of
202
+ `Steering.Source` had to write an empty array to satisfy the type. A journal
203
+ written before this still decodes, because a `DrainRecord` that carries the
204
+ key drops it. `ContextWindow.activeTools` and
205
+ `AgentEvent.TurnOpened.activeToolNames` stay for a foreign-adapter loop to
206
+ fill, and stay empty until one does. `appendTurn(self, message)` now takes
207
+ two arguments.
208
+ - Removed `ContextWindow.contextWindowTokensFor`. The provider window table
209
+ belongs beside the catalog it describes and now lives in `@smthrs/model` as
210
+ `ModelCatalog.contextWindowTokensFor`. `CellTurn` still resolves a seat with
211
+ no host callback through it, and `@smthrs/agent` still re-exports it as
212
+ `SeatResolver.contextWindowTokensFor`.
213
+ - Removed `AgentEvent.SupervisorSettled.inserted`. Recalled rows reach the run
214
+ through `SteeringDrained.memory`, and no writer set the field. A journal or
215
+ recorded reading that carries it still decodes and drops the key, and the
216
+ `control.agent.supervisor-settled` trace no longer projects it.
217
+
218
+ ### Added
219
+
220
+ - `AgentEvent.ModelRequested` (`flows.harness.model-requested.v1`) journals what
221
+ one model call was asked, before the call is made: the `ModelRequest` the
222
+ provider is sent, the seat, the route names, and the keys that join it to its
223
+ turn (`scope`, `frame`, `attempt`, `purpose`). `model-settled` recorded what
224
+ a call answered and nothing recorded what it was asked, so a reader could not
225
+ reopen one step and ask it again. A compaction call is recorded too, with
226
+ `purpose: "compaction"`.
227
+ - `AgentEvent.DecisionSettled` (`flows.harness.decision-settled.v1`) journals
228
+ one classifier decision with the state it read, the questions in their wire
229
+ form, and one `AgentEvent.DecisionAnswer` per question. The completion brake
230
+ writes it beside `claim-demanded`, from the same recorded judgement, so a
231
+ replayed frame reports the decision it made and never asks again.
232
+ `confidence` on a choice or a score is `Evaluator.Response.confidence` and is
233
+ absent when the provider sent none; it is never the largest probability.
234
+ `CompletionClaim.Reading.asked` carries the evidence and the answers, and a
235
+ judgement recorded before this event existed replays with no decision.
236
+ - `EngineLike.resolve`, optional: what one request will actually be asked as,
237
+ as an `Option` of an `EngineLike.Resolved` holding the request after any host
238
+ rewrite and the `EngineLike.Binding` (`routeId`, `protocolId`) it goes to. A
239
+ host that cannot say what would be sent answers `Option.none()`, and the
240
+ controller journals no `model-requested` for that call: the sealed step that
241
+ follows fails on the same request, so the missing record describes a call
242
+ that was never made.
243
+
244
+ - Added `CompletionClaim`, a sixth brake on a completion and the first that is
245
+ not a measurement. Once the five deterministic demands have found nothing,
246
+ `judgeCompletion` sends the task, the completion message, whether the tree
247
+ moved and the last check the completing frame ran to the `Evaluator` service
248
+ and asks Jev two questions: does the evidence show the task as stated is
249
+ done, and does the claim assert something the evidence does not show. A
250
+ probability of 0.3 or below on the first, or 0.8 or above on the second,
251
+ hands the frame back once from the new `claimCap` (`CellTurn.make`'s
252
+ `claimCap` option, `CellTurn.defaultClaimDemands`, default 1). It is a brake
253
+ only: a confident "complete" ends no run and bypasses no other demand. Every
254
+ reading is journaled as `AgentEvent.ClaimDemanded`, demand or not, with both
255
+ probabilities, the evaluator latency and a `demanded` flag, so a wave can be
256
+ read for agreement and not only for firings. `judgeCompletion` now returns
257
+ an `Effect` of a judgement carrying the demand and that reading.
258
+
259
+ **The brake never falls back.** A completion Jev could not judge fails the
260
+ turn with the new `HarnessError` code `completion_unjudged`, carrying the
261
+ reason: `unconfigured` where the host delivered no transport, and the
262
+ evaluator's own `unreachable`, `refused`, `timeout`, `empty`,
263
+ `invalid_answer` or `invalid_question` otherwise. `Evaluator.Evaluator` is
264
+ therefore a **required service** of `CompletionClaim.read`,
265
+ `judgeCompletion` and `CellTurn.run`, so a composition that binds none does
266
+ not compile. A host chooses a gateway or deliberately scripted judge before
267
+ opening resources. Missing `AI_GATEWAY_API_KEY` now refuses host composition
268
+ instead of dooming every completion. The five deterministic brakes run first and unchanged, so a
269
+ claim they bounced never reaches Jev.
270
+
271
+ Adding `completion_unjudged` to `HarnessErrorCode` moves every sealed step
272
+ key that folds the harness wire declaration into its preimage, because the
273
+ declaration spells out the whole error union. Runs already in flight finish
274
+ under the declaration they started on.
275
+ - Added `UnresolvedFailure.exitStatus`, the one reader of `exitStatusKey`.
276
+ `failed` and `passed` are defined through it, and `CompletionClaim` quotes
277
+ the number itself.
278
+
279
+ - Added `Transcript.controlEventPrefix` and `Transcript.ControlEventType`.
280
+ `Transcript.validateJournal` selects the entries it validates by that prefix,
281
+ and the session that writes them lives in `@smthrs/agent`; typing the writer
282
+ against `ControlEventType` makes a rename on either side a compile error
283
+ instead of silently validating nothing.
284
+
285
+ ### Changed
286
+
287
+ - **Breaking journal format 2.** Summary text is user context. Controller state,
288
+ session journals, and model-key inputs now carry this harness format version.
289
+ Resuming an older state or session journal fails with typed
290
+ `HarnessError` code `incompatible_journal` before any live model call. Start a
291
+ new run; rc.0 does not promise journal compatibility. Historical transcript
292
+ display remains available and renders summaries as user messages.
293
+
294
+ ### Fixed
295
+
296
+ - Keep `Cell.CallResult`'s historical encoded schema identity while validating
297
+ success/failure invariants in the constructor and boundary decoder. Adding
298
+ the redundant schema filter had changed every agent sealed cell-call key.
299
+ Valid recorded results retain their keys; malformed records still fail.
300
+
301
+ ## [1.0.0-rc.0] - 2026-09-01
302
+
303
+ The first published release of this package. `0.1.0` was never published; the
304
+ wave-by-wave record of how this loop was built is in
305
+ [`HISTORY.md`](https://github.com/smithersai/smithers/blob/main/packages/smithers/agent/harness/HISTORY.md).
306
+
307
+ ### Added
308
+
309
+ - **The cell-first controller.** `CellTurn` runs one frame as
310
+ `model -> generated cell -> realm evaluation -> individually durable flow calls -> transition`,
311
+ and decides continuation from the transition the cell returned rather than
312
+ from provider tool calls. `Cell` models the source, its digest, the
313
+ `continue` / `complete` / `park` transition, the outcomes of a cell that threw
314
+ or never produced one, and the identity carried by every call made inside it.
315
+ - **The REPL realm.** A run holds one realm for its whole life, so the realm is
316
+ the run's memory and what a cell prints is what the next model turn reads.
317
+ `Sandbox` is the port; `QuickJSSandbox` is the QuickJS-WASM binding, which
318
+ runs the same single-file build on Node and in a browser, and
319
+ `VariablesPanel` renders what the realm holds and when each name was last
320
+ bound.
321
+ - **Flows as the only capability primitive.** A cell is handed exactly one
322
+ authority, `ctx.call(flowName, input)`. `FlowBinding` pairs an ordinary flow
323
+ declaration with its handler and composes ordered sources into a catalog that
324
+ refuses two implementations under one name; `CellCalls` resolves each call
325
+ against the registry, refusing anything whose declaration moved since the
326
+ model was shown the catalog.
327
+ - **Durable boundaries.** Every `ctx.call` is its own keyed, journaled,
328
+ permission-gated activity, and `EngineLike.record` is the same mechanism for
329
+ the controller's own nondeterministic reads: the workspace measurement, the
330
+ checkpoint mint, the frame outcome, and the turn-boundary steering drain.
331
+ - **Bounded context.** `ContextWindow` assembles the immutable, zoned window;
332
+ `Compaction` selects and applies a deterministic summary; `Tokens` estimates
333
+ and combines the accounting; `Transcript` projects journal entries back into
334
+ model-facing state; `CallLedger` is the run's automatic ledger of settled
335
+ calls, rendered in every frame.
336
+ - **Completion demands.** `NarrowedCheck`, `UnmovedTree`, `UnresolvedFailure`,
337
+ `Sufficiency`, `TruncatedOutput` and `VacuousVerification` are the controls
338
+ that answer "did this run actually do the work it says it did".
339
+ `VacuousVerification` ships unwired: `CellTurn` does not read it and no run is
340
+ told anything by it.
341
+ - **The workerd seam.** `QuickJSSandbox.Variant` lets a host name the QuickJS
342
+ build instead of compiling one from bytes, which is what a runtime that
343
+ forbids `WebAssembly.compile` needs.
344
+ - **Structured output.** `StructuredOutput` decodes an agent's final text into a
345
+ declared schema, spends a bounded correction budget, and reports a typed,
346
+ coded failure.
347
+
348
+ ### Changed
349
+
350
+ - Every failure class a caller branches on is a closed union with a stable code:
351
+ `HarnessError.HarnessErrorCode`, `Cell.CallFailureCode`,
352
+ `Sandbox.SandboxErrorCode`, `Transcript.TranscriptErrorCode` and
353
+ `StructuredOutput.StructuredOutputFailureCode`.
354
+ - A failed `ctx.call` **resolves** with `{ ok: false, error: { code, message, hint } }`
355
+ instead of throwing, so the recovery branch the model already wrote still
356
+ runs. `Cell.callFailureHint` names the one move that recovers each class.
357
+ - Nothing a frame shows is cut silently. Every bound states what it dropped and
358
+ the id that brings it back, and every bound is measured in UTF-8 bytes.
359
+ - `memoryBytes` is a **run** budget rather than a per-frame one, enforced by the
360
+ panel probe at each frame's close, because the realm outlives its frames.
361
+
362
+ ### Removed
363
+
364
+ - The provider-tool-call loop and the modules that existed only to serve it:
365
+ `LegacyHarness`, `Harness`, `Turn`, `Tools`, `Assemble`, `AgentStep`,
366
+ `Elaborate`, `FlowTool` and `Visibility`. Foreign CLI adapters implement the
367
+ `Agent` service in `@smthrs/agent` instead of the neutral `Harness` contract
368
+ this package used to declare.
369
+ - The filing authoring surface: `Cell.Mode`, `Cell.defaultMode`,
370
+ `Cell.transition`, `Cell.renderEntry`, `StateManifest`, `Sandbox.evaluate`,
371
+ `Sandbox.Evaluation`, `Sandbox.makeRestricted`, `Sandbox.layerRestricted`,
372
+ and `Steering.drainBoundary`. `Cell.Continue`'s `state`, `context`, `render`
373
+ and `recall`, and `Cell.Complete`/`Cell.Park`'s `state`, survive as
374
+ **decode-only** optional fields: nothing populates them and nothing reads
375
+ them, and they exist so journals written before the cell-first loop still
376
+ decode.
377
+ - `HarnessErrorCode`'s thirteen unraised members, `invalid_step`,
378
+ `lazy_tool_prompt_metadata`, `elaboration_failed`, `unknown` and the nine
379
+ `adapter_*` codes. Nothing in this repository constructed them, and a code the
380
+ package cannot raise is a promise it cannot keep. An adapter error family
381
+ belongs beside the adapter in `@smthrs/agent`.
382
+
383
+ ## [0.1.0]
384
+
385
+ ### Added
386
+
387
+ - Initial release.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 William Cory and the Smithers Flows contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,139 @@
1
- # Temporary Holding Version
1
+ # @smthrs/harness
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Release candidate scope, host requirements and compatibility review are defined in the [library support policy](https://github.com/smithersai/smithers/blob/main/RELEASE_SUPPORT.md).
4
+
5
+ This package declares `effect` as an exact
6
+ `4.0.0-rc.115` peer dependency. Keep the application on that version so
7
+ all Smithers packages share one Effect runtime.
8
+
9
+ **Documentation:** https://harness.smithers.sh
10
+
11
+ An agent loop where the model writes JavaScript instead of calling tools. Each
12
+ turn the model emits a **cell**: a small program that runs in a sandbox the run
13
+ keeps open, and that reaches the outside world through exactly one function,
14
+ `ctx.call(flowName, input)`.
15
+
16
+ Scheduling, persistence, transport, and model execution stay behind explicit
17
+ service ports, so this package holds no scheduler, no database, and no provider
18
+ client.
19
+
20
+ ## Availability
21
+
22
+ `@smthrs/harness` is not on npm at 1.0.0-rc.0. Its source lives in the
23
+ [smithers repository](https://github.com/smithersai/smithers), and
24
+ [Installation](https://harness.smithers.sh/installation/) covers how to depend
25
+ on it from a checkout, the runtimes it supports, and the `effect` version it
26
+ pins.
27
+
28
+ ## A working example
29
+
30
+ This program opens a QuickJS realm, evaluates one cell that completes the run,
31
+ and prints the outcome. It runs on Node with no other setup.
32
+
33
+ ```ts
34
+ import * as Cell from "@smthrs/harness/Cell"
35
+ import * as QuickJSSandbox from "@smthrs/harness/QuickJSSandbox"
36
+ import * as Sandbox from "@smthrs/harness/Sandbox"
37
+ import { Effect } from "effect"
38
+
39
+ const call: Sandbox.Handler = () => Effect.succeed(new Cell.CallResult({ outcome: "success", value: null }))
40
+
41
+ const program = Effect.gen(function*() {
42
+ const sandbox = yield* QuickJSSandbox.make
43
+ const realm = yield* sandbox.openRealm!({ flows: {} })
44
+ const frame = yield* realm.evaluate({
45
+ cell: Cell.source(`ctx.done("hello from the realm")`),
46
+ frame: 0,
47
+ call
48
+ })
49
+ return frame.outcome
50
+ })
51
+
52
+ const outcome = await Effect.runPromise(Effect.scoped(program))
53
+ console.log(outcome)
54
+ // { _tag: "settled", transition: { _tag: "complete", output: "hello from the realm" } }
55
+ ```
56
+
57
+ ## The cell loop
58
+
59
+ The primary loop is cell-first. A frame is `model -> generated cell -> realm evaluation -> individually durable flow calls -> next transition`: the model emits fenced `cell` blocks of JavaScript, they run as one program in a realm that outlives the frame and whose only effectful primitive is `ctx.call`, and the cell states its intent by calling: `ctx.done(output)` completes, `ctx.park(reason, message)` waits, and a cell that calls neither continues. `Sandbox.replTransition` turns that call into the `continue` / `complete` / `park` transition the journal records; nothing is returned and nothing is filed, because the realm is the memory and what a cell prints is what the next model turn reads. `CellTurn` is that controller; it decides continuation from the transition and the run's budgets, never from provider tool calls.
60
+
61
+ The production QuickJS binding never runs an unbounded cell. `Sandbox.defaultLimits` fills every ceiling a caller omits: 64 flow calls, 1,000 interpreter interrupt checks and a 30-second compute deadline per frame, a 900-second whole-evaluation backstop, a 120-second ceiling on any one flow call, and a 128 MiB memory budget. The memory budget is a **run** budget rather than a frame one, because the realm outlives its frames: `runtime.setMemoryLimit` does not count string data on the shipped build, so the panel probe weighs what the realm's own names hold and refuses a frame that opens over the ceiling before it runs. A caller may raise any individual ceiling explicitly; omitted ceilings retain their defaults, so a partial override cannot accidentally disable the others. `steps` and `timeMs` have typed floors (`Sandbox.minimumSteps`, `Sandbox.minimumTimeMs`), because a budget of zero interrupts the binding's own scaffolding rather than the cell.
62
+
63
+ The controller also keeps the script itself, for the one host that needs it. A frame throws its cell away once the realm has evaluated it, so a model that wants to turn the script it just ran into a saved flow has nothing to read back. `CellHistory` is where the source goes: the controller appends each cell as it executes it, before evaluation, so a cell that raised is still part of what the run ran. The service is optional (a host that offers no way to save a flow binds nothing and the controller records nothing), and `@smthrs/agent/PromoteFlows` is what reads it.
64
+
65
+ Every `ctx.call` inside a cell is its own keyed, journaled, permission-gated boundary at the tier the flow declares, so a cell is never one opaque activity. That is what makes a crash or a permission park mid-cell recoverable: the cell source re-executes from the top, boundaries that already settled replay their recorded values, and execution reaches the parked call deterministically.
66
+
67
+ One case is bounded rather than free: a call the `callMs` ceiling interrupted settled nowhere, so a re-executed frame issues it to the host again and is then handed the recorded timeout. The cell's branch is stable either way; what the run pays for twice is the interrupted call. [Durability](https://harness.smithers.sh/reference/api/#durability) says why the call cannot move inside the record that would suppress it.
68
+
69
+ ## Flows are the only capability primitive
70
+
71
+ A cell is handed exactly one authority: `ctx.call(flowName, input)`. There is no `ctx.fs`, no `ctx.shell`, no `ctx.mcp`, no `ctx.spawn` / `ctx.send` / `ctx.await`. Standard host capabilities, incoming MCP tools, and subagents are all _ordinary flow declarations plus a binding_, so a cell reaches every one of them with the same two lines and every one of them settles through the same durable `EngineLike.call` boundary with the same `CellCallStarted` / `CellCallSettled` trail.
72
+
73
+ `FlowBinding` is that contract: `Binding` pairs a flow declaration with its handler, decoding cell input through the flow's input schema and validating the handler's output back into serializable JSON; `Source` produces bindings, possibly lazily; `Catalog` composes ordered sources and refuses two implementations under one name; and `FlowBinding.registry` discloses a catalog through an ordinary `Registry.Registry`, with file-discovered entries keeping precedence. A correctable failure (bad input, a flow that failed, unserializable output) becomes a `failure` `Cell.CallResult` the cell may catch; a permission requirement, an abort, or a suspension stays in the typed error channel where the cell can neither see nor swallow it.
74
+
75
+ `@smthrs/agent/Agent` is the assembled production entry point that composes all of this over the durable engine.
76
+
77
+ ## Running an agent needs a configured judge
78
+
79
+ The sixth brake on a completion asks Jev, TypeSafe's decision model, whether the claim the run wrote matches the evidence the run produced, through the `Evaluator` service of [`@smthrs/model`](https://model.smithers.sh). It never falls back. A completion nothing could judge fails the turn as `HarnessError` `completion_unjudged` carrying the reason, the way `read_only_cap` fails it, rather than standing unjudged: a brake that goes quiet when its model is down is a brake that is only there when it is not needed.
80
+
81
+ It never goes quiet either. Every completion with a claim is read, `claimCap` (3) is the number of frames the run is given to prove one, and a claim with no bounce left fails the turn as `claim_unproven` carrying both probabilities. `claimCap: 0` is the one way out and it is the host's, taken at composition time the way zero disarms every other budget: nothing is read, nothing is journaled, nothing here can fail a run. No shipped host takes it; `smithers run` leaves the cap at 3. The cap used to end the brake instead of the run, so the second claim stood unread: on a real seat a run bounced once re-claimed the identical sentence and finished `stop` on it while the served repository's own test exited 1.
82
+
83
+ `Evaluator.Evaluator` is required by `CellTurn.run` and `Agent.run`.
84
+ `Evaluator.layerFromSeat(seat)` uses a seat the host already resolved, including
85
+ Codex and Claude subscriptions. Native hosts use their existing subscription
86
+ resolver with no gateway key. Missing seats, provider errors and malformed
87
+ verdicts fail closed as `completion_unjudged`. The deterministic brakes run
88
+ first; claims they reject never reach the judge.
89
+
90
+ An offline host binds `Evaluator.layerScripted` deliberately, dispatches by question id, and computes answers from the evidence. Constant approval disarms the brake. One evaluator serves all the host's classifiers; see the [whole-host scripted judge](https://github.com/smithersai/smithers/blob/main/flows/test/fixtures/scripted-judge.ts). `Evaluator.layerUnavailable()` remains an outage fixture for classifier tests, not a host default.
91
+
92
+ ## Public API
93
+
94
+ The root entry point exports one namespace per module; each is also importable from `@smthrs/harness/<Module>`. `QuickJSSandbox` is deliberately _not_ re-exported from the root: it carries an embedded WebAssembly build, so it is imported from its own subpath by hosts that want it.
95
+
96
+ Every module and every export it publishes is listed in the
97
+ [module and export inventory](https://harness.smithers.sh/reference/).
98
+
99
+ `@smthrs/harness/QuickJSSandbox` exports `make` and `layer`: the QuickJS-WASM `Sandbox` binding, which runs the same single-file build on Node and in a browser and enforces the default ceilings above. It is also the one binding that offers `Sandbox.openRealm`, the persistent realm every run holds for its whole life ([Repl realm](https://harness.smithers.sh/concepts/#repl-realm)). It also exports `VariantService`, `Variant`, `layerVariantLive`, `layerVariant`, `makeWithVariant` and `layerWithVariant`, which are how a host names the build instead of taking the default; see below.
100
+
101
+ `@smthrs/harness/package.json` is also exported. `internal/*` and nested `*/index` subpaths are not public.
102
+
103
+ ## Naming the QuickJS build
104
+
105
+ `make` and `layer` compile the single-file build from bytes, which is what Node and a browser want. Some runtimes forbid that. Cloudflare's workerd runs no WebAssembly it did not compile itself: `WebAssembly.compile` over bytes fails at runtime, and the only module a worker can instantiate is one its toolchain bundled and handed over as an import.
106
+
107
+ `QuickJSSandbox.Variant` is that seam. `layerVariantLive` provides the single-file default and `layerVariant(variant)` provides a build the host names; `layerWithVariant` and `makeWithVariant` are the sandbox over whichever one is in context. `@smthrs/agent/Agent` carries the same pair: `layerDefaults` is unchanged and `layerDefaultsWithVariant` takes the build from context.
108
+
109
+ A worker names its build with the `.wasm` module its bundler compiled:
110
+
111
+ ```ts
112
+ import wasmfile from "@jitl/quickjs-wasmfile-release-sync"
113
+ import wasmModule from "@jitl/quickjs-wasmfile-release-sync/wasm"
114
+ import * as QuickJSSandbox from "@smthrs/harness/QuickJSSandbox"
115
+ import { Layer } from "effect"
116
+ import { newVariant } from "quickjs-emscripten-core"
117
+
118
+ const layer = QuickJSSandbox.layerWithVariant.pipe(
119
+ Layer.provide(QuickJSSandbox.layerVariant(newVariant(wasmfile, { wasmModule })))
120
+ )
121
+ ```
122
+
123
+ The full workerd setup, including the `wrangler` configuration a worker needs,
124
+ is in [Run on Cloudflare workerd](https://harness.smithers.sh/guides/workerd/).
125
+
126
+ ## Documentation
127
+
128
+ The published site is https://harness.smithers.sh.
129
+
130
+ - [Quickstart](https://harness.smithers.sh/quickstart/): run two cells against
131
+ one realm and read the frames they produce.
132
+ - [Concepts](https://harness.smithers.sh/concepts/): the cell loop, the
133
+ persistent realm, and durable flow calls as the only I/O.
134
+ - [API reference](https://harness.smithers.sh/reference/api/): behavior and
135
+ signatures for every public export.
136
+ - [Module and export inventory](https://harness.smithers.sh/reference/): every
137
+ module and its exports, one table per module.
138
+ - [Troubleshooting](https://harness.smithers.sh/troubleshooting/): the failure
139
+ modes the package raises, and what to do about each.