anchor.diff:              State
       end.
   
  +process_server_heartbeat(State, _Header, Body) ->
  +    case catch jiffy:decode(Body) of
  +        {Data} ->
  +            %% TODO - we should do something with these heartbeats...
  +            ej:get({<<"server">>}, Data),
  +            State;
  +        {'EXIT', Error} ->
  +            lager:error("Server heartbeat JSON parsing failed: body=~s, error=~s", [Body, Error]),
  +            State
  +    end.
  +
   respond(<<"commit">>, JobId, State) ->
       send_response(<<"ack_commit">>, JobId, State);
   respond(<<"run">>, JobId, State) ->
  
positive.code: %% TODO: tighten typedefs up
  -record(state,
          {command_sock :: any(),
           client_name :: binary(),
           heartbeat_interval :: integer(),
           sequence :: integer(),
  
negative.code: 
      lager:info("Getting config from Pushy Server ~s:~w", [Hostname, Port]),
      Config = pushy_client_config:get_config(?PUSHY_ORGNAME, Hostname, Port),
      Interval =  pushy_util:get_env(pushysim, heartbeat_interval, fun is_integer/1),
  
      NodeId = list_to_binary(io_lib:format("~s-~4..0B", [ClientName, InstanceId])),
      lager:info("Starting pushy client with node id ~s (~s).", [NodeId, IncarnationId]),
  
  
      HeartbeatAddress = proplists:get_value(heartbeat_address, Config),
      {ok, HeartbeatSock} = connect_to_heartbeat(Ctx, HeartbeatAddress),
      CommandAddress = proplists:get_value(command_address, Config),
      {ok, CommandSock} = connect_to_command(Ctx, CommandAddress),
  
      {ok, PrivateKey} = chef_keyring:get_key(client_private),
      {ok, PublicKey} = server_public_key(Config),
  
      State = #state{command_sock = CommandSock,
                     heartbeat_sock = HeartbeatSock,
                     client_name = ClientName,
                     heartbeat_interval = Interval,
                     sequence = 0,
  