anchor.diff:  %% @doc Convenience function for assembling a job_node tuple from a proplist
   proplist_to_job_node(Proplist) ->
       {safe_get(<<"node_name">>, Proplist),
  -     job_status_atom(safe_get(<<"status">>, Proplist)),
  +     job_status(safe_get(<<"status">>, Proplist)),
        safe_get(<<"created_at">>, Proplist),
        safe_get(<<"updated_at">>, Proplist)
        }.
   
   %% Heartbeat Status translators
  -hb_status_code(idle) -> 1;
  -hb_status_code(ready) -> 2;
  -hb_status_code(running) -> 3;
  -hb_status_code(restarting) -> 4.
  -hb_status_atom(1) -> idle;
  -hb_status_atom(2) -> ready;
  -hb_status_atom(3) -> running;
  -hb_status_atom(4) -> restarting.
  +hb_status(idle) -> 1;
  +hb_status(ready) -> 2;
  +hb_status(running) -> 3;
  +hb_status(restarting) -> 4;
  +hb_status(1) -> idle;
  +hb_status(2) -> ready;
  +hb_status(3) -> running;
  +hb_status(4) -> restarting.
   
   %% Job Status translators
  -job_status_code(new) -> 0;
  -job_status_code(executing) -> 1;
  -job_status_code(complete) -> 2;
  -job_status_code(error) -> 3;
  -job_status_code(failed) -> 4;
  -job_status_code(expired) -> 5;
  -job_status_code(aborted) -> 6.
  -job_status_atom(0) -> new;
  -job_status_atom(1) -> executing;
  -job_status_atom(2) -> complete;
  -job_status_atom(3) -> error;
  -job_status_atom(4) -> failed;
  -job_status_atom(5) -> expired;
  -job_status_atom(6) -> aborted.
  +job_status(new) -> 0;
  +job_status(executing) -> 1;
  +job_status(complete) -> 2;
  +job_status(error) -> 3;
  +job_status(failed) -> 4;
  +job_status(expired) -> 5;
  +job_status(aborted) -> 6;
  +job_status(0) -> new;
  +job_status(1) -> executing;
  +job_status(2) -> complete;
  +job_status(3) -> error;
  +job_status(4) -> failed;
  +job_status(5) -> expired;
  +job_status(6) -> aborted.
   
   %% CHEF_COMMON CARGO_CULT
   %% chef_sql:flatten_record/1
  
positive.code: insert_job_nodes([], _OrgId, _JobId, _CreatedAt, _UpdatedAt) ->
      ok;
  insert_job_nodes([{NodeName, Status, _CreatedAt, _UpdatedAt}|Rest], OrgId, JobId, CreatedAt, UpdatedAt) ->
      case sqerl:statement(insert_job_node, [OrgId, NodeName, job_status_code(Status),
            CreatedAt, UpdatedAt, JobId], count) of
          {ok, 1} ->
              insert_job_nodes(Rest, OrgId, JobId, CreatedAt, UpdatedAt);
  
negative.code:                                       updated_at = UpdatedAt,
                                        node_name = NodeName,
                                        org_id = OrgId}) ->
      UpdateFields = [hb_status(Status), LastUpdatedBy, UpdatedAt, OrgId, NodeName],
      do_update(update_node_status_by_orgid_name, UpdateFields).
  
  %% job ops
  