component: AiMonitorHeartbeat
proto_imports:
  - vehicle/ai_monitor/robot_monitor/diagnostics/heartbeat_diagnostics.proto
metric: zoox::ai_monitor::proto::HeartbeatMetric
namespace: zoox::ai_monitor::heartbeat
faults:
  - id: 0
    name: HERO_STATE_MIA
    severity: ERROR
    description: "Staleness detected on topic /planner/hero_state. Check Planner for staleness."
    triggers_nogo: true
    # Deprecated.
  - id: 1
    name: LLC_MIA
    severity: ERROR
    deprecated: true
    description: "Staleness detected on topic /vehicle/measurements. Check LLC."
    triggers_nogo: true
    # TODO(PLAN-8186): Deprecate /swopdash/nogo_request topic
  - id: 2
    name: NOGO_REQUEST_MIA
    severity: ERROR
    description: "Staleness detected on topic /swopdash/nogo_request. Check Swopdash for staleness or check for poor network connectivity."
    triggers_nogo: true
    # Deprecated.
  - id: 3
    name: SWF_SOLVER_MIA
    severity: ERROR
    deprecated: true
    description: "Staleness detected on topic /pose_estimator/swf_solver/status. Check Localizer and Mofo for staleness or check for poor network connectivity."
    triggers_nogo: true
  - id: 4
    name: SMOOTHER_MIA
    severity: ERROR
    description: "Staleness detected on topic /planner/smoother. Check Planner for staleness."
    triggers_nogo: true
  - id: 5
    name: DECISION_MIA
    severity: ERROR
    description: "Staleness detected on topic /planner/decision. Check Planner for staleness."
    triggers_nogo: true
  - id: 6
    name: MOFO_MIA
    severity: ERROR
    description: "Staleness detected on topic /hero_smooth_state. Check Localizer and Mofo for staleness or check for poor network connectivity."
    triggers_nogo: true
    # Deprecated.
  - id: 7
    name: NOGO_REQUEST2_MIA
    severity: ERROR
    deprecated: true
    description: "Coredash state input timed out."
    triggers_nogo: true
  - id: 8
    name: PCP_MIA
    severity: ERROR
    description: "Staleness detected on topic /driving/PerceptionObstacles2. Check Perception for staleness."
    triggers_nogo: true
  - id: 9
    name: FUSED_STATIC_CORRIDOR_MIA
    severity: ERROR
    description: "Staleness detected on topic /planner/corridor/fused_static_corridor. Check Planner for staleness."
    triggers_nogo: true
  - id: 10
    name: CONSTRUCTION_ZONE_MONITOR_MIA
    severity: ERROR
    description: "Staleness detected on topic /perception/construction_zone_output. Check Perception for staleness."
    triggers_nogo: true
  - id: 11
    name: PRED_MIA
    severity: ERROR
    description: "Staleness detected on topic /prediction/prediction_internal_state. Check Planner for staleness."
    triggers_nogo: true
  - id: 12
    name: COREDASH_MIA
    severity: ERROR
    description: "Staleness detected on topic /swopdash/client/heartbeat. Check Coredash for staleness or check for poor network connectivity."
    triggers_nogo: true
  - id: 13
    name: SAFETYPCP_MIA
    severity: ERROR
    description: "Staleness detected on topic /safety_pcp/obstacles. Check Safety Perception for staleness."
    triggers_nogo: true
  - id: 14
    name: VEH_MEAS_MIA
    severity: ERROR
    description: "Staleness detected on topic /vehicle/measurements. Check EMU or LLC."
    triggers_nogo: true
  - id: 15
    name: CHUM_RECORDER_MIA
    severity: ERROR
    description: "Staleness detected on topic /chum_recorder/heartbeat. Check the chum recorder is running."
    triggers_nogo: true
  - id: 16
    name: SAFETYNET_MIA
    severity: ERROR
    description: "Staleness detected on topic /safetynet/safetynet_output. Check the SafetyNet is running."
    triggers_nogo: true

    ##############################################################################################
    ## Warning diagnostics set if AI monitor heartbeat component is enabled for test mode only. ##
    ##############################################################################################

  - id: 1000
    name: HeroStateMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /planner/hero_state. Check Planner for staleness."
    # Deprecated.
  - id: 1001
    name: LlcMiaWarn
    severity: WARNING
    deprecated: true
    description: "Staleness detected on topic /vehicle/measurements. Check LLC."
    # TODO(PLAN-8186): Deprecate /swopdash/nogo_request topic
  - id: 1002
    name: NoGoRequestMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /swopdash/nogo_request. Check Swopdash for staleness or check for poor network connectivity."
    # Deprecated.
  - id: 1003
    name: SwfSolverMiaWarn
    severity: WARNING
    deprecated: true
    description: "Staleness detected on topic /pose_estimator/swf_solver/status. Check Localizer and Mofo for staleness or check for poor network connectivity."
  - id: 1004
    name: SmootherMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /planner/smoother. Check Planner for staleness."
  - id: 1005
    name: DecisionMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /planner/decision. Check Planner for staleness."
  - id: 1006
    name: MofoMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /hero_smooth_state. Check Localizer and Mofo for staleness or check for poor network connectivity."
  - id: 1008
    name: PcpMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /driving/PerceptionObstacles2. Check Perception for staleness."
  - id: 1009
    name: FusedStaticCorridorMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /planner/corridor/fused_static_corridor. Check Planner for staleness."
  - id: 1010
    name: ConstructionZoneMonitorMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /perception/construction_zone_output. Check Perception for staleness."
  - id: 1011
    name: PredMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /prediction/prediction_internal_state. Check Planner for staleness."
  - id: 1012
    name: CoredashMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /swopdash/client/heartbeat. Check Coredash for staleness or check for poor network connectivity."
  - id: 1013
    name: SafetyPcpMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /safety_pcp/obstacles. Check Safety Perception for staleness."
  - id: 1014
    name: VehMeasMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /vehicle/measurements. Check EMU or LLC."
  - id: 1015
    name: ChumRecorderMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /chum_recorder/heartbeat. Check chum recorder is running."
  - id: 1016
    name: SafetyNetMiaWarn
    severity: WARNING
    description: "Staleness detected on topic /safetynet/safetynet_output. Check SafetyNet is running."
