@@ -131,7 +131,7 @@ Main Components
131131 - Maps directly to ``ros2_medkit_msgs::msg::Fault `` via ``to_msg() ``
132132 - Uses ``std::set `` for reporting_sources to ensure uniqueness
133133 - Tracks first and last occurrence timestamps
134- - Manages fault status lifecycle (PENDING → CONFIRMED → CLEARED)
134+ - Manages fault status lifecycle with debounce (PREFAILED → CONFIRMED → CLEARED)
135135
136136Services
137137--------
@@ -141,17 +141,19 @@ Services
141141
142142Reports a new fault or updates an existing one.
143143
144- - **Input validation **: fault_code and source_id cannot be empty, severity must be 0-3
144+ - **Input validation **: fault_code and source_id cannot be empty, event_type must be valid
145+ - **Event types **: FAILED (fault detected) or PASSED (fault condition cleared)
146+ - **Debounce **: FAILED events decrement counter, PASSED events increment counter
145147- **Aggregation **: Same fault_code from different sources creates a single fault entry
146148- **Severity escalation **: Fault severity is updated if a higher severity is reported
147- - **Returns **: ``success =true `` with message indicating "New fault" or "Fault updated"
149+ - **Returns **: ``accepted =true `` if event was processed
148150
149151~/get_faults
150152~~~~~~~~~~~~
151153
152154Queries faults with optional filtering.
153155
154- - **Status filter **: Filter by status (PENDING, CONFIRMED, CLEARED); defaults to CONFIRMED
156+ - **Status filter **: Filter by status (PREFAILED, PREPASSED, CONFIRMED, HEALED , CLEARED); defaults to CONFIRMED
155157- **Severity filter **: When ``filter_by_severity=true ``, returns only faults of specified severity
156158- **Returns **: List of ``Fault `` messages matching the filter criteria
157159
@@ -191,14 +193,17 @@ When a fault is re-reported with a higher severity, the stored severity is updat
191193This ensures the fault reflects the worst-case condition. Severity levels are ordered:
192194``INFO(0) < WARN(1) < ERROR(2) < CRITICAL(3) ``.
193195
194- Status Lifecycle
195- ~~~~~~~~~~~~~~~~
196+ Status Lifecycle (Debounce Model)
197+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
196198
197- Faults follow a lifecycle: PENDING → CONFIRMED → CLEARED
199+ Faults follow an AUTOSAR DEM-style debounce lifecycle:
198200
199- - **PENDING **: Initial status when fault is first reported
200- - **CONFIRMED **: Status after automatic or manual confirmation (Issue #6)
201- - **CLEARED **: Status after fault is cleared/acknowledged
201+ - **PREFAILED **: Debounce counter < 0 but above confirmation threshold (fault trending towards confirmation)
202+ - **PREPASSED **: Debounce counter > 0 but below healing threshold (fault trending towards healing)
203+ - **CONFIRMED **: Debounce counter <= confirmation threshold (e.g., -3). Fault is active and verified.
204+ - **HEALED **: Debounce counter >= healing threshold (if healing enabled). Fault resolved by PASSED events.
205+ - **CLEARED **: Fault manually acknowledged via ClearFault service
202206
203- Currently, faults start as PENDING and move to CLEARED when explicitly cleared.
204- Automatic PENDING → CONFIRMED transitions will be implemented in Issue #6.
207+ FAILED events decrement the debounce counter (towards confirmation).
208+ PASSED events increment the debounce counter (towards healing).
209+ CRITICAL severity bypasses debounce and confirms immediately.
0 commit comments