anchor.diff:      get_effective/1, 
       add_qos_entry_id/3, add_qos_entry_id/4, remove_qos_entry_id/3,
       is_replica_required_on_storage/2, is_effective_qos_of_file/2,
  -    qos_membership/1, has_any_qos_entry/2, 
  +    qos_membership/1,
       cleanup_reference_related_documents/1, cleanup_reference_related_documents/2, 
       cleanup_on_no_reference/1,
       delete_associated_entries_on_no_references/1
  
positive.code: 
  
  -spec qos_membership(file_meta:uuid() | file_meta:doc()) -> membership().
  qos_membership(FileUuidOrDoc) ->
      case {has_any_qos_entry(FileUuidOrDoc, direct), has_any_qos_entry(FileUuidOrDoc, effective)} of
          {true, true} -> ?DIRECT_AND_ANCESTOR_MEMBERSHIP;
          {true, false} -> ?DIRECT_MEMBERSHIP;
          {false, true} -> ?ANCESTOR_MEMBERSHIP;
          {false, false} -> ?NONE_MEMBERSHIP
      end.
  
  
  %%--------------------------------------------------------------------
  %% @doc
  %% Checks whether given file has any QoS entry (effective or direct).
  %% @end
  %%--------------------------------------------------------------------
  -spec has_any_qos_entry(file_meta:uuid() | file_meta:doc(), direct | effective) -> boolean().
  has_any_qos_entry(#document{key = Uuid}, direct) ->
      has_any_qos_entry(fslogic_uuid:ensure_referenced_uuid(Uuid), direct);
  has_any_qos_entry(Key, direct) ->
      has_any_qos_entry(get(Key));
  has_any_qos_entry(UuidOrDoc, effective) ->
      has_any_qos_entry(get_effective(UuidOrDoc)).
  
  
  %%--------------------------------------------------------------------
  
negative.code: 
  
  %% @private
  -spec get_original_parent_doc(undefined | file_ctx:ctx()) -> undefined | file_meta:doc().
  get_original_parent_doc(undefined) -> undefined;
  get_original_parent_doc(OriginalParentCtx) ->
  