@voltro/workflow 0.86.0 → 0.88.0

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 (99) hide show
  1. package/CHANGELOG.md +5484 -0
  2. package/THIRD-PARTY-NOTICES.md +3 -227
  3. package/dist/admission.js +1 -2
  4. package/dist/admissionDrainer.js +5 -3
  5. package/dist/admissionGate.js +1 -2
  6. package/dist/admissionStore.js +1 -2
  7. package/dist/admissionSubmission.js +1 -2
  8. package/dist/admissionTables.js +4 -4
  9. package/dist/admissionTransaction.js +1 -2
  10. package/dist/awaitEvent.js +1 -2
  11. package/dist/budgetHold.js +1 -2
  12. package/dist/cancelOnPlan.js +1 -2
  13. package/dist/cancelOnSweep.js +1 -2
  14. package/dist/cancelPendingStart.js +1 -2
  15. package/dist/cluster.d.ts +111 -27
  16. package/dist/cluster.js +12 -8
  17. package/dist/clusterCron.js +18 -11
  18. package/dist/clusterDiagnostics.js +1 -2
  19. package/dist/clusterDiagnosticsSql.js +1 -2
  20. package/dist/clusterLayer.js +105 -71
  21. package/dist/clusterMigrationGate.js +1 -2
  22. package/dist/clusterRunnerLayer.js +27 -18
  23. package/dist/clusterShardGroups.js +32 -0
  24. package/dist/clusterTestSuite.d.ts +45 -2
  25. package/dist/clusterTestSuite.js +225 -197
  26. package/dist/controlMonitor.js +1 -2
  27. package/dist/controlRequest.js +1 -2
  28. package/dist/executionRefusal.js +1 -2
  29. package/dist/failureHandoff.js +1 -2
  30. package/dist/failureMessage.js +1 -2
  31. package/dist/failureRecovery.js +1 -2
  32. package/dist/failureReportStore.js +1 -2
  33. package/dist/flowControl.js +1 -2
  34. package/dist/forwardStartReceipts.js +1 -2
  35. package/dist/inMemoryLayer.js +1 -2
  36. package/dist/inMemoryRecorder.js +1 -2
  37. package/dist/index.d.ts +50 -23
  38. package/dist/index.js +24 -23
  39. package/dist/inspectWorkflow.js +2 -3
  40. package/dist/journalEncryption.js +1 -2
  41. package/dist/journalRoutingGuard.js +49 -0
  42. package/dist/journalRoutingLayout.js +46 -0
  43. package/dist/journalRoutingLock.js +38 -0
  44. package/dist/journalRoutingMaintenance.js +23 -0
  45. package/dist/journalRoutingMessageStorage.js +31 -0
  46. package/dist/journalRoutingNamespace.js +22 -0
  47. package/dist/journalRoutingRuntime.js +32 -0
  48. package/dist/journalRoutingSharding.js +27 -0
  49. package/dist/journalRoutingState.js +92 -0
  50. package/dist/journalRoutingTable.js +10 -0
  51. package/dist/journalRoutingTransaction.js +15 -0
  52. package/dist/messages.js +1 -2
  53. package/dist/nondeterminism.js +1 -2
  54. package/dist/parentClosure.js +1 -2
  55. package/dist/parentClosureRecovery.js +1 -2
  56. package/dist/pendingSubmission.js +1 -2
  57. package/dist/prepareSubmissionDispatch.js +1 -2
  58. package/dist/preparedExecution.js +1 -2
  59. package/dist/primitives.js +1 -2
  60. package/dist/queuedCancellationRequest.js +1 -2
  61. package/dist/queuedControl.js +1 -2
  62. package/dist/recorder.js +1 -2
  63. package/dist/residentExecutionEvidence.js +1 -2
  64. package/dist/retryPolicy.js +1 -2
  65. package/dist/runEventsTable.js +1 -2
  66. package/dist/runGeneration.js +1 -2
  67. package/dist/runRecording.js +1 -2
  68. package/dist/runStepsTable.js +1 -2
  69. package/dist/runnerStorageGuard.js +1 -2
  70. package/dist/runsTable.js +1 -2
  71. package/dist/scheduleDeclaration.js +1 -2
  72. package/dist/signalHint.js +1 -2
  73. package/dist/signals.js +1 -2
  74. package/dist/signalsSuspending.js +1 -2
  75. package/dist/sqliteWorkflowOwnership.js +1 -2
  76. package/dist/stalenessSweep.js +1 -2
  77. package/dist/startContextsTable.js +1 -2
  78. package/dist/startReceipt.js +1 -2
  79. package/dist/submissionRecovery.js +1 -2
  80. package/dist/submissionRejection.js +1 -2
  81. package/dist/submissionRetry.js +1 -2
  82. package/dist/suspensionUnavailable.js +1 -2
  83. package/dist/updates.js +1 -2
  84. package/dist/watermarkTable.js +1 -2
  85. package/dist/webCrypto.js +4 -17
  86. package/dist/workflowDelivery.js +1 -2
  87. package/dist/workflowExecutorRouting.js +32 -0
  88. package/dist/workflowJournal.js +1 -2
  89. package/dist/workflowJournalReset.js +1 -2
  90. package/dist/workflowReadSelections.js +1 -2
  91. package/dist/workflowRestartDispatch.js +30 -25
  92. package/dist/workflowRestartObservation.js +1 -2
  93. package/dist/workflowRestartPreparation.js +1 -2
  94. package/dist/workflowRestartReservation.js +158 -157
  95. package/dist/workflowResumeDispatch.js +18 -18
  96. package/dist/workflowRuntimeReadiness.js +11 -0
  97. package/dist/workflowShardRelocation.js +57 -0
  98. package/dist/workflowShardRelocationSql.js +71 -0
  99. package/package.json +5 -11
