* test(bpmn): cover compensation, targeted replay and transaction cancellation
W15 turns on compensation boundary events, reverse-order replay, targeted
compensation, transaction subprocesses and cancel end/boundary events. The
measured claim in the design holds: the command applier needs no changes, and
none were made. A compensation handler arrives as an ordinary StartWork
carrying cause=compensation, and the binder already binds it because the reader
emits an ordinary Primary binding for an isForCompensation element.
What is new is the test mass that says so, and each case pins a failure that
otherwise looks like success:
- three registrations replayed in reverse, asserted as an ordered log rather
than as "all three ran"
- a compensate throw naming an activityRef, where the two unselected handlers
are bound work that must stay unrun -- which is also where "a handler is
never scheduled from flow" becomes observable
- a compensation run torn down mid-replay by a cancel end event, so its claimed
but unrun entry is released back to registered and the cancellation's own
replay reaches it; leaving it claimed would cancel with nothing to compensate
and finish looking healthy
- a transaction completing Cancelled with no cancel boundary to route it, which
must fault rather than take the ordinary sequence flow
- two compensation logs, one per scope, in a subprocess and around it
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* test(bpmn): pin the duplicate live-work record a cancelled transaction leaves
CompensationRunCancelledMidReplay asserted only log counts and Finished, so
the two live ledger records/bookmarks it produces for the releaseSeat slot
went unasserted. Add an explicit assertion on the scope's ledger, and correct
the comment that framed the second handler start as evidence only of the
release working, when it is also the symptom of the interpreter defect
tracked in #7959.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>