anchor.diff:      end.
   
   -spec do_add_job_event(host(), jobname(), binary(), event(), state()) -> state().
  -do_add_job_event(Host, JobName, Msg, Event, {_Events, MsgBuf} = S) ->
  +do_add_job_event(Host, JobName, Msg, Event, #state{msgbuf = MsgBuf} = S) ->
       case dict:is_key(JobName, MsgBuf) of
           true -> add_event(Host, JobName, Msg, Event, S);
           false -> S
       end.
   
  -add_event(Host0, JobName, Msg, Event, {Events, MsgBuf}) ->
  +add_event(Host0, JobName, Msg, Event,
  +          #state{events = Events, msgbuf = MsgBuf} = S) ->
       {ok, {NMsg, LstLen0, MsgLst0}} = dict:find(JobName, MsgBuf),
       Time = disco_util:format_timestamp(now()),
       Host = list_to_binary(Host0),
  
positive.code: % the zombie job.
  handle_cast({job_done, JobName}, S) ->
      {noreply, do_job_done(JobName, S)};
  handle_cast({clean_job, JobName}, {Events, _MsgBuf} = S) ->
      {_, {_, MsgBufN}} = handle_cast({job_done, JobName}, S),
      delete_jobdir(JobName),
      {noreply, {dict:erase(JobName, Events), MsgBufN}}.
  
  -spec handle_info(term(), state()) -> gs_noreply().
  handle_info(Msg, State) ->
  
negative.code:         {error, {already_started, Server}} -> {ok, Server}
      end.
  
  % events dict: jobname -> { [event()], <start_time>, <job_coordinator_pid> }
  % msgbuf dict: jobname -> { <nmsgs>, <list-length>, [<msg>] }
  -record(state, {events = dict:new() :: dict(),
                  msgbuf = dict:new() :: dict()}).
  -type state() :: #state{}.
  
  -spec init(_) -> gs_init().
  init(_Args) ->
      _ = ets:new(event_files, [named_table]),
      {ok, #state{}}.
  
  -spec handle_call(term(), from(), state()) -> gs_reply(term()) | gs_noreply().
  
  handle_call({new_job, JobPrefix, Pid, Stages}, From,
              #state{events = Events0, msgbuf = MsgBuf0} = S) ->
      case unique_key(JobPrefix, Events0) of
          invalid_prefix ->
              {reply, {error, invalid_prefix}, S};
  