@fluidgrids/workflows 2026.1027.1 → 2026.1028.2

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 (166) hide show
  1. package/README.md +144 -13
  2. package/dist/activation-BBh1p82z.d.cts +57 -0
  3. package/dist/activation-DnhG7SmF.d.ts +57 -0
  4. package/dist/assemble-BLqQ8lSu.d.cts +39 -0
  5. package/dist/assemble-DWgaXHd-.d.ts +39 -0
  6. package/dist/chunk-2J6TF7YI.cjs +86 -0
  7. package/dist/chunk-4LYSEANA.js +199 -0
  8. package/dist/chunk-623FVQSN.cjs +251 -0
  9. package/dist/{chunk-W32BSO3M.js → chunk-6FSHT5IL.js} +2 -2
  10. package/dist/{chunk-E3APHA6O.cjs → chunk-7AAZGVKD.js} +1 -64
  11. package/dist/chunk-ABFZWYHT.js +612 -0
  12. package/dist/{chunk-6U446SKY.js → chunk-BD7ZPG53.js} +2 -2
  13. package/dist/chunk-BO6OVILK.js +79 -0
  14. package/dist/chunk-C5OLWZ42.js +245 -0
  15. package/dist/{chunk-OSPTJCDI.cjs → chunk-CPDK3K5N.cjs} +6 -6
  16. package/dist/chunk-DHTLALBL.cjs +80 -0
  17. package/dist/chunk-DJYMDLV5.js +227 -0
  18. package/dist/{chunk-IHKXLG6I.js → chunk-E2VK7J2C.js} +1 -1
  19. package/dist/{chunk-3M34AUIY.cjs → chunk-FEW3JBYA.cjs} +3 -3
  20. package/dist/chunk-FMSW2HDF.cjs +267 -0
  21. package/dist/chunk-FR7KYWRO.cjs +41 -0
  22. package/dist/{chunk-7YR7DI7B.cjs → chunk-GBQ33SIZ.cjs} +44 -44
  23. package/dist/{chunk-6AIAC2FP.cjs → chunk-GVTZMA5C.cjs} +4 -4
  24. package/dist/{chunk-EEAIM35V.js → chunk-HWJZVOG7.js} +64 -23
  25. package/dist/chunk-I5LR3D2K.js +869 -0
  26. package/dist/chunk-IISBRUWJ.js +13 -0
  27. package/dist/chunk-JD2VQIDZ.cjs +15 -0
  28. package/dist/{chunk-UB2BHU2M.js → chunk-JZ4TOOLN.js} +1 -1
  29. package/dist/chunk-L24YIZY7.cjs +207 -0
  30. package/dist/chunk-LNUQE6D6.js +39 -0
  31. package/dist/chunk-M4BBAERY.cjs +1635 -0
  32. package/dist/chunk-N23SKIG4.js +73 -0
  33. package/dist/{chunk-TWOYB4Y7.cjs → chunk-NEIUQASE.cjs} +13 -13
  34. package/dist/chunk-P6TA5EZT.cjs +634 -0
  35. package/dist/chunk-PMCM2OH4.js +46 -0
  36. package/dist/chunk-PZCVF76Q.cjs +868 -0
  37. package/dist/{chunk-6BEW4QD6.js → chunk-QAN5MZEM.js} +1 -1
  38. package/dist/{chunk-CSYBNN3V.cjs → chunk-QKZL3ONM.cjs} +2 -2
  39. package/dist/chunk-QQ6ULXHI.cjs +885 -0
  40. package/dist/chunk-SAENRNBJ.cjs +52 -0
  41. package/dist/{chunk-TQF7MYEN.cjs → chunk-SAOBPYYJ.cjs} +134 -96
  42. package/dist/{chunk-XBIID5DY.js → chunk-SMCANK3F.js} +5 -4
  43. package/dist/{chunk-UWQWD7BP.cjs → chunk-SX2PNKKT.cjs} +18 -17
  44. package/dist/{chunk-UJNHTS6D.js → chunk-TBDXTV22.cjs} +8 -45
  45. package/dist/chunk-UK3WM7YZ.cjs +75 -0
  46. package/dist/chunk-VOKMAAJP.js +848 -0
  47. package/dist/chunk-VRHHBPT6.js +1622 -0
  48. package/dist/{chunk-5AW745OG.js → chunk-XHXIDVEC.js} +1 -1
  49. package/dist/chunk-XKJA7KX3.js +72 -0
  50. package/dist/chunk-Z2Y65YOY.cjs +7 -0
  51. package/dist/codegen/index.cjs +9 -7
  52. package/dist/codegen/index.d.cts +2 -2
  53. package/dist/codegen/index.d.ts +2 -2
  54. package/dist/codegen/index.js +6 -5
  55. package/dist/file-BOoHZgoQ.d.cts +1557 -0
  56. package/dist/file-yuPCFU5b.d.ts +1557 -0
  57. package/dist/history/index.cjs +287 -0
  58. package/dist/history/index.d.cts +157 -0
  59. package/dist/history/index.d.ts +157 -0
  60. package/dist/history/index.js +5 -0
  61. package/dist/index.cjs +134 -36
  62. package/dist/index.d.cts +137 -9
  63. package/dist/index.d.ts +137 -9
  64. package/dist/index.js +8 -3
  65. package/dist/ir/index.cjs +152 -158
  66. package/dist/ir/index.d.cts +14 -4
  67. package/dist/ir/index.d.ts +14 -4
  68. package/dist/ir/index.js +41 -50
  69. package/dist/lower-BzmUz0sq.d.cts +129 -0
  70. package/dist/lower-_-iT4HYs.d.ts +129 -0
  71. package/dist/lower-types-DQNBfWQn.d.cts +37 -0
  72. package/dist/lower-types-DQNBfWQn.d.ts +37 -0
  73. package/dist/{manifest-Duf-gHdO.d.cts → manifest-0OLw0i7k.d.cts} +1 -1
  74. package/dist/{manifest-Bp9ZJlav.d.ts → manifest-C8N6HDYl.d.ts} +1 -1
  75. package/dist/node-evaluator-4MSDKWOG.cjs +22 -0
  76. package/dist/node-evaluator-SX4LEYQC.js +12 -0
  77. package/dist/quickjs/index.cjs +236 -12
  78. package/dist/quickjs/index.d.cts +46 -5
  79. package/dist/quickjs/index.d.ts +46 -5
  80. package/dist/quickjs/index.js +230 -9
  81. package/dist/roundtrip/index.cjs +333 -131
  82. package/dist/roundtrip/index.d.cts +39 -7
  83. package/dist/roundtrip/index.d.ts +39 -7
  84. package/dist/roundtrip/index.js +185 -13
  85. package/dist/runtime/index.cjs +90 -0
  86. package/dist/runtime/index.d.cts +297 -0
  87. package/dist/runtime/index.d.ts +297 -0
  88. package/dist/runtime/index.js +8 -0
  89. package/dist/testing/index.cjs +1057 -0
  90. package/dist/testing/index.d.cts +305 -0
  91. package/dist/testing/index.d.ts +305 -0
  92. package/dist/testing/index.js +1037 -0
  93. package/dist/{types-Dr2Fn1Ax.d.ts → types-BGoPzgcl.d.cts} +1 -1
  94. package/dist/{types-Dr2Fn1Ax.d.cts → types-BGoPzgcl.d.ts} +1 -1
  95. package/dist/types-CpBBjaGX.d.cts +380 -0
  96. package/dist/types-DV-HX_Gt.d.ts +380 -0
  97. package/dist/{assemble-CrpUyd_3.d.ts → workflow-Bpr3vnA_.d.ts} +40 -160
  98. package/dist/workflow-C2a05WUJ.d.ts +444 -0
  99. package/dist/{assemble-DEf3znGD.d.cts → workflow-FXUkpIBc.d.cts} +40 -160
  100. package/dist/workflow-J-yYixny.d.cts +444 -0
  101. package/fixtures/README.md +128 -0
  102. package/fixtures/histories/activity-failure-fails-run.history.json +163 -0
  103. package/fixtures/histories/activity-retry-then-success.history.json +147 -0
  104. package/fixtures/histories/cancel-activity-abandon.history.json +126 -0
  105. package/fixtures/histories/cancel-activity-compensate.history.json +307 -0
  106. package/fixtures/histories/cancel-concurrent-non-cancellable.history.json +234 -0
  107. package/fixtures/histories/cancel-concurrent-scope-timeout.history.json +184 -0
  108. package/fixtures/histories/cancel-condition-after-cancel.history.json +200 -0
  109. package/fixtures/histories/cancel-during-timer.history.json +123 -0
  110. package/fixtures/histories/cancel-saga-compensations.history.json +325 -0
  111. package/fixtures/histories/cancel-scope-timeout.history.json +148 -0
  112. package/fixtures/histories/child-abandon-outlives-parent.history.json +191 -0
  113. package/fixtures/histories/child-cancel-default.history.json +234 -0
  114. package/fixtures/histories/child-cancel-request.history.json +206 -0
  115. package/fixtures/histories/child-durable-child-side.history.json +124 -0
  116. package/fixtures/histories/child-durable-result.history.json +163 -0
  117. package/fixtures/histories/child-failure-caught.history.json +166 -0
  118. package/fixtures/histories/child-graph-by-key.history.json +138 -0
  119. package/fixtures/histories/child-terminated-by-parent-close.history.json +85 -0
  120. package/fixtures/histories/continue-as-new-first-run.history.json +146 -0
  121. package/fixtures/histories/continue-as-new-history-limit.history.json +489 -0
  122. package/fixtures/histories/continue-as-new-last-run.history.json +147 -0
  123. package/fixtures/histories/continue-as-new-suggested.history.json +352 -0
  124. package/fixtures/histories/details-and-context.history.json +176 -0
  125. package/fixtures/histories/deterministic-values.history.json +128 -0
  126. package/fixtures/histories/engine-builtins.history.json +172 -0
  127. package/fixtures/histories/gather-activities.history.json +291 -0
  128. package/fixtures/histories/gather-all-settled.history.json +219 -0
  129. package/fixtures/histories/gather-mixed.history.json +281 -0
  130. package/fixtures/histories/input-during-running-task.history.json +111 -0
  131. package/fixtures/histories/nondeterminism-reordered.history.json +218 -0
  132. package/fixtures/histories/patched-deprecated.history.json +271 -0
  133. package/fixtures/histories/patched-new-run.history.json +270 -0
  134. package/fixtures/histories/patched-old-history.history.json +190 -0
  135. package/fixtures/histories/race-activity-wins.history.json +152 -0
  136. package/fixtures/histories/race-signal-beats-child.history.json +161 -0
  137. package/fixtures/histories/race-timeout-wins.history.json +118 -0
  138. package/fixtures/histories/side-effect-recorded.history.json +153 -0
  139. package/fixtures/histories/signal-buffered-at-start.history.json +157 -0
  140. package/fixtures/histories/signal-default-handler.history.json +187 -0
  141. package/fixtures/histories/signal-handler.history.json +191 -0
  142. package/fixtures/histories/signal-parent-child-side.history.json +132 -0
  143. package/fixtures/histories/signal-parent.history.json +202 -0
  144. package/fixtures/histories/signal-run-delivered.history.json +128 -0
  145. package/fixtures/histories/signal-run-undelivered.history.json +134 -0
  146. package/fixtures/histories/signal-wait.history.json +111 -0
  147. package/fixtures/histories/task-failure-code-error.history.json +137 -0
  148. package/fixtures/histories/task-failure-then-transient-attempt.history.json +140 -0
  149. package/fixtures/histories/timer-condition-met.history.json +201 -0
  150. package/fixtures/histories/timer-condition-timeout.history.json +118 -0
  151. package/fixtures/histories/timer-sleep-once.history.json +118 -0
  152. package/fixtures/histories/timer-sleep-sequence.history.json +210 -0
  153. package/fixtures/histories/update-accepted-completed.history.json +149 -0
  154. package/fixtures/histories/update-with-start-rejected-validation.history.json +91 -0
  155. package/package.json +44 -5
  156. package/schema/history-file.schema.json +2544 -0
  157. package/schema/ir-v2.schema.json +16 -0
  158. package/schema/run-event.schema.json +2374 -0
  159. package/schema/workflow-command.schema.json +1095 -0
  160. package/schema/workflow-task.schema.json +3560 -0
  161. package/dist/chunk-MBBKGD7K.js +0 -440
  162. package/dist/chunk-Y7NWR3WH.cjs +0 -450
  163. package/dist/lower-CXggJTIo.d.ts +0 -67
  164. package/dist/lower-DAzvsJCo.d.cts +0 -67
  165. package/dist/node-evaluator-CH3XCJND.cjs +0 -17
  166. package/dist/node-evaluator-TULXA3WE.js +0 -8
