anchor.diff:      ok.
   
   %% Ctx will never be a list or binary so we can tell if a context is passed by checking that
  --spec set(otel_ctx:t() | key() | unicode:charlist(), #{key() => value()} | [{key(), value()}] | value()) -> otel_ctx:t() | ok.
  +-spec set(otel_ctx:t() | input_key(), #{input_key() => input_value()} | [{input_key(), input_value()}] | input_value()) -> otel_ctx:t() | ok.
   set(Key, Value) when (is_list(Key) orelse is_binary(Key)) andalso is_binary(Value) ->
  -    set(Key, Value, []);
  +    ?assert_type(set(Key, Value, []), ok | undefined | #{any() => any()});
   %% drop bad value
   set(Key, Value) when (is_list(Key) orelse is_binary(Key)) andalso not is_binary(Value) ->
       ok;
   set(Ctx, KeyValues) when is_list(KeyValues) ->
  -    set(Ctx, maps:from_list(KeyValues));
  -set(Ctx, KeyValues) when is_map(KeyValues) ->
  +    ?assert_type(set(Ctx, maps:from_list(KeyValues)), ok | undefined | #{any() => any()});
  +set(Ctx, KeyValues) when is_map(KeyValues) andalso (is_map(Ctx) orelse Ctx =:= undefined)->
       Baggage = otel_ctx:get_value(Ctx, ?BAGGAGE_KEY, #{}),
       otel_ctx:set_value(Ctx, ?BAGGAGE_KEY, maps:merge(Baggage, verify_baggage(KeyValues))).
   
  --spec set(otel_ctx:t() | key() | unicode:charlist(), key() | value() | unicode:charlist(), value() | list()) -> otel_ctx:t() | ok.
  +-spec set_to(otel_ctx:t(), #{input_key() => input_value()} | [{input_key(), input_value()}]) -> otel_ctx:t().
  +set_to(Ctx, KeyValues) when is_list(KeyValues) ->
  +    set_to(Ctx, maps:from_list(KeyValues));
  +set_to(Ctx, KeyValues) when is_map(KeyValues) ->
  +    Baggage = otel_ctx:get_value(Ctx, ?BAGGAGE_KEY, #{}),
  +    otel_ctx:set_value(Ctx, ?BAGGAGE_KEY, maps:merge(Baggage, verify_baggage(KeyValues))).
  +
  +-spec set(otel_ctx:t() | input_key(), input_key() | input_value(), input_value() | metadata()) -> otel_ctx:t() | ok.
   set(Key, Value, Metadata) when (is_list(Key) orelse is_binary(Key)) andalso is_binary(Value) ->
       Baggage = otel_ctx:get_value(?BAGGAGE_KEY, #{}),
       otel_ctx:set_value(?BAGGAGE_KEY, maps:merge(Baggage, verify_baggage(#{Key => {Value, Metadata}})));
  
positive.code: set(Key, Value, _Metadata) when (is_list(Key) orelse is_binary(Key)) andalso not is_binary(Value) ->
      ok;
  set(Ctx, Key, Value) ->
      set(Ctx, Key, Value, []).
  
  -spec set(otel_ctx:t(), key() | unicode:charlist(), value(), metadata()) -> otel_ctx:t().
  set(Ctx, Key, Value, Metadata) when is_binary(Value) ->
      Baggage = otel_ctx:get_value(Ctx, ?BAGGAGE_KEY, #{}),
      otel_ctx:set_value(Ctx, ?BAGGAGE_KEY, maps:merge(Baggage, verify_baggage(#{Key => {Value, Metadata}})));
  %% drop bad value
  set(Ctx, _, _, _) ->
      Ctx.
  
  -spec get_all() -> t().
  
negative.code:          set/2,
           set/3,
           set/4,
           set_to/2,
           set_to/3,
           set_to/4,
           get_all/0,
           get_all/1,
           clear/0,
  