anchor.diff:  %% Alarm helpers
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %% @doc Get alarm by name.
  --spec get_alarm(Name :: atom(), Alarms :: alarms()) -> alarm() | false.
  +-spec get_alarm(Name :: atom(), Alarms :: alarms()) -> {ok, alarm()} |
  +                                                       {false, unknown_alarm}.
   get_alarm(Name, Alarms) ->
  -    lists:keyfind(Name, 2, Alarms).
  +    case Alarm = lists:keyfind(Name, 2, Alarms) of
  +        false  -> {error, unknown_alarm};
  +        _Found -> {ok, Alarm}
  +    end.
   
   %% @doc Get value for specified option key from key-value list. Return provided
   %%      default value, if key does not exist.
  
positive.code: 
  on({check_alarm, Name}, {IsLeader, Alarms, ScaleReq, Triggers})
    when IsLeader andalso ScaleReq#scale_req.lock =:= locked  ->
      Alarm = get_alarm(Name, Alarms),
  
      ?TRACE("check_alarm: ~p, scale_req is locked", [Name]),
      {IsLeader, Alarms, ScaleReq, next(Name, Alarm#alarm.interval, Triggers)};
  
negative.code: %% @doc Check alarm Name for new scale request.
  on({check_alarm, Name}, {IsLeader, Alarms, ScaleReq, Triggers})
    when IsLeader andalso ScaleReq#scale_req.lock =:= unlocked  ->
      {ok, Alarm} = get_alarm(Name, Alarms),
  
      % log current number of vms
      log_vms(),
  