anchor.diff:      do_submit_tasks(re_run, Awake, S1, ?FAILURES_ALLOWED).
   
   -spec do_stage_done(stage_name(), state()) -> state().
  -do_stage_done(Stage, #state{jobinfo    = #jobinfo{jobname = JobName},
  -                            pipeline   = P,
  +do_stage_done(Stage, S) ->
  +    maybe_event_stage_done(Stage, S),
  +    do_next_stage(Stage, S).
  +
  +maybe_event_stage_done(Stage, #state{jobinfo    = #jobinfo{jobname = JobName},
                               tasks      = Tasks,
  -                            stage_info = SI} = S) ->
  +                            stage_info = SI}) ->
       case Stage of
           ?INPUT ->
               ok;
  
positive.code:             Since = disco:format_time_since(Start),
              event_server:event(JobName, "Stage ~s finished in ~s",
                                 [Stage, Since], Event)
      end,
      case pipeline_utils:next_stage(P, Stage) of
          done ->
              finish_pipeline(Stage, S);
  
negative.code:                     S
              end
      end.
  
  start_next_stage(PrevStageOutputs, Stage, Grouping,
                   #state{jobinfo = #jobinfo{jobname = JobName}} = S) ->
      {Tasks, S1} = setup_stage_tasks(PrevStageOutputs, Stage, Grouping, S),
  