code: def add(self, message_dict):
          
          is_action = message_dict.get(ACTION_TYPE_FIELD) is not None
          written_message = WrittenMessage.from_dict(message_dict)
          if is_action:
              action_level = written_message.task_level.parent()
              action = self._nodes.get(action_level)
              if action is None:
                  action = WrittenAction(
                      task_level=action_level,
                      task_uuid=message_dict[TASK_UUID_FIELD])
              if message_dict[ACTION_STATUS_FIELD] == STARTED_STATUS:
                  # Either newly created MissingAction, or one created by
                  # previously added descendant of the action.
                  action = action._start(written_message)
              else:
                  action = action._end(written_message)
              return self._insert_action(action)
          else:
              # Special case where there is no action:
              if written_message.task_level.level == [1]:
                  return self.transform([
                      "_nodes", self._root_level], written_message, [
                          "_completed"], lambda s: s.add(self._root_level))
              else:
                  return self._ensure_node_parents(written_message)
docs: Update the L{Task} with a dictionary containing a serialized Eliot
          message.
  
          @param message_dict: Dictionary whose task UUID matches this one.
  
          @return: Updated L{Task}.