executeBatch
Executes queued, commands of one aggregate in arrival order, deciding each on the state the ones before it left and appending their streams with one EventLog.appendAll: the aggregate's commands are committed together instead of one append each. Each command's outcome is what execute would have given it.
The first command always runs, alone through execute when it cannot start a batch. A batch takes the commands after it while each one is pure (its decide function and after hooks do no I/O, so deciding it again costs nothing), is not sent for a schedule, is not among the aggregate's recent requests or the batch's own, and appends a stream; it ends before the first that is not, which is BatchOutcome.Again: the lane runs it next, alone if need be. It ends after a command whose decide function registers an after-append action, which reads the state that command was decided on once its stream commits: no later command of the batch evolves it first. The streams commit as a prefix (EventLog.appendAll); the first that does not commit is settled as execute settles an append, and the commands after it, compensated, are BatchOutcome.Again: their streams were decided on a state that did not commit. The aggregate's state is then dropped from the cache, as a later stream evolved it.
A state may be evolved in place: a member's CommandOutcome.Committed.state is the instance the later members of its batch evolved further, as the next command's execute evolves it. The state each stream committed is the one appending is given for it, before the next member is decided.
observer sees each command the batch settles as execute shows it a command: its execution, from the start of its decision to its outcome (the first command's from the start of the batch), its decision and its stream's append, in the trace of its caller (QueuedCommand.trace); what its stream carries for delivery holds its own append's trace. A command the batch hands back is observed by the run that settles it (Batching).