anchor.diff:      status_to_phase(Status).
   
   
  --spec handle_lane_preparing(
  -    pos_integer(),
  -    atm_workflow_execution:id(),
  -    fun((atm_workflow_execution:record()) -> atm_workflow_execution:record() | errors:error())
  -) ->
  +-spec handle_lane_preparing(pos_integer(), atm_workflow_execution:id(), lane_run_diff()) ->
       {ok, atm_workflow_execution:doc()} | errors:error().
  -handle_lane_preparing(AtmLaneIndex, AtmWorkflowExecutionId, AtmLaneExecutionDiff) ->
  +handle_lane_preparing(LaneIndex, AtmWorkflowExecutionId, AtmLaneExecutionDiff) ->
       Diff = fun
  -        (Record = #atm_workflow_execution{status = ?SCHEDULED_STATUS, curr_lane_index = CurrIndex})
  -            when CurrIndex =:= AtmLaneIndex
  +        (Record = #atm_workflow_execution{status = ?SCHEDULED_STATUS, curr_lane_index = CurrLaneIndex}) when
  +            CurrLaneIndex =:= LaneIndex
           ->
               case AtmLaneExecutionDiff(Record) of
                   {ok, NewRecord} ->
  
positive.code: -export([handle_ended/1]).
  
  
  %%%===================================================================
  %%% API
  %%%===================================================================
  
negative.code:     end.
  
  
  -spec handle_lane_task_status_change(atm_workflow_execution:id(), lane_run_diff()) ->
      ok | errors:error().
  handle_lane_task_status_change(AtmWorkflowExecutionId, AtmLaneExecutionDiff) ->
      Diff = fun(Record) ->
  