@@ -1,15 +1,15 @@
1
1
  # Third-Party Notices — @voltro/workflow
2
2
 
3
- This package uses the open-source software listed below. Each is the
3
+ This package uses the third-party software listed below. Each is the
4
4
  property of its respective copyright holders and is used under the terms of
5
5
  its license. This file is provided for attribution; it grants no rights in
6
6
  @voltro/workflow itself, which is proprietary (see LICENSE).
7
7
 
8
- Generated from the resolved runtime dependency closure (4 packages).
8
+ Generated from the resolved runtime dependency closure (2 packages).
9
9
 
10
10
  ---
11
11
 
12
- ## jose@6.2.12
12
+ ## jose@6.2.13
13
13
 
14
14
  License: MIT
15
15
 
@@ -37,214 +37,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37
37
  SOFTWARE.
38
38
  ```
39
39
 
40
- ## typeid-js@1.2.0
41
-
42
- License: Apache-2.0
43
-
44
- ```
45
- Apache License
46
- Version 2.0, January 2004
47
- http://www.apache.org/licenses/
48
-
49
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
50
-
51
- 1. Definitions.
52
-
53
- "License" shall mean the terms and conditions for use, reproduction,
54
- and distribution as defined by Sections 1 through 9 of this document.
55
-
56
- "Licensor" shall mean the copyright owner or entity authorized by
57
- the copyright owner that is granting the License.
58
-
59
- "Legal Entity" shall mean the union of the acting entity and all
60
- other entities that control, are controlled by, or are under common
61
- control with that entity. For the purposes of this definition,
62
- "control" means (i) the power, direct or indirect, to cause the
63
- direction or management of such entity, whether by contract or
64
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
65
- outstanding shares, or (iii) beneficial ownership of such entity.
66
-
67
- "You" (or "Your") shall mean an individual or Legal Entity
68
- exercising permissions granted by this License.
69
-
70
- "Source" form shall mean the preferred form for making modifications,
71
- including but not limited to software source code, documentation
72
- source, and configuration files.
73
-
74
- "Object" form shall mean any form resulting from mechanical
75
- transformation or translation of a Source form, including but
76
- not limited to compiled object code, generated documentation,
77
- and conversions to other media types.
78
-
79
- "Work" shall mean the work of authorship, whether in Source or
80
- Object form, made available under the License, as indicated by a
81
- copyright notice that is included in or attached to the work
82
- (an example is provided in the Appendix below).
83
-
84
- "Derivative Works" shall mean any work, whether in Source or Object
85
- form, that is based on (or derived from) the Work and for which the
86
- editorial revisions, annotations, elaborations, or other modifications
87
- represent, as a whole, an original work of authorship. For the purposes
88
- of this License, Derivative Works shall not include works that remain
89
- separable from, or merely link (or bind by name) to the interfaces of,
90
- the Work and Derivative Works thereof.
91
-
92
- "Contribution" shall mean any work of authorship, including
93
- the original version of the Work and any modifications or additions
94
- to that Work or Derivative Works thereof, that is intentionally
95
- submitted to Licensor for inclusion in the Work by the copyright owner
96
- or by an individual or Legal Entity authorized to submit on behalf of
97
- the copyright owner. For the purposes of this definition, "submitted"
98
- means any form of electronic, verbal, or written communication sent
99
- to the Licensor or its representatives, including but not limited to
100
- communication on electronic mailing lists, source code control systems,
101
- and issue tracking systems that are managed by, or on behalf of, the
102
- Licensor for the purpose of discussing and improving the Work, but
103
- excluding communication that is conspicuously marked or otherwise
104
- designated in writing by the copyright owner as "Not a Contribution."
105
-
106
- "Contributor" shall mean Licensor and any individual or Legal Entity
107
- on behalf of whom a Contribution has been received by Licensor and
108
- subsequently incorporated within the Work.
109
-
110
- 2. Grant of Copyright License. Subject to the terms and conditions of
111
- this License, each Contributor hereby grants to You a perpetual,
112
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
113
- copyright license to reproduce, prepare Derivative Works of,
114
- publicly display, publicly perform, sublicense, and distribute the
115
- Work and such Derivative Works in Source or Object form.
116
-
117
- 3. Grant of Patent License. Subject to the terms and conditions of
118
- this License, each Contributor hereby grants to You a perpetual,
119
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
120
- (except as stated in this section) patent license to make, have made,
121
- use, offer to sell, sell, import, and otherwise transfer the Work,
122
- where such license applies only to those patent claims licensable
123
- by such Contributor that are necessarily infringed by their
124
- Contribution(s) alone or by combination of their Contribution(s)
125
- with the Work to which such Contribution(s) was submitted. If You
126
- institute patent litigation against any entity (including a
127
- cross-claim or counterclaim in a lawsuit) alleging that the Work
128
- or a Contribution incorporated within the Work constitutes direct
129
- or contributory patent infringement, then any patent licenses
130
- granted to You under this License for that Work shall terminate
131
- as of the date such litigation is filed.
132
-
133
- 4. Redistribution. You may reproduce and distribute copies of the
134
- Work or Derivative Works thereof in any medium, with or without
135
- modifications, and in Source or Object form, provided that You
136
- meet the following conditions:
137
-
138
- (a) You must give any other recipients of the Work or
139
- Derivative Works a copy of this License; and
140
-
141
- (b) You must cause any modified files to carry prominent notices
142
- stating that You changed the files; and
143
-
144
- (c) You must retain, in the Source form of any Derivative Works
145
- that You distribute, all copyright, patent, trademark, and
146
- attribution notices from the Source form of the Work,
147
- excluding those notices that do not pertain to any part of
148
- the Derivative Works; and
149
-
150
- (d) If the Work includes a "NOTICE" text file as part of its
151
- distribution, then any Derivative Works that You distribute must
152
- include a readable copy of the attribution notices contained
153
- within such NOTICE file, excluding those notices that do not
154
- pertain to any part of the Derivative Works, in at least one
155
- of the following places: within a NOTICE text file distributed
156
- as part of the Derivative Works; within the Source form or
157
- documentation, if provided along with the Derivative Works; or,
158
- within a display generated by the Derivative Works, if and
159
- wherever such third-party notices normally appear. The contents
160
- of the NOTICE file are for informational purposes only and
161
- do not modify the License. You may add Your own attribution
162
- notices within Derivative Works that You distribute, alongside
163
- or as an addendum to the NOTICE text from the Work, provided
164
- that such additional attribution notices cannot be construed
165
- as modifying the License.
166
-
167
- You may add Your own copyright statement to Your modifications and
168
- may provide additional or different license terms and conditions
169
- for use, reproduction, or distribution of Your modifications, or
170
- for any such Derivative Works as a whole, provided Your use,
171
- reproduction, and distribution of the Work otherwise complies with
172
- the conditions stated in this License.
173
-
174
- 5. Submission of Contributions. Unless You explicitly state otherwise,
175
- any Contribution intentionally submitted for inclusion in the Work
176
- by You to the Licensor shall be under the terms and conditions of
177
- this License, without any additional terms or conditions.
178
- Notwithstanding the above, nothing herein shall supersede or modify
179
- the terms of any separate license agreement you may have executed
180
- with Licensor regarding such Contributions.
181
-
182
- 6. Trademarks. This License does not grant permission to use the trade
183
- names, trademarks, service marks, or product names of the Licensor,
184
- except as required for reasonable and customary use in describing the
185
- origin of the Work and reproducing the content of the NOTICE file.
186
-
187
- 7. Disclaimer of Warranty. Unless required by applicable law or
188
- agreed to in writing, Licensor provides the Work (and each
189
- Contributor provides its Contributions) on an "AS IS" BASIS,
190
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
191
- implied, including, without limitation, any warranties or conditions
192
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
193
- PARTICULAR PURPOSE. You are solely responsible for determining the
194
- appropriateness of using or redistributing the Work and assume any
195
- risks associated with Your exercise of permissions under this License.
196
-
197
- 8. Limitation of Liability. In no event and under no legal theory,
198
- whether in tort (including negligence), contract, or otherwise,
199
- unless required by applicable law (such as deliberate and grossly
200
- negligent acts) or agreed to in writing, shall any Contributor be
201
- liable to You for damages, including any direct, indirect, special,
202
- incidental, or consequential damages of any character arising as a
203
- result of this License or out of the use or inability to use the
204
- Work (including but not limited to damages for loss of goodwill,
205
- work stoppage, computer failure or malfunction, or any and all
206
- other commercial damages or losses), even if such Contributor
207
- has been advised of the possibility of such damages.
208
-
209
- 9. Accepting Warranty or Additional Liability. While redistributing
210
- the Work or Derivative Works thereof, You may choose to offer,
211
- and charge a fee for, acceptance of support, warranty, indemnity,
212
- or other liability obligations and/or rights consistent with this
213
- License. However, in accepting such obligations, You may act only
214
- on Your own behalf and on Your sole responsibility, not on behalf
215
- of any other Contributor, and only if You agree to indemnify,
216
- defend, and hold each Contributor harmless for any liability
217
- incurred by, or claims asserted against, such Contributor by reason
218
- of your accepting any such warranty or additional liability.
219
-
220
- END OF TERMS AND CONDITIONS
221
-
222
- APPENDIX: How to apply the Apache License to your work.
223
-
224
- To apply the Apache License to your work, attach the following
225
- boilerplate notice, with the fields enclosed by brackets "[]"
226
- replaced with your own identifying information. (Don't include
227
- the brackets!) The text should be enclosed in the appropriate
228
- comment syntax for the file format. We also recommend that a
229
- file or class name and description of purpose be included on the
230
- same "printed page" as the copyright notice for easier
231
- identification within third-party archives.
232
-
233
- Copyright [yyyy] [name of copyright owner]
234
-
235
- Licensed under the Apache License, Version 2.0 (the "License");
236
- you may not use this file except in compliance with the License.
237
- You may obtain a copy of the License at
238
-
239
- http://www.apache.org/licenses/LICENSE-2.0
240
-
241
- Unless required by applicable law or agreed to in writing, software
242
- distributed under the License is distributed on an "AS IS" BASIS,
243
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
244
- See the License for the specific language governing permissions and
245
- limitations under the License.
246
- ```
247
-
248
40
  ## ulid@3.0.2
249
41
 
250
42
  License: MIT
@@ -273,19 +65,3 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
273
65
  SOFTWARE.
274
66
  ```
