Drafted with an AI assistant. The script was run and the results checked by me.
A walk through one AshStateMachine action, from the obvious version to ones that are safe under concurrency. locked_transition.exs (next to this file) runs every version against PostgreSQL. The results below are from Ash 3.34.6 and Ash main (291f5fc, 2026-10-09), with AshPostgres 2.14.5 and AshStateMachine 0.2.13; main includes the ash#3008 fix.
An order is :open until its payment succeeds. The payment provider's webhook then calls confirm_payment, which must: