anchor.diff:  %%--------------------------------------------------------------------
   -spec state_get(Key :: term()) -> Value :: term().
   state_get(Key) ->
  -    case dbsync_state:get({dbsync_state, Key}) of
  +    case dbsync_state:get(Key) of
           {ok, #document{value = #dbsync_state{entry = Value}}} ->
               Value;
           {error, {not_found, _}} ->
  
positive.code: %%--------------------------------------------------------------------
  -spec state_put(Key :: term(), Value :: term()) -> ok.
  state_put(Key, Value) ->
      {ok, _} = dbsync_state:save(#document{key = {dbsync_state, Key}, value = #dbsync_state{entry = Value}}),
      ok.
  
  %%--------------------------------------------------------------------
  
negative.code:     end, CurrentUntil, SortedKeys),
      case Stashed + 1 < NewBranchSince of
          true ->
              % missing batches - check once more (requests may be processed in parallel) and request missing changes
              timer:sleep(timer:seconds(2)),
              NewCurrentUntil = get_current_seq(ProviderId, SpaceId),
              case NewCurrentUntil > CurrentUntil of
  