@smthrs/engine-store 0.0.0-stage → 1.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (787) hide show
  1. package/CHANGELOG.md +247 -0
  2. package/LICENSE +21 -0
  3. package/README.md +146 -2
  4. package/dist/cjs/ArtifactGc.d.ts +235 -0
  5. package/dist/cjs/ArtifactGc.d.ts.map +1 -0
  6. package/dist/cjs/ArtifactGc.js +183 -0
  7. package/dist/cjs/ArtifactGc.js.map +7 -0
  8. package/dist/cjs/ArtifactSync.d.ts +164 -0
  9. package/dist/cjs/ArtifactSync.d.ts.map +1 -0
  10. package/dist/cjs/ArtifactSync.js +144 -0
  11. package/dist/cjs/ArtifactSync.js.map +7 -0
  12. package/dist/cjs/CacheSync.d.ts +112 -0
  13. package/dist/cjs/CacheSync.d.ts.map +1 -0
  14. package/dist/cjs/CacheSync.js +64 -0
  15. package/dist/cjs/CacheSync.js.map +7 -0
  16. package/dist/cjs/DeferredClockFold.d.ts +354 -0
  17. package/dist/cjs/DeferredClockFold.d.ts.map +1 -0
  18. package/dist/cjs/DeferredClockFold.js +335 -0
  19. package/dist/cjs/DeferredClockFold.js.map +7 -0
  20. package/dist/cjs/DisasterRecovery.d.ts +431 -0
  21. package/dist/cjs/DisasterRecovery.d.ts.map +1 -0
  22. package/dist/cjs/DisasterRecovery.js +453 -0
  23. package/dist/cjs/DisasterRecovery.js.map +7 -0
  24. package/dist/cjs/DurableEngineState.d.ts +776 -0
  25. package/dist/cjs/DurableEngineState.d.ts.map +1 -0
  26. package/dist/cjs/DurableEngineState.js +1536 -0
  27. package/dist/cjs/DurableEngineState.js.map +7 -0
  28. package/dist/cjs/EngineStore.d.ts +158 -0
  29. package/dist/cjs/EngineStore.d.ts.map +1 -0
  30. package/dist/cjs/EngineStore.js +398 -0
  31. package/dist/cjs/EngineStore.js.map +7 -0
  32. package/dist/cjs/EngineStoreMetrics.d.ts +276 -0
  33. package/dist/cjs/EngineStoreMetrics.d.ts.map +1 -0
  34. package/dist/cjs/EngineStoreMetrics.js +135 -0
  35. package/dist/cjs/EngineStoreMetrics.js.map +7 -0
  36. package/dist/cjs/Errors.d.ts +22 -0
  37. package/dist/cjs/Errors.d.ts.map +1 -0
  38. package/dist/cjs/Errors.js +39 -0
  39. package/dist/cjs/Errors.js.map +7 -0
  40. package/dist/cjs/EventTypes.d.ts +27 -0
  41. package/dist/cjs/EventTypes.d.ts.map +1 -0
  42. package/dist/cjs/EventTypes.js +37 -0
  43. package/dist/cjs/EventTypes.js.map +7 -0
  44. package/dist/cjs/ExecutionFacts.d.ts +59 -0
  45. package/dist/cjs/ExecutionFacts.d.ts.map +1 -0
  46. package/dist/cjs/ExecutionFacts.js +123 -0
  47. package/dist/cjs/ExecutionFacts.js.map +7 -0
  48. package/dist/cjs/ExecutionSnapshot.d.ts +117 -0
  49. package/dist/cjs/ExecutionSnapshot.d.ts.map +1 -0
  50. package/dist/cjs/ExecutionSnapshot.js +111 -0
  51. package/dist/cjs/ExecutionSnapshot.js.map +7 -0
  52. package/dist/cjs/Inconsistency.d.ts +154 -0
  53. package/dist/cjs/Inconsistency.d.ts.map +1 -0
  54. package/dist/cjs/Inconsistency.js +135 -0
  55. package/dist/cjs/Inconsistency.js.map +7 -0
  56. package/dist/cjs/Migrations.d.ts +56 -0
  57. package/dist/cjs/Migrations.d.ts.map +1 -0
  58. package/dist/cjs/Migrations.js +78 -0
  59. package/dist/cjs/Migrations.js.map +7 -0
  60. package/dist/cjs/OwnerIdentity.d.ts +91 -0
  61. package/dist/cjs/OwnerIdentity.d.ts.map +1 -0
  62. package/dist/cjs/OwnerIdentity.js +65 -0
  63. package/dist/cjs/OwnerIdentity.js.map +7 -0
  64. package/dist/cjs/PlanInputStore.d.ts +110 -0
  65. package/dist/cjs/PlanInputStore.d.ts.map +1 -0
  66. package/dist/cjs/PlanInputStore.js +224 -0
  67. package/dist/cjs/PlanInputStore.js.map +7 -0
  68. package/dist/cjs/PlanMergeStore.d.ts +113 -0
  69. package/dist/cjs/PlanMergeStore.d.ts.map +1 -0
  70. package/dist/cjs/PlanMergeStore.js +255 -0
  71. package/dist/cjs/PlanMergeStore.js.map +7 -0
  72. package/dist/cjs/PlanScheduler.d.ts +363 -0
  73. package/dist/cjs/PlanScheduler.d.ts.map +1 -0
  74. package/dist/cjs/PlanScheduler.js +1090 -0
  75. package/dist/cjs/PlanScheduler.js.map +7 -0
  76. package/dist/cjs/Reconciliation.d.ts +175 -0
  77. package/dist/cjs/Reconciliation.d.ts.map +1 -0
  78. package/dist/cjs/Reconciliation.js +119 -0
  79. package/dist/cjs/Reconciliation.js.map +7 -0
  80. package/dist/cjs/ReplayOnly.d.ts +91 -0
  81. package/dist/cjs/ReplayOnly.d.ts.map +1 -0
  82. package/dist/cjs/ReplayOnly.js +52 -0
  83. package/dist/cjs/ReplayOnly.js.map +7 -0
  84. package/dist/cjs/Retention.d.ts +113 -0
  85. package/dist/cjs/Retention.d.ts.map +1 -0
  86. package/dist/cjs/Retention.js +99 -0
  87. package/dist/cjs/Retention.js.map +7 -0
  88. package/dist/cjs/RunCatalogRead.d.ts +17 -0
  89. package/dist/cjs/RunCatalogRead.d.ts.map +1 -0
  90. package/dist/cjs/RunCatalogRead.js +33 -0
  91. package/dist/cjs/RunCatalogRead.js.map +7 -0
  92. package/dist/cjs/RunChangeFeed.d.ts +75 -0
  93. package/dist/cjs/RunChangeFeed.d.ts.map +1 -0
  94. package/dist/cjs/RunChangeFeed.js +96 -0
  95. package/dist/cjs/RunChangeFeed.js.map +7 -0
  96. package/dist/cjs/RunState.d.ts +116 -0
  97. package/dist/cjs/RunState.d.ts.map +1 -0
  98. package/dist/cjs/RunState.js +76 -0
  99. package/dist/cjs/RunState.js.map +7 -0
  100. package/dist/cjs/Selection.d.ts +495 -0
  101. package/dist/cjs/Selection.d.ts.map +1 -0
  102. package/dist/cjs/Selection.js +288 -0
  103. package/dist/cjs/Selection.js.map +7 -0
  104. package/dist/cjs/SelectionStore.d.ts +141 -0
  105. package/dist/cjs/SelectionStore.d.ts.map +1 -0
  106. package/dist/cjs/SelectionStore.js +229 -0
  107. package/dist/cjs/SelectionStore.js.map +7 -0
  108. package/dist/cjs/StepBoundary.d.ts +501 -0
  109. package/dist/cjs/StepBoundary.d.ts.map +1 -0
  110. package/dist/cjs/StepBoundary.js +619 -0
  111. package/dist/cjs/StepBoundary.js.map +7 -0
  112. package/dist/cjs/StepCacheFold.d.ts +148 -0
  113. package/dist/cjs/StepCacheFold.d.ts.map +1 -0
  114. package/dist/cjs/StepCacheFold.js +131 -0
  115. package/dist/cjs/StepCacheFold.js.map +7 -0
  116. package/dist/cjs/StepSandbox.d.ts +78 -0
  117. package/dist/cjs/StepSandbox.d.ts.map +1 -0
  118. package/dist/cjs/StepSandbox.js +75 -0
  119. package/dist/cjs/StepSandbox.js.map +7 -0
  120. package/dist/cjs/WakeBus.d.ts +116 -0
  121. package/dist/cjs/WakeBus.d.ts.map +1 -0
  122. package/dist/cjs/WakeBus.js +89 -0
  123. package/dist/cjs/WakeBus.js.map +7 -0
  124. package/dist/cjs/WorkspaceSandbox.d.ts +619 -0
  125. package/dist/cjs/WorkspaceSandbox.d.ts.map +1 -0
  126. package/dist/cjs/WorkspaceSandbox.js +711 -0
  127. package/dist/cjs/WorkspaceSandbox.js.map +7 -0
  128. package/dist/cjs/index.d.ts +157 -0
  129. package/dist/cjs/index.d.ts.map +1 -0
  130. package/dist/cjs/index.js +95 -0
  131. package/dist/cjs/index.js.map +7 -0
  132. package/dist/cjs/internal/ActionPersistence.d.ts +276 -0
  133. package/dist/cjs/internal/ActionPersistence.d.ts.map +1 -0
  134. package/dist/cjs/internal/ActionPersistence.js +1395 -0
  135. package/dist/cjs/internal/ActionPersistence.js.map +7 -0
  136. package/dist/cjs/internal/ArtifactRoots.d.ts +38 -0
  137. package/dist/cjs/internal/ArtifactRoots.d.ts.map +1 -0
  138. package/dist/cjs/internal/ArtifactRoots.js +89 -0
  139. package/dist/cjs/internal/ArtifactRoots.js.map +7 -0
  140. package/dist/cjs/internal/AttemptAdmission.d.ts +53 -0
  141. package/dist/cjs/internal/AttemptAdmission.d.ts.map +1 -0
  142. package/dist/cjs/internal/AttemptAdmission.js +52 -0
  143. package/dist/cjs/internal/AttemptAdmission.js.map +7 -0
  144. package/dist/cjs/internal/AttemptLifecycle.d.ts +245 -0
  145. package/dist/cjs/internal/AttemptLifecycle.d.ts.map +1 -0
  146. package/dist/cjs/internal/AttemptLifecycle.js +112 -0
  147. package/dist/cjs/internal/AttemptLifecycle.js.map +7 -0
  148. package/dist/cjs/internal/AttemptProbe.d.ts +53 -0
  149. package/dist/cjs/internal/AttemptProbe.d.ts.map +1 -0
  150. package/dist/cjs/internal/AttemptProbe.js +66 -0
  151. package/dist/cjs/internal/AttemptProbe.js.map +7 -0
  152. package/dist/cjs/internal/CacheAdmission.d.ts +79 -0
  153. package/dist/cjs/internal/CacheAdmission.d.ts.map +1 -0
  154. package/dist/cjs/internal/CacheAdmission.js +71 -0
  155. package/dist/cjs/internal/CacheAdmission.js.map +7 -0
  156. package/dist/cjs/internal/CacheAgeHistory.d.ts +27 -0
  157. package/dist/cjs/internal/CacheAgeHistory.d.ts.map +1 -0
  158. package/dist/cjs/internal/CacheAgeHistory.js +61 -0
  159. package/dist/cjs/internal/CacheAgeHistory.js.map +7 -0
  160. package/dist/cjs/internal/CacheAgeVerdicts.d.ts +15 -0
  161. package/dist/cjs/internal/CacheAgeVerdicts.d.ts.map +1 -0
  162. package/dist/cjs/internal/CacheAgeVerdicts.js +73 -0
  163. package/dist/cjs/internal/CacheAgeVerdicts.js.map +7 -0
  164. package/dist/cjs/internal/CacheOutputPolicy.d.ts +24 -0
  165. package/dist/cjs/internal/CacheOutputPolicy.d.ts.map +1 -0
  166. package/dist/cjs/internal/CacheOutputPolicy.js +75 -0
  167. package/dist/cjs/internal/CacheOutputPolicy.js.map +7 -0
  168. package/dist/cjs/internal/CachePublication.d.ts +97 -0
  169. package/dist/cjs/internal/CachePublication.d.ts.map +1 -0
  170. package/dist/cjs/internal/CachePublication.js +80 -0
  171. package/dist/cjs/internal/CachePublication.js.map +7 -0
  172. package/dist/cjs/internal/CallFacts.d.ts +15 -0
  173. package/dist/cjs/internal/CallFacts.d.ts.map +1 -0
  174. package/dist/cjs/internal/CallFacts.js +97 -0
  175. package/dist/cjs/internal/CallFacts.js.map +7 -0
  176. package/dist/cjs/internal/CopiedRecord.d.ts +61 -0
  177. package/dist/cjs/internal/CopiedRecord.d.ts.map +1 -0
  178. package/dist/cjs/internal/CopiedRecord.js +134 -0
  179. package/dist/cjs/internal/CopiedRecord.js.map +7 -0
  180. package/dist/cjs/internal/DeferredPersistence.d.ts +108 -0
  181. package/dist/cjs/internal/DeferredPersistence.d.ts.map +1 -0
  182. package/dist/cjs/internal/DeferredPersistence.js +270 -0
  183. package/dist/cjs/internal/DeferredPersistence.js.map +7 -0
  184. package/dist/cjs/internal/EffectRecords.d.ts +92 -0
  185. package/dist/cjs/internal/EffectRecords.d.ts.map +1 -0
  186. package/dist/cjs/internal/EffectRecords.js +63 -0
  187. package/dist/cjs/internal/EffectRecords.js.map +7 -0
  188. package/dist/cjs/internal/EngineJj.d.ts +30 -0
  189. package/dist/cjs/internal/EngineJj.d.ts.map +1 -0
  190. package/dist/cjs/internal/EngineJj.js +42 -0
  191. package/dist/cjs/internal/EngineJj.js.map +7 -0
  192. package/dist/cjs/internal/EngineStateSchema.d.ts +68 -0
  193. package/dist/cjs/internal/EngineStateSchema.d.ts.map +1 -0
  194. package/dist/cjs/internal/EngineStateSchema.js +58 -0
  195. package/dist/cjs/internal/EngineStateSchema.js.map +7 -0
  196. package/dist/cjs/internal/ExecutionSnapshotRead.d.ts +162 -0
  197. package/dist/cjs/internal/ExecutionSnapshotRead.d.ts.map +1 -0
  198. package/dist/cjs/internal/ExecutionSnapshotRead.js +201 -0
  199. package/dist/cjs/internal/ExecutionSnapshotRead.js.map +7 -0
  200. package/dist/cjs/internal/ExecutionSnapshotRelations.d.ts +39 -0
  201. package/dist/cjs/internal/ExecutionSnapshotRelations.d.ts.map +1 -0
  202. package/dist/cjs/internal/ExecutionSnapshotRelations.js +105 -0
  203. package/dist/cjs/internal/ExecutionSnapshotRelations.js.map +7 -0
  204. package/dist/cjs/internal/ExitEncoding.d.ts +180 -0
  205. package/dist/cjs/internal/ExitEncoding.d.ts.map +1 -0
  206. package/dist/cjs/internal/ExitEncoding.js +236 -0
  207. package/dist/cjs/internal/ExitEncoding.js.map +7 -0
  208. package/dist/cjs/internal/FileBoundarySnapshot.d.ts +14 -0
  209. package/dist/cjs/internal/FileBoundarySnapshot.d.ts.map +1 -0
  210. package/dist/cjs/internal/FileBoundarySnapshot.js +51 -0
  211. package/dist/cjs/internal/FileBoundarySnapshot.js.map +7 -0
  212. package/dist/cjs/internal/FileEnumeration.d.ts +127 -0
  213. package/dist/cjs/internal/FileEnumeration.d.ts.map +1 -0
  214. package/dist/cjs/internal/FileEnumeration.js +194 -0
  215. package/dist/cjs/internal/FileEnumeration.js.map +7 -0
  216. package/dist/cjs/internal/HostReflection.d.ts +80 -0
  217. package/dist/cjs/internal/HostReflection.d.ts.map +1 -0
  218. package/dist/cjs/internal/HostReflection.js +43 -0
  219. package/dist/cjs/internal/HostReflection.js.map +7 -0
  220. package/dist/cjs/internal/JournalRecords.d.ts +325 -0
  221. package/dist/cjs/internal/JournalRecords.d.ts.map +1 -0
  222. package/dist/cjs/internal/JournalRecords.js +122 -0
  223. package/dist/cjs/internal/JournalRecords.js.map +7 -0
  224. package/dist/cjs/internal/NodeJournal.d.ts +157 -0
  225. package/dist/cjs/internal/NodeJournal.d.ts.map +1 -0
  226. package/dist/cjs/internal/NodeJournal.js +192 -0
  227. package/dist/cjs/internal/NodeJournal.js.map +7 -0
  228. package/dist/cjs/internal/Ordering.d.ts +14 -0
  229. package/dist/cjs/internal/Ordering.d.ts.map +1 -0
  230. package/dist/cjs/internal/Ordering.js +25 -0
  231. package/dist/cjs/internal/Ordering.js.map +7 -0
  232. package/dist/cjs/internal/PlanInputs.d.ts +14 -0
  233. package/dist/cjs/internal/PlanInputs.d.ts.map +1 -0
  234. package/dist/cjs/internal/PlanInputs.js +78 -0
  235. package/dist/cjs/internal/PlanInputs.js.map +7 -0
  236. package/dist/cjs/internal/PlanMerges.d.ts +178 -0
  237. package/dist/cjs/internal/PlanMerges.d.ts.map +1 -0
  238. package/dist/cjs/internal/PlanMerges.js +125 -0
  239. package/dist/cjs/internal/PlanMerges.js.map +7 -0
  240. package/dist/cjs/internal/ProvenanceSlot.d.ts +30 -0
  241. package/dist/cjs/internal/ProvenanceSlot.d.ts.map +1 -0
  242. package/dist/cjs/internal/ProvenanceSlot.js +53 -0
  243. package/dist/cjs/internal/ProvenanceSlot.js.map +7 -0
  244. package/dist/cjs/internal/ResultEnvelope.d.ts +88 -0
  245. package/dist/cjs/internal/ResultEnvelope.d.ts.map +1 -0
  246. package/dist/cjs/internal/ResultEnvelope.js +90 -0
  247. package/dist/cjs/internal/ResultEnvelope.js.map +7 -0
  248. package/dist/cjs/internal/RetentionOps.d.ts +414 -0
  249. package/dist/cjs/internal/RetentionOps.d.ts.map +1 -0
  250. package/dist/cjs/internal/RetentionOps.js +354 -0
  251. package/dist/cjs/internal/RetentionOps.js.map +7 -0
  252. package/dist/cjs/internal/RunCatalogOps.d.ts +118 -0
  253. package/dist/cjs/internal/RunCatalogOps.d.ts.map +1 -0
  254. package/dist/cjs/internal/RunCatalogOps.js +85 -0
  255. package/dist/cjs/internal/RunCatalogOps.js.map +7 -0
  256. package/dist/cjs/internal/RunCoordinator.d.ts +78 -0
  257. package/dist/cjs/internal/RunCoordinator.d.ts.map +1 -0
  258. package/dist/cjs/internal/RunCoordinator.js +123 -0
  259. package/dist/cjs/internal/RunCoordinator.js.map +7 -0
  260. package/dist/cjs/internal/RunDriver.d.ts +192 -0
  261. package/dist/cjs/internal/RunDriver.d.ts.map +1 -0
  262. package/dist/cjs/internal/RunDriver.js +1586 -0
  263. package/dist/cjs/internal/RunDriver.js.map +7 -0
  264. package/dist/cjs/internal/RunLifecycle.d.ts +22 -0
  265. package/dist/cjs/internal/RunLifecycle.d.ts.map +1 -0
  266. package/dist/cjs/internal/RunLifecycle.js +63 -0
  267. package/dist/cjs/internal/RunLifecycle.js.map +7 -0
  268. package/dist/cjs/internal/RunListing.d.ts +78 -0
  269. package/dist/cjs/internal/RunListing.d.ts.map +1 -0
  270. package/dist/cjs/internal/RunListing.js +171 -0
  271. package/dist/cjs/internal/RunListing.js.map +7 -0
  272. package/dist/cjs/internal/RunListingError.d.ts +35 -0
  273. package/dist/cjs/internal/RunListingError.d.ts.map +1 -0
  274. package/dist/cjs/internal/RunListingError.js +47 -0
  275. package/dist/cjs/internal/RunListingError.js.map +7 -0
  276. package/dist/cjs/internal/RuntimeGraph.d.ts +73 -0
  277. package/dist/cjs/internal/RuntimeGraph.d.ts.map +1 -0
  278. package/dist/cjs/internal/RuntimeGraph.js +180 -0
  279. package/dist/cjs/internal/RuntimeGraph.js.map +7 -0
  280. package/dist/cjs/internal/SandboxedExecution.d.ts +80 -0
  281. package/dist/cjs/internal/SandboxedExecution.d.ts.map +1 -0
  282. package/dist/cjs/internal/SandboxedExecution.js +104 -0
  283. package/dist/cjs/internal/SandboxedExecution.js.map +7 -0
  284. package/dist/cjs/internal/StateTransaction.d.ts +44 -0
  285. package/dist/cjs/internal/StateTransaction.d.ts.map +1 -0
  286. package/dist/cjs/internal/StateTransaction.js +52 -0
  287. package/dist/cjs/internal/StateTransaction.js.map +7 -0
  288. package/dist/cjs/internal/StepFacts.d.ts +14 -0
  289. package/dist/cjs/internal/StepFacts.d.ts.map +1 -0
  290. package/dist/cjs/internal/StepFacts.js +58 -0
  291. package/dist/cjs/internal/StepFacts.js.map +7 -0
  292. package/dist/cjs/internal/TypedEvents.d.ts +14 -0
  293. package/dist/cjs/internal/TypedEvents.d.ts.map +1 -0
  294. package/dist/cjs/internal/TypedEvents.js +37 -0
  295. package/dist/cjs/internal/TypedEvents.js.map +7 -0
  296. package/dist/cjs/migrations/0001_initial.d.ts +17 -0
  297. package/dist/cjs/migrations/0001_initial.d.ts.map +1 -0
  298. package/dist/cjs/migrations/0001_initial.js +61 -0
  299. package/dist/cjs/migrations/0001_initial.js.map +7 -0
  300. package/dist/cjs/migrations/0002_selection_store.d.ts +15 -0
  301. package/dist/cjs/migrations/0002_selection_store.d.ts.map +1 -0
  302. package/dist/cjs/migrations/0002_selection_store.js +56 -0
  303. package/dist/cjs/migrations/0002_selection_store.js.map +7 -0
  304. package/dist/cjs/migrations/0003_plan_inputs.d.ts +13 -0
  305. package/dist/cjs/migrations/0003_plan_inputs.d.ts.map +1 -0
  306. package/dist/cjs/migrations/0003_plan_inputs.js +90 -0
  307. package/dist/cjs/migrations/0003_plan_inputs.js.map +7 -0
  308. package/dist/cjs/migrations/0004_plan_environment.d.ts +14 -0
  309. package/dist/cjs/migrations/0004_plan_environment.d.ts.map +1 -0
  310. package/dist/cjs/migrations/0004_plan_environment.js +56 -0
  311. package/dist/cjs/migrations/0004_plan_environment.js.map +7 -0
  312. package/dist/cjs/migrations/0005_plan_merges.d.ts +14 -0
  313. package/dist/cjs/migrations/0005_plan_merges.d.ts.map +1 -0
  314. package/dist/cjs/migrations/0005_plan_merges.js +82 -0
  315. package/dist/cjs/migrations/0005_plan_merges.js.map +7 -0
  316. package/dist/cjs/migrations/0006_execution_listing.d.ts +15 -0
  317. package/dist/cjs/migrations/0006_execution_listing.d.ts.map +1 -0
  318. package/dist/cjs/migrations/0006_execution_listing.js +101 -0
  319. package/dist/cjs/migrations/0006_execution_listing.js.map +7 -0
  320. package/dist/cjs/migrations/0007_run_parent_sequence.d.ts +15 -0
  321. package/dist/cjs/migrations/0007_run_parent_sequence.d.ts.map +1 -0
  322. package/dist/cjs/migrations/0007_run_parent_sequence.js +40 -0
  323. package/dist/cjs/migrations/0007_run_parent_sequence.js.map +7 -0
  324. package/dist/cjs/migrations/0008_deferred_consumption.d.ts +16 -0
  325. package/dist/cjs/migrations/0008_deferred_consumption.d.ts.map +1 -0
  326. package/dist/cjs/migrations/0008_deferred_consumption.js +45 -0
  327. package/dist/cjs/migrations/0008_deferred_consumption.js.map +7 -0
  328. package/dist/cjs/migrations/0009_deferred_clock_facts.d.ts +24 -0
  329. package/dist/cjs/migrations/0009_deferred_clock_facts.d.ts.map +1 -0
  330. package/dist/cjs/migrations/0009_deferred_clock_facts.js +141 -0
  331. package/dist/cjs/migrations/0009_deferred_clock_facts.js.map +7 -0
  332. package/dist/cjs/migrations/0010_pending_cancellation.d.ts +15 -0
  333. package/dist/cjs/migrations/0010_pending_cancellation.d.ts.map +1 -0
  334. package/dist/cjs/migrations/0010_pending_cancellation.js +41 -0
  335. package/dist/cjs/migrations/0010_pending_cancellation.js.map +7 -0
  336. package/dist/cjs/package.json +1 -0
  337. package/dist/cjs/test/TestStores.d.ts +89 -0
  338. package/dist/cjs/test/TestStores.d.ts.map +1 -0
  339. package/dist/cjs/test/TestStores.js +98 -0
  340. package/dist/cjs/test/TestStores.js.map +7 -0
  341. package/dist/esm/ArtifactGc.d.ts +235 -0
  342. package/dist/esm/ArtifactGc.d.ts.map +1 -0
  343. package/dist/esm/ArtifactGc.js +268 -0
  344. package/dist/esm/ArtifactGc.js.map +1 -0
  345. package/dist/esm/ArtifactSync.d.ts +164 -0
  346. package/dist/esm/ArtifactSync.d.ts.map +1 -0
  347. package/dist/esm/ArtifactSync.js +176 -0
  348. package/dist/esm/ArtifactSync.js.map +1 -0
  349. package/dist/esm/CacheSync.d.ts +112 -0
  350. package/dist/esm/CacheSync.d.ts.map +1 -0
  351. package/dist/esm/CacheSync.js +94 -0
  352. package/dist/esm/CacheSync.js.map +1 -0
  353. package/dist/esm/DeferredClockFold.d.ts +354 -0
  354. package/dist/esm/DeferredClockFold.d.ts.map +1 -0
  355. package/dist/esm/DeferredClockFold.js +472 -0
  356. package/dist/esm/DeferredClockFold.js.map +1 -0
  357. package/dist/esm/DisasterRecovery.d.ts +431 -0
  358. package/dist/esm/DisasterRecovery.d.ts.map +1 -0
  359. package/dist/esm/DisasterRecovery.js +523 -0
  360. package/dist/esm/DisasterRecovery.js.map +1 -0
  361. package/dist/esm/DurableEngineState.d.ts +776 -0
  362. package/dist/esm/DurableEngineState.d.ts.map +1 -0
  363. package/dist/esm/DurableEngineState.js +1648 -0
  364. package/dist/esm/DurableEngineState.js.map +1 -0
  365. package/dist/esm/EngineStore.d.ts +158 -0
  366. package/dist/esm/EngineStore.d.ts.map +1 -0
  367. package/dist/esm/EngineStore.js +403 -0
  368. package/dist/esm/EngineStore.js.map +1 -0
  369. package/dist/esm/EngineStoreMetrics.d.ts +276 -0
  370. package/dist/esm/EngineStoreMetrics.d.ts.map +1 -0
  371. package/dist/esm/EngineStoreMetrics.js +260 -0
  372. package/dist/esm/EngineStoreMetrics.js.map +1 -0
  373. package/dist/esm/Errors.d.ts +22 -0
  374. package/dist/esm/Errors.d.ts.map +1 -0
  375. package/dist/esm/Errors.js +22 -0
  376. package/dist/esm/Errors.js.map +1 -0
  377. package/dist/esm/EventTypes.d.ts +27 -0
  378. package/dist/esm/EventTypes.d.ts.map +1 -0
  379. package/dist/esm/EventTypes.js +27 -0
  380. package/dist/esm/EventTypes.js.map +1 -0
  381. package/dist/esm/ExecutionFacts.d.ts +59 -0
  382. package/dist/esm/ExecutionFacts.d.ts.map +1 -0
  383. package/dist/esm/ExecutionFacts.js +96 -0
  384. package/dist/esm/ExecutionFacts.js.map +1 -0
  385. package/dist/esm/ExecutionSnapshot.d.ts +117 -0
  386. package/dist/esm/ExecutionSnapshot.d.ts.map +1 -0
  387. package/dist/esm/ExecutionSnapshot.js +95 -0
  388. package/dist/esm/ExecutionSnapshot.js.map +1 -0
  389. package/dist/esm/Inconsistency.d.ts +154 -0
  390. package/dist/esm/Inconsistency.d.ts.map +1 -0
  391. package/dist/esm/Inconsistency.js +133 -0
  392. package/dist/esm/Inconsistency.js.map +1 -0
  393. package/dist/esm/Migrations.d.ts +56 -0
  394. package/dist/esm/Migrations.d.ts.map +1 -0
  395. package/dist/esm/Migrations.js +91 -0
  396. package/dist/esm/Migrations.js.map +1 -0
  397. package/dist/esm/OwnerIdentity.d.ts +91 -0
  398. package/dist/esm/OwnerIdentity.d.ts.map +1 -0
  399. package/dist/esm/OwnerIdentity.js +99 -0
  400. package/dist/esm/OwnerIdentity.js.map +1 -0
  401. package/dist/esm/PlanInputStore.d.ts +110 -0
  402. package/dist/esm/PlanInputStore.d.ts.map +1 -0
  403. package/dist/esm/PlanInputStore.js +207 -0
  404. package/dist/esm/PlanInputStore.js.map +1 -0
  405. package/dist/esm/PlanMergeStore.d.ts +113 -0
  406. package/dist/esm/PlanMergeStore.d.ts.map +1 -0
  407. package/dist/esm/PlanMergeStore.js +244 -0
  408. package/dist/esm/PlanMergeStore.js.map +1 -0
  409. package/dist/esm/PlanScheduler.d.ts +363 -0
  410. package/dist/esm/PlanScheduler.d.ts.map +1 -0
  411. package/dist/esm/PlanScheduler.js +1321 -0
  412. package/dist/esm/PlanScheduler.js.map +1 -0
  413. package/dist/esm/Reconciliation.d.ts +175 -0
  414. package/dist/esm/Reconciliation.d.ts.map +1 -0
  415. package/dist/esm/Reconciliation.js +175 -0
  416. package/dist/esm/Reconciliation.js.map +1 -0
  417. package/dist/esm/ReplayOnly.d.ts +91 -0
  418. package/dist/esm/ReplayOnly.d.ts.map +1 -0
  419. package/dist/esm/ReplayOnly.js +59 -0
  420. package/dist/esm/ReplayOnly.js.map +1 -0
  421. package/dist/esm/Retention.d.ts +113 -0
  422. package/dist/esm/Retention.d.ts.map +1 -0
  423. package/dist/esm/Retention.js +139 -0
  424. package/dist/esm/Retention.js.map +1 -0
  425. package/dist/esm/RunCatalogRead.d.ts +17 -0
  426. package/dist/esm/RunCatalogRead.d.ts.map +1 -0
  427. package/dist/esm/RunCatalogRead.js +17 -0
  428. package/dist/esm/RunCatalogRead.js.map +1 -0
  429. package/dist/esm/RunChangeFeed.d.ts +75 -0
  430. package/dist/esm/RunChangeFeed.d.ts.map +1 -0
  431. package/dist/esm/RunChangeFeed.js +81 -0
  432. package/dist/esm/RunChangeFeed.js.map +1 -0
  433. package/dist/esm/RunState.d.ts +116 -0
  434. package/dist/esm/RunState.d.ts.map +1 -0
  435. package/dist/esm/RunState.js +109 -0
  436. package/dist/esm/RunState.js.map +1 -0
  437. package/dist/esm/Selection.d.ts +495 -0
  438. package/dist/esm/Selection.d.ts.map +1 -0
  439. package/dist/esm/Selection.js +482 -0
  440. package/dist/esm/Selection.js.map +1 -0
  441. package/dist/esm/SelectionStore.d.ts +141 -0
  442. package/dist/esm/SelectionStore.d.ts.map +1 -0
  443. package/dist/esm/SelectionStore.js +215 -0
  444. package/dist/esm/SelectionStore.js.map +1 -0
  445. package/dist/esm/StepBoundary.d.ts +501 -0
  446. package/dist/esm/StepBoundary.d.ts.map +1 -0
  447. package/dist/esm/StepBoundary.js +919 -0
  448. package/dist/esm/StepBoundary.js.map +1 -0
  449. package/dist/esm/StepCacheFold.d.ts +148 -0
  450. package/dist/esm/StepCacheFold.d.ts.map +1 -0
  451. package/dist/esm/StepCacheFold.js +201 -0
  452. package/dist/esm/StepCacheFold.js.map +1 -0
  453. package/dist/esm/StepSandbox.d.ts +78 -0
  454. package/dist/esm/StepSandbox.d.ts.map +1 -0
  455. package/dist/esm/StepSandbox.js +70 -0
  456. package/dist/esm/StepSandbox.js.map +1 -0
  457. package/dist/esm/WakeBus.d.ts +116 -0
  458. package/dist/esm/WakeBus.d.ts.map +1 -0
  459. package/dist/esm/WakeBus.js +121 -0
  460. package/dist/esm/WakeBus.js.map +1 -0
  461. package/dist/esm/WorkspaceSandbox.d.ts +619 -0
  462. package/dist/esm/WorkspaceSandbox.d.ts.map +1 -0
  463. package/dist/esm/WorkspaceSandbox.js +985 -0
  464. package/dist/esm/WorkspaceSandbox.js.map +1 -0
  465. package/dist/esm/index.d.ts +157 -0
  466. package/dist/esm/index.d.ts.map +1 -0
  467. package/dist/esm/index.js +157 -0
  468. package/dist/esm/index.js.map +1 -0
  469. package/dist/esm/internal/ActionPersistence.d.ts +276 -0
  470. package/dist/esm/internal/ActionPersistence.d.ts.map +1 -0
  471. package/dist/esm/internal/ActionPersistence.js +2306 -0
  472. package/dist/esm/internal/ActionPersistence.js.map +1 -0
  473. package/dist/esm/internal/ArtifactRoots.d.ts +38 -0
  474. package/dist/esm/internal/ArtifactRoots.d.ts.map +1 -0
  475. package/dist/esm/internal/ArtifactRoots.js +76 -0
  476. package/dist/esm/internal/ArtifactRoots.js.map +1 -0
  477. package/dist/esm/internal/AttemptAdmission.d.ts +53 -0
  478. package/dist/esm/internal/AttemptAdmission.d.ts.map +1 -0
  479. package/dist/esm/internal/AttemptAdmission.js +52 -0
  480. package/dist/esm/internal/AttemptAdmission.js.map +1 -0
  481. package/dist/esm/internal/AttemptLifecycle.d.ts +245 -0
  482. package/dist/esm/internal/AttemptLifecycle.d.ts.map +1 -0
  483. package/dist/esm/internal/AttemptLifecycle.js +104 -0
  484. package/dist/esm/internal/AttemptLifecycle.js.map +1 -0
  485. package/dist/esm/internal/AttemptProbe.d.ts +53 -0
  486. package/dist/esm/internal/AttemptProbe.d.ts.map +1 -0
  487. package/dist/esm/internal/AttemptProbe.js +83 -0
  488. package/dist/esm/internal/AttemptProbe.js.map +1 -0
  489. package/dist/esm/internal/CacheAdmission.d.ts +79 -0
  490. package/dist/esm/internal/CacheAdmission.d.ts.map +1 -0
  491. package/dist/esm/internal/CacheAdmission.js +72 -0
  492. package/dist/esm/internal/CacheAdmission.js.map +1 -0
  493. package/dist/esm/internal/CacheAgeHistory.d.ts +27 -0
  494. package/dist/esm/internal/CacheAgeHistory.d.ts.map +1 -0
  495. package/dist/esm/internal/CacheAgeHistory.js +49 -0
  496. package/dist/esm/internal/CacheAgeHistory.js.map +1 -0
  497. package/dist/esm/internal/CacheAgeVerdicts.d.ts +15 -0
  498. package/dist/esm/internal/CacheAgeVerdicts.d.ts.map +1 -0
  499. package/dist/esm/internal/CacheAgeVerdicts.js +54 -0
  500. package/dist/esm/internal/CacheAgeVerdicts.js.map +1 -0
  501. package/dist/esm/internal/CacheOutputPolicy.d.ts +24 -0
  502. package/dist/esm/internal/CacheOutputPolicy.d.ts.map +1 -0
  503. package/dist/esm/internal/CacheOutputPolicy.js +73 -0
  504. package/dist/esm/internal/CacheOutputPolicy.js.map +1 -0
  505. package/dist/esm/internal/CachePublication.d.ts +97 -0
  506. package/dist/esm/internal/CachePublication.d.ts.map +1 -0
  507. package/dist/esm/internal/CachePublication.js +116 -0
  508. package/dist/esm/internal/CachePublication.js.map +1 -0
  509. package/dist/esm/internal/CallFacts.d.ts +15 -0
  510. package/dist/esm/internal/CallFacts.d.ts.map +1 -0
  511. package/dist/esm/internal/CallFacts.js +83 -0
  512. package/dist/esm/internal/CallFacts.js.map +1 -0
  513. package/dist/esm/internal/CopiedRecord.d.ts +61 -0
  514. package/dist/esm/internal/CopiedRecord.d.ts.map +1 -0
  515. package/dist/esm/internal/CopiedRecord.js +165 -0
  516. package/dist/esm/internal/CopiedRecord.js.map +1 -0
  517. package/dist/esm/internal/DeferredPersistence.d.ts +108 -0
  518. package/dist/esm/internal/DeferredPersistence.d.ts.map +1 -0
  519. package/dist/esm/internal/DeferredPersistence.js +240 -0
  520. package/dist/esm/internal/DeferredPersistence.js.map +1 -0
  521. package/dist/esm/internal/EffectRecords.d.ts +92 -0
  522. package/dist/esm/internal/EffectRecords.d.ts.map +1 -0
  523. package/dist/esm/internal/EffectRecords.js +94 -0
  524. package/dist/esm/internal/EffectRecords.js.map +1 -0
  525. package/dist/esm/internal/EngineJj.d.ts +30 -0
  526. package/dist/esm/internal/EngineJj.d.ts.map +1 -0
  527. package/dist/esm/internal/EngineJj.js +29 -0
  528. package/dist/esm/internal/EngineJj.js.map +1 -0
  529. package/dist/esm/internal/EngineStateSchema.d.ts +68 -0
  530. package/dist/esm/internal/EngineStateSchema.d.ts.map +1 -0
  531. package/dist/esm/internal/EngineStateSchema.js +53 -0
  532. package/dist/esm/internal/EngineStateSchema.js.map +1 -0
  533. package/dist/esm/internal/ExecutionSnapshotRead.d.ts +162 -0
  534. package/dist/esm/internal/ExecutionSnapshotRead.d.ts.map +1 -0
  535. package/dist/esm/internal/ExecutionSnapshotRead.js +218 -0
  536. package/dist/esm/internal/ExecutionSnapshotRead.js.map +1 -0
  537. package/dist/esm/internal/ExecutionSnapshotRelations.d.ts +39 -0
  538. package/dist/esm/internal/ExecutionSnapshotRelations.d.ts.map +1 -0
  539. package/dist/esm/internal/ExecutionSnapshotRelations.js +81 -0
  540. package/dist/esm/internal/ExecutionSnapshotRelations.js.map +1 -0
  541. package/dist/esm/internal/ExitEncoding.d.ts +180 -0
  542. package/dist/esm/internal/ExitEncoding.d.ts.map +1 -0
  543. package/dist/esm/internal/ExitEncoding.js +361 -0
  544. package/dist/esm/internal/ExitEncoding.js.map +1 -0
  545. package/dist/esm/internal/FileBoundarySnapshot.d.ts +14 -0
  546. package/dist/esm/internal/FileBoundarySnapshot.d.ts.map +1 -0
  547. package/dist/esm/internal/FileBoundarySnapshot.js +29 -0
  548. package/dist/esm/internal/FileBoundarySnapshot.js.map +1 -0
  549. package/dist/esm/internal/FileEnumeration.d.ts +127 -0
  550. package/dist/esm/internal/FileEnumeration.d.ts.map +1 -0
  551. package/dist/esm/internal/FileEnumeration.js +236 -0
  552. package/dist/esm/internal/FileEnumeration.js.map +1 -0
  553. package/dist/esm/internal/HostReflection.d.ts +80 -0
  554. package/dist/esm/internal/HostReflection.d.ts.map +1 -0
  555. package/dist/esm/internal/HostReflection.js +98 -0
  556. package/dist/esm/internal/HostReflection.js.map +1 -0
  557. package/dist/esm/internal/JournalRecords.d.ts +325 -0
  558. package/dist/esm/internal/JournalRecords.d.ts.map +1 -0
  559. package/dist/esm/internal/JournalRecords.js +306 -0
  560. package/dist/esm/internal/JournalRecords.js.map +1 -0
  561. package/dist/esm/internal/NodeJournal.d.ts +157 -0
  562. package/dist/esm/internal/NodeJournal.d.ts.map +1 -0
  563. package/dist/esm/internal/NodeJournal.js +298 -0
  564. package/dist/esm/internal/NodeJournal.js.map +1 -0
  565. package/dist/esm/internal/Ordering.d.ts +14 -0
  566. package/dist/esm/internal/Ordering.d.ts.map +1 -0
  567. package/dist/esm/internal/Ordering.js +14 -0
  568. package/dist/esm/internal/Ordering.js.map +1 -0
  569. package/dist/esm/internal/PlanInputs.d.ts +14 -0
  570. package/dist/esm/internal/PlanInputs.d.ts.map +1 -0
  571. package/dist/esm/internal/PlanInputs.js +57 -0
  572. package/dist/esm/internal/PlanInputs.js.map +1 -0
  573. package/dist/esm/internal/PlanMerges.d.ts +178 -0
  574. package/dist/esm/internal/PlanMerges.d.ts.map +1 -0
  575. package/dist/esm/internal/PlanMerges.js +113 -0
  576. package/dist/esm/internal/PlanMerges.js.map +1 -0
  577. package/dist/esm/internal/ProvenanceSlot.d.ts +30 -0
  578. package/dist/esm/internal/ProvenanceSlot.d.ts.map +1 -0
  579. package/dist/esm/internal/ProvenanceSlot.js +39 -0
  580. package/dist/esm/internal/ProvenanceSlot.js.map +1 -0
  581. package/dist/esm/internal/ResultEnvelope.d.ts +88 -0
  582. package/dist/esm/internal/ResultEnvelope.d.ts.map +1 -0
  583. package/dist/esm/internal/ResultEnvelope.js +83 -0
  584. package/dist/esm/internal/ResultEnvelope.js.map +1 -0
  585. package/dist/esm/internal/RetentionOps.d.ts +414 -0
  586. package/dist/esm/internal/RetentionOps.d.ts.map +1 -0
  587. package/dist/esm/internal/RetentionOps.js +576 -0
  588. package/dist/esm/internal/RetentionOps.js.map +1 -0
  589. package/dist/esm/internal/RunCatalogOps.d.ts +118 -0
  590. package/dist/esm/internal/RunCatalogOps.d.ts.map +1 -0
  591. package/dist/esm/internal/RunCatalogOps.js +120 -0
  592. package/dist/esm/internal/RunCatalogOps.js.map +1 -0
  593. package/dist/esm/internal/RunCoordinator.d.ts +78 -0
  594. package/dist/esm/internal/RunCoordinator.d.ts.map +1 -0
  595. package/dist/esm/internal/RunCoordinator.js +115 -0
  596. package/dist/esm/internal/RunCoordinator.js.map +1 -0
  597. package/dist/esm/internal/RunDriver.d.ts +192 -0
  598. package/dist/esm/internal/RunDriver.d.ts.map +1 -0
  599. package/dist/esm/internal/RunDriver.js +2334 -0
  600. package/dist/esm/internal/RunDriver.js.map +1 -0
  601. package/dist/esm/internal/RunLifecycle.d.ts +22 -0
  602. package/dist/esm/internal/RunLifecycle.d.ts.map +1 -0
  603. package/dist/esm/internal/RunLifecycle.js +49 -0
  604. package/dist/esm/internal/RunLifecycle.js.map +1 -0
  605. package/dist/esm/internal/RunListing.d.ts +78 -0
  606. package/dist/esm/internal/RunListing.d.ts.map +1 -0
  607. package/dist/esm/internal/RunListing.js +146 -0
  608. package/dist/esm/internal/RunListing.js.map +1 -0
  609. package/dist/esm/internal/RunListingError.d.ts +35 -0
  610. package/dist/esm/internal/RunListingError.d.ts.map +1 -0
  611. package/dist/esm/internal/RunListingError.js +27 -0
  612. package/dist/esm/internal/RunListingError.js.map +1 -0
  613. package/dist/esm/internal/RuntimeGraph.d.ts +73 -0
  614. package/dist/esm/internal/RuntimeGraph.d.ts.map +1 -0
  615. package/dist/esm/internal/RuntimeGraph.js +182 -0
  616. package/dist/esm/internal/RuntimeGraph.js.map +1 -0
  617. package/dist/esm/internal/SandboxedExecution.d.ts +80 -0
  618. package/dist/esm/internal/SandboxedExecution.d.ts.map +1 -0
  619. package/dist/esm/internal/SandboxedExecution.js +107 -0
  620. package/dist/esm/internal/SandboxedExecution.js.map +1 -0
  621. package/dist/esm/internal/StateTransaction.d.ts +44 -0
  622. package/dist/esm/internal/StateTransaction.d.ts.map +1 -0
  623. package/dist/esm/internal/StateTransaction.js +54 -0
  624. package/dist/esm/internal/StateTransaction.js.map +1 -0
  625. package/dist/esm/internal/StepFacts.d.ts +14 -0
  626. package/dist/esm/internal/StepFacts.d.ts.map +1 -0
  627. package/dist/esm/internal/StepFacts.js +35 -0
  628. package/dist/esm/internal/StepFacts.js.map +1 -0
  629. package/dist/esm/internal/TypedEvents.d.ts +14 -0
  630. package/dist/esm/internal/TypedEvents.d.ts.map +1 -0
  631. package/dist/esm/internal/TypedEvents.js +14 -0
  632. package/dist/esm/internal/TypedEvents.js.map +1 -0
  633. package/dist/esm/migrations/0001_initial.d.ts +17 -0
  634. package/dist/esm/migrations/0001_initial.d.ts.map +1 -0
  635. package/dist/esm/migrations/0001_initial.js +41 -0
  636. package/dist/esm/migrations/0001_initial.js.map +1 -0
  637. package/dist/esm/migrations/0002_selection_store.d.ts +15 -0
  638. package/dist/esm/migrations/0002_selection_store.d.ts.map +1 -0
  639. package/dist/esm/migrations/0002_selection_store.js +34 -0
  640. package/dist/esm/migrations/0002_selection_store.js.map +1 -0
  641. package/dist/esm/migrations/0003_plan_inputs.d.ts +13 -0
  642. package/dist/esm/migrations/0003_plan_inputs.d.ts.map +1 -0
  643. package/dist/esm/migrations/0003_plan_inputs.js +70 -0
  644. package/dist/esm/migrations/0003_plan_inputs.js.map +1 -0
  645. package/dist/esm/migrations/0004_plan_environment.d.ts +14 -0
  646. package/dist/esm/migrations/0004_plan_environment.d.ts.map +1 -0
  647. package/dist/esm/migrations/0004_plan_environment.js +33 -0
  648. package/dist/esm/migrations/0004_plan_environment.js.map +1 -0
  649. package/dist/esm/migrations/0005_plan_merges.d.ts +14 -0
  650. package/dist/esm/migrations/0005_plan_merges.d.ts.map +1 -0
  651. package/dist/esm/migrations/0005_plan_merges.js +59 -0
  652. package/dist/esm/migrations/0005_plan_merges.js.map +1 -0
  653. package/dist/esm/migrations/0006_execution_listing.d.ts +15 -0
  654. package/dist/esm/migrations/0006_execution_listing.d.ts.map +1 -0
  655. package/dist/esm/migrations/0006_execution_listing.js +81 -0
  656. package/dist/esm/migrations/0006_execution_listing.js.map +1 -0
  657. package/dist/esm/migrations/0007_run_parent_sequence.d.ts +15 -0
  658. package/dist/esm/migrations/0007_run_parent_sequence.d.ts.map +1 -0
  659. package/dist/esm/migrations/0007_run_parent_sequence.js +18 -0
  660. package/dist/esm/migrations/0007_run_parent_sequence.js.map +1 -0
  661. package/dist/esm/migrations/0008_deferred_consumption.d.ts +16 -0
  662. package/dist/esm/migrations/0008_deferred_consumption.d.ts.map +1 -0
  663. package/dist/esm/migrations/0008_deferred_consumption.js +24 -0
  664. package/dist/esm/migrations/0008_deferred_consumption.js.map +1 -0
  665. package/dist/esm/migrations/0009_deferred_clock_facts.d.ts +24 -0
  666. package/dist/esm/migrations/0009_deferred_clock_facts.d.ts.map +1 -0
  667. package/dist/esm/migrations/0009_deferred_clock_facts.js +127 -0
  668. package/dist/esm/migrations/0009_deferred_clock_facts.js.map +1 -0
  669. package/dist/esm/migrations/0010_pending_cancellation.d.ts +15 -0
  670. package/dist/esm/migrations/0010_pending_cancellation.d.ts.map +1 -0
  671. package/dist/esm/migrations/0010_pending_cancellation.js +19 -0
  672. package/dist/esm/migrations/0010_pending_cancellation.js.map +1 -0
  673. package/dist/esm/test/TestStores.d.ts +89 -0
  674. package/dist/esm/test/TestStores.d.ts.map +1 -0
  675. package/dist/esm/test/TestStores.js +103 -0
  676. package/dist/esm/test/TestStores.js.map +1 -0
  677. package/docs/README.md +113 -0
  678. package/docs/api.md +1494 -0
  679. package/docs/concepts/attempts-and-replay.md +149 -0
  680. package/docs/concepts/cache-admission.md +265 -0
  681. package/docs/concepts/call-facts.md +86 -0
  682. package/docs/concepts/durable-waits.md +175 -0
  683. package/docs/concepts/execution-facts.md +90 -0
  684. package/docs/concepts/ownership-and-fencing.md +128 -0
  685. package/docs/concepts/step-boundaries.md +148 -0
  686. package/docs/concepts/workspace-transactions.md +199 -0
  687. package/docs/event-types.md +14 -0
  688. package/docs/guides/back-up-and-restore.md +164 -0
  689. package/docs/guides/collect-unreferenced-artifacts.md +128 -0
  690. package/docs/guides/compose-a-durable-engine.md +146 -0
  691. package/docs/guides/coordinate-two-processes.md +120 -0
  692. package/docs/guides/defer-work-with-selection.md +171 -0
  693. package/docs/guides/delete-old-run-history.md +154 -0
  694. package/docs/guides/drive-a-plan.md +314 -0
  695. package/docs/guides/observe-engine-metrics.md +98 -0
  696. package/docs/guides/observe-executions.md +187 -0
  697. package/docs/guides/reclaim-runs-from-a-dead-host.md +133 -0
  698. package/docs/guides/share-a-cache-across-machines.md +134 -0
  699. package/docs/guides/testing.md +123 -0
  700. package/docs/installation.md +102 -0
  701. package/docs/quickstart.md +215 -0
  702. package/docs/troubleshooting.md +347 -0
  703. package/package.json +438 -3
  704. package/src/ArtifactGc.ts +408 -0
  705. package/src/ArtifactSync.ts +278 -0
  706. package/src/CacheSync.ts +131 -0
  707. package/src/DeferredClockFold.ts +586 -0
  708. package/src/DisasterRecovery.ts +888 -0
  709. package/src/DurableEngineState.ts +2656 -0
  710. package/src/EngineStore.ts +656 -0
  711. package/src/EngineStoreMetrics.ts +331 -0
  712. package/src/Errors.ts +28 -0
  713. package/src/EventTypes.ts +27 -0
  714. package/src/ExecutionFacts.ts +125 -0
  715. package/src/ExecutionSnapshot.ts +186 -0
  716. package/src/Inconsistency.ts +253 -0
  717. package/src/Migrations.ts +95 -0
  718. package/src/OwnerIdentity.ts +125 -0
  719. package/src/PlanInputStore.ts +292 -0
  720. package/src/PlanMergeStore.ts +330 -0
  721. package/src/PlanScheduler.ts +1806 -0
  722. package/src/Reconciliation.ts +224 -0
  723. package/src/ReplayOnly.ts +95 -0
  724. package/src/Retention.ts +214 -0
  725. package/src/RunCatalogRead.ts +27 -0
  726. package/src/RunChangeFeed.ts +125 -0
  727. package/src/RunState.ts +137 -0
  728. package/src/Selection.ts +683 -0
  729. package/src/SelectionStore.ts +353 -0
  730. package/src/StepBoundary.ts +1165 -0
  731. package/src/StepCacheFold.ts +244 -0
  732. package/src/StepSandbox.ts +110 -0
  733. package/src/WakeBus.ts +167 -0
  734. package/src/WorkspaceSandbox.ts +1604 -0
  735. package/src/index.ts +185 -0
  736. package/src/internal/ActionPersistence.ts +2687 -0
  737. package/src/internal/ArtifactRoots.ts +92 -0
  738. package/src/internal/AttemptAdmission.ts +76 -0
  739. package/src/internal/AttemptLifecycle.ts +163 -0
  740. package/src/internal/AttemptProbe.ts +90 -0
  741. package/src/internal/CacheAdmission.ts +133 -0
  742. package/src/internal/CacheAgeHistory.ts +58 -0
  743. package/src/internal/CacheAgeVerdicts.ts +61 -0
  744. package/src/internal/CacheOutputPolicy.ts +82 -0
  745. package/src/internal/CachePublication.ts +153 -0
  746. package/src/internal/CallFacts.ts +87 -0
  747. package/src/internal/CopiedRecord.ts +201 -0
  748. package/src/internal/DeferredPersistence.ts +459 -0
  749. package/src/internal/EffectRecords.ts +136 -0
  750. package/src/internal/EngineJj.ts +30 -0
  751. package/src/internal/EngineStateSchema.ts +92 -0
  752. package/src/internal/ExecutionSnapshotRead.ts +300 -0
  753. package/src/internal/ExecutionSnapshotRelations.ts +121 -0
  754. package/src/internal/ExitEncoding.ts +453 -0
  755. package/src/internal/FileBoundarySnapshot.ts +39 -0
  756. package/src/internal/FileEnumeration.ts +334 -0
  757. package/src/internal/HostReflection.ts +128 -0
  758. package/src/internal/JournalRecords.ts +396 -0
  759. package/src/internal/NodeJournal.ts +340 -0
  760. package/src/internal/Ordering.ts +14 -0
  761. package/src/internal/PlanInputs.ts +62 -0
  762. package/src/internal/PlanMerges.ts +123 -0
  763. package/src/internal/ProvenanceSlot.ts +52 -0
  764. package/src/internal/ResultEnvelope.ts +118 -0
  765. package/src/internal/RetentionOps.ts +865 -0
  766. package/src/internal/RunCatalogOps.ts +174 -0
  767. package/src/internal/RunCoordinator.ts +215 -0
  768. package/src/internal/RunDriver.ts +3154 -0
  769. package/src/internal/RunLifecycle.ts +53 -0
  770. package/src/internal/RunListing.ts +210 -0
  771. package/src/internal/RunListingError.ts +37 -0
  772. package/src/internal/RuntimeGraph.ts +253 -0
  773. package/src/internal/SandboxedExecution.ts +165 -0
  774. package/src/internal/StateTransaction.ts +71 -0
  775. package/src/internal/StepFacts.ts +36 -0
  776. package/src/internal/TypedEvents.ts +29 -0
  777. package/src/migrations/0001_initial.ts +51 -0
  778. package/src/migrations/0002_selection_store.ts +38 -0
  779. package/src/migrations/0003_plan_inputs.ts +75 -0
  780. package/src/migrations/0004_plan_environment.ts +34 -0
  781. package/src/migrations/0005_plan_merges.ts +60 -0
  782. package/src/migrations/0006_execution_listing.ts +86 -0
  783. package/src/migrations/0007_run_parent_sequence.ts +19 -0
  784. package/src/migrations/0008_deferred_consumption.ts +27 -0
  785. package/src/migrations/0009_deferred_clock_facts.ts +163 -0
  786. package/src/migrations/0010_pending_cancellation.ts +20 -0
  787. package/src/test/TestStores.ts +145 -0
