mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
3064b8f13d
Storm forensics (fence_count audit column) attributed every corrupted run to a credit hole, not engine nondeterminism: two invocations that loaded the identical prefix present byte-identical stateCursor+stateEventCount, so the snapshot-keyed credit admitted both writers' decision batches and their interleaved sets baked an order no replay derives (correlation ordinals inverted against commit order at seqs the writers' fence_counts prove they never saw). The runtime now mints a random writerId per invocation delivery and sends it with every precondition snapshot; the world's credit compares writerId (falling back to stateCursor only for runtimes that don't send one). A second writer with the same snapshot 412s and restarts against the corrected log. Also adds the fence_count forensics column and a WORKFLOW_POSTGRES_EVENT_FENCE=tail|decision experiment switch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>