275
67
 
276
- ## uuid@11.1.1
277
-
278
- License: MIT
279
-
280
- ```
281
- The MIT License (MIT)
282
-
283
- Copyright (c) 2010-2020 Robert Kieffer and other contributors
284
-
285
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
286
-
287
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
288
-
289
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
290
- ```
291
-
package/dist/admission.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/admission.ts
1
+ // src/admission.ts
2
2
  var e = class extends Error {
3
3
  workflowName;
4
4
  field;
@@ -136,5 +136,4 @@ var e = class extends Error {
136
136
  let r = e.timeouts?.finishMs;
137
137
  return r === void 0 || t.terminal ? !1 : n - t.startedAt >= r;
138
138
  }, u = (e, t) => e.priority === t.priority ? e.firstSeenAt === t.firstSeenAt ? e.id < t.id ? -1 : +(e.id > t.id) : e.firstSeenAt - t.firstSeenAt : t.priority - e.priority;
139
- //#endregion
140
139
  export { e as FlowControlKeyError, u as comparePendingOrder, a as decideAdmission, l as isFinishExpired, c as isStartExpired, i as nextSlotAt, n as pooledConcurrencyKey, r as resolveAdmissionKeys };
@@ -16,7 +16,7 @@ import { forwardStartReceipts as L } from "./forwardStartReceipts.js";
16
16
  import { Schema as R } from "effect";
17
17
  import { eq as z } from "@voltro/database";
18
18
  import { randomUUID as B } from "node:crypto";
19
- //#region src/admissionDrainer.ts
19
+ // src/admissionDrainer.ts
20
20
  var V = {
21
21
  scanned: 0,
22
22
  admitted: 0,
@@ -604,7 +604,10 @@ var V = {
604
604
  evicted: 0
605
605
  }, i, n.batch !== void 0, r);
606
606
  let o = await e.transaction((e) => f(e, t.id));
607
- if (o?.executionId == null || o.executionId !== o.preparedExecutionId) throw Error("Admission submission has no confirmed engine acceptance");
607
+ if (o?.executionId == null || o.executionId !== o.preparedExecutionId) {
608
+ let e = /* @__PURE__ */ Error("Admission submission has no confirmed engine acceptance");
609
+ throw o !== void 0 && o.receiptsBound && o.failureId === null && o.executionId === null && o.runId === null && (o.preparedExecutionId === null ? o.dispatchAttempts === 0 : o.preparedExecutionId.length > 0) && o.workflowName === a.workflowName && o.tenantId === a.tenantId && o.ledgerId === a.ledgerId ? new U(t.id, e) : e;
610
+ }
608
611
  return o.executionId;
609
612
  }, $ = async (e, t, n, r, i, a, o) => {
610
613
  let s = t.dispatchAttempts === 0 ? 0 : void 0, u = t.retry.recovery?.attempts ?? 0;
@@ -701,5 +704,4 @@ var V = {
701
704
  ...i === void 0 ? {} : { nextDeadlineAt: i }
702
705
  };
703
706
  };
