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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +199 -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 +1584 -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 +298 -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 +3152 -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,175 @@
1
+ ---
2
+ title: "Durable waits"
3
+ description: "How a parked run survives a restart: durable deferreds and clocks, the waiting taxonomy, the sweeps that re-drive stranded runs, and the wake bus that makes the common case fast."
4
+ sidebar:
5
+ order: 5
6
+ ---
7
+
8
+ A flow that waits is the hard case for durability. The process holding the
9
+ timer can die, the completion can arrive while nothing is listening, and the run
10
+ can be left parked with no one scheduled to wake it. `DurableEngineState` is the
11
+ state that makes waiting survive all three.
12
+
13
+ ## Two durable primitives
14
+
15
+ A **deferred** is addressed by flow name, execution id, and deferred name. It is
16
+ completed once, first writer wins, and its `exit` is the value the resumed run
17
+ receives.
18
+
19
+ A **clock** is addressed the same way and carries an absolute `dueAtMs`.
20
+ Scheduling is first writer wins and fenced against the active run owner, so a
21
+ process that no longer owns a run cannot arm a timer against it.
22
+
23
+ Both report outcome unions rather than booleans, so a caller can tell a fresh
24
+ write from an idempotent repeat:
25
+
26
+ | Call | Outcomes |
27
+ | ------------------ | ---------------------------------------------- |
28
+ | `completeDeferred` | `Completed` or `Existing` |
29
+ | `scheduleClock` | `Scheduled` or `Existing` |
30
+ | `completeClock` | `Completed`, `AlreadyCompleted`, or `NotFound` |
31
+ | `park` | `Parked` or `NotFound` |
32
+ | `wake` | `Woken`, `NotWaiting`, or `NotFound` |
33
+
34
+ A successful mutation means the row is durable. Callers may therefore journal
35
+ and schedule a wake only after the mutation returns.
36
+
37
+ The additive [state event schemas](https://journal.smithers.sh/concepts/state-event-authority/)
38
+ describe execution, deferred and clock history with explicit lineage. Existing
39
+ writers retain their bytes and these stores remain authoritative. A retained
40
+ attempt-history projection cannot replace deferred, clock or ownership state.
41
+
42
+ ## The waiting taxonomy
43
+
44
+ A run that suspends parks first. The driver writes a `Waiting` payload with a
45
+ `reason`, an optional `wakeAt`, and an optional `token`:
46
+
47
+ - reason `timer`, with the earliest pending clock deadline as `wakeAt`, when a
48
+ durable clock is outstanding.
49
+ - reason `event` otherwise.
50
+ - reason `released` for a run interrupt-released by shutdown or a lapsed lease;
51
+ its `interrupt-released` decision records which as `cause`.
52
+ - reason `quarantine` for a run parked on corrupt attempt evidence.
53
+
54
+ Every resume clears the payload when the run re-enters `running`. Because the
55
+ driver populates the taxonomy on the execution path rather than only through the
56
+ store API, `waitingRuns` and the waiting-row partial index match real
57
+ suspensions.
58
+
59
+ `WaitingRunsFilter` narrows a sweep to actionable rows by `reason`,
60
+ `dueBeforeMs`, and a `cancelRequested` predicate over the run row, so a sweeper
61
+ fetches only what it can act on instead of scanning every parked run.
62
+
63
+ ## Three sweeps, on the heartbeat cadence
64
+
65
+ The driver re-drives three durable shapes periodically, and each one re-enters
66
+ the ordinary claim, steal, and activate path:
67
+
68
+ 1. Parked runs whose cancellation was durably requested.
69
+ 2. Runs parked with reason `released`, left by a shutdown that interrupted them.
70
+ 3. Stale `running` rows left by a hard-killed owner.
71
+ `staleRunningRuns(staleBeforeMs, limit?)` lists runs whose heartbeat froze
72
+ before the horizon, with that heartbeat, oldest first, so a capped sweep drains a mass
73
+ owner death across ticks rather than waking every stale run in every driver
74
+ on every tick.
75
+
76
+ Registration does its own recovery: `pendingClocks(scope)` re-arms outstanding
77
+ timers and `completedDeferreds(flowName)` recovers unconsumed completions. Both exclude rows
78
+ whose run has settled, so a restart arms timers for runs that can still make
79
+ progress and for no others. Before serving a persisted deferred result, the
80
+ engine marks it consumed. Later registration sweeps leave that completion out,
81
+ so a run parked on a subsequent approval, timer, or deferred stays parked. The
82
+ original result remains available for replay. Migration 0008 starts existing
83
+ completions as unconsumed, allowing recovery after an upgrade.
84
+
85
+ One corrupt row costs its own row and nothing else. Every list read
86
+ (`dueClocks`, `pendingClocks`, `completedDeferreds`, `waitingRuns`,
87
+ `runParents`, and `runChildren`) skips a row that will not decode and logs a
88
+ storage-integrity warning naming its primary key, so a single unreadable row
89
+ cannot stop a registration, a timer sweep, or a cancellation cascade. The point
90
+ reads `deferred`, `clock`, and `waiting` still fail on such a row: they answer a
91
+ question about one row, and reporting "no row" for a completion or deadline that
92
+ is durably recorded but unreadable would re-run work whose side effects already
93
+ ran.
94
+
95
+ A wake for a flow the sweeping process has not registered is not dropped
96
+ silently. The driver logs a once-per-run structured warning naming the run id
97
+ and the flow, and leaves the durable waiting row parked, so any process that
98
+ does register the flow still reclaims the run.
99
+
100
+ ## Cancellation is observed, not just recorded
101
+
102
+ While a run executes, the driver polls `cancel_requested_at_ms` on the heartbeat
103
+ cadence and cancels the run, interrupting the flow fiber, when another process
104
+ called `RunStore.requestCancel`. A terminal transition additionally asserts
105
+ `{ cancelRequested: "absent" }` inside the ownership compare-and-swap, so a
106
+ request that races past the last poll turns finalize into a cancellation rather
107
+ than a `completed` or `failed` write.
108
+
109
+ `completeRunClocks(executionId, completedAtMs)` closes every uncompleted clock
110
+ row of one run in a single statement, inside the terminal transaction. A run
111
+ that settled has no future, so a timer firing against it could only schedule a
112
+ resume nothing will drive.
113
+
114
+ ## Retrying a clock that failed to fire
115
+
116
+ A durable clock whose fire fails transiently is redispatched with capped
117
+ exponential backoff rather than being lost until process restart. The policy is
118
+ `EngineStore.Options.clockFireRetryPolicy`, defaulting to exponential from 100ms
119
+ capped at 30s, forever. It is the same option shape as the engine's
120
+ `suspendedRetryPolicy`: the built-in behavior is the default, and a deployment
121
+ that wants a different backoff supplies one rather than patching the store.
122
+
123
+ ## The wake bus makes the common case fast
124
+
125
+ Polling is correct and slow. `WakeBus` is an in-process, edge-triggered bus:
126
+ `wake(executionId)` resumes every waiter parked on that execution, `awaitWake`
127
+ parks until the next one, and `waiters` reports the current count for tests and
128
+ diagnostics.
129
+
130
+ Nothing about it is durable, and that is the design. A wake with no waiters is
131
+ dropped, and the polling fallback covers the run. Registration is removed when
132
+ a waiting fiber is interrupted, including scope closure and losing a race
133
+ against the polling sleep, so an abandoned wait leaks nothing. Cross-process
134
+ delivery stays store-driven.
135
+
136
+ An engine composition resolves the bus optionally. Provide `WakeBus.layer` to
137
+ share one bus between the engine and your own wake sources; provide nothing and
138
+ the composition builds a private one. `WakeBus.layerNoop()` drops every wake,
139
+ which is what a test asserting the polling fallback provides.
140
+
141
+ ## The run DAG
142
+
143
+ `DurableEngineState` also owns the parent edges between runs, because a run
144
+ row's `state_json` carries only the first creating parent and a diamond gives a
145
+ run a second one.
146
+
147
+ `recordRunParent(childId, parentId)` is first writer wins per pair, and the
148
+ cycle check runs inside the same write transaction as the insert: the edge is
149
+ inserted, the child's ancestor chain is walked over the durable edges, and on a
150
+ hit the transaction rolls back and the call fails with `RunParentCycleError`. A
151
+ rejected edge therefore leaves no durable trace, and of two concurrent writers
152
+ whose edges jointly close a cycle exactly one fails. The driver maps that error
153
+ to `FlowCycleDetected`.
154
+
155
+ `transaction(effect)` runs several store operations atomically. The driver wraps
156
+ the parent-edge record and the run-row creation it guards in one, so a crash
157
+ between them cannot leave a durable orphan edge for a run that was never
158
+ created. Serialized write transactions are a documented requirement of the
159
+ `DurableWriter.write` contract, not a SQLite artifact: a Postgres-backed
160
+ implementation must use `SERIALIZABLE`.
161
+
162
+ `runParents(childId)` and `runChildren(parentId)` list the edges oldest first.
163
+ The child direction is the only instance-independent way to find the runs a
164
+ cancelled parent linked to itself, so cancellation cascade reads it rather than
165
+ an in-process map. `removeRunParentsForRun(runId)` deletes every edge naming a
166
+ run as child or parent; an `AFTER DELETE` trigger on `flows_runs` prunes the
167
+ same edges in the same transaction, so a lane that never calls the hook still
168
+ cannot leave ghost edges.
169
+
170
+ ## Related
171
+
172
+ - [Coordinate two processes](../guides/coordinate-two-processes.md): sharing a
173
+ wake bus and following a workspace's runs.
174
+ - [Ownership and fencing](./ownership-and-fencing.md): why parking and clock
175
+ scheduling take an owner.
@@ -0,0 +1,90 @@
1
+ # Native lifecycle observations
2
+
3
+ The native driver records `executionFact: { version: 1, baseline, observation }`
4
+ in its authoritative `flows.engine.run-decision` and `flows.engine.interrupted`
5
+ records. This is a producer contract implemented by `RunDriver`, separate from
6
+ the generic `EngineEvent` schema vocabulary. Adding a schema alone does not
7
+ migrate a writer.
8
+
9
+ An observation contains the execution ID, flow name, lifecycle status, creation,
10
+ start and finish timestamps, effective parent, trampoline lineage and ordinal,
11
+ actual cancellation-request timestamp, and waiting reason/deadline/token digest.
12
+ Ownership, claims, heartbeats and cancellation acknowledger identity remain
13
+ operational store state; a heartbeat does not invalidate a semantic observation.
14
+ The existing encoded `state` on run decisions remains unchanged.
15
+
16
+ A wait's `tokenDigest` is SHA-256 of the exact opaque token, or null when absent.
17
+ The protected native waiting row remains execution authority for resolving the
18
+ wait. The event contains a comparison commitment, **not a replayable resolver
19
+ credential**. The journal redactor is not bypassed. Other application strings
20
+ that the redactor changes cannot establish exact replay equality and correctly
21
+ remain observations rather than verified event state.
22
+
23
+ ## Commit boundary
24
+
25
+ Creation, parent admission, activation, resume clearing, suspension, release,
26
+ handoff and terminal settlement capture their fact in the transaction that
27
+ changes the row. Parking and the guarded status CAS are one transaction. A lost
28
+ CAS rolls the park back, preserving an earlier committed waiting row. Resume
29
+ clears the waiting row before capturing the running fact and before executing
30
+ work. Engine-state is the outer transaction and the journal write transaction
31
+ is inside it, matching deferred completion's state-first lock order. The memory
32
+ state adapter holds its own gate: taking the journal writer first can deadlock against a
33
+ state-first fiber waiting for that writer. The memory state gate is released
34
+ at SQL commit before post-commit journal work; publication failures after
35
+ commit cannot undo either committed boundary.
36
+
37
+ Cancellation records the actual `cancel_requested_at_ms` only when a guarded
38
+ request changes a live row. Repeat requests, missing rows and terminal rows
39
+ invent no new intent. Lineage cancellation reads membership, updates live rounds
40
+ and records each changed round in one native transaction. Descendant and inherited
41
+ requests use the same producer. A completed predecessor does not acquire a fake
42
+ request timestamp just because its successor is cancelled.
43
+
44
+ The Node and Bun host capture the native journal, run store and engine state
45
+ before `AgentSession` selects the separate control journal. Its direct
46
+ cancellation callback executes in the captured host context, outside any caller's
47
+ control SQL transaction. The native commit precedes the control receipt; the two
48
+ databases are not one distributed transaction. A later control write failure
49
+ cannot undo already accepted native intent, which remains visible in the native
50
+ observation and copied facts. Low-level `RunStore` calls and standalone legacy
51
+ `AgentSession.requestCancel` do not promise this event contract.
52
+
53
+ ## Replay and migration
54
+
55
+ `ExecutionFact.fold` in `@smthrs/journal` is browser safe and pure. New creation
56
+ facts establish a `created` baseline. A first fact for an older row, an unknown
57
+ producer version, an explicit omission, or a generation boundary cannot invent
58
+ the missing prefix. A later complete fact establishes a `legacy` baseline.
59
+ If a low-level/corrupt row cannot encode a valid observation, the writer records
60
+ `{ version: 1, unavailable: "invalid-observation" }`. Existing invalid-round or
61
+ corruption handling can still settle the execution; this marker never creates
62
+ verified coverage and does not normalize malformed ancestry into invented facts.
63
+ The exposed sequence/generation range names the current round's native stream;
64
+ root and current are both compared, and either legacy baseline makes the logical
65
+ view's baseline legacy. Numeric sequence holes alone are not omissions: rolled-back SQL journal
66
+ reservations can leave them without losing a committed event.
67
+
68
+ The native supervisor authenticates a wrapper through its native flow, approved
69
+ plan and root ancestry, then the bridge writes a separate `control.engine.bound`
70
+ fact. It never binds a control run by trusting an input `runId` field. Existing
71
+ `control.engine.event` payloads and producer identities are unchanged. The bridge
72
+ walks both durable spawn edges and native trampoline membership; a handoff is not
73
+ a spawn edge. A legacy adapter without the lineage port cannot establish coverage
74
+ for a missing latest round.
75
+
76
+ Gateway run reads and subscriptions use the same control fold and native fold.
77
+ `lifecycleProvenance` continues to describe control replay and whether lifecycle
78
+ was engine observed. The additive `executionProvenance` separately identifies
79
+ native `events`, `legacy-observation` or `unverified-observation`. Native facts are
80
+ compared against a coherent observation of both the requested root and latest
81
+ round. The root retains ancestry and round identity; the current round supplies
82
+ status and waiting. A missing binding, gap, unsupported version or mismatch keeps
83
+ an honest observed fallback. Bridge lag is possible because this is a read-side
84
+ copy between databases, not a distributed snapshot.
85
+
86
+ This stream verifies the semantic run/approval view. It does not rebuild every
87
+ execution table: action outcomes, clocks, deferred values and resolver credentials
88
+ retain their existing native authorities. [Native call facts](./call-facts.md)
89
+ now use the owning action transaction and durable journal as their outbox.
90
+ Other agent trace records still use a best-effort channel.
@@ -0,0 +1,128 @@
1
+ ---
2
+ title: "Ownership and fencing"
3
+ description: "How one engine claims a run, how every durable write is fenced on an OwnerId, and how a run is reclaimed from an owner that stopped heartbeating."
4
+ sidebar:
5
+ order: 1
6
+ ---
7
+
8
+ Two processes can open the same database. Nothing in SQLite stops the second
9
+ one from driving a run the first one is already driving, and nothing in the
10
+ first one notices. Ownership is the answer: exactly one incarnation owns a run
11
+ at a time, every durable write it makes is conditioned on still being that
12
+ owner, and a run whose owner went away can be taken over on evidence rather
13
+ than on a guess.
14
+
15
+ ## The OwnerId
16
+
17
+ An `OwnerId` is a triple: the `hostId` the composition declares, a `pid`, and a
18
+ fresh `nonce`. `OwnerIdentity` mints it, once per incarnation:
19
+
20
+ ```ts
21
+ import { OwnerIdentity } from "@smthrs/engine-store"
22
+
23
+ const identity = OwnerIdentity.layer
24
+ ```
25
+
26
+ The default reads a process id off `globalThis` where the platform has one, and
27
+ draws an incarnation number from `Random` where it does not, so a browser tab
28
+ can mint a token even though it cannot execute durable flows. The nonce is a
29
+ UUIDv4 from the injected `Crypto` service. `layerConstant(owner)` pins the whole
30
+ token, which is what a test wants, and what a host that already holds a lease
31
+ from somewhere else wants.
32
+
33
+ The nonce is what makes the token an incarnation rather than a machine. A
34
+ process that restarts on the same host with the same pid mints a different
35
+ token, so its writes are correctly refused against runs the previous
36
+ incarnation still owns.
37
+
38
+ ## What fencing means in practice
39
+
40
+ The engine claims a run before driving it, and from then on every durable write
41
+ carries the owner:
42
+
43
+ - Run state transitions go through the run store, which asks the journal's
44
+ consensus strategy whether the owner still holds the run inside the same
45
+ write transaction. A stale owner gets `FenceLost`.
46
+ - Attempt lifecycle writes pass the owner to the journal, which fences the
47
+ append. A reclaimed owner fails with `fence_lost` and self-interrupts rather
48
+ than appending.
49
+ - `DurableEngineState.park` and `scheduleClock` take the owner, so a process
50
+ that no longer runs a run cannot park it or arm a timer against it.
51
+ - Terminal transitions additionally assert `{ cancelRequested: "absent" }`
52
+ inside the same compare-and-swap, so a cancellation that arrives after the
53
+ last poll turns finalize into a cancellation rather than a `completed` write.
54
+
55
+ The consequence is that a zombie process is harmless. It can hold a live fiber
56
+ and a live database handle, and every write it attempts against a reclaimed run
57
+ is refused by the row it is writing to.
58
+
59
+ ## The lease, and the evidence to break it
60
+
61
+ An owner heartbeats while it drives. `isAlive` on `EngineStore.Options` decides
62
+ whether a run whose lease has expired may be stolen; answering `true` refuses
63
+ the takeover.
64
+
65
+ The default is `Ownership.leaseLiveness(Ownership.heartbeatStaleAfter)`: the
66
+ owner counts as alive while its persisted `heartbeat_at_ms` is younger than the
67
+ staleness cutoff, and gone once it is not. That is the weakest honest answer,
68
+ and the only evidence every host has. It is also enough: a process killed with
69
+ SIGKILL stops heartbeating, so a fresh process reclaims its runs with no
70
+ application code at all.
71
+
72
+ A deployment that knows more supplies its own check and refuses the takeover
73
+ for longer. A `process.kill(pid, 0)` probe is one such check;
74
+ `Ownership.sameHostPidProbe` is the shipped version. Guard any pid read with
75
+ `Ownership.sameHostIncarnation`, because a pid names a process only inside its
76
+ own host's namespace. A supplied check receives the recorded owner and a
77
+ `LivenessContext` of `{ claimant, heartbeatAtMs, nowMs }`.
78
+
79
+ ## The journal says which answer was used
80
+
81
+ Every arbitration is recorded, so a takeover is auditable after the fact:
82
+
83
+ | Record | Meaning |
84
+ | ---------------------------------------------------------------------- | -------------------------------------------------------------- |
85
+ | `steal-refused-owner-alive` with `evidence: "lease-fresh"` | The lease was still inside the staleness window. |
86
+ | `steal-refused-owner-alive` with `evidence: "probe"` | The supplied `isAlive` check answered for the owner. |
87
+ | `stolen-and-activated` with `evidence: "lease-expired"` | The lease had expired and no check refused it. |
88
+ | `stolen-and-activated` with `evidence: "same-host-pid-dead"` | A same-host probe found the process gone. |
89
+ | `stolen-and-activated` with `evidence: "cross-host-unreachable-stale"` | The owner was on another host and unreachable past the window. |
90
+
91
+ A refusal is journaled once, not once per sweep tick. The record is addressed
92
+ by the run, the refused owner, the lease it was refused against, and the
93
+ evidence that refused it, and it carries source sequence 0, so the journal's
94
+ first-writer admission collapses every repeat about an unchanged lease into one
95
+ record. The evidence is part of the address because one lease can be refused
96
+ twice for different reasons: a wake arriving while the owner is still pulsing
97
+ is refused by the lease, and the same owner, alive but stalled past the window,
98
+ is refused by the probe. Both records stand.
99
+
100
+ ## Backoff, so arbitration keeps moving
101
+
102
+ The driver stops re-probing a run it was just refused. Each refusal defers that
103
+ run for two heartbeat ticks, doubling per consecutive refusal against the same
104
+ lease up to `heartbeatStaleAfter`. The stale-running sweep reads past exactly
105
+ the rows it is going to skip, so its batch of 64 keeps advancing. Without that,
106
+ the oldest stale rows sort first every second and a run behind them is never
107
+ arbitrated at all.
108
+
109
+ A deferral is forgotten as soon as its row leaves the stale window: the owner
110
+ resumed heartbeating, the run was stolen, or the run settled. A fresh stall
111
+ under a new lease is therefore probed on the first tick that sees it, rather
112
+ than waiting out a backoff it did not earn.
113
+
114
+ ## Restoring a backup resets the fence
115
+
116
+ A restored database still carries the owner tokens that were live when the
117
+ backup was taken. `DisasterRecovery.fence` clears every pending claim and
118
+ suspends every run that was `running`, in one serialized write transaction, so
119
+ a surviving pre-backup owner fails its compare-and-swap immediately and the
120
+ restored runs are claimable without waiting out the staleness cutoff. See
121
+ [Back up and restore the store](../guides/back-up-and-restore.md).
122
+
123
+ ## Related
124
+
125
+ - [Reclaim runs from a dead host](../guides/reclaim-runs-from-a-dead-host.md):
126
+ the task-shaped version of this page.
127
+ - [Attempts and replay](./attempts-and-replay.md): what a reclaiming process
128
+ does with the attempt rows the previous owner left behind.
@@ -0,0 +1,148 @@
1
+ ---
2
+ title: "Step boundaries"
3
+ description: "The declared read and write sets of a step, what prepare, settle, and replayOutputs each measure, and why only whole-tree evidence may enter the shared cache."
4
+ sidebar:
5
+ order: 3
6
+ ---
7
+
8
+ A step declares which files it reads and which it writes. `StepBoundary` is the
9
+ service that measures that declaration against reality: before the step runs,
10
+ after it runs, and again when a later replay has to reproduce its outputs on a
11
+ workspace that never executed anything.
12
+
13
+ The declaration itself is `FileBoundary`, from
14
+ [`@smthrs/flow`](/api/flow)'s `Action` namespace: a `readSet`, a `writeSet`,
15
+ optional `removes`, and a `boundaryMode` of `hard` or `expected`.
16
+
17
+ ## The three calls
18
+
19
+ ```ts
20
+ interface Service {
21
+ readonly prepare: (descriptor: FileBoundary) => Effect<PreparedBoundary, UnsupportedBoundary, Crypto>
22
+ readonly settle: (prepared: PreparedBoundary) => Effect<BoundaryEvidence, SettleError, Crypto>
23
+ readonly replayOutputs: (evidence: BoundaryEvidence) => Effect<void, ReplayError, Crypto>
24
+ }
25
+ ```
26
+
27
+ `prepare` measures the declared read set's real digests and returns a
28
+ `PreparedBoundary` carrying the descriptor plus a `readSnapshot`. The declared
29
+ digests in the descriptor are caller metadata folded into the step key; the
30
+ snapshot is the evidence that they still describe reality.
31
+
32
+ `settle` measures the writes afterwards and turns them into
33
+ `BoundaryEvidence`: the declared outputs (as a replayable payload), a
34
+ `diffIdentity` naming the post-state, and two optional honest flags,
35
+ `wholeTreeWritesVerified` and `hermeticReadsVerified`.
36
+
37
+ `replayOutputs` reproduces those outputs from the evidence.
38
+
39
+ ## Hard mode refuses, expected mode records
40
+
41
+ The same observation produces a refusal in `hard` mode and a `BoundaryDeviation`
42
+ in `expected` mode:
43
+
44
+ | Observation | Hard mode | Expected mode |
45
+ | ---------------------------------------------------------------------- | -------------------------- | ------------------------------------ |
46
+ | Wrote outside the declared write set | `UndeclaredWrite` | `ExpectedSetDeviation` |
47
+ | Did not produce a declared output, and did not declare it as a removal | `MissingDeclaredOutput` | `MissingDeclaredOutput` deviation |
48
+ | Left a declared removal in place | `SurvivingDeclaredRemoval` | `SurvivingDeclaredRemoval` deviation |
49
+
50
+ The two absence cases exist for a specific reason. Recording `digest: null` as
51
+ valid evidence caches the claim "this file should not exist", which
52
+ `replayOutputs` then acts on by deleting the path on a workspace that never ran
53
+ the step. A step that crashed after declaring its writes would poison the cache
54
+ with an eraser. Declaring a path in `removes` is how a deliberate deletion says
55
+ so, and it is the only thing that makes an absence legitimate.
56
+
57
+ A deviation of any variant bars the evidence from the shared cache, so an
58
+ unexplained absence never reaches another host either way. Deviations go to
59
+ [`Reconciliation`](../guides/drive-a-plan.md), which answers with a verdict.
60
+
61
+ ## Bounded host measurement
62
+
63
+ `prepare` and `settle` use the kernel's optional guarded batch capability when
64
+ the host provides it. Enumeration batches directory and stat requests while
65
+ retaining the plan's glob matcher, dotfile behavior, pruning, sorted output,
66
+ and entry budget. Hosts without batching use the existing operations with at
67
+ most four in flight.
68
+
69
+ Read digests are SHA-256 of the original file bytes. Tree-artifact and diff
70
+ identities still use the same canonical key inputs and absence sentinels, so
71
+ batching introduces no persisted key or evidence migration. The declaration
72
+ snapshot stays immutable, and all measurements use the same guarded filesystem
73
+ whose root descriptor identity is pinned at composition.
74
+
75
+ Settlement first obtains digest/size measurements, then groups content reads
76
+ by both path count and the host's response-byte budget. A change between the
77
+ two measurements refuses settlement. Inline decisions and artifact spills
78
+ remain in sorted path order, preserving the aggregate inline budget and the
79
+ resulting manifest. Helper errors retain their original cause through
80
+ `UnsupportedBoundary`. Losing the workspace root fails the boundary instead
81
+ of turning every file into an absence.
82
+
83
+ Batching does not freeze the workspace, attest whole-tree writes, or change
84
+ cache admission. Each helper measures through checked descriptors; later
85
+ verification still has to consume fresh measurements through that boundary.
86
+
87
+ ## Inline, or spilled by digest
88
+
89
+ Outputs are recorded by content digest, never inlined without bound. Two limits
90
+ on `FileSystemOptions` decide:
91
+
92
+ - `maxInlineBytes`, the largest single output carried inline in the evidence.
93
+ Defaults to 1 MiB.
94
+ - `maxTotalInlineBytes`, the largest aggregate inline payload one settle may
95
+ fold into its evidence. Defaults to 8 MiB. A per-output bound alone still let
96
+ a wide write set multiply many individually small payloads into an unbounded
97
+ evidence row.
98
+
99
+ Anything past either bound is handed to the `ArtifactStore` and recorded by
100
+ digest reference only. `referencedDigests(evidence)` names exactly those
101
+ digests: the set a shared tier must hold before the evidence's cache entry
102
+ becomes observable there, and the set a replay on a fresh host has to fetch.
103
+
104
+ The blob mechanics, content addressing, atomic publication, digest
105
+ verification, and dedupe, belong to [`@smthrs/artifacts`](/api/artifacts). What
106
+ stays here is the policy that decides which outputs become blobs at all.
107
+
108
+ ## Why the production boundary cannot claim the whole tree by itself
109
+
110
+ `StepBoundary.layer` is the filesystem-backed boundary over the kernel
111
+ `FileSystem` seam and the artifact store. It measures declared paths. It cannot
112
+ see a write elsewhere in the tree, so it never claims
113
+ `wholeTreeWritesVerified` on its own, and a composition with a boundary but no
114
+ sandbox keeps the honest outcome: run-local results only.
115
+
116
+ The whole-tree proof comes from running the body somewhere else. That is
117
+ [`WorkspaceSandbox`](./workspace-transactions.md): the transaction is the tree,
118
+ so a write outside the declared set is a map comparison rather than an
119
+ inference, and the engine sets the flag structurally.
120
+
121
+ `StepBoundary.layerTest(options)` is deterministic and supports
122
+ explicit `failure` or `deviation` fixtures, replay, and `readSnapshot` assertions, but it does not
123
+ enforce a real sandbox. Its `wholeTreeWriteDetection` default of `true` is a
124
+ fixture, not a proof.
125
+
126
+ ## Replay refusals a caller can act on
127
+
128
+ `replayOutputs` distinguishes three failures on purpose:
129
+
130
+ - `MissingArtifact`: the bytes are simply not on this host. A shared artifact
131
+ tier can repair it, so `ArtifactSync.hydrate` fetches and the dispatch
132
+ retries the replay exactly once before falling through to a real execution.
133
+ - `BoundaryCorruption`: the bytes are here and no longer hash to their recorded
134
+ digest. That is an integrity violation, not a transient failure.
135
+ - `UnsupportedBoundary`: the host could not honour the boundary at all. It is
136
+ the catch-all, and it carries the refusing host or store failure whole in
137
+ `cause` rather than flattened into the message.
138
+
139
+ ## Related
140
+
141
+ - [Workspace transactions](./workspace-transactions.md): where the whole-tree
142
+ proof actually comes from.
143
+ - [Cache admission](./cache-admission.md): the full list of conditions a record
144
+ must meet before another run may use it.
145
+ - [Share a cache across machines](../guides/share-a-cache-across-machines.md):
146
+ publishing the digests this evidence references.
147
+
148
+ Test filesystem classification with `StepBoundary.layer` over an in-memory `FileSystem` and `ArtifactStore`. `layerTest` returns supplied settlement evidence or failure verbatim; it does not classify changed paths, missing outputs, or surviving removals.