anchor.diff:              ok
       end.
   
  +-spec can_finish(pipeline(), stage_name(), disco_gbtree(stage_name(), stage_info())) -> boolean().
   can_finish(P, Stage, SI) ->
       pipeline_utils:all_deps_finished(P, Stage, SI) andalso
       jc_utils:no_tasks_running(Stage, SI).
   
  +-spec event_stage_done(stage_name(), state()) -> ok.
   event_stage_done(Stage, #state{jobinfo    = #jobinfo{jobname = JobName},
                               tasks      = Tasks,
                               stage_info = SI}) ->
  
positive.code:             do_submit_tasks_in(Mode, [TaskId|Rest], S1, NFailuresAllowed)
      end.
  
  do_submit_tasks_in(Mode, [TaskId | Rest], #state{stage_info = SI,
                                                data_map   = DataMap,
                                                next_runid = RunId,
  
negative.code:     S2 = do_next_stage(Stage, S1),
      maybe_start_pending(S2).
  
  -spec maybe_event_stage_done(stage_name(), state()) -> ok.
  maybe_event_stage_done(Stage, #state{pipeline = P, stage_info = SI} = S) ->
      case can_finish(P, Stage, SI) of
          true -> event_stage_done(Stage, S);
  