704
- //#endregion
705
707
  export { H as DEFAULT_DRAIN_BATCH, ee as acceptAdmissionSubmission, G as drainTick, W as isUnacknowledgedSubmission };
@@ -1,7 +1,7 @@
1
1
  import { resolveAdmissionKeys as e } from "./admission.js";
2
2
  import { decodePendingPayload as t, evaluateAdmission as n, persistDefer as r, recordAdmission as i } from "./admissionStore.js";
3
3
  import { and as a, eq as o } from "@voltro/database";
4
- //#region src/admissionGate.ts
4
+ // src/admissionGate.ts
5
5
  var s = async (t) => {
6
6
  let { store: a, control: o, now: s } = t, l = e(o, t.payload), u = await n({
7
7
  store: a,
@@ -111,5 +111,4 @@ var s = async (t) => {
111
111
  runId: r
112
112
  });
113
113
  };
114
- //#endregion
115
114
  export { s as admitStart, l as linkExecution };
@@ -4,7 +4,7 @@ import { comparePendingOrder as r, decideAdmission as i } from "./admission.js";
4
4
  import { settlePendingStartReceipts as a } from "./startReceipt.js";
5
5
  import { and as o, eq as s, gt as c, isNull as l, or as u } from "@voltro/database";
6
6
  import { createHash as d, randomUUID as f } from "node:crypto";
7
- //#region src/admissionStore.ts
7
+ // src/admissionStore.ts
8
8
  var p = "_voltro_workflow_pending", m = "_voltro_workflow_admissions", h = "_voltro_workflow_pauses", g = (e) => o(l("releasedAt"), u(l("executionId"), c("expiresAt", new Date(e)))), _ = (e, t, n) => e.encodeWorkflowPayload === void 0 ? n : e.encodeWorkflowPayload(t, n), v = (e, t, n) => e.decodeWorkflowPayload === void 0 ? n : e.decodeWorkflowPayload(t, n), y = 864e5, b = (e, t, n) => `wfp_${d("sha256").update(`${e}\u0000${t}\u0000${n}`).digest("hex").slice(0, 40)}`, x = (e) => {
9
9
  if (e instanceof Date) return e.getTime();
10
10
  if (typeof e == "number") return e;
@@ -343,5 +343,4 @@ var p = "_voltro_workflow_pending", m = "_voltro_workflow_admissions", h = "_vol
343
343
  }], n)), i = t.getTime(), a = r.filter((e) => e.releasedAt != null && x(e.admittedAt) < i);