@@ -0,0 +1,398 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var EngineStore_exports = {};
30
+ __export(EngineStore_exports, {
31
+ layer: () => layer,
32
+ layerWithPrivilegedJj: () => layerWithPrivilegedJj,
33
+ make: () => make
34
+ });
35
+ module.exports = __toCommonJS(EngineStore_exports);
36
+ var CapabilitySet = __toESM(require("@smthrs/capability/CapabilitySet"), 1);
37
+ var import_crypto = require("@smthrs/crypto");
38
+ var import_engine = require("@smthrs/engine");
39
+ var import_flow = require("@smthrs/flow");
40
+ var import_FileBoundary = require("@smthrs/flow/FileBoundary");
41
+ var import_journal = require("@smthrs/journal");
42
+ var import_kernel = require("@smthrs/kernel");
43
+ var import_run_store = require("@smthrs/run-store");
44
+ var import_step_cache = require("@smthrs/step-cache");
45
+ var Deferred = __toESM(require("effect/Deferred"), 1);
46
+ var Effect = __toESM(require("effect/Effect"), 1);
47
+ var Layer = __toESM(require("effect/Layer"), 1);
48
+ var Option = __toESM(require("effect/Option"), 1);
49
+ var Schema = __toESM(require("effect/Schema"), 1);
50
+ var DurableEngineState = __toESM(require("./DurableEngineState.js"), 1);
51
+ var ActionPersistence = __toESM(require("./internal/ActionPersistence.js"), 1);
52
+ var AttemptAdmission = __toESM(require("./internal/AttemptAdmission.js"), 1);
53
+ var AttemptProbe = __toESM(require("./internal/AttemptProbe.js"), 1);
54
+ var CacheAgeVerdicts = __toESM(require("./internal/CacheAgeVerdicts.js"), 1);
55
+ var DeferredPersistence = __toESM(require("./internal/DeferredPersistence.js"), 1);
56
+ var EngineJj = __toESM(require("./internal/EngineJj.js"), 1);
57
+ var NodeJournal = __toESM(require("./internal/NodeJournal.js"), 1);
58
+ var RunDriver = __toESM(require("./internal/RunDriver.js"), 1);
59
+ var OwnerIdentity = __toESM(require("./OwnerIdentity.js"), 1);
60
+ var ReplayOnly = __toESM(require("./ReplayOnly.js"), 1);
61
+ var import_RunState = require("./RunState.js");
62
+ var StepBoundary = __toESM(require("./StepBoundary.js"), 1);
63
+ var StepSandbox = __toESM(require("./StepSandbox.js"), 1);
64
+ var WakeBus = __toESM(require("./WakeBus.js"), 1);
65
+ var WorkspaceSandbox = __toESM(require("./WorkspaceSandbox.js"), 1);
66
+ const isBoundaryMetadata = Schema.is(import_FileBoundary.FileBoundary);
67
+ const makeWithEngineJj = (options) => Effect.gen(function* () {
68
+ const host = yield* CapabilitySet.current;
69
+ const ownerIdentity = yield* OwnerIdentity.OwnerIdentity;
70
+ const owner = yield* ownerIdentity.ownerId(options.owner.hostId);
71
+ const admission = AttemptAdmission.makeUnsafe();
72
+ const ageVerdicts = /* @__PURE__ */ new WeakMap();
73
+ const attemptStore = yield* import_run_store.AttemptStore.AttemptStore;
74
+ const cacheStore = yield* import_step_cache.CacheStore.CacheStore;
75
+ const journal = yield* import_journal.Journal.Journal;
76
+ const declarationRoot = NodeJournal.hostRoot(options.declarationRoot);
77
+ const declaredRevision = options.sourceRevision;
78
+ const sourceRevision = () => {
79
+ const answer = typeof declaredRevision === "function" ? declaredRevision() : declaredRevision;
80
+ return typeof answer === "string" && answer.length > 0 ? answer : void 0;
81
+ };
82
+ const actionJj = yield* import_kernel.Jj.Jj;
83
+ const engineJj = yield* EngineJj.EngineJj;
84
+ const runStore = yield* import_run_store.RunStore.RunStore;
85
+ const forkOrigins = /* @__PURE__ */ new WeakMap();
86
+ const keyOrigins = Effect.fnUntraced(function* (instance) {
87
+ const cached = forkOrigins.get(instance);
88
+ if (cached !== void 0) return cached;
89
+ const row = yield* runStore.get(instance.executionId).pipe(Effect.orDie);
90
+ const state = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(import_RunState.RunState))(row.stateJson).pipe(Effect.orDie);
91
+ const origins = state.forkKeyRunIds ?? [];
92
+ forkOrigins.set(instance, origins);
93
+ return origins;
94
+ });
95
+ const stepBoundary = yield* StepBoundary.StepBoundary;
96
+ const workspaceSandbox = yield* Effect.serviceOption(WorkspaceSandbox.WorkspaceSandbox);
97
+ const stepSandbox = yield* Effect.serviceOption(StepSandbox.StepSandbox);
98
+ const effectDispatcher = yield* Effect.serviceOption(WorkspaceSandbox.EffectDispatcher);
99
+ const replayOnly = Option.getOrUndefined(yield* Effect.serviceOption(ReplayOnly.ReplayOnly));
100
+ const engineState = yield* DurableEngineState.DurableEngineState;
101
+ const attemptSurvivors = engineState.attemptSurvivors;
102
+ const providedWakeBus = yield* Effect.serviceOption(WakeBus.WakeBus);
103
+ const wakeBus = Option.getOrElse(providedWakeBus, WakeBus.makeUnsafe);
104
+ const engine = yield* Deferred.make();
105
+ const driver = yield* RunDriver.make({
106
+ owner,
107
+ journalSource: options.journalSource,
108
+ isAlive: options.isAlive,
109
+ canExecute: options.canExecute,
110
+ canActivate: options.canActivate,
111
+ requestResume: options.requestResume,
112
+ engine: Deferred.await(engine),
113
+ wakeBus
114
+ });
115
+ const deferred = yield* DeferredPersistence.make({
116
+ owner,
117
+ journalSource: options.journalSource,
118
+ scheduleResume: (flowName, executionId, reason, sourceId) => driver.scheduleResume(flowName, executionId, reason, sourceId),
119
+ fireRetryPolicy: options.clockFireRetryPolicy
120
+ });
121
+ const actionExecute = Effect.fn("FlowEngine.actionExecute")(function* (input) {
122
+ const parent = yield* import_flow.FlowRuntime.FlowInstance;
123
+ let cacheAgeVerdict = ageVerdicts.get(parent);
124
+ if (cacheAgeVerdict === void 0) {
125
+ cacheAgeVerdict = CacheAgeVerdicts.make(parent.executionId);
126
+ ageVerdicts.set(parent, cacheAgeVerdict);
127
+ }
128
+ yield* Effect.annotateCurrentSpan({
129
+ runId: parent.executionId,
130
+ action: input.action.name,
131
+ // `stepKey`, never `key`. `@smthrs/journal`'s redaction replaces the
132
+ // value of any field whose name is a standalone trailing `key` word,
133
+ // and `RedactedLogger` applies that rule to every log line this
134
+ // package emits under a real host. A field named `key` reached the
135
+ // operator as `[REDACTED]`, destroying the one field that says which
136
+ // dispatch the line describes. The span carries the same name so the
137
+ // trace and the log agree.
138
+ stepKey: input.key,
139
+ attempt: input.attempt,
140
+ tier: input.tier
141
+ });
142
+ const instance = import_engine.FlowEngine.makeInstance(
143
+ parent.flow,
144
+ parent.executionId
145
+ );
146
+ ageVerdicts.set(instance, cacheAgeVerdict);
147
+ const flowEngine = yield* Deferred.await(engine);
148
+ instance.interrupted = parent.interrupted;
149
+ const waitingBefore = parent.waiting;
150
+ instance.waiting = waitingBefore;
151
+ const logContext = {
152
+ runId: parent.executionId,
153
+ action: input.action.name,
154
+ stepKey: input.key,
155
+ attempt: input.attempt,
156
+ tier: input.tier
157
+ };
158
+ yield* Effect.logTrace("action dispatch started", logContext);
159
+ const snapshot = input.snapshot === void 0 ? void 0 : Effect.provideContext(input.snapshot, yield* Effect.context());
160
+ const result = yield* ActionPersistence.make({
161
+ runId: parent.executionId,
162
+ owner,
163
+ sourceId: options.journalSource,
164
+ engineJj,
165
+ execute: (actionInput) => actionInput.action.executeEncoded,
166
+ idempotencyKey: input.action.idempotencyKey === void 0 ? void 0 : input.key,
167
+ admission,
168
+ cacheAgeVerdict,
169
+ replayOnly
170
+ })({
171
+ action: input.action,
172
+ attempt: input.attempt,
173
+ key: input.key,
174
+ tier: input.tier,
175
+ ...input.nondeterministic === void 0 ? {} : { nondeterministic: input.nondeterministic },
176
+ ...isBoundaryMetadata(input.metadata) ? { metadata: input.metadata } : {},
177
+ ...snapshot === void 0 ? {} : { snapshot }
178
+ }).pipe(
179
+ // This is an engine safety refusal, not a failure declared by the
180
+ // action. Keep it on the defect channel like the numbered-retry
181
+ // guard in FlowEngine, before the action's error codec can mask it.
182
+ Effect.catchIf(
183
+ (cause) => cause instanceof import_flow.Action.IrreversibleRetryRequiresIdempotencyKey,
184
+ // Encode the tagged fields before the generic defect codec reduces
185
+ // an Error instance to just its name and message.
186
+ (cause) => Effect.die(Schema.encodeSync(import_flow.Action.IrreversibleRetryRequiresIdempotencyKey)(cause))
187
+ ),
188
+ import_flow.Flow.intoResult,
189
+ Effect.provideService(import_flow.FlowRuntime.FlowInstance, instance),
190
+ Effect.provideService(
191
+ import_flow.FlowRuntime.FlowRuntime,
192
+ flowEngine
193
+ ),
194
+ Effect.provideService(import_run_store.AttemptStore.AttemptStore, attemptStore),
195
+ Effect.provideService(import_step_cache.CacheStore.CacheStore, cacheStore),
196
+ Effect.provideService(import_journal.Journal.Journal, journal),
197
+ Effect.provideService(import_kernel.Jj.Jj, actionJj),
198
+ Effect.provideService(import_run_store.RunStore.RunStore, runStore),
199
+ Effect.provideService(StepBoundary.StepBoundary, stepBoundary),
200
+ (dispatch) => Option.isNone(stepSandbox) ? dispatch : Effect.provideService(dispatch, StepSandbox.StepSandbox, stepSandbox.value),
201
+ (dispatch) => Option.isNone(workspaceSandbox) ? dispatch : Effect.provideService(dispatch, WorkspaceSandbox.WorkspaceSandbox, workspaceSandbox.value),
202
+ (dispatch) => Option.isNone(effectDispatcher) ? dispatch : Effect.provideService(dispatch, WorkspaceSandbox.EffectDispatcher, effectDispatcher.value),
203
+ Effect.ensuring(Effect.sync(() => {
204
+ if (parent.waiting === waitingBefore) parent.waiting = instance.waiting;
205
+ }))
206
+ );
207
+ const outcome = result._tag === "Complete" ? result.exit._tag === "Success" ? "success" : "failure" : result._tag.toLowerCase();
208
+ yield* Effect.annotateCurrentSpan({ outcome });
209
+ yield* Effect.logTrace("action dispatch settled", { ...logContext, outcome });
210
+ return result;
211
+ });
212
+ const encoded = {
213
+ // Unspanned here: `driver.register` already opens the
214
+ // `FlowEngine.register` span, and a second identical wrapper would nest
215
+ // two same-name spans around one operation.
216
+ register: (flow, execute) => driver.register(flow, execute).pipe(
217
+ Effect.tap(() => deferred.sweepDue(flow._tag))
218
+ ),
219
+ execute: driver.execute,
220
+ poll: driver.poll,
221
+ interrupt: driver.interrupt,
222
+ // The driver's refusal, forwarded rather than re-implemented: the
223
+ // durable engine has one cancellation path, so `interruptUnsafe` fails
224
+ // with `unsafe_interrupt_unsupported` here too (the release policy).
225
+ interruptUnsafe: driver.interruptUnsafe,
226
+ resume: driver.resume,
227
+ actionExecute,
228
+ /**
229
+ * The graph a walk drove, and how each of its nodes settled.
230
+ *
231
+ * Addressed by the record's own `sourceId` rather than a minted one, so
232
+ * a resumed walk writes the identities the first walk used and the
233
+ * journal's `(run, source, sequence)` uniqueness holds one row per node
234
+ * instead of one per observation. A `Duplicate` receipt is that
235
+ * collapse happening, and it is the expected answer on a resume.
236
+ *
237
+ * On the durable, owner-fenced channel, like every other engine record:
238
+ * a writer that lost the run self-interrupts rather than narrating a
239
+ * walk it no longer owns.
240
+ */
241
+ nodeRecordBytes: (record) => Effect.map(import_flow.FlowRuntime.FlowInstance, (parent) => NodeJournal.encodedBytes({
242
+ runId: parent.executionId,
243
+ sourceId: options.journalSource,
244
+ lineageId: import_engine.FlowEngine.Lineage.root(parent.executionId),
245
+ root: declarationRoot,
246
+ sourceRevision: sourceRevision()
247
+ }, record)),
248
+ recordNode: (record) => Effect.flatMap(import_flow.FlowRuntime.FlowInstance, (parent) => journal.emitDurable(
249
+ NodeJournal.entry({
250
+ runId: parent.executionId,
251
+ sourceId: options.journalSource,
252
+ lineageId: import_engine.FlowEngine.Lineage.root(parent.executionId),
253
+ root: declarationRoot,
254
+ sourceRevision: sourceRevision()
255
+ }, record),
256
+ owner
257
+ ).pipe(
258
+ Effect.catch((error) => error.code === "fence_lost" ? Effect.interrupt : Effect.die(error)),
259
+ Effect.asVoid
260
+ )),
261
+ actionReplayKey: Effect.fnUntraced(function* (derive) {
262
+ const instance = yield* import_flow.FlowRuntime.FlowInstance;
263
+ const origins = yield* keyOrigins(instance);
264
+ if (origins.length === 0) return yield* derive(instance.executionId, false);
265
+ const probed = /* @__PURE__ */ new Set();
266
+ for (const runId of [instance.executionId, ...origins]) {
267
+ for (const runScoped of [true, false]) {
268
+ const key = yield* derive(runId, runScoped);
269
+ if (probed.has(key)) continue;
270
+ probed.add(key);
271
+ const digest = yield* Schema.decodeUnknownEffect(import_crypto.Sha256)(key).pipe(Effect.orDie);
272
+ const found = yield* AttemptProbe.probeAttempts(
273
+ attemptStore,
274
+ attemptSurvivors,
275
+ instance.executionId,
276
+ digest
277
+ );
278
+ if (Option.isSome(found)) return key;
279
+ }
280
+ }
281
+ return yield* derive(instance.executionId, true);
282
+ }),
283
+ // The durable schedule-to-close origin (issue #45): the first
284
+ // attempt's persisted `startedAtMs` for the action key. It lives in
285
+ // the same `flows_attempts` rows that already restore the attempt
286
+ // sequence across park/resume and process death, so the engine's
287
+ // `expirationMs` budget is measured from the true first attempt
288
+ // instead of restarting on every process.
289
+ actionRetryOrigin: Effect.fnUntraced(function* (input) {
290
+ const parent = yield* import_flow.FlowRuntime.FlowInstance;
291
+ const survivors = yield* AttemptProbe.probeAttempts(
292
+ attemptStore,
293
+ attemptSurvivors,
294
+ parent.executionId,
295
+ yield* Schema.decodeUnknownEffect(import_crypto.Sha256)(input.key).pipe(Effect.orDie)
296
+ );
297
+ return Option.map(survivors, ({ earliestStartedAtMs }) => earliestStartedAtMs);
298
+ }),
299
+ // The durable attempt counter (issue #59): the highest contiguous
300
+ // persisted attempt for the key, so a resumed run replays failed
301
+ // attempts under their original numbers instead of restarting at 1 —
302
+ // the persisted failure is rethrown by `ActionPersistence`, the
303
+ // retry decision sees the true attempt count, and the backoff ladder
304
+ // is not re-slept.
305
+ actionLatestAttempt: Effect.fnUntraced(function* (input) {
306
+ const parent = yield* import_flow.FlowRuntime.FlowInstance;
307
+ const survivors = yield* AttemptProbe.probeAttempts(
308
+ attemptStore,
309
+ attemptSurvivors,
310
+ parent.executionId,
311
+ yield* Schema.decodeUnknownEffect(import_crypto.Sha256)(input.key).pipe(Effect.orDie)
312
+ );
313
+ return Option.map(survivors, ({ latest }) => latest);
314
+ }),
315
+ // The durable restore-before-retry handle (issue #1805): the earliest
316
+ // boundary snapshot persisted in the key's surviving attempt rows, so a
317
+ // restarted process restores the original pre-image before a retry.
318
+ actionSnapshot: Effect.fnUntraced(function* (input) {
319
+ const parent = yield* import_flow.FlowRuntime.FlowInstance;
320
+ const stepKeyDigest = yield* Schema.decodeUnknownEffect(import_crypto.Sha256)(input.key).pipe(Effect.orDie);
321
+ const survivors = yield* AttemptProbe.probeAttempts(
322
+ attemptStore,
323
+ attemptSurvivors,
324
+ parent.executionId,
325
+ stepKeyDigest
326
+ );
327
+ if (Option.isNone(survivors)) return Option.none();
328
+ return yield* ActionPersistence.earliestBoundarySnapshot(attemptStore, parent.executionId, stepKeyDigest, {
329
+ earliest: survivors.value.earliestAttempt,
330
+ latest: survivors.value.latest
331
+ });
332
+ }),
333
+ deferredResult: deferred.deferredResult,
334
+ deferredDone: deferred.deferredDone,
335
+ deferredDoneIfWaiting: deferred.deferredDoneIfWaiting,
336
+ scheduleClock: deferred.scheduleClock,
337
+ // The engine races this against its suspension backoff sleep, so an
338
+ // IN-PROCESS wake — deferred completed, clock fired, operator resume,
339
+ // run settled — resumes the waiting caller immediately, with the
340
+ // polling schedule as the bounded fallback. The bus is edge-triggered
341
+ // and miss-tolerant (`WakeBus.ts`); a wake published before the caller
342
+ // re-subscribes only costs one poll interval. Cross-process wakes ride
343
+ // the polling schedule and the heartbeat sweeps: the bus is in-process,
344
+ // and the journal offers no committed cross-process subscription.
345
+ resumeSignal: (_flow, executionId) => wakeBus.awaitWake(executionId)
346
+ };
347
+ const service = {
348
+ ...import_engine.FlowEngine.bindHostCeiling(host, import_engine.FlowEngine.makeUnsafe(encoded)),
349
+ durability: "durable"
350
+ };
351
+ yield* Deferred.succeed(engine, service);
352
+ return service;
353
+ });
354
+ const make = (options) => Effect.gen(function* () {
355
+ const jj = yield* import_kernel.Jj.Jj;
356
+ return yield* makeWithEngineJj(options).pipe(
357
+ Effect.provideService(EngineJj.EngineJj, jj)
358
+ );
359
+ });
360
+ const layerBase = (options) => {
361
+ const snapshotBoundary = Layer.effect(
362
+ import_engine.FlowEngine.SnapshotBoundary,
363
+ Effect.map(EngineJj.EngineJj, (jj) => import_engine.FlowEngine.SnapshotBoundary.of({
364
+ snapshot: Effect.fn("SnapshotBoundary.snapshot")(
365
+ ({ key, attempt }) => Effect.annotateCurrentSpan({ stepKey: key, attempt }).pipe(
366
+ Effect.andThen(jj.snapshot(`smithers action ${key} attempt ${attempt}`)),
367
+ Effect.orDie,
368
+ // The commit id, never the change id: an agent's `jj squash` in the
369
+ // step rewrites the change, and a change id would then name the
370
+ // step's edits instead of the pre-image.
371
+ Effect.map((snapshot) => snapshot.commitId)
372
+ )
373
+ ),
374
+ restore: Effect.fn("SnapshotBoundary.restore")(
375
+ (snapshot) => Effect.annotateCurrentSpan({ snapshot: String(snapshot) }).pipe(
376
+ Effect.andThen(jj.restore(snapshot)),
377
+ Effect.orDie
378
+ )
379
+ ),
380
+ diff: Effect.fn("SnapshotBoundary.diff")(
381
+ (snapshot, { key, attempt }) => Effect.annotateCurrentSpan({ stepKey: key, attempt }).pipe(
382
+ Effect.andThen(jj.snapshot(`smithers action ${key} attempt ${attempt} settled`)),
383
+ Effect.orDie,
384
+ Effect.flatMap((current) => jj.diff(snapshot, current.commitId).pipe(Effect.orDie))
385
+ )
386
+ )
387
+ }))
388
+ );
389
+ return Layer.merge(
390
+ Layer.effect(import_flow.FlowRuntime.FlowRuntime, makeWithEngineJj(options)),
391
+ snapshotBoundary
392
+ );
393
+ };
394
+ const layer = (options) => layerBase(options).pipe(Layer.provide(EngineJj.layerFromJj));
395
+ const layerWithPrivilegedJj = (options, privilegedJj) => layerBase(options).pipe(
396
+ Layer.provide(EngineJj.layerFromJj.pipe(Layer.provide(privilegedJj)))
397
+ );
398
+ //# sourceMappingURL=EngineStore.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/EngineStore.ts"],
4
+ "sourcesContent": ["/**\n * Durable `FlowEngine.Encoded` composition over `@smthrs/journal`.\n *\n * Governing designs: `docs/concepts/ownership-and-fencing.md`,\n * `docs/concepts/attempts-and-replay.md`, and\n * `packages/smithers/flows/flow/docs/concepts/flows-and-actions.md`.\n *\n * @since 0.1.0\n */\n\nimport * as CapabilitySet from \"@smthrs/capability/CapabilitySet\"\nimport { Sha256 } from \"@smthrs/crypto\"\nimport type { DurableWriter } from \"@smthrs/database/DurableWriter\"\nimport { FlowEngine } from \"@smthrs/engine\"\nimport { Action, Flow, FlowRuntime } from \"@smthrs/flow\"\nimport { FileBoundary } from \"@smthrs/flow/FileBoundary\"\nimport { Journal } from \"@smthrs/journal\"\nimport { Jj } from \"@smthrs/kernel\"\nimport { AttemptStore, RunStore } from \"@smthrs/run-store\"\nimport type { Ownership } from \"@smthrs/run-store\"\nimport { CacheStore } from \"@smthrs/step-cache\"\nimport type * as Crypto from \"effect/Crypto\"\nimport * as Deferred from \"effect/Deferred\"\nimport * as Effect from \"effect/Effect\"\nimport * as Layer from \"effect/Layer\"\nimport * as Option from \"effect/Option\"\nimport type * as Schedule from \"effect/Schedule\"\nimport * as Schema from \"effect/Schema\"\nimport type * as Scope from \"effect/Scope\"\nimport * as DurableEngineState from \"./DurableEngineState.ts\"\nimport * as ActionPersistence from \"./internal/ActionPersistence.ts\"\nimport * as AttemptAdmission from \"./internal/AttemptAdmission.ts\"\nimport * as AttemptProbe from \"./internal/AttemptProbe.ts\"\nimport * as CacheAgeVerdicts from \"./internal/CacheAgeVerdicts.ts\"\nimport * as DeferredPersistence from \"./internal/DeferredPersistence.ts\"\nimport * as EngineJj from \"./internal/EngineJj.ts\"\nimport * as NodeJournal from \"./internal/NodeJournal.ts\"\nimport * as RunDriver from \"./internal/RunDriver.ts\"\nimport * as OwnerIdentity from \"./OwnerIdentity.ts\"\nimport * as ReplayOnly from \"./ReplayOnly.ts\"\nimport { RunState } from \"./RunState.ts\"\nimport * as StepBoundary from \"./StepBoundary.ts\"\nimport * as StepSandbox from \"./StepSandbox.ts\"\nimport * as WakeBus from \"./WakeBus.ts\"\nimport * as WorkspaceSandbox from \"./WorkspaceSandbox.ts\"\n\n/**\n * Why the engine itself asked a parked execution to resume, as reported to\n * {@link Options.requestResume}.\n *\n * @since 1.0.0-rc.0\n * @category models\n */\nexport type RequestedResumeReason = RunDriver.RequestedResumeReason\n\n/**\n * Engine-store construction options.\n *\n * @since 0.1.0\n * @category models\n */\nexport interface Options {\n readonly owner: {\n readonly hostId: string\n }\n readonly journalSource: string\n /**\n * The directory a declaration path is recorded relative to.\n *\n * A node record can carry where its action was declared, and the path the\n * runtime reports is absolute. A journal is read on machines that did not\n * write it, so the absolute form is at best noise and at worst an\n * operator's home directory published into a run's history: the writer\n * strips this prefix, and omits the path entirely when it cannot.\n *\n * Defaults to the process working directory where there is one. A host\n * without a filesystem identity \u2014 a worker, a browser \u2014 passes nothing and\n * records no declaration paths at all, which is the honest answer.\n */\n readonly declarationRoot?: string | undefined\n /**\n * The revision of the tree this host read its flows out of.\n *\n * A node record can carry where its action was declared, and a path with a\n * line does not say which bytes were at that line: the tree moves, and the\n * same path after an edit is a different file. A host that can name the\n * revision it loaded from declares it here, and every recorded graph page\n * carries it, so a reader can open that file AT that revision.\n *\n * Absent by default, which is the honest answer for a host served out of\n * no version control or one that cannot name a revision holding what it\n * loaded. A reader with nothing shows no code rather than code it cannot\n * bind (D-068).\n *\n * A host that only learns the answer AFTER this store is built declares a\n * reader instead of a string, and it is asked once per recorded page. The\n * native host is one: the modules whose sites these records carry are read\n * during registration, which runs after this layer, so the revision that\n * describes them is not known when the store is composed. An answer that\n * is not a non-empty string records nothing, exactly as `undefined` does.\n */\n readonly sourceRevision?: string | (() => string | undefined) | undefined\n /**\n * Liveness arbitration consulted before this store steals a run whose lease\n * has expired. Answering `true` refuses the takeover.\n *\n * Optional. The default is `Ownership.leaseLiveness(heartbeatStaleAfter)`:\n * the owner is alive while its persisted heartbeat is younger than the\n * staleness cutoff, and gone once it is not. That is the weakest honest\n * answer and the one every host can give, so a composition that supplies\n * nothing still reclaims the runs of an owner killed with SIGKILL \u2014 the\n * steal it admits carries `lease-expired` evidence, which the run store\n * verifies against the row in the same write.\n *\n * A deployment that can say more supplies its own check and refuses the\n * takeover for longer: `Ownership.sameHostIncarnation` is the guard a local\n * `process.kill(pid, 0)` probe applies before reading `owner.pid`.\n */\n readonly isAlive?: Ownership.LivenessCheck | undefined\n /** Host routing, checked before claiming a run (including automatic wakes). */\n readonly canExecute?: ((row: RunStore.RunRow) => Effect.Effect<boolean>) | undefined\n /**\n * Read-only host admission fence, rechecked in the native activation transaction.\n * Use captured native reads and synchronous local probes only; external I/O\n * and module loading belong in `canExecute`.\n */\n readonly canActivate?: ((row: RunStore.RunRow) => Effect.Effect<boolean>) | undefined\n /**\n * Records, for a host that keeps one, that this engine has asked a parked\n * execution to resume: a durable clock fired, a durable deferred completed,\n * or a child settled under a parent that parked on it.\n *\n * A host that refuses to re-enter a parked run nobody asked for \u2014 the\n * control plane's executor does \u2014 reads the record to tell those wakes from\n * its own heartbeat sweep. Without it a run that slept never settled.\n *\n * Optional; a composition with no such host leaves it undefined.\n *\n * @since 1.0.0-rc.0\n */\n readonly requestResume?:\n | ((executionId: string, reason: RequestedResumeReason) => Effect.Effect<void>)\n | undefined\n /**\n * Redispatch policy for a durable clock whose fire failed. Defaults to\n * {@link DeferredPersistence.defaultFireRetryPolicy} \u2014 exponential from\n * 100ms, capped at 30s, forever. Same shape as the engine's\n * `suspendedRetryPolicy` option: the built-in behavior is the default, and\n * a deployment that wants a different backoff supplies one here rather than\n * patching the store.\n */\n readonly clockFireRetryPolicy?: Schedule.Schedule<unknown, unknown> | undefined\n}\n\ntype PublicRequirements =\n | AttemptStore.AttemptStore\n | CacheStore.CacheStore\n // DECIDED (2026-08-11, pending review): hashing is a construction-time\n // requirement of this composition rather than a per-call one.\n // The run driver derives each trampoline round's execution id from\n // (lineage, ordinal) with the injected SHA-256, on the coordinator's own\n // fiber rather than a caller's, so hashing is a construction-time\n // requirement of the composition (`packages/smithers/flows/engine/docs/api.md`).\n | Crypto.Crypto\n | DurableEngineState.DurableEngineState\n | DurableWriter\n | Journal.Journal\n | Jj.Jj\n | OwnerIdentity.OwnerIdentity\n | RunStore.RunStore\n | Scope.Scope\n | StepBoundary.Service\n\ntype Requirements = PublicRequirements | EngineJj.EngineJj\n\nconst isBoundaryMetadata = Schema.is(FileBoundary)\n\n/**\n * Constructs the production encoded composition.\n *\n * Registrations and active fibers are scoped in memory. Run identity, encoded\n * payload, results, deferred completions, clocks, actions, and ownership\n * are persisted by the supplied layers. Supply the same DurableWriter used\n * by the journal and run store so cancellation can retain complete failures.\n * The capability ceiling current at construction is the engine's host\n * ceiling: every run it admits records it, and every join, poll, and resume\n * is compared under it, whichever context later calls the service.\n *\n * @since 0.1.0\n * @category constructors\n */\nconst makeWithEngineJj = (\n options: Options\n): Effect.Effect<FlowRuntime.FlowRuntime[\"Service\"], never, Requirements> =>\n Effect.gen(function*() {\n const host = yield* CapabilitySet.current\n const ownerIdentity = yield* OwnerIdentity.OwnerIdentity\n const owner = yield* ownerIdentity.ownerId(options.owner.hostId)\n // One admission mutex per incarnation, shared by every dispatch this\n // store drives: `ActionPersistence.make` runs per dispatch below, so a\n // per-make default would never contend and the same-key exclusion the\n // adoption evidence rests on (issues #102, #103) would silently vanish.\n const admission = AttemptAdmission.makeUnsafe()\n // Run instances own the projection's lifetime, including nested actions.\n // A resumed instance rebuilds it without retaining completed runs here.\n const ageVerdicts = new WeakMap<FlowRuntime.FlowInstance[\"Service\"], ReturnType<typeof CacheAgeVerdicts.make>>()\n const attemptStore = yield* AttemptStore.AttemptStore\n const cacheStore = yield* CacheStore.CacheStore\n const journal = yield* Journal.Journal\n const declarationRoot = NodeJournal.hostRoot(options.declarationRoot)\n /*\n * Stated by the host or not at all; nothing here derives a revision. A\n * reader is asked where the record is written rather than here, because a\n * host that learns its revision after this layer builds would otherwise\n * be captured before it knows the answer.\n */\n const declaredRevision = options.sourceRevision\n const sourceRevision = (): string | undefined => {\n const answer = typeof declaredRevision === \"function\" ? declaredRevision() : declaredRevision\n return typeof answer === \"string\" && answer.length > 0 ? answer : undefined\n }\n const actionJj = yield* Jj.Jj\n const engineJj = yield* EngineJj.EngineJj\n const runStore = yield* RunStore.RunStore\n const forkOrigins = new WeakMap<FlowRuntime.FlowInstance[\"Service\"], ReadonlyArray<string>>()\n const keyOrigins = Effect.fnUntraced(function*(instance: FlowRuntime.FlowInstance[\"Service\"]) {\n const cached = forkOrigins.get(instance)\n if (cached !== undefined) return cached\n const row = yield* runStore.get(instance.executionId).pipe(Effect.orDie)\n const state = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(RunState))(row.stateJson).pipe(Effect.orDie)\n const origins = state.forkKeyRunIds ?? []\n forkOrigins.set(instance, origins)\n return origins\n })\n const stepBoundary = yield* StepBoundary.StepBoundary\n /**\n * Both halves of the isolated-execution lane are OPTIONAL and resolved\n * here, at composition time, for the same reason every service above is:\n * `actionExecute` runs on the engine's fiber, which does not carry the\n * store's layer context, so anything the dispatch needs has to be captured\n * now and re-provided below. A composition without a sandbox keeps the\n * pre-existing behaviour \u2014 the body runs against the host directly \u2014 and\n * one without a dispatcher journals what a transaction queued without\n * sending it.\n */\n const workspaceSandbox = yield* Effect.serviceOption(WorkspaceSandbox.WorkspaceSandbox)\n const stepSandbox = yield* Effect.serviceOption(StepSandbox.StepSandbox)\n const effectDispatcher = yield* Effect.serviceOption(WorkspaceSandbox.EffectDispatcher)\n // Resolved at composition like the sandboxes: a verifier composes an\n // engine that replays and executes nothing (`ReplayOnly`).\n const replayOnly = Option.getOrUndefined(yield* Effect.serviceOption(ReplayOnly.ReplayOnly))\n const engineState = yield* DurableEngineState.DurableEngineState\n const attemptSurvivors = engineState.attemptSurvivors\n /**\n * Resolved like the sandbox lane above: OPTIONAL, at composition time. A\n * host that provides `WakeBus.layer` shares one bus between this engine\n * and its own wake sources; a composition given none builds a private\n * bus, which is complete for the in-process seam because every wake\n * source below (driver, deferred persistence) publishes through it.\n */\n const providedWakeBus = yield* Effect.serviceOption(WakeBus.WakeBus)\n const wakeBus = Option.getOrElse(providedWakeBus, WakeBus.makeUnsafe)\n\n const engine = yield* Deferred.make<FlowRuntime.FlowRuntime[\"Service\"]>()\n const driver = yield* RunDriver.make({\n owner,\n journalSource: options.journalSource,\n isAlive: options.isAlive,\n canExecute: options.canExecute,\n canActivate: options.canActivate,\n requestResume: options.requestResume,\n engine: Deferred.await(engine),\n wakeBus\n })\n const deferred = yield* DeferredPersistence.make({\n owner,\n journalSource: options.journalSource,\n scheduleResume: (flowName, executionId, reason, sourceId) =>\n driver.scheduleResume(flowName, executionId, reason, sourceId),\n fireRetryPolicy: options.clockFireRetryPolicy\n })\n\n const actionExecute = Effect.fn(\"FlowEngine.actionExecute\")(function*(input: FlowEngine.ActionExecuteOptions) {\n const parent = yield* FlowRuntime.FlowInstance\n let cacheAgeVerdict = ageVerdicts.get(parent)\n if (cacheAgeVerdict === undefined) {\n cacheAgeVerdict = CacheAgeVerdicts.make(parent.executionId)\n ageVerdicts.set(parent, cacheAgeVerdict)\n }\n yield* Effect.annotateCurrentSpan({\n runId: parent.executionId,\n action: input.action.name,\n // `stepKey`, never `key`. `@smthrs/journal`'s redaction replaces the\n // value of any field whose name is a standalone trailing `key` word,\n // and `RedactedLogger` applies that rule to every log line this\n // package emits under a real host. A field named `key` reached the\n // operator as `[REDACTED]`, destroying the one field that says which\n // dispatch the line describes. The span carries the same name so the\n // trace and the log agree.\n stepKey: input.key,\n attempt: input.attempt,\n tier: input.tier\n })\n const instance = FlowEngine.makeInstance(\n parent.flow,\n parent.executionId\n )\n ageVerdicts.set(instance, cacheAgeVerdict)\n const flowEngine = yield* Deferred.await(engine)\n instance.interrupted = parent.interrupted\n // DECIDED (2026-08-11, pending review): the waiting classification is\n // threaded through the dispatch's instance and back, because the dispatch\n // runs under an instance of its own while `annotateWaiting` is documented\n // to reach the parked row. An implementation that declares one \u2014 `Sleep`\n // under `timer`, `WaitFor` under `event` with its wake token \u2014 writes it\n // here, so without the thread-back `RunDriver` would park on the derived\n // default and an action's declaration would be inert. It is seeded as\n // well as copied back so a body that annotated before dispatching keeps\n // its own declaration, and so the consumption `deferredResult` performs\n // on a settled wait travels out the same way (issue #42).\n const waitingBefore = parent.waiting\n instance.waiting = waitingBefore\n const logContext = {\n runId: parent.executionId,\n action: input.action.name,\n stepKey: input.key,\n attempt: input.attempt,\n tier: input.tier\n }\n yield* Effect.logTrace(\"action dispatch started\", logContext)\n // The boundary preparation runs under the dispatching parent, not the\n // action's own instance, exactly as the engine would run it itself.\n const snapshot = input.snapshot === undefined\n ? undefined\n : Effect.provideContext(input.snapshot, yield* Effect.context<FlowRuntime.FlowInstance | Crypto.Crypto>())\n const result = yield* ActionPersistence.make({\n runId: parent.executionId,\n owner,\n sourceId: options.journalSource,\n engineJj,\n execute: (actionInput) => (actionInput.action as Action.Any).executeEncoded as Effect.Effect<unknown, unknown>,\n idempotencyKey: input.action.idempotencyKey === undefined\n ? undefined\n : input.key,\n admission,\n cacheAgeVerdict,\n replayOnly\n })({\n action: input.action,\n attempt: input.attempt,\n key: input.key,\n tier: input.tier,\n ...(input.nondeterministic === undefined ? {} : { nondeterministic: input.nondeterministic }),\n ...(isBoundaryMetadata(input.metadata)\n ? { metadata: input.metadata }\n : {}),\n ...(snapshot === undefined ? {} : { snapshot })\n }).pipe(\n // This is an engine safety refusal, not a failure declared by the\n // action. Keep it on the defect channel like the numbered-retry\n // guard in FlowEngine, before the action's error codec can mask it.\n Effect.catchIf(\n (cause): cause is Action.IrreversibleRetryRequiresIdempotencyKey =>\n cause instanceof Action.IrreversibleRetryRequiresIdempotencyKey,\n // Encode the tagged fields before the generic defect codec reduces\n // an Error instance to just its name and message.\n (cause) => Effect.die(Schema.encodeSync(Action.IrreversibleRetryRequiresIdempotencyKey)(cause))\n ),\n Flow.intoResult,\n Effect.provideService(FlowRuntime.FlowInstance, instance),\n Effect.provideService(\n FlowRuntime.FlowRuntime,\n flowEngine\n ),\n Effect.provideService(AttemptStore.AttemptStore, attemptStore),\n Effect.provideService(CacheStore.CacheStore, cacheStore),\n Effect.provideService(Journal.Journal, journal),\n Effect.provideService(Jj.Jj, actionJj),\n Effect.provideService(RunStore.RunStore, runStore),\n Effect.provideService(StepBoundary.StepBoundary, stepBoundary),\n (dispatch) =>\n Option.isNone(stepSandbox)\n ? dispatch\n : Effect.provideService(dispatch, StepSandbox.StepSandbox, stepSandbox.value),\n (dispatch) =>\n Option.isNone(workspaceSandbox)\n ? dispatch\n : Effect.provideService(dispatch, WorkspaceSandbox.WorkspaceSandbox, workspaceSandbox.value),\n (dispatch) =>\n Option.isNone(effectDispatcher)\n ? dispatch\n : Effect.provideService(dispatch, WorkspaceSandbox.EffectDispatcher, effectDispatcher.value),\n Effect.ensuring(Effect.sync(() => {\n if (parent.waiting === waitingBefore) parent.waiting = instance.waiting\n }))\n )\n const outcome = result._tag === \"Complete\"\n ? result.exit._tag === \"Success\" ? \"success\" : \"failure\"\n : result._tag.toLowerCase()\n yield* Effect.annotateCurrentSpan({ outcome })\n yield* Effect.logTrace(\"action dispatch settled\", { ...logContext, outcome })\n return result\n })\n\n const encoded: FlowEngine.Encoded = {\n // Unspanned here: `driver.register` already opens the\n // `FlowEngine.register` span, and a second identical wrapper would nest\n // two same-name spans around one operation.\n register: (flow, execute) =>\n driver.register(flow, execute).pipe(\n Effect.tap(() => deferred.sweepDue(flow._tag))\n ),\n execute: driver.execute,\n poll: driver.poll,\n interrupt: driver.interrupt,\n // The driver's refusal, forwarded rather than re-implemented: the\n // durable engine has one cancellation path, so `interruptUnsafe` fails\n // with `unsafe_interrupt_unsupported` here too (the release policy).\n interruptUnsafe: driver.interruptUnsafe,\n resume: driver.resume,\n actionExecute,\n /**\n * The graph a walk drove, and how each of its nodes settled.\n *\n * Addressed by the record's own `sourceId` rather than a minted one, so\n * a resumed walk writes the identities the first walk used and the\n * journal's `(run, source, sequence)` uniqueness holds one row per node\n * instead of one per observation. A `Duplicate` receipt is that\n * collapse happening, and it is the expected answer on a resume.\n *\n * On the durable, owner-fenced channel, like every other engine record:\n * a writer that lost the run self-interrupts rather than narrating a\n * walk it no longer owns.\n */\n nodeRecordBytes: (record) =>\n Effect.map(FlowRuntime.FlowInstance, (parent) =>\n NodeJournal.encodedBytes({\n runId: parent.executionId,\n sourceId: options.journalSource,\n lineageId: FlowEngine.Lineage.root(parent.executionId),\n root: declarationRoot,\n sourceRevision: sourceRevision()\n }, record)),\n recordNode: (record) =>\n Effect.flatMap(FlowRuntime.FlowInstance, (parent) =>\n journal.emitDurable(\n NodeJournal.entry({\n runId: parent.executionId,\n sourceId: options.journalSource,\n lineageId: FlowEngine.Lineage.root(parent.executionId),\n root: declarationRoot,\n sourceRevision: sourceRevision()\n }, record),\n owner\n ).pipe(\n Effect.catch((error) => error.code === \"fence_lost\" ? Effect.interrupt : Effect.die(error)),\n Effect.asVoid\n )),\n actionReplayKey: Effect.fnUntraced(function*(derive) {\n const instance = yield* FlowRuntime.FlowInstance\n const origins = yield* keyOrigins(instance)\n if (origins.length === 0) return yield* derive(instance.executionId, false)\n // Prefer this child's own work on resume, then only ancestor keys\n // backed by attempts copied into this child. Never read parent rows.\n const probed = new Set<string>()\n for (const runId of [instance.executionId, ...origins]) {\n for (const runScoped of [true, false]) {\n const key = yield* derive(runId, runScoped)\n if (probed.has(key)) continue\n probed.add(key)\n const digest = yield* Schema.decodeUnknownEffect(Sha256)(key).pipe(Effect.orDie)\n const found = yield* AttemptProbe.probeAttempts(\n attemptStore,\n attemptSurvivors,\n instance.executionId,\n digest\n )\n if (Option.isSome(found)) return key\n }\n }\n return yield* derive(instance.executionId, true)\n }),\n // The durable schedule-to-close origin (issue #45): the first\n // attempt's persisted `startedAtMs` for the action key. It lives in\n // the same `flows_attempts` rows that already restore the attempt\n // sequence across park/resume and process death, so the engine's\n // `expirationMs` budget is measured from the true first attempt\n // instead of restarting on every process.\n actionRetryOrigin: Effect.fnUntraced(function*(input: {\n readonly key: string\n }) {\n const parent = yield* FlowRuntime.FlowInstance\n const survivors = yield* AttemptProbe.probeAttempts(\n attemptStore,\n attemptSurvivors,\n parent.executionId,\n yield* Schema.decodeUnknownEffect(Sha256)(input.key).pipe(Effect.orDie)\n )\n return Option.map(survivors, ({ earliestStartedAtMs }) => earliestStartedAtMs)\n }),\n // The durable attempt counter (issue #59): the highest contiguous\n // persisted attempt for the key, so a resumed run replays failed\n // attempts under their original numbers instead of restarting at 1 \u2014\n // the persisted failure is rethrown by `ActionPersistence`, the\n // retry decision sees the true attempt count, and the backoff ladder\n // is not re-slept.\n actionLatestAttempt: Effect.fnUntraced(function*(input: {\n readonly key: string\n }) {\n const parent = yield* FlowRuntime.FlowInstance\n const survivors = yield* AttemptProbe.probeAttempts(\n attemptStore,\n attemptSurvivors,\n parent.executionId,\n yield* Schema.decodeUnknownEffect(Sha256)(input.key).pipe(Effect.orDie)\n )\n return Option.map(survivors, ({ latest }) => latest)\n }),\n // The durable restore-before-retry handle (issue #1805): the earliest\n // boundary snapshot persisted in the key's surviving attempt rows, so a\n // restarted process restores the original pre-image before a retry.\n actionSnapshot: Effect.fnUntraced(function*(input: {\n readonly key: string\n }) {\n const parent = yield* FlowRuntime.FlowInstance\n const stepKeyDigest = yield* Schema.decodeUnknownEffect(Sha256)(input.key).pipe(Effect.orDie)\n const survivors = yield* AttemptProbe.probeAttempts(\n attemptStore,\n attemptSurvivors,\n parent.executionId,\n stepKeyDigest\n )\n if (Option.isNone(survivors)) return Option.none()\n return yield* ActionPersistence.earliestBoundarySnapshot(attemptStore, parent.executionId, stepKeyDigest, {\n earliest: survivors.value.earliestAttempt,\n latest: survivors.value.latest\n })\n }),\n deferredResult: deferred.deferredResult,\n deferredDone: deferred.deferredDone,\n deferredDoneIfWaiting: deferred.deferredDoneIfWaiting,\n scheduleClock: deferred.scheduleClock,\n // The engine races this against its suspension backoff sleep, so an\n // IN-PROCESS wake \u2014 deferred completed, clock fired, operator resume,\n // run settled \u2014 resumes the waiting caller immediately, with the\n // polling schedule as the bounded fallback. The bus is edge-triggered\n // and miss-tolerant (`WakeBus.ts`); a wake published before the caller\n // re-subscribes only costs one poll interval. Cross-process wakes ride\n // the polling schedule and the heartbeat sweeps: the bus is in-process,\n // and the journal offers no committed cross-process subscription.\n resumeSignal: (_flow, executionId) => wakeBus.awaitWake(executionId)\n }\n const service = {\n ...FlowEngine.bindHostCeiling(host, FlowEngine.makeUnsafe(encoded)),\n durability: \"durable\" as const\n }\n yield* Deferred.succeed(engine, service)\n return service\n })\n\n/**\n * Constructs the production encoded composition using the ambient `Jj` for\n * both public action access and private engine bookkeeping.\n *\n * @since 0.1.0\n * @category constructors\n */\nexport const make = (\n options: Options\n): Effect.Effect<FlowRuntime.FlowRuntime[\"Service\"], never, PublicRequirements> =>\n Effect.gen(function*() {\n const jj = yield* Jj.Jj\n return yield* makeWithEngineJj(options).pipe(\n Effect.provideService(EngineJj.EngineJj, jj)\n )\n })\n\n/**\n * Provides the durable flow engine.\n *\n * @since 0.1.0\n * @category layers\n */\nconst layerBase = (\n options: Options\n): Layer.Layer<\n FlowEngine.SnapshotBoundary | FlowRuntime.FlowRuntime,\n never,\n Requirements\n> => {\n const snapshotBoundary = Layer.effect(\n FlowEngine.SnapshotBoundary,\n Effect.map(EngineJj.EngineJj, (jj) =>\n FlowEngine.SnapshotBoundary.of({\n snapshot: Effect.fn(\"SnapshotBoundary.snapshot\")(({ key, attempt }) =>\n Effect.annotateCurrentSpan({ stepKey: key, attempt }).pipe(\n Effect.andThen(jj.snapshot(`smithers action ${key} attempt ${attempt}`)),\n Effect.orDie,\n // The commit id, never the change id: an agent's `jj squash` in the\n // step rewrites the change, and a change id would then name the\n // step's edits instead of the pre-image.\n Effect.map((snapshot) => snapshot.commitId)\n )\n ),\n restore: Effect.fn(\"SnapshotBoundary.restore\")((snapshot) =>\n Effect.annotateCurrentSpan({ snapshot: String(snapshot) }).pipe(\n Effect.andThen(jj.restore(snapshot as never)),\n Effect.orDie\n )\n ),\n diff: Effect.fn(\"SnapshotBoundary.diff\")((snapshot, { key, attempt }) =>\n Effect.annotateCurrentSpan({ stepKey: key, attempt }).pipe(\n Effect.andThen(jj.snapshot(`smithers action ${key} attempt ${attempt} settled`)),\n Effect.orDie,\n Effect.flatMap((current) => jj.diff(snapshot as never, current.commitId).pipe(Effect.orDie))\n )\n )\n }))\n )\n return Layer.merge(\n Layer.effect(FlowRuntime.FlowRuntime, makeWithEngineJj(options)),\n snapshotBoundary\n )\n}\n\n/**\n * Provides the durable engine using the ambient `Jj` for both action and\n * engine contexts. Host compositions that guard action access should use\n * {@link layerWithPrivilegedJj} instead.\n *\n * @since 0.1.0\n * @category layers\n */\nexport const layer = (\n options: Options\n): Layer.Layer<FlowEngine.SnapshotBoundary | FlowRuntime.FlowRuntime, never, PublicRequirements> =>\n layerBase(options).pipe(Layer.provide(EngineJj.layerFromJj))\n\n/**\n * Provides the durable engine with a private repository implementation for\n * engine bookkeeping while retaining ambient `Jj` for action bodies.\n *\n * @since 1.0.0\n * @category layers\n */\nexport const layerWithPrivilegedJj = <E, R>(\n options: Options,\n privilegedJj: Layer.Layer<Jj.Jj, E, R>\n): Layer.Layer<\n FlowEngine.SnapshotBoundary | FlowRuntime.FlowRuntime,\n E,\n PublicRequirements | R\n> =>\n layerBase(options).pipe(\n Layer.provide(EngineJj.layerFromJj.pipe(Layer.provide(privilegedJj)))\n )\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,oBAA+B;AAC/B,oBAAuB;AAEvB,oBAA2B;AAC3B,kBAA0C;AAC1C,0BAA6B;AAC7B,qBAAwB;AACxB,oBAAmB;AACnB,uBAAuC;AAEvC,wBAA2B;AAE3B,eAA0B;AAC1B,aAAwB;AACxB,YAAuB;AACvB,aAAwB;AAExB,aAAwB;AAExB,yBAAoC;AACpC,wBAAmC;AACnC,uBAAkC;AAClC,mBAA8B;AAC9B,uBAAkC;AAClC,0BAAqC;AACrC,eAA0B;AAC1B,kBAA6B;AAC7B,gBAA2B;AAC3B,oBAA+B;AAC/B,iBAA4B;AAC5B,sBAAyB;AACzB,mBAA8B;AAC9B,kBAA6B;AAC7B,cAAyB;AACzB,uBAAkC;AAmIlC,MAAM,qBAAqB,OAAO,GAAG,gCAAY;AAgBjD,MAAM,mBAAmB,CACvB,YAEA,OAAO,IAAI,aAAY;AACrB,QAAM,OAAO,OAAO,cAAc;AAClC,QAAM,gBAAgB,OAAO,cAAc;AAC3C,QAAM,QAAQ,OAAO,cAAc,QAAQ,QAAQ,MAAM,MAAM;AAK/D,QAAM,YAAY,iBA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