anchor.diff:                %% delete_fun/0 %% currently not needed anywhere else
                 update_fun/0
                ]).
  +
  +-type object_rec() :: tuple().
   
   %% -type chef_object_name() :: 'chef_node' |
   %%                             'chef_role'.
  
positive.code: 
  fetch_query_for_type(chef_sandbox) ->
      fetch_sandbox.
  
  -define(ASSERT_RECORD(Object, RecName),
          case Object of
              #RecName{} -> Object;
              _ -> error({unexpected_type, {expected, #RecName{}}, {found, Object}})
          end).
  
  assert_chef_object(Object, chef_client) ->
      ?ASSERT_RECORD(Object, chef_client);
  
  assert_chef_object(Object, chef_data_bag) ->
      ?ASSERT_RECORD(Object, chef_data_bag);
  
  assert_chef_object(Object, chef_data_bag_item) ->
      ?ASSERT_RECORD(Object, chef_data_bag_item);
  
  assert_chef_object(Object, chef_environment) ->
      ?ASSERT_RECORD(Object, chef_environment);
  
  assert_chef_object(Object, chef_node) ->
      ?ASSERT_RECORD(Object, chef_node);
  
  assert_chef_object(Object, chef_role) ->
      ?ASSERT_RECORD(Object, chef_role);
  
  assert_chef_object(Object, chef_sandbox) ->
      ?ASSERT_RECORD(Object, chef_sandbox);
  
  assert_chef_object(Object, chef_cookbook_version) ->
      ?ASSERT_RECORD(Object, chef_cookbook_version);
  
  assert_chef_object(Object, chef_user) ->
      ?ASSERT_RECORD(Object, chef_user).
  
  %% assert_chef_object(Object, chef_data_bag) ->
  %%     case Object of
  %%         #chef_data_bag{} -> true;
  %%         _ -> error({unexpected_type, {expected, #chef_data_bag{}}, {found, Object}})
  %%     end;
  %% assert_chef_object(Object, chef_data_bag_item) ->
  %%     case Object of
  %%         #chef_data_bag_item{} -> true;
  %%         _ -> error({unexpected_type, {expected, #chef_data_bag_item{}}, {found, Object}})
  %%     end;
  %% assert_chef_object(Object, chef_environment) ->
  %%     case Object of
  %%         #chef_environment{} -> true;
  %%         _ -> error({unexpected_type, {expected, #chef_environment{}}, {found, Object}})
  %%     end;
  %% assert_chef_object(Object, chef_node) ->
  %%     case Object of
  %%         #chef_node{} -> true;
  %%         _ -> error({unexpected_type, {expected, #chef_node{}}, {found, Object}})
  %%     end;
  %% assert_chef_object(Object, chef_role) ->
  %%     case Object of
  %%         #chef_role{} -> true;
  %%         _ -> error({unexpected_type, {expected, #chef_role{}}, {found, Object}})
  %%     end.
  
  
  -spec fetch_objects(#context{}, atom(),
                      binary() | {id, object_id()}) -> {not_found, org} |
  
negative.code:     case stats_hero:ctime(ReqId, {chef_sql, Fun},
                            fun() -> chef_sql:Fun(OrgId, ObjectIdentifier) end) of
          {ok, not_found} -> not_found;
          {ok, Object} -> Object;
          {error, _Why} = Error -> Error
      end;
  fetch_object(#context{}=Ctx, ObjectType, OrgName, ObjectIdentifier) ->
  