344
344
  return await Promise.all(a.map((t) => e.delete(m, String(t.id)))), a.length;
345
345
  };
346
- //#endregion
347
346
  export { m as ADMISSIONS_TABLE, y as DEFAULT_LEASE_MS, h as PAUSES_TABLE, p as PENDING_TABLE, g as admissionLeaseHeldPredicate, L as allIntents, U as deadLetterIntent, v as decodePendingPayload, R as deleteIntent, z as discardIntent, B as discardIntentInTransaction, F as dueIntents, _ as encodePendingPayload, G as evaluateAdmission, H as noteIntentAttempt, j as parkDelayedStart, E as pauseWorkflow, b as pendingSlotId, I as pendingWindow, A as persistDefer, K as pruneAdmissions, O as readAdmissionState, T as readPausedWorkflows, N as recordAdmission, P as releaseLease, D as resumeWorkflow, V as retryBackoffMs, W as retryDeadLetterIntent, C as toPendingIntent };
@@ -9,7 +9,7 @@ import { Schema as f } from "effect";
9
9
  import { and as p, eq as m, gt as h, isNull as g } from "@voltro/database";
10
10
  import { createHash as _, randomUUID as v } from "node:crypto";
11
11
  import { isDeepStrictEqual as y } from "node:util";
12
- //#region src/admissionSubmission.ts
12
+ // src/admissionSubmission.ts
13
13
  var b = "_voltro_workflow_submissions", x = "wfsub", S = () => `${x}_${v()}`, C = f.Struct({
14
14
  id: f.String,
15
15
  workflowName: f.String,
@@ -293,5 +293,4 @@ var E = async (e, t, n) => (await D(e, t, n)).map((e) => w(e)), D = async (e, t,
293
293
  if (await e.update("_voltro_workflow_submissions", t, { failureId: u }) === null) throw Error("Admission submission disappeared during rejection");
294
294
  return await a(e, d.id, s.now), d;
295
295
  };
296
- //#endregion
297
296
  export { x as ADMISSION_SUBMISSION_ID_PREFIX, b as SUBMISSIONS_TABLE, M as acknowledgeAdmissionSubmission, N as acknowledgeAdmissionSubmissionInTransaction, I as beginAdmissionSubmissionDispatchInTransaction, w as decodeAdmissionSubmission, T as dispatchedExecutionSubmissions, S as newAdmissionSubmissionId, F as noteAdmissionSubmissionFailure, E as pendingAdmissionSubmissions, j as persistReservedSubmission, P as prepareAdmissionSubmissionExecutionInTransaction, O as readAdmissionSubmission, D as readPendingAdmissionSubmissionRows, L as rejectAdmissionSubmissionInTransaction, k as reserveAdmissionSubmission, A as reserveAdmissionSubmissionInTransaction };
@@ -1,5 +1,5 @@
1
1
  import { boolean as e, id as t, integer as n, json as r, real as i, table as a, text as o, timestamp as s } from "@voltro/database";
2
- //#region src/admissionTables.ts
2
+ // src/admissionTables.ts
3
3
  var c = a("_voltro_workflow_admission_locks", {
4
4
  id: t({ prefix: "wfalk" }),
5
5
  nonce: o()
@@ -67,8 +67,9 @@ var c = a("_voltro_workflow_admission_locks", {
67
67
  payload: r(),
68
68
  callerContext: r().nullable(),
69
69
  intentIds: r(),
70
- eviction: r().nullable()
71
- }).nonReactive(), p = a("_voltro_workflow_start_receipts", {
70
+ eviction: r().nullable(),
71
+ poolReleaseSettledAt: s().nullable()
72
+ }).index("_voltro_workflow_submissions_pool_settlement_idx", ["poolReleaseSettledAt", "id"]).nonReactive(), p = a("_voltro_workflow_start_receipts", {
72
73
  id: t({ prefix: "wfrc" }),
73
74
  workflowName: o(),
74
75
  tenantId: o().nullable(),
@@ -133,5 +134,4 @@ var c = a("_voltro_workflow_admission_locks", {
133
134
  pausedBy: o().nullable(),
134
135
  reason: o().nullable()
135
136
  });
136
- //#endregion
137
137
  export { c as _voltroWorkflowAdmissionLocksTable, h as _voltroWorkflowAdmissionsTable, u as _voltroWorkflowControlRequestsTable, d as _voltroWorkflowFailureReportsTable, l as _voltroWorkflowParentClosuresTable, g as _voltroWorkflowPausesTable, m as _voltroWorkflowPendingTable, p as _voltroWorkflowStartReceiptsTable, f as _voltroWorkflowSubmissionsTable };
@@ -1,6 +1,6 @@
1
1
  import { eq as e } from "@voltro/database";
2
2
  import { randomUUID as t } from "node:crypto";
3
- //#region src/admissionTransaction.ts
3
+ // src/admissionTransaction.ts
4
4
  var n = "_voltro_workflow_admission_locks", r = "deployment", i = async (i, a) => (await i.insertIgnoreWithOutcome(n, {
5
5
  id: r,
6
6
  nonce: t()
@@ -17,5 +17,4 @@ var n = "_voltro_workflow_admission_locks", r = "deployment", i = async (i, a) =
17
17
  if (await n.update("_voltro_workflow_admission_locks", r, { nonce: t() }) === null) throw Error("Admission coordinator row disappeared; refusing an unlocked decision");
18
18
  return a(n);
19
19
  }));
20
- //#endregion
21
20
  export { n as ADMISSION_LOCKS_TABLE, i as withAdmissionTransaction };
@@ -2,7 +2,7 @@ import { encryptionAwareActivity as e } from "./journalEncryption.js";
2
2
  import { CurrentWorkflowRunId as t, WorkflowRunRecorder as n } from "./recorder.js";
3
3
  import { Effect as r, Schema as i } from "effect";
4
4
  import { and as a, eq as o, gte as s } from "@voltro/database";
5
- //#region src/awaitEvent.ts
5
+ // src/awaitEvent.ts
6
6
  var c = async (e, t) => {
7
7
  if (e !== void 0) try {
8
8
  await e.recordEvent(t);
@@ -78,5 +78,4 @@ var c = async (e, t) => {
78
78
  }
79
79
  return /* @__PURE__ */ new Date(0);
80
80
  });
81
- //#endregion
82
81
  export { l as awaitEvent };
@@ -1,7 +1,7 @@
1
1
  import { awaitSignalSuspending as e, completeSuspendingSignal as t } from "./signalsSuspending.js";
2
2
  import { Cause as n, Effect as r, Schema as i } from "effect";
3
3
  import { and as a, eq as o, generateId as s, id as c, isNull as l, registerRetention as u, retentionTtlMsFromEnv as d, table as f, text as p, timestamp as m } from "@voltro/database";
4
- //#region src/budgetHold.ts
4
+ // src/budgetHold.ts
5
5
  var h = "_voltro_budget_holds", g = "budget-hold", _ = (e) => `${g}:${e}`, v = (e) => `${e.executionId}/${e.stepName}/${e.budget}#${e.generation}`, y = async (e, t) => (await e.query({
6
6
  table: h,
7
7
  predicate: a(o("executionId", t.executionId), o("stepName", t.stepName), o("budget", t.budget)),
@@ -132,5 +132,4 @@ var h = "_voltro_budget_holds", g = "budget-hold", _ = (e) => `${g}:${e}`, v = (
132
132
  }
133
133
  return [...n.values()];
134
134
  };
135
- //#endregion
136
135
  export { h as BUDGET_HOLDS_TABLE, S as BudgetHoldExpired, C as DEFAULT_BUDGET_HOLD_TIMEOUT_MS, w as DEFAULT_BUDGET_RECHECK_MS, b as _voltroBudgetHoldsTable, y as budgetHoldGeneration, v as budgetHoldKey, _ as budgetHoldSignalName, j as heldBudgets, A as pendingBudgetHolds, k as releaseBudgetHolds, T as suspendForBudget };
@@ -1,5 +1,5 @@
1
1
  import { Result as e, Schema as t } from "effect";
2
- //#region src/cancelOnPlan.ts
2
+ // src/cancelOnPlan.ts
3
3
  var n = (e) => {
4
4
  let t = e instanceof Error ? e.message : String(e);
5
5
  return t.length > 400 ? `${t.slice(0, 400)}…` : t;
@@ -71,5 +71,4 @@ var n = (e) => {
71
71
  for (let n of e) (t === void 0 || n.occurredAt.getTime() > t.getTime()) && (t = n.occurredAt);
72
72
  return t;
73
73
  };
74
- //#endregion
75
74
  export { i as newestEventAt, r as planCancellations };
@@ -1,6 +1,6 @@
1
1
  import { newestEventAt as e, planCancellations as t } from "./cancelOnPlan.js";
2
2
  import { and as n, eq as r, gte as i } from "@voltro/database";
3
- //#region src/cancelOnSweep.ts
3
+ // src/cancelOnSweep.ts
4
4
  var a = "_voltro_workflow_watermarks", o = "_voltro_workflow_events", s = "cancelOn", c = 36e5, l = 500, u = 2e3, d = (e) => {
5
5
  if (e instanceof Date) return e;
6
6
  if (typeof e == "number") return new Date(e);
@@ -184,5 +184,4 @@ var a = "_voltro_workflow_watermarks", o = "_voltro_workflow_events", s = "cance
184
184
  watermark: A
185
185
  };
186
186
  };
187
- //#endregion
188
187
  export { s as CANCEL_ON_WATERMARK, c as DEFAULT_COLD_LOOKBACK_MS, l as DEFAULT_EVENT_BATCH, u as DEFAULT_RUN_PAGE, o as EVENTS_TABLE, a as WATERMARKS_TABLE, p as readWatermark, _ as sweepCancelOn, m as writeWatermark };
@@ -2,7 +2,7 @@ import { readAdmissionSubmission as e } from "./admissionSubmission.js";
2
2
  import { readWorkflowStartReceipt as t, settlePendingStartReceipts as n } from "./startReceipt.js";
3
3
  import { PENDING_TABLE as r, toPendingIntent as i } from "./admissionStore.js";
4
4
  import { eq as a } from "@voltro/database";
5
- //#region src/cancelPendingStart.ts
5
+ // src/cancelPendingStart.ts
6
6
  var o = async (o, s) => {
7
7
  if (!Number.isFinite(s.now) || !Number.isFinite(new Date(s.now).getTime())) throw Error("Queued cancellation requires a valid timestamp");
8
8
  let c = await t(o, s.receiptId);
@@ -46,5 +46,4 @@ var o = async (o, s) => {
46
46
  outcome: d
47
47
  };
48
48
  };
49
- //#endregion
50
49
  export { o as cancelPendingWorkflowStartInTransaction };