@@ -0,0 +1,281 @@
1
+ {
2
+ "format": "fluidgrids.history",
3
+ "formatVersion": 1,
4
+ "name": "gather-mixed",
5
+ "description": "An activity, a timer and a child awaited together.",
6
+ "source": "src/gather.ts",
7
+ "info": {
8
+ "workspaceId": "test-workspace",
9
+ "taskQueue": "managed",
10
+ "attempt": 1,
11
+ "startedAt": "2026-01-01T00:00:00.000Z",
12
+ "runStartedAt": "2026-01-01T00:00:00.000Z",
13
+ "runId": "run-1"
14
+ },
15
+ "nowMs": 1767225900000,
16
+ "workflowFn": "gatherMixed",
17
+ "events": [
18
+ {
19
+ "seq": 1,
20
+ "type": "WORKFLOW_STARTED",
21
+ "payload": {
22
+ "workflowFn": "gatherMixed",
23
+ "input": null,
24
+ "taskQueue": "managed",
25
+ "randomnessSeed": "run-1"
26
+ },
27
+ "createdAt": "2026-01-01T00:00:00.000Z"
28
+ },
29
+ {
30
+ "seq": 2,
31
+ "type": "WORKFLOW_TASK_SCHEDULED",
32
+ "payload": {
33
+ "taskId": "run-1-task-1"
34
+ },
35
+ "createdAt": "2026-01-01T00:00:00.000Z"
36
+ },
37
+ {
38
+ "seq": 3,
39
+ "type": "WORKFLOW_TASK_STARTED",
40
+ "payload": {
41
+ "taskId": "run-1-task-1",
42
+ "attempt": 1
43
+ },
44
+ "createdAt": "2026-01-01T00:00:00.000Z"
45
+ },
46
+ {
47
+ "seq": 4,
48
+ "type": "WORKFLOW_TASK_COMPLETED",
49
+ "payload": {
50
+ "taskId": "run-1-task-1"
51
+ },
52
+ "createdAt": "2026-01-01T00:00:00.000Z",
53
+ "taskId": "run-1-task-1"
54
+ },
55
+ {
56
+ "seq": 5,
57
+ "type": "ACTIVITY_SCHEDULED",
58
+ "payload": {
59
+ "activityId": "a1",
60
+ "kind": "node",
61
+ "nodeType": "store/stripe",
62
+ "operation": "createCharge",
63
+ "args": {
64
+ "amount": 100,
65
+ "customer": "c-2"
66
+ },
67
+ "retry": {
68
+ "retryDelay": 1000,
69
+ "backoffMultiplier": 2,
70
+ "maxDelay": 100000
71
+ },
72
+ "nodeVersion": "1.3.0"
73
+ },
74
+ "createdAt": "2026-01-01T00:00:00.000Z",
75
+ "taskId": "run-1-task-1"
76
+ },
77
+ {
78
+ "seq": 6,
79
+ "type": "TIMER_STARTED",
80
+ "payload": {
81
+ "timerId": "t1",
82
+ "durationMs": 300000,
83
+ "fireAt": "2026-01-01T00:05:00.000Z"
84
+ },
85
+ "createdAt": "2026-01-01T00:00:00.000Z",
86
+ "taskId": "run-1-task-1"
87
+ },
88
+ {
89
+ "seq": 7,
90
+ "type": "CHILD_RUN_INITIATED",
91
+ "payload": {
92
+ "childId": "c1",
93
+ "workflowFn": "addOne",
94
+ "input": {
95
+ "n": 9
96
+ },
97
+ "options": {
98
+ "parentClosePolicy": "TERMINATE"
99
+ }
100
+ },
101
+ "createdAt": "2026-01-01T00:00:00.000Z",
102
+ "taskId": "run-1-task-1"
103
+ },
104
+ {
105
+ "seq": 8,
106
+ "type": "CHILD_RUN_STARTED",
107
+ "payload": {
108
+ "childId": "c1",
109
+ "childRunId": "run-2",
110
+ "executionKind": "DURABLE_FN"
111
+ },
112
+ "createdAt": "2026-01-01T00:00:00.000Z"
113
+ },
114
+ {
115
+ "seq": 9,
116
+ "type": "WORKFLOW_TASK_SCHEDULED",
117
+ "payload": {
118
+ "taskId": "run-1-task-2"
119
+ },
120
+ "createdAt": "2026-01-01T00:00:00.000Z"
121
+ },
122
+ {
123
+ "seq": 10,
124
+ "type": "WORKFLOW_TASK_STARTED",
125
+ "payload": {
126
+ "taskId": "run-1-task-2",
127
+ "attempt": 1
128
+ },
129
+ "createdAt": "2026-01-01T00:00:00.000Z"
130
+ },
131
+ {
132
+ "seq": 11,
133
+ "type": "WORKFLOW_TASK_COMPLETED",
134
+ "payload": {
135
+ "taskId": "run-1-task-2"
136
+ },
137
+ "createdAt": "2026-01-01T00:00:00.000Z",
138
+ "taskId": "run-1-task-2"
139
+ },
140
+ {
141
+ "seq": 12,
142
+ "type": "ACTIVITY_STARTED",
143
+ "payload": {
144
+ "activityId": "a1",
145
+ "attempt": 1
146
+ },
147
+ "createdAt": "2026-01-01T00:00:00.000Z"
148
+ },
149
+ {
150
+ "seq": 13,
151
+ "type": "ACTIVITY_COMPLETED",
152
+ "payload": {
153
+ "activityId": "a1",
154
+ "attempt": 1,
155
+ "result": {
156
+ "id": "ch_1",
157
+ "amount": 100
158
+ }
159
+ },
160
+ "createdAt": "2026-01-01T00:00:00.000Z"
161
+ },
162
+ {
163
+ "seq": 14,
164
+ "type": "WORKFLOW_TASK_SCHEDULED",
165
+ "payload": {
166
+ "taskId": "run-1-task-3"
167
+ },
168
+ "createdAt": "2026-01-01T00:00:00.000Z"
169
+ },
170
+ {
171
+ "seq": 15,
172
+ "type": "WORKFLOW_TASK_STARTED",
173
+ "payload": {
174
+ "taskId": "run-1-task-3",
175
+ "attempt": 1
176
+ },
177
+ "createdAt": "2026-01-01T00:00:00.000Z"
178
+ },
179
+ {
180
+ "seq": 16,
181
+ "type": "WORKFLOW_TASK_COMPLETED",
182
+ "payload": {
183
+ "taskId": "run-1-task-3"
184
+ },
185
+ "createdAt": "2026-01-01T00:00:00.000Z",
186
+ "taskId": "run-1-task-3"
187
+ },
188
+ {
189
+ "seq": 17,
190
+ "type": "CHILD_RUN_COMPLETED",
191
+ "payload": {
192
+ "childId": "c1",
193
+ "childRunId": "run-2",
194
+ "result": {
195
+ "n": 10
196
+ }
197
+ },
198
+ "createdAt": "2026-01-01T00:01:00.000Z"
199
+ },
200
+ {
201
+ "seq": 18,
202
+ "type": "WORKFLOW_TASK_SCHEDULED",
203
+ "payload": {
204
+ "taskId": "run-1-task-4"
205
+ },
206
+ "createdAt": "2026-01-01T00:01:00.000Z"
207
+ },
208
+ {
209
+ "seq": 19,
210
+ "type": "WORKFLOW_TASK_STARTED",
211
+ "payload": {
212
+ "taskId": "run-1-task-4",
213
+ "attempt": 1
214
+ },
215
+ "createdAt": "2026-01-01T00:01:00.000Z"
216
+ },
217
+ {
218
+ "seq": 20,
219
+ "type": "WORKFLOW_TASK_COMPLETED",
220
+ "payload": {
221
+ "taskId": "run-1-task-4"
222
+ },
223
+ "createdAt": "2026-01-01T00:01:00.000Z",
224
+ "taskId": "run-1-task-4"
225
+ },
226
+ {
227
+ "seq": 21,
228
+ "type": "TIMER_FIRED",
229
+ "payload": {
230
+ "timerId": "t1"
231
+ },
232
+ "createdAt": "2026-01-01T00:05:00.000Z"
233
+ },
234
+ {
235
+ "seq": 22,
236
+ "type": "WORKFLOW_TASK_SCHEDULED",
237
+ "payload": {
238
+ "taskId": "run-1-task-5"
239
+ },
240
+ "createdAt": "2026-01-01T00:05:00.000Z"
241
+ },
242
+ {
243
+ "seq": 23,
244
+ "type": "WORKFLOW_TASK_STARTED",
245
+ "payload": {
246
+ "taskId": "run-1-task-5",
247
+ "attempt": 1
248
+ },
249
+ "createdAt": "2026-01-01T00:05:00.000Z"
250
+ },
251
+ {
252
+ "seq": 24,
253
+ "type": "WORKFLOW_TASK_COMPLETED",
254
+ "payload": {
255
+ "taskId": "run-1-task-5"
256
+ },
257
+ "createdAt": "2026-01-01T00:05:00.000Z",
258
+ "taskId": "run-1-task-5"
259
+ },
260
+ {
261
+ "seq": 25,
262
+ "type": "WORKFLOW_COMPLETED",
263
+ "payload": {
264
+ "output": {
265
+ "paid": "ch_1",
266
+ "child": {
267
+ "n": 10
268
+ }
269
+ }
270
+ },
271
+ "createdAt": "2026-01-01T00:05:00.000Z",
272
+ "taskId": "run-1-task-5"
273
+ }
274
+ ],
275
+ "expected": {
276
+ "protocol": 1,
277
+ "outcome": "commands",
278
+ "commands": [],
279
+ "logs": []
280
+ }
281
+ }
@@ -0,0 +1,111 @@
1
+ {
2
+ "format": "fluidgrids.history",
3
+ "formatVersion": 1,
4
+ "name": "input-during-running-task",
5
+ "description": "C-HIST rule 5: a signal appended between STARTED(k) and COMPLETED(k) belongs to activation k+1.",
6
+ "source": "src/signals.ts",
7
+ "info": {
8
+ "workspaceId": "test-workspace",
9
+ "taskQueue": "managed",
10
+ "attempt": 1,
11
+ "startedAt": "2026-01-01T00:00:00.000Z",
12
+ "runStartedAt": "2026-01-01T00:00:00.000Z",
13
+ "runId": "run-1"
14
+ },
15
+ "nowMs": 1767225600000,
16
+ "workflowFn": "waitForApproval",
17
+ "events": [
18
+ {
19
+ "seq": 1,
20
+ "type": "WORKFLOW_STARTED",
21
+ "payload": {
22
+ "workflowFn": "waitForApproval",
23
+ "input": null,
24
+ "taskQueue": "managed",
25
+ "randomnessSeed": "run-1"
26
+ },
27
+ "createdAt": "2026-01-01T00:00:00.000Z"
28
+ },
29
+ {
30
+ "seq": 2,
31
+ "type": "WORKFLOW_TASK_SCHEDULED",
32
+ "payload": {
33
+ "taskId": "run-1-task-1"
34
+ },
35
+ "createdAt": "2026-01-01T00:00:00.000Z"
36
+ },
37
+ {
38
+ "seq": 3,
39
+ "type": "WORKFLOW_TASK_STARTED",
40
+ "payload": {
41
+ "taskId": "run-1-task-1",
42
+ "attempt": 1
43
+ },
44
+ "createdAt": "2026-01-01T00:00:00.000Z"
45
+ },
46
+ {
47
+ "seq": 4,
48
+ "type": "SIGNAL_RECEIVED",
49
+ "payload": {
50
+ "name": "approve",
51
+ "payload": {
52
+ "by": "cy"
53
+ },
54
+ "receivedAt": "2026-01-01T00:00:00.000Z"
55
+ },
56
+ "createdAt": "2026-01-01T00:00:00.000Z"
57
+ },
58
+ {
59
+ "seq": 5,
60
+ "type": "WORKFLOW_TASK_COMPLETED",
61
+ "payload": {
62
+ "taskId": "run-1-task-1"
63
+ },
64
+ "createdAt": "2026-01-01T00:00:00.000Z",
65
+ "taskId": "run-1-task-1"
66
+ },
67
+ {
68
+ "seq": 6,
69
+ "type": "WORKFLOW_TASK_SCHEDULED",
70
+ "payload": {
71
+ "taskId": "run-1-task-2"
72
+ },
73
+ "createdAt": "2026-01-01T00:00:00.000Z"
74
+ },
75
+ {
76
+ "seq": 7,
77
+ "type": "WORKFLOW_TASK_STARTED",
78
+ "payload": {
79
+ "taskId": "run-1-task-2",
80
+ "attempt": 1
81
+ },
82
+ "createdAt": "2026-01-01T00:00:00.000Z"
83
+ },
84
+ {
85
+ "seq": 8,
86
+ "type": "WORKFLOW_TASK_COMPLETED",
87
+ "payload": {
88
+ "taskId": "run-1-task-2"
89
+ },
90
+ "createdAt": "2026-01-01T00:00:00.000Z",
91
+ "taskId": "run-1-task-2"
92
+ },
93
+ {
94
+ "seq": 9,
95
+ "type": "WORKFLOW_COMPLETED",
96
+ "payload": {
97
+ "output": {
98
+ "approvedBy": "cy"
99
+ }
100
+ },
101
+ "createdAt": "2026-01-01T00:00:00.000Z",
102
+ "taskId": "run-1-task-2"
103
+ }
104
+ ],
105
+ "expected": {
106
+ "protocol": 1,
107
+ "outcome": "commands",
108
+ "commands": [],
109
+ "logs": []
110
+ }
111
+ }
@@ -0,0 +1,218 @@
1
+ {
2
+ "format": "fluidgrids.history",
3
+ "formatVersion": 1,
4
+ "name": "nondeterminism-reordered",
5
+ "description": "Reordering two activities without patched(): replay fails the task with NON_DETERMINISM.",
6
+ "source": "src/patched-v1.ts",
7
+ "replaySource": "src/patched-v2.ts",
8
+ "info": {
9
+ "workspaceId": "test-workspace",
10
+ "taskQueue": "managed",
11
+ "attempt": 1,
12
+ "startedAt": "2026-01-01T00:00:00.000Z",
13
+ "runStartedAt": "2026-01-01T00:00:00.000Z",
14
+ "runId": "run-1"
15
+ },
16
+ "nowMs": 1767225600000,
17
+ "workflowFn": "reordered",
18
+ "events": [
19
+ {
20
+ "seq": 1,
21
+ "type": "WORKFLOW_STARTED",
22
+ "payload": {
23
+ "workflowFn": "reordered",
24
+ "input": null,
25
+ "taskQueue": "managed",
26
+ "randomnessSeed": "run-1"
27
+ },
28
+ "createdAt": "2026-01-01T00:00:00.000Z"
29
+ },
30
+ {
31
+ "seq": 2,
32
+ "type": "WORKFLOW_TASK_SCHEDULED",
33
+ "payload": {
34
+ "taskId": "run-1-task-1"
35
+ },
36
+ "createdAt": "2026-01-01T00:00:00.000Z"
37
+ },
38
+ {
39
+ "seq": 3,
40
+ "type": "WORKFLOW_TASK_STARTED",
41
+ "payload": {
42
+ "taskId": "run-1-task-1",
43
+ "attempt": 1
44
+ },
45
+ "createdAt": "2026-01-01T00:00:00.000Z"
46
+ },
47
+ {
48
+ "seq": 4,
49
+ "type": "WORKFLOW_TASK_COMPLETED",
50
+ "payload": {
51
+ "taskId": "run-1-task-1"
52
+ },
53
+ "createdAt": "2026-01-01T00:00:00.000Z",
54
+ "taskId": "run-1-task-1"
55
+ },
56
+ {
57
+ "seq": 5,
58
+ "type": "ACTIVITY_SCHEDULED",
59
+ "payload": {
60
+ "activityId": "a1",
61
+ "kind": "node",
62
+ "nodeType": "store/stripe",
63
+ "operation": "createCharge",
64
+ "args": {
65
+ "amount": 10,
66
+ "customer": "c-4"
67
+ },
68
+ "retry": {
69
+ "retryDelay": 1000,
70
+ "backoffMultiplier": 2,
71
+ "maxDelay": 100000
72
+ },
73
+ "nodeVersion": "1.3.0"
74
+ },
75
+ "createdAt": "2026-01-01T00:00:00.000Z",
76
+ "taskId": "run-1-task-1"
77
+ },
78
+ {
79
+ "seq": 6,
80
+ "type": "ACTIVITY_STARTED",
81
+ "payload": {
82
+ "activityId": "a1",
83
+ "attempt": 1
84
+ },
85
+ "createdAt": "2026-01-01T00:00:00.000Z"
86
+ },
87
+ {
88
+ "seq": 7,
89
+ "type": "ACTIVITY_COMPLETED",
90
+ "payload": {
91
+ "activityId": "a1",
92
+ "attempt": 1,
93
+ "result": {
94
+ "id": "ch_1",
95
+ "amount": 10
96
+ }
97
+ },
98
+ "createdAt": "2026-01-01T00:00:00.000Z"
99
+ },
100
+ {
101
+ "seq": 8,
102
+ "type": "WORKFLOW_TASK_SCHEDULED",
103
+ "payload": {
104
+ "taskId": "run-1-task-2"
105
+ },
106
+ "createdAt": "2026-01-01T00:00:00.000Z"
107
+ },
108
+ {
109
+ "seq": 9,
110
+ "type": "WORKFLOW_TASK_STARTED",
111
+ "payload": {
112
+ "taskId": "run-1-task-2",
113
+ "attempt": 1
114
+ },
115
+ "createdAt": "2026-01-01T00:00:00.000Z"
116
+ },
117
+ {
118
+ "seq": 10,
119
+ "type": "WORKFLOW_TASK_COMPLETED",
120
+ "payload": {
121
+ "taskId": "run-1-task-2"
122
+ },
123
+ "createdAt": "2026-01-01T00:00:00.000Z",
124
+ "taskId": "run-1-task-2"
125
+ },
126
+ {
127
+ "seq": 11,
128
+ "type": "ACTIVITY_SCHEDULED",
129
+ "payload": {
130
+ "activityId": "a2",
131
+ "kind": "node",
132
+ "nodeType": "store/slack",
133
+ "operation": "sendMessage",
134
+ "args": {
135
+ "channel": "#billing",
136
+ "text": "paid"
137
+ },
138
+ "retry": {
139
+ "retryDelay": 1000,
140
+ "backoffMultiplier": 2,
141
+ "maxDelay": 100000
142
+ },
143
+ "nodeVersion": "1.0.0"
144
+ },
145
+ "createdAt": "2026-01-01T00:00:00.000Z",
146
+ "taskId": "run-1-task-2"
147
+ },
148
+ {
149
+ "seq": 12,
150
+ "type": "ACTIVITY_STARTED",
151
+ "payload": {
152
+ "activityId": "a2",
153
+ "attempt": 1
154
+ },
155
+ "createdAt": "2026-01-01T00:00:00.000Z"
156
+ },
157
+ {
158
+ "seq": 13,
159
+ "type": "ACTIVITY_COMPLETED",
160
+ "payload": {
161
+ "activityId": "a2",
162
+ "attempt": 1,
163
+ "result": {
164
+ "ts": "1700000000.000100"
165
+ }
166
+ },
167
+ "createdAt": "2026-01-01T00:00:00.000Z"
168
+ },
169
+ {
170
+ "seq": 14,
171
+ "type": "WORKFLOW_TASK_SCHEDULED",
172
+ "payload": {
173
+ "taskId": "run-1-task-3"
174
+ },
175
+ "createdAt": "2026-01-01T00:00:00.000Z"
176
+ },
177
+ {
178
+ "seq": 15,
179
+ "type": "WORKFLOW_TASK_STARTED",
180
+ "payload": {
181
+ "taskId": "run-1-task-3",
182
+ "attempt": 1
183
+ },
184
+ "createdAt": "2026-01-01T00:00:00.000Z"
185
+ },
186
+ {
187
+ "seq": 16,
188
+ "type": "WORKFLOW_TASK_COMPLETED",
189
+ "payload": {
190
+ "taskId": "run-1-task-3"
191
+ },
192
+ "createdAt": "2026-01-01T00:00:00.000Z",
193
+ "taskId": "run-1-task-3"
194
+ },
195
+ {
196
+ "seq": 17,
197
+ "type": "WORKFLOW_COMPLETED",
198
+ "payload": {
199
+ "output": {
200
+ "paid": "ch_1"
201
+ }
202
+ },
203
+ "createdAt": "2026-01-01T00:00:00.000Z",
204
+ "taskId": "run-1-task-3"
205
+ }
206
+ ],
207
+ "expected": {
208
+ "protocol": 1,
209
+ "outcome": "failed",
210
+ "commands": [],
211
+ "logs": [],
212
+ "failure": {
213
+ "cause": "NON_DETERMINISM",
214
+ "message": "Replay of workflow task run-1-task-1 diverged: the code issued SCHEDULE_ACTIVITY a1 (store/slack sendMessage) where the history has ACTIVITY_SCHEDULED a1 (seq 5)",
215
+ "seq": 5
216
+ }
217
+ }
218
+ }