anchor.diff:                                   }}}.
   
   %% ===================================================================
  +release_caps(Caps, State0) ->
  +    Vat = self(),
  +    lists:foldl(
  +      fun (Cap, State) ->
  +              case Cap of
  +                  #capability{ id = {local, {Id, Vat}} } ->
  +                      release_export(Id, all, State);
  +                  _ ->
  +                      %% TODO: how do we release the other capabilities..
  +                      State
  +              end
  +      end, State0, Caps).
  +
  +%% ===================================================================
   
   %% ===================================================================
   %% process messages, these are run in their own processes
   %% ===================================================================
   
   %% ===================================================================
  +-spec handle_message_process(Message::ecapnp:object(), Vat::pid()) -> ok.
   handle_message_process(Message, Vat) ->
       case ecapnp:get(Message) of
           {call, Call} -> handle_call(Call, Vat);
           {return, Return} -> handle_return(Return, Vat);
           {restore, Restore} -> handle_restore(Restore, Vat);
  -        %% {finish, Finish} -> handle_finish(Finish, Vat);
  -        %% {release, Release} -> handle_release(Release, Vat);
  +        {finish, Finish} -> handle_finish(Finish, Vat);
  +        {release, Release} -> handle_release(Release, Vat);
           _ ->
               {ok, Reply} = ecapnp:set_root('Message', rpc_capnp),
               ecapnp:set({unimplemented, Message}, Reply),
  
positive.code:                        questions = Qs#questions{
                                       promises = Ps1
                                      }},
              Finish = new_message(finish),
              ok = ecapnp:set(questionId, Id, Finish),
              {noreply, send_message(Finish, State1)}
      end.
  
  %% ===================================================================
  
  
  %% ===================================================================
  
negative.code:     send_message(Message, Vat).
  
  %% ===================================================================
  handle_finish(Finish, Vat) ->
      Id = ecapnp:get(questionId, Finish),
      Release = ecapnp:get(releaseResultCaps, Finish),
      gen_server:call(Vat, {finish, Id, Release}).
  
  %% ===================================================================
  handle_release(Release, Vat) ->
      Id = ecapnp:get(id, Release),
      Count = ecapnp:get(referenceCount, Release),
      gen_server:call(Vat, {release, Id, Count}).
  
  %% ===================================================================
  
  %% ===================================================================
  %% common utils
  