Files
Pranay Prakash 73977ee9ef test(core): deterministic repro of step-vs-wait/hook replay delivery divergence (corrupted event log)
Adds packages/core/src/step-delivery-ordering.test.ts, reproducing the
production CORRUPTED_EVENT_LOG failures on o2flow runs
wrun_41KYJENABV0GSF5YTE9EETV5DD and wrun_41KYJEE01S0GPC9RWT5MEKVCX8
(@workflow/core@5.0.0-beta.36).

Step results are not part of the `pendingDeliveryBarriers` system in
private.ts, which pins branch-deciding delivery order to event-log position
for the kinds 'hook' and 'wait' only. A `step_completed` resolution's
microtask-hop count instead depends on whether the invocation's shared
ReplayPayloadCache already memoized its result, so a `step_completed`
adjacent in the log to a `wait_completed` or a buffered `hook_received` is
delivered after it on the first replay of a queue delivery (cold cache, the
ordering the log records) and before it on every later replay of that same
delivery (warm cache). The two workflow branches then swap the deterministic
ULIDs they draw for their next step calls, and replay diverges permanently at
the same event.

The two "later replay" tests are expected to FAIL on main -- that failure is
the reproduction. The companion fix on branch pgp/fix-step-delivery-ordering
adds 'step' to the delivery-barrier system and makes them pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
2026-07-27 13:13:16 -07:00
..
2026-07-08 14:43:01 -04:00
2026-07-22 09:56:48 -07:00
2026-07-08 20:07:27 +00:00