@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
@@ -0,0 +1,90 @@
1
+ /**
2
+ * The completion with nothing behind it.
3
+ *
4
+ * A run finishes by claiming its work is done. Every other control in this
5
+ * package asks whether the *evidence* for that claim holds up. This one asks a
6
+ * question that comes before evidence: is there anything for the evidence to be
7
+ * about. A run that has not changed the workspace at any point in its life has
8
+ * produced nothing, and a sentence describing a change it did not make is not a
9
+ * result — it is a description of one.
10
+ *
11
+ * It is not hypothetical. On a graded benchmark one instance ran seven frames,
12
+ * issued eleven flow calls — three `read`, seven `grep`, one `bash` — made no
13
+ * editing call of any kind, and closed all seven frames on the identical
14
+ * workspace digest the run had opened on. It then completed with "Updated
15
+ * `AdminSite.catch_all_view()` to preserve query strings when `APPEND_SLASH`
16
+ * redirects add a trailing slash." The captured patch was zero bytes. The same
17
+ * instance had resolved in five frames one wave earlier.
18
+ *
19
+ * Every armed control let that through, and each for a reason that was correct
20
+ * about its own subject: the read-only cap is a stall detector and the run
21
+ * finished below it, the narrowing demand judges the shape of a check and there
22
+ * was no check to narrow, and the phantom-write veto vetoes a write that was
23
+ * declared and did not happen — this run declared none. The harness held the
24
+ * fact that decides it the whole time, in seven `mutation-observed` events on
25
+ * one digest, and never consulted it at the `complete` transition.
26
+ *
27
+ * The comparison is between two measurements the harness already took: the
28
+ * digest of the tree the run opened on, and the digest the completing frame
29
+ * closed on. Equal digests mean the tree the completion describes is the tree
30
+ * the run was handed. Nothing here reads the completion's text, and nothing
31
+ * here decides whether the run was right: "no change is needed" is a legitimate
32
+ * answer to a task, and the demand names it as one of the two ways out.
33
+ *
34
+ * @since 0.1.0
35
+ */
36
+ import * as DemandText from "./internal/demandText.js";
37
+ /**
38
+ * Whether a completing frame is finishing on the tree the run started with.
39
+ *
40
+ * Both conditions are read off measurements the controller already took, and
41
+ * both are required:
42
+ *
43
+ * 1. the run has an opening measurement that covered the whole tree, and the
44
+ * completing frame closed on one — an incomplete walk cannot say a tree held
45
+ * still, and an empty digest is recorded for exactly that case;
46
+ * 2. the two digests are equal.
47
+ *
48
+ * Digest equality, rather than a count of frames that reported a mutation, is
49
+ * what the demand's own sentence claims: that nothing in this workspace differs
50
+ * from the tree the run opened on. That is true of a run that never wrote and
51
+ * equally true of a run that wrote and undid it, and the sentence holds in both
52
+ * cases. A run whose tree moved and stayed moved is not this failure, whatever
53
+ * else may be wrong with it.
54
+ *
55
+ * @category conversions
56
+ * @since 0.1.0
57
+ */
58
+ export const find = (options) => options.opened === "" || options.digest === "" || options.opened !== options.digest ||
59
+ (options.elsewhere ?? 0) > 0
60
+ ? undefined
61
+ : { opened: options.opened, closed: options.digest };
62
+ /**
63
+ * States that the tree never moved, and names the two answers that end it.
64
+ *
65
+ * The two ways out are stated as equals because they are equals. A task whose
66
+ * right answer is "nothing needs changing" exists, and a run that reaches that
67
+ * conclusion honestly must be able to say so and finish; a demand that only
68
+ * accepted an edit would be pushing such a run into making one. What the demand
69
+ * refuses is the third thing, which is what the recorded run did: a sentence
70
+ * describing an edit, with no edit behind it.
71
+ *
72
+ * The second answer asks for its own working, and the wave that armed this is
73
+ * why. The run this module was built from was bounced off a fabricated
74
+ * completion and answered with "No change is needed", from a run that had made
75
+ * *one* call in its whole life. Nothing is gated on the answer — the harness
76
+ * cannot know whether the claim is true, and grading it would be the harness
77
+ * deciding the task — but the sentence no longer hands the exit over for free:
78
+ * a run that concluded the repository is already correct concluded it from
79
+ * something, and saying what that was costs a truthful run nothing and costs a
80
+ * run that checked nothing the whole answer.
81
+ *
82
+ * It also says plainly that nothing makes the change for the run, and that the
83
+ * next answer stands. Anything softer invites a re-submission of the same
84
+ * frame; anything harder would be the harness grading the run's conclusion.
85
+ *
86
+ * @category constructors
87
+ * @since 0.1.0
88
+ */
89
+ export const demand = (found) => DemandText.unmoved(found.opened, found.closed);
90
+ //# sourceMappingURL=UnmovedTree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnmovedTree.js","sourceRoot":"","sources":["../../src/UnmovedTree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,UAAU,MAAM,0BAA0B,CAAA;AAetD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,OAepB,EAAuB,EAAE,CACxB,OAAO,CAAC,MAAM,KAAK,EAAE,IAAI,OAAO,CAAC,MAAM,KAAK,EAAE,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM;IACjF,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC,GAAG,CAAC;IAC5B,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAA;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAc,EAAU,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA","sourcesContent":["/**\n * The completion with nothing behind it.\n *\n * A run finishes by claiming its work is done. Every other control in this\n * package asks whether the *evidence* for that claim holds up. This one asks a\n * question that comes before evidence: is there anything for the evidence to be\n * about. A run that has not changed the workspace at any point in its life has\n * produced nothing, and a sentence describing a change it did not make is not a\n * result — it is a description of one.\n *\n * It is not hypothetical. On a graded benchmark one instance ran seven frames,\n * issued eleven flow calls — three `read`, seven `grep`, one `bash` — made no\n * editing call of any kind, and closed all seven frames on the identical\n * workspace digest the run had opened on. It then completed with \"Updated\n * `AdminSite.catch_all_view()` to preserve query strings when `APPEND_SLASH`\n * redirects add a trailing slash.\" The captured patch was zero bytes. The same\n * instance had resolved in five frames one wave earlier.\n *\n * Every armed control let that through, and each for a reason that was correct\n * about its own subject: the read-only cap is a stall detector and the run\n * finished below it, the narrowing demand judges the shape of a check and there\n * was no check to narrow, and the phantom-write veto vetoes a write that was\n * declared and did not happen — this run declared none. The harness held the\n * fact that decides it the whole time, in seven `mutation-observed` events on\n * one digest, and never consulted it at the `complete` transition.\n *\n * The comparison is between two measurements the harness already took: the\n * digest of the tree the run opened on, and the digest the completing frame\n * closed on. Equal digests mean the tree the completion describes is the tree\n * the run was handed. Nothing here reads the completion's text, and nothing\n * here decides whether the run was right: \"no change is needed\" is a legitimate\n * answer to a task, and the demand names it as one of the two ways out.\n *\n * @since 0.1.0\n */\n\nimport * as DemandText from \"./internal/demandText.ts\"\n\n/**\n * A completion taken over the tree the run was handed.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface Unmoved {\n /** Content address of the workspace the run opened on. */\n readonly opened: string\n /** Content address of the workspace the completing frame closed on. */\n readonly closed: string\n}\n\n/**\n * Whether a completing frame is finishing on the tree the run started with.\n *\n * Both conditions are read off measurements the controller already took, and\n * both are required:\n *\n * 1. the run has an opening measurement that covered the whole tree, and the\n * completing frame closed on one — an incomplete walk cannot say a tree held\n * still, and an empty digest is recorded for exactly that case;\n * 2. the two digests are equal.\n *\n * Digest equality, rather than a count of frames that reported a mutation, is\n * what the demand's own sentence claims: that nothing in this workspace differs\n * from the tree the run opened on. That is true of a run that never wrote and\n * equally true of a run that wrote and undid it, and the sentence holds in both\n * cases. A run whose tree moved and stayed moved is not this failure, whatever\n * else may be wrong with it.\n *\n * @category conversions\n * @since 0.1.0\n */\nexport const find = (options: {\n /** The digest the run opened on; empty when the run never measured one. */\n readonly opened: string\n /** The digest the completing frame closed on; empty when unmeasured. */\n readonly digest: string\n /**\n * Writes this run recorded on trees the two digests do not cover.\n *\n * A `bash` call routed into a container measures that container's working\n * directory itself and reports a move under the reserved `mutated` key; the\n * host walk behind `opened` and `digest` never saw that tree. One such write\n * is the tree moving, and the two digests agreeing says nothing against it.\n * Absent or zero leaves the comparison exactly as it was.\n */\n readonly elsewhere?: number | undefined\n}): Unmoved | undefined =>\n options.opened === \"\" || options.digest === \"\" || options.opened !== options.digest ||\n (options.elsewhere ?? 0) > 0\n ? undefined\n : { opened: options.opened, closed: options.digest }\n\n/**\n * States that the tree never moved, and names the two answers that end it.\n *\n * The two ways out are stated as equals because they are equals. A task whose\n * right answer is \"nothing needs changing\" exists, and a run that reaches that\n * conclusion honestly must be able to say so and finish; a demand that only\n * accepted an edit would be pushing such a run into making one. What the demand\n * refuses is the third thing, which is what the recorded run did: a sentence\n * describing an edit, with no edit behind it.\n *\n * The second answer asks for its own working, and the wave that armed this is\n * why. The run this module was built from was bounced off a fabricated\n * completion and answered with \"No change is needed\", from a run that had made\n * *one* call in its whole life. Nothing is gated on the answer — the harness\n * cannot know whether the claim is true, and grading it would be the harness\n * deciding the task — but the sentence no longer hands the exit over for free:\n * a run that concluded the repository is already correct concluded it from\n * something, and saying what that was costs a truthful run nothing and costs a\n * run that checked nothing the whole answer.\n *\n * It also says plainly that nothing makes the change for the run, and that the\n * next answer stands. Anything softer invites a re-submission of the same\n * frame; anything harder would be the harness grading the run's conclusion.\n *\n * @category constructors\n * @since 0.1.0\n */\nexport const demand = (found: Unmoved): string => DemandText.unmoved(found.opened, found.closed)\n"]}
@@ -0,0 +1,196 @@
1
+ /**
2
+ * The failing check a completion stepped around.
3
+ *
4
+ * `NarrowedCheck` names a completion whose last check is a *narrower* version
5
+ * of one the run already ran, taken after the workspace moved. This module
6
+ * names the case one step further along: the run's reading of some subject
7
+ * reported a failure, over the very tree the run is now completing on, and the
8
+ * run neither re-ran it nor left it alone — it took a *different* reading of the
9
+ * same subject and completed on that one instead.
10
+ *
11
+ * It is not hypothetical. On a graded benchmark, one run edited a source file at
12
+ * frame 11, ran `pytest -rA testing/python/collect.py` at frame 12 — the whole
13
+ * file, unfiltered, over the tree it would go on to finish with — and was told
14
+ * "2 failed, 72 passed". At frame 13 it ran a command naming four cases out of
15
+ * that same file, was told "4 passed", and at frame 14 it completed. The broad
16
+ * result was never re-run, never retracted, and never mentioned. Its graded
17
+ * patch passed both target tests and 144 of 145 neighbours.
18
+ *
19
+ * ## Why a failing check alone is not the trigger
20
+ *
21
+ * "Some check failed and the run finished anyway" is not a defect, and reading
22
+ * it as one would be the harness deciding whose failures matter. The same wave
23
+ * contains the counter-example: an instance that **resolved** ran
24
+ * `pytest -rA astropy/io/fits/tests/test_header.py` after its edit, was told "2
25
+ * failed, 148 passed", and completed — correctly, because those two failures
26
+ * were nothing to do with its change. Nothing in the record distinguishes those
27
+ * two failure counts, and nothing may: counting failures means parsing a
28
+ * runner's output, which makes this a rule about pytest instead of a rule about
29
+ * evidence.
30
+ *
31
+ * What separates the two runs is what happened *after* the failing check. The
32
+ * resolved run walked away from that subject entirely: no later call it made
33
+ * names `astropy/io/fits/tests/test_header.py` at all. The unresolved run went
34
+ * back to exactly the subject that had failed, asked a smaller question about
35
+ * it, and reported the smaller answer. That is the shape this module names, and
36
+ * it is one the run's own record establishes: the run itself demonstrated the
37
+ * subject was still live by returning to it.
38
+ *
39
+ * So the demand is not "you have a failing test". It is: *the reading you
40
+ * replaced reported a failure, and you replaced it rather than answering it.*
41
+ * The run may answer either way — fix what the check reported, or complete again
42
+ * saying why those failures are expected. The loop asks once and accepts what
43
+ * comes back, because a harness that decided which failures counted would be
44
+ * grading the agent's work with its own.
45
+ *
46
+ * @since 0.1.0
47
+ */
48
+ import type { Schema } from "effect";
49
+ import type * as NarrowedCheck from "./NarrowedCheck.ts";
50
+ /**
51
+ * The reserved key a flow reports its subject's exit status under.
52
+ *
53
+ * The second of the two conventions the loop reads off an otherwise opaque call
54
+ * result, alongside `invalidProbe`. It is not a shared type — the controller
55
+ * must not depend on the tool library — so it is a documented wire key.
56
+ * `@smthrs/std` `Bash` and `ShellCommand` are the producing half and own what
57
+ * the number means; the controller only has to know that a result carrying a
58
+ * non-zero number under this key is a result whose subject reported failure.
59
+ *
60
+ * @category identifiers
61
+ * @since 0.1.0
62
+ */
63
+ export declare const exitStatusKey = "exitCode";
64
+ /**
65
+ * Whether a settled call's result reports a failing exit status.
66
+ *
67
+ * A result that declares no exit status is not a failure and not a success: it
68
+ * is a call whose flow does not report one, and reading its absence either way
69
+ * would be an assumption. `false` is the answer that costs a demand rather than
70
+ * inventing one.
71
+ *
72
+ * @category predicates
73
+ * @since 0.1.0
74
+ */
75
+ export declare const failed: (value: Schema.Json) => boolean;
76
+ /**
77
+ * The exit status a settled call's result reports about its subject, or
78
+ * nothing where it reports none.
79
+ *
80
+ * The one reader of {@link exitStatusKey}, so the two predicates below and
81
+ * every caller that wants the number itself agree by construction rather than
82
+ * by three copies of the same shape test.
83
+ *
84
+ * @category getters
85
+ * @since 1.0.0-rc.0
86
+ */
87
+ export declare const exitStatus: (value: Schema.Json) => number | undefined;
88
+ /**
89
+ * Whether a settled call's result reports a passing exit status.
90
+ *
91
+ * The mirror of {@link failed}, and not its negation. A result that declares no
92
+ * exit status is neither: `false` from both predicates is a call whose flow
93
+ * does not report one, which is what a read and a search are. `Sufficiency`
94
+ * builds a completion signal out of this answer, so silence has to read as
95
+ * silence — a file read that "did not fail" is not a check that passed.
96
+ *
97
+ * @category predicates
98
+ * @since 0.1.0
99
+ */
100
+ export declare const passed: (value: Schema.Json) => boolean;
101
+ /**
102
+ * A failing check, paired with the reading the run took in its place.
103
+ *
104
+ * @category models
105
+ * @since 0.1.0
106
+ */
107
+ export interface Displaced {
108
+ /** The check that reported a failure and was never re-run. */
109
+ readonly failed: NarrowedCheck.Check;
110
+ /** A later check over the same tree that revisits its subject. */
111
+ readonly instead: NarrowedCheck.Check;
112
+ }
113
+ /**
114
+ * Whether a later check asks about the same subject as an earlier one.
115
+ *
116
+ * The relation is: same flow, a different call, and every *target* the earlier
117
+ * check named is named again. Targets — the terms carrying a separator, as
118
+ * `NarrowedCheck` `targeting` reads them — are the paths, files, modules and
119
+ * node ids a call is about; everything else is a condition on them. So "same
120
+ * subject" means the later call went back to all of the places the earlier one
121
+ * looked, whether it asked a narrower question there, a broader one, or looked
122
+ * somewhere else as well.
123
+ *
124
+ * It is deliberately weaker than `NarrowedCheck` `narrows`, which additionally
125
+ * requires every *condition* to be carried and forbids adding a target. That
126
+ * relation misses a compound command — a `git diff` of two source files joined
127
+ * onto a test run — because the diff's own paths read as added targets. This one
128
+ * does not, because the question it answers is not "is this the same question
129
+ * again" but "did you come back to this".
130
+ *
131
+ * An earlier check that names no target at all is never revisited. Such a call
132
+ * has no subject to return to, and treating it as revisited by any later call of
133
+ * the same flow would make the relation vacuous.
134
+ *
135
+ * @category predicates
136
+ * @since 0.1.0
137
+ */
138
+ export declare const revisits: (later: NarrowedCheck.Check, earlier: NarrowedCheck.Check) => boolean;
139
+ /**
140
+ * Finds the failing check a completion replaced rather than answered.
141
+ *
142
+ * Every condition is read off something the harness already records:
143
+ *
144
+ * 1. the frame closed on a complete measurement, so a digest means something;
145
+ * 2. some check in the ledger reported a failing exit status;
146
+ * 3. that check was recorded over the tree this frame is completing on, so its
147
+ * result is a statement about the tree the completion stands on;
148
+ * 4. it was recorded by a frame that changed nothing, so the digest stamped on
149
+ * it is the tree it actually ran over rather than a conservative guess;
150
+ * 5. some *later* check {@link revisits} it.
151
+ *
152
+ * Condition 4 is the one that cannot be dropped. A frame's calls are not ordered
153
+ * against its edits in anything the harness records, so a check taken in a frame
154
+ * that also edited is stamped with that frame's closing digest — which reads a
155
+ * check taken *before* the edit as though it ran after. `NarrowedCheck` accepts
156
+ * that in the direction that suppresses demands; here the same stamp would
157
+ * attribute a pre-edit failure to a tree the check never ran over, and invent
158
+ * one. The same wave carries an instance where it would have: a reproduction run
159
+ * in the same frame as the edit that fixed it, still reporting the bug.
160
+ *
161
+ * The ledger holds one entry per call signature, carrying that call's most
162
+ * recent run, so "never re-ran it" needs no separate test: a check re-run and
163
+ * passed is no longer failing, and a check re-run and failed again is still
164
+ * unanswered. Ledger order is recency of last run, which is what makes
165
+ * condition 5 a statement about time.
166
+ *
167
+ * The most recent such failing check wins, because it is the reading the
168
+ * completion is standing closest to.
169
+ *
170
+ * @category conversions
171
+ * @since 0.1.0
172
+ */
173
+ export declare const find: (options: {
174
+ /** Every check this run has run, oldest first, this frame's included. */
175
+ readonly ledger: ReadonlyArray<NarrowedCheck.Check>;
176
+ /** The workspace digest the completing frame closed on; empty when unmeasured. */
177
+ readonly digest: string;
178
+ }) => Displaced | undefined;
179
+ /**
180
+ * States which reading failed, which one replaced it, and what ends it.
181
+ *
182
+ * The text quotes both calls as the run wrote them and asserts only what the
183
+ * record says: the first reported a failing exit status over this exact tree,
184
+ * the second asked about the same subject, and the first was never run again.
185
+ * It does not say the failures are the run's fault, because it does not know —
186
+ * a pre-existing failure is a real answer and the demand names it as one of the
187
+ * two ways out.
188
+ *
189
+ * It also says plainly that nothing re-runs anything for the run, and that the
190
+ * next answer stands.
191
+ *
192
+ * @category constructors
193
+ * @since 0.1.0
194
+ */
195
+ export declare const demand: (found: Displaced) => string;
196
+ //# sourceMappingURL=UnresolvedFailure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnresolvedFailure.d.ts","sourceRoot":"","sources":["../../src/UnresolvedFailure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,KAAK,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAGxD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,aAAa,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,CAAC,IAAI,KAAG,OAG3C,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,CAAC,IAAI,KAAG,MAAM,GAAG,SAIxD,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,CAAC,IAAI,KAAG,OAAkC,CAAA;AAE9E;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAA;IACpC,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,KAAK,CAAA;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,QAAQ,GACnB,OAAO,aAAa,CAAC,KAAK,EAC1B,SAAS,aAAa,CAAC,KAAK,KAC3B,OAWF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,IAAI,GAAI,SAAS;IAC5B,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IACnD,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB,KAAG,SAAS,GAAG,SAYf,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,GAAI,OAAO,SAAS,KAAG,MACyC,CAAA"}
@@ -0,0 +1,218 @@
1
+ /**
2
+ * The failing check a completion stepped around.
3
+ *
4
+ * `NarrowedCheck` names a completion whose last check is a *narrower* version
5
+ * of one the run already ran, taken after the workspace moved. This module
6
+ * names the case one step further along: the run's reading of some subject
7
+ * reported a failure, over the very tree the run is now completing on, and the
8
+ * run neither re-ran it nor left it alone — it took a *different* reading of the
9
+ * same subject and completed on that one instead.
10
+ *
11
+ * It is not hypothetical. On a graded benchmark, one run edited a source file at
12
+ * frame 11, ran `pytest -rA testing/python/collect.py` at frame 12 — the whole
13
+ * file, unfiltered, over the tree it would go on to finish with — and was told
14
+ * "2 failed, 72 passed". At frame 13 it ran a command naming four cases out of
15
+ * that same file, was told "4 passed", and at frame 14 it completed. The broad
16
+ * result was never re-run, never retracted, and never mentioned. Its graded
17
+ * patch passed both target tests and 144 of 145 neighbours.
18
+ *
19
+ * ## Why a failing check alone is not the trigger
20
+ *
21
+ * "Some check failed and the run finished anyway" is not a defect, and reading
22
+ * it as one would be the harness deciding whose failures matter. The same wave
23
+ * contains the counter-example: an instance that **resolved** ran
24
+ * `pytest -rA astropy/io/fits/tests/test_header.py` after its edit, was told "2
25
+ * failed, 148 passed", and completed — correctly, because those two failures
26
+ * were nothing to do with its change. Nothing in the record distinguishes those
27
+ * two failure counts, and nothing may: counting failures means parsing a
28
+ * runner's output, which makes this a rule about pytest instead of a rule about
29
+ * evidence.
30
+ *
31
+ * What separates the two runs is what happened *after* the failing check. The
32
+ * resolved run walked away from that subject entirely: no later call it made
33
+ * names `astropy/io/fits/tests/test_header.py` at all. The unresolved run went
34
+ * back to exactly the subject that had failed, asked a smaller question about
35
+ * it, and reported the smaller answer. That is the shape this module names, and
36
+ * it is one the run's own record establishes: the run itself demonstrated the
37
+ * subject was still live by returning to it.
38
+ *
39
+ * So the demand is not "you have a failing test". It is: *the reading you
40
+ * replaced reported a failure, and you replaced it rather than answering it.*
41
+ * The run may answer either way — fix what the check reported, or complete again
42
+ * saying why those failures are expected. The loop asks once and accepts what
43
+ * comes back, because a harness that decided which failures counted would be
44
+ * grading the agent's work with its own.
45
+ *
46
+ * @since 0.1.0
47
+ */
48
+ import * as DemandText from "./internal/demandText.js";
49
+ import { targeting } from "./NarrowedCheck.js";
50
+ /**
51
+ * The reserved key a flow reports its subject's exit status under.
52
+ *
53
+ * The second of the two conventions the loop reads off an otherwise opaque call
54
+ * result, alongside `invalidProbe`. It is not a shared type — the controller
55
+ * must not depend on the tool library — so it is a documented wire key.
56
+ * `@smthrs/std` `Bash` and `ShellCommand` are the producing half and own what
57
+ * the number means; the controller only has to know that a result carrying a
58
+ * non-zero number under this key is a result whose subject reported failure.
59
+ *
60
+ * @category identifiers
61
+ * @since 0.1.0
62
+ */
63
+ export const exitStatusKey = "exitCode";
64
+ /**
65
+ * Whether a settled call's result reports a failing exit status.
66
+ *
67
+ * A result that declares no exit status is not a failure and not a success: it
68
+ * is a call whose flow does not report one, and reading its absence either way
69
+ * would be an assumption. `false` is the answer that costs a demand rather than
70
+ * inventing one.
71
+ *
72
+ * @category predicates
73
+ * @since 0.1.0
74
+ */
75
+ export const failed = (value) => {
76
+ const status = exitStatus(value);
77
+ return status !== undefined && status !== 0;
78
+ };
79
+ /**
80
+ * The exit status a settled call's result reports about its subject, or
81
+ * nothing where it reports none.
82
+ *
83
+ * The one reader of {@link exitStatusKey}, so the two predicates below and
84
+ * every caller that wants the number itself agree by construction rather than
85
+ * by three copies of the same shape test.
86
+ *
87
+ * @category getters
88
+ * @since 1.0.0-rc.0
89
+ */
90
+ export const exitStatus = (value) => {
91
+ if (value === null || typeof value !== "object" || Array.isArray(value))
92
+ return undefined;
93
+ const status = value[exitStatusKey];
94
+ return typeof status === "number" ? status : undefined;
95
+ };
96
+ /**
97
+ * Whether a settled call's result reports a passing exit status.
98
+ *
99
+ * The mirror of {@link failed}, and not its negation. A result that declares no
100
+ * exit status is neither: `false` from both predicates is a call whose flow
101
+ * does not report one, which is what a read and a search are. `Sufficiency`
102
+ * builds a completion signal out of this answer, so silence has to read as
103
+ * silence — a file read that "did not fail" is not a check that passed.
104
+ *
105
+ * @category predicates
106
+ * @since 0.1.0
107
+ */
108
+ export const passed = (value) => exitStatus(value) === 0;
109
+ /**
110
+ * Whether a later check asks about the same subject as an earlier one.
111
+ *
112
+ * The relation is: same flow, a different call, and every *target* the earlier
113
+ * check named is named again. Targets — the terms carrying a separator, as
114
+ * `NarrowedCheck` `targeting` reads them — are the paths, files, modules and
115
+ * node ids a call is about; everything else is a condition on them. So "same
116
+ * subject" means the later call went back to all of the places the earlier one
117
+ * looked, whether it asked a narrower question there, a broader one, or looked
118
+ * somewhere else as well.
119
+ *
120
+ * It is deliberately weaker than `NarrowedCheck` `narrows`, which additionally
121
+ * requires every *condition* to be carried and forbids adding a target. That
122
+ * relation misses a compound command — a `git diff` of two source files joined
123
+ * onto a test run — because the diff's own paths read as added targets. This one
124
+ * does not, because the question it answers is not "is this the same question
125
+ * again" but "did you come back to this".
126
+ *
127
+ * An earlier check that names no target at all is never revisited. Such a call
128
+ * has no subject to return to, and treating it as revisited by any later call of
129
+ * the same flow would make the relation vacuous.
130
+ *
131
+ * @category predicates
132
+ * @since 0.1.0
133
+ */
134
+ export const revisits = (later, earlier) => {
135
+ if (later.flow !== earlier.flow)
136
+ return false;
137
+ if (later.signature === earlier.signature)
138
+ return false;
139
+ const carried = new Set(later.terms);
140
+ let named = false;
141
+ for (const term of earlier.terms) {
142
+ if (!targeting(term))
143
+ continue;
144
+ named = true;
145
+ if (!carried.has(term))
146
+ return false;
147
+ }
148
+ return named;
149
+ };
150
+ /**
151
+ * Finds the failing check a completion replaced rather than answered.
152
+ *
153
+ * Every condition is read off something the harness already records:
154
+ *
155
+ * 1. the frame closed on a complete measurement, so a digest means something;
156
+ * 2. some check in the ledger reported a failing exit status;
157
+ * 3. that check was recorded over the tree this frame is completing on, so its
158
+ * result is a statement about the tree the completion stands on;
159
+ * 4. it was recorded by a frame that changed nothing, so the digest stamped on
160
+ * it is the tree it actually ran over rather than a conservative guess;
161
+ * 5. some *later* check {@link revisits} it.
162
+ *
163
+ * Condition 4 is the one that cannot be dropped. A frame's calls are not ordered
164
+ * against its edits in anything the harness records, so a check taken in a frame
165
+ * that also edited is stamped with that frame's closing digest — which reads a
166
+ * check taken *before* the edit as though it ran after. `NarrowedCheck` accepts
167
+ * that in the direction that suppresses demands; here the same stamp would
168
+ * attribute a pre-edit failure to a tree the check never ran over, and invent
169
+ * one. The same wave carries an instance where it would have: a reproduction run
170
+ * in the same frame as the edit that fixed it, still reporting the bug.
171
+ *
172
+ * The ledger holds one entry per call signature, carrying that call's most
173
+ * recent run, so "never re-ran it" needs no separate test: a check re-run and
174
+ * passed is no longer failing, and a check re-run and failed again is still
175
+ * unanswered. Ledger order is recency of last run, which is what makes
176
+ * condition 5 a statement about time.
177
+ *
178
+ * The most recent such failing check wins, because it is the reading the
179
+ * completion is standing closest to.
180
+ *
181
+ * @category conversions
182
+ * @since 0.1.0
183
+ */
184
+ export const find = (options) => {
185
+ if (options.digest === "")
186
+ return undefined;
187
+ let found = undefined;
188
+ for (const [index, earlier] of options.ledger.entries()) {
189
+ if (!earlier.failing || !earlier.stable)
190
+ continue;
191
+ if (earlier.digest !== options.digest)
192
+ continue;
193
+ const instead = options.ledger.slice(index + 1).find((candidate) => revisits(candidate, earlier));
194
+ // Oldest first, keeping the last match: the ledger is ordered by when each
195
+ // check last ran, so the surviving pair names the most recent failure.
196
+ if (instead !== undefined)
197
+ found = { failed: earlier, instead };
198
+ }
199
+ return found;
200
+ };
201
+ /**
202
+ * States which reading failed, which one replaced it, and what ends it.
203
+ *
204
+ * The text quotes both calls as the run wrote them and asserts only what the
205
+ * record says: the first reported a failing exit status over this exact tree,
206
+ * the second asked about the same subject, and the first was never run again.
207
+ * It does not say the failures are the run's fault, because it does not know —
208
+ * a pre-existing failure is a real answer and the demand names it as one of the
209
+ * two ways out.
210
+ *
211
+ * It also says plainly that nothing re-runs anything for the run, and that the
212
+ * next answer stands.
213
+ *
214
+ * @category constructors
215
+ * @since 0.1.0
216
+ */
217
+ export const demand = (found) => DemandText.unresolved(found.failed.flow, found.failed.label, found.instead.label);
218
+ //# sourceMappingURL=UnresolvedFailure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnresolvedFailure.js","sourceRoot":"","sources":["../../src/UnresolvedFailure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAGH,OAAO,KAAK,UAAU,MAAM,0BAA0B,CAAA;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAkB,EAAW,EAAE;IACpD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IAChC,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,CAAC,CAAA;AAC7C,CAAC,CAAA;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAkB,EAAsB,EAAE;IACnE,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IACzF,MAAM,MAAM,GAAI,KAAiC,CAAC,aAAa,CAAC,CAAA;IAChE,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;AACxD,CAAC,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAkB,EAAW,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AAe9E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,KAA0B,EAC1B,OAA4B,EACnB,EAAE;IACX,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI;QAAE,OAAO,KAAK,CAAA;IAC7C,IAAI,KAAK,CAAC,SAAS,KAAK,OAAO,CAAC,SAAS;QAAE,OAAO,KAAK,CAAA;IACvD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACpC,IAAI,KAAK,GAAG,KAAK,CAAA;IACjB,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QACjC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAAE,SAAQ;QAC9B,KAAK,GAAG,IAAI,CAAA;QACZ,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAA;IACtC,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,OAKpB,EAAyB,EAAE;IAC1B,IAAI,OAAO,CAAC,MAAM,KAAK,EAAE;QAAE,OAAO,SAAS,CAAA;IAC3C,IAAI,KAAK,GAA0B,SAAS,CAAA;IAC5C,KAAK,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;QACxD,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM;YAAE,SAAQ;QACjD,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM;YAAE,SAAQ;QAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAA;QACjG,2EAA2E;QAC3E,uEAAuE;QACvE,IAAI,OAAO,KAAK,SAAS;YAAE,KAAK,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;IACjE,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAgB,EAAU,EAAE,CACjD,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA","sourcesContent":["/**\n * The failing check a completion stepped around.\n *\n * `NarrowedCheck` names a completion whose last check is a *narrower* version\n * of one the run already ran, taken after the workspace moved. This module\n * names the case one step further along: the run's reading of some subject\n * reported a failure, over the very tree the run is now completing on, and the\n * run neither re-ran it nor left it alone — it took a *different* reading of the\n * same subject and completed on that one instead.\n *\n * It is not hypothetical. On a graded benchmark, one run edited a source file at\n * frame 11, ran `pytest -rA testing/python/collect.py` at frame 12 — the whole\n * file, unfiltered, over the tree it would go on to finish with — and was told\n * \"2 failed, 72 passed\". At frame 13 it ran a command naming four cases out of\n * that same file, was told \"4 passed\", and at frame 14 it completed. The broad\n * result was never re-run, never retracted, and never mentioned. Its graded\n * patch passed both target tests and 144 of 145 neighbours.\n *\n * ## Why a failing check alone is not the trigger\n *\n * \"Some check failed and the run finished anyway\" is not a defect, and reading\n * it as one would be the harness deciding whose failures matter. The same wave\n * contains the counter-example: an instance that **resolved** ran\n * `pytest -rA astropy/io/fits/tests/test_header.py` after its edit, was told \"2\n * failed, 148 passed\", and completed — correctly, because those two failures\n * were nothing to do with its change. Nothing in the record distinguishes those\n * two failure counts, and nothing may: counting failures means parsing a\n * runner's output, which makes this a rule about pytest instead of a rule about\n * evidence.\n *\n * What separates the two runs is what happened *after* the failing check. The\n * resolved run walked away from that subject entirely: no later call it made\n * names `astropy/io/fits/tests/test_header.py` at all. The unresolved run went\n * back to exactly the subject that had failed, asked a smaller question about\n * it, and reported the smaller answer. That is the shape this module names, and\n * it is one the run's own record establishes: the run itself demonstrated the\n * subject was still live by returning to it.\n *\n * So the demand is not \"you have a failing test\". It is: *the reading you\n * replaced reported a failure, and you replaced it rather than answering it.*\n * The run may answer either way — fix what the check reported, or complete again\n * saying why those failures are expected. The loop asks once and accepts what\n * comes back, because a harness that decided which failures counted would be\n * grading the agent's work with its own.\n *\n * @since 0.1.0\n */\n\nimport type { Schema } from \"effect\"\nimport * as DemandText from \"./internal/demandText.ts\"\nimport type * as NarrowedCheck from \"./NarrowedCheck.ts\"\nimport { targeting } from \"./NarrowedCheck.ts\"\n\n/**\n * The reserved key a flow reports its subject's exit status under.\n *\n * The second of the two conventions the loop reads off an otherwise opaque call\n * result, alongside `invalidProbe`. It is not a shared type — the controller\n * must not depend on the tool library — so it is a documented wire key.\n * `@smthrs/std` `Bash` and `ShellCommand` are the producing half and own what\n * the number means; the controller only has to know that a result carrying a\n * non-zero number under this key is a result whose subject reported failure.\n *\n * @category identifiers\n * @since 0.1.0\n */\nexport const exitStatusKey = \"exitCode\"\n\n/**\n * Whether a settled call's result reports a failing exit status.\n *\n * A result that declares no exit status is not a failure and not a success: it\n * is a call whose flow does not report one, and reading its absence either way\n * would be an assumption. `false` is the answer that costs a demand rather than\n * inventing one.\n *\n * @category predicates\n * @since 0.1.0\n */\nexport const failed = (value: Schema.Json): boolean => {\n const status = exitStatus(value)\n return status !== undefined && status !== 0\n}\n\n/**\n * The exit status a settled call's result reports about its subject, or\n * nothing where it reports none.\n *\n * The one reader of {@link exitStatusKey}, so the two predicates below and\n * every caller that wants the number itself agree by construction rather than\n * by three copies of the same shape test.\n *\n * @category getters\n * @since 1.0.0-rc.0\n */\nexport const exitStatus = (value: Schema.Json): number | undefined => {\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) return undefined\n const status = (value as Record<string, unknown>)[exitStatusKey]\n return typeof status === \"number\" ? status : undefined\n}\n\n/**\n * Whether a settled call's result reports a passing exit status.\n *\n * The mirror of {@link failed}, and not its negation. A result that declares no\n * exit status is neither: `false` from both predicates is a call whose flow\n * does not report one, which is what a read and a search are. `Sufficiency`\n * builds a completion signal out of this answer, so silence has to read as\n * silence — a file read that \"did not fail\" is not a check that passed.\n *\n * @category predicates\n * @since 0.1.0\n */\nexport const passed = (value: Schema.Json): boolean => exitStatus(value) === 0\n\n/**\n * A failing check, paired with the reading the run took in its place.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface Displaced {\n /** The check that reported a failure and was never re-run. */\n readonly failed: NarrowedCheck.Check\n /** A later check over the same tree that revisits its subject. */\n readonly instead: NarrowedCheck.Check\n}\n\n/**\n * Whether a later check asks about the same subject as an earlier one.\n *\n * The relation is: same flow, a different call, and every *target* the earlier\n * check named is named again. Targets — the terms carrying a separator, as\n * `NarrowedCheck` `targeting` reads them — are the paths, files, modules and\n * node ids a call is about; everything else is a condition on them. So \"same\n * subject\" means the later call went back to all of the places the earlier one\n * looked, whether it asked a narrower question there, a broader one, or looked\n * somewhere else as well.\n *\n * It is deliberately weaker than `NarrowedCheck` `narrows`, which additionally\n * requires every *condition* to be carried and forbids adding a target. That\n * relation misses a compound command — a `git diff` of two source files joined\n * onto a test run — because the diff's own paths read as added targets. This one\n * does not, because the question it answers is not \"is this the same question\n * again\" but \"did you come back to this\".\n *\n * An earlier check that names no target at all is never revisited. Such a call\n * has no subject to return to, and treating it as revisited by any later call of\n * the same flow would make the relation vacuous.\n *\n * @category predicates\n * @since 0.1.0\n */\nexport const revisits = (\n later: NarrowedCheck.Check,\n earlier: NarrowedCheck.Check\n): boolean => {\n if (later.flow !== earlier.flow) return false\n if (later.signature === earlier.signature) return false\n const carried = new Set(later.terms)\n let named = false\n for (const term of earlier.terms) {\n if (!targeting(term)) continue\n named = true\n if (!carried.has(term)) return false\n }\n return named\n}\n\n/**\n * Finds the failing check a completion replaced rather than answered.\n *\n * Every condition is read off something the harness already records:\n *\n * 1. the frame closed on a complete measurement, so a digest means something;\n * 2. some check in the ledger reported a failing exit status;\n * 3. that check was recorded over the tree this frame is completing on, so its\n * result is a statement about the tree the completion stands on;\n * 4. it was recorded by a frame that changed nothing, so the digest stamped on\n * it is the tree it actually ran over rather than a conservative guess;\n * 5. some *later* check {@link revisits} it.\n *\n * Condition 4 is the one that cannot be dropped. A frame's calls are not ordered\n * against its edits in anything the harness records, so a check taken in a frame\n * that also edited is stamped with that frame's closing digest — which reads a\n * check taken *before* the edit as though it ran after. `NarrowedCheck` accepts\n * that in the direction that suppresses demands; here the same stamp would\n * attribute a pre-edit failure to a tree the check never ran over, and invent\n * one. The same wave carries an instance where it would have: a reproduction run\n * in the same frame as the edit that fixed it, still reporting the bug.\n *\n * The ledger holds one entry per call signature, carrying that call's most\n * recent run, so \"never re-ran it\" needs no separate test: a check re-run and\n * passed is no longer failing, and a check re-run and failed again is still\n * unanswered. Ledger order is recency of last run, which is what makes\n * condition 5 a statement about time.\n *\n * The most recent such failing check wins, because it is the reading the\n * completion is standing closest to.\n *\n * @category conversions\n * @since 0.1.0\n */\nexport const find = (options: {\n /** Every check this run has run, oldest first, this frame's included. */\n readonly ledger: ReadonlyArray<NarrowedCheck.Check>\n /** The workspace digest the completing frame closed on; empty when unmeasured. */\n readonly digest: string\n}): Displaced | undefined => {\n if (options.digest === \"\") return undefined\n let found: Displaced | undefined = undefined\n for (const [index, earlier] of options.ledger.entries()) {\n if (!earlier.failing || !earlier.stable) continue\n if (earlier.digest !== options.digest) continue\n const instead = options.ledger.slice(index + 1).find((candidate) => revisits(candidate, earlier))\n // Oldest first, keeping the last match: the ledger is ordered by when each\n // check last ran, so the surviving pair names the most recent failure.\n if (instead !== undefined) found = { failed: earlier, instead }\n }\n return found\n}\n\n/**\n * States which reading failed, which one replaced it, and what ends it.\n *\n * The text quotes both calls as the run wrote them and asserts only what the\n * record says: the first reported a failing exit status over this exact tree,\n * the second asked about the same subject, and the first was never run again.\n * It does not say the failures are the run's fault, because it does not know —\n * a pre-existing failure is a real answer and the demand names it as one of the\n * two ways out.\n *\n * It also says plainly that nothing re-runs anything for the run, and that the\n * next answer stands.\n *\n * @category constructors\n * @since 0.1.0\n */\nexport const demand = (found: Displaced): string =>\n DemandText.unresolved(found.failed.flow, found.failed.label, found.instead.label)\n"]}