anchor.diff:  -export_type([stats/0]).
   -endif.
   
  --type option()   :: feedback_response |
  -                    {feedback_request, comm:mypid()} |
  +-type option()   :: {feedback_request, comm:mypid()} |
                       {send_stats, comm:mypid()} | %send stats to pid after completion
                       {session_id, rrepair:session_id()} |
                       {from_my_node, 0 | 1}.
  
positive.code: -spec get_stats_session_id(stats()) -> rrepair:session_id() | null.
  get_stats_session_id(Stats) -> Stats#resolve_stats.session_id.
  
  -spec get_stats_feedback(stats()) -> boolean().
  get_stats_feedback(Stats) -> Stats#resolve_stats.feedback_response.
  
  %% @doc merges two stats records with identical session_id, otherwise error will be raised
  -spec merge_stats(stats(), stats()) -> stats() | error.
  merge_stats(#resolve_stats{ session_id = ASID,
                              diff_size = ADiff,
                              feedback_response = AFB,
                              regen_count = ARC,
                              regen_fail_count = AFC,
                              upd_fail_count = AUFC,
                              update_count = AUC },
              #resolve_stats{ session_id = BSID,
                              diff_size = BDiff,
                              feedback_response = BFB,
                              regen_count = BRC,
                              regen_fail_count = BFC,
                              upd_fail_count = BUFC,
  
negative.code:     NewState = State#rr_resolve_state{stats = NewStats, feedbackKvv = {NewFBItems, MyIKvTree}},
      ?ASSERT(_Diff =:= (NewRegenOk + NewUpdOk + NewUpdFail + NewRegenFail)),
      ?TRACE("UPDATED = ~p - Regen=~p", [NewUpdOk, NewRegenOk], State),
      shutdown(resolve_ok, NewState, FBDest, NewFBItems, []);
  
  on({'DOWN', _MonitorRef, process, _Owner, _Info}, _State) ->
      log:log(info, "[ ~p - ~p] shutdown due to rrepair shut down", [?MODULE, comm:this()]),
  