Requirements#

Fault Library Requirements
status: draft
security: YES
safety: QM
tags: requirements, fault_lib
version: 1

Functional Requirements#

Component Fault Catalog
status: invalid
security: NO
safety: QM
reqtype: Interface
version: 1

The fault library shall provide an API for defining and managing component fault catalogs. Fault catalogs can be initialized from a JSON file, a JSON string, or constructed programmatically using the provided API.

Unique Fault IDs in a Catalog
status: invalid
security: NO
safety: QM
reqtype: Functional
version: 1

The fault library shall refuse a catalog that defines a fault ID twice.

Fault Reporting
status: invalid
security: NO
safety: QM
reqtype: Functional
version: 1

The fault library shall let a component report a fault of its catalog with its lifecycle stage, the time of the report and optional environment data, through a reporter bound once to the fault’s descriptor.

Framework Agnostic
status: invalid
security: NO
safety: QM
reqtype: Non-Functional
version: 1

The fault library shall be usable from synchronous code without an async runtime and from several threads, particularly also at the same point in time.

Debouncing
status: invalid
security: NO
safety: QM
reqtype: Functional
version: 1

The fault library shall debounce reports per fault before relaying them, with a policy configured in the fault catalog: a minimum count within a time window, a hold time, and/or an edge with a cooldown.

Enabling Conditions
status: invalid
security: NO
safety: QM
reqtype: Functional
version: 1

The fault library shall let a component report the status of an enabling condition and let fault monitors query it.

Relay to the Fault Manager
status: invalid
security: NO
safety: QM
reqtype: Functional
version: 1

The fault library shall relay reports to the diagnostic fault manager over IPC. A report whose send fails with a transient error (transport down, timeout, queue full or rate limited) shall be kept in a retry queue of 512 reports, which drops the oldest report when full. Each report shall be retried up to 10 times, with the delay doubling from 100 ms up to 5 s, and shall be dropped after the tenth failed attempt.

Relay Permanent Errors
status: invalid
security: NO
safety: QM
reqtype: Functional
version: 1

The fault library shall drop a report at once when its send fails with an error that is not transient.

Relay Acknowledgement
status: invalid
security: NO
safety: QM
reqtype: Functional
version: 1

The fault library shall count a successful send as relayed and shall not wait for an acknowledgement from the fault manager.

Reporting Errors
status: invalid
security: NO
safety: QM
reqtype: Functional
version: 1

The fault library shall return an error to the reporting component when a report cannot be relayed or queued.

Assumptions of Use (AoU)#

Fault IDs
status: valid
security: NO
safety: QM
reqtype: Non-Functional
version: 1

The integrator shall give the faults of a component’s catalog IDs that are unique within that catalog and shall use only ASCII in text fault IDs and environment data.

Verification#

The requirements are verified by the tests of Eclipse OpenSOVD fault-lib at commit 12dac50. fault-lib does not tag its tests with requirement IDs yet, so they are listed here instead of being linked automatically.

Requirement

Tests in fault-lib

Component Fault Catalog (comp_req__fault_lib__catalog)

json_file_catalog_e2e, json_string_with_debounce_and_reset

Unique Fault IDs in a Catalog (comp_req__fault_lib__catalog_unique_ids)

duplicate_fault_id_returns_error, catalog_builder_rejects_duplicate_text_fault_id

Fault Reporting (comp_req__fault_lib__reporting)

publish_success, report_fault_with_env_data_and_query

Framework Agnostic (comp_req__fault_lib__framework_agnostic)

req1_reporter_requires_no_async_runtime, req1_reporter_is_send_sync, concurrent_process_and_query_does_not_panic

Debouncing (comp_req__fault_lib__debounce)

count_with_window_reports_only_after_min_count_within_window, holdtime_requires_continuous_duration_before_report, edge_with_cooldown_reports_first_then_suppresses_during_cooldown, req3_descriptor_supports_reporter_side_debounce

Enabling Conditions (comp_req__fault_lib__enabling_conditions)

enabling_condition_status_transitions

Relay to the Fault Manager (comp_req__fault_lib__relay)

cache_for_retry_evicts_oldest_when_full, backoff_delay_grows_exponentially, handle_send_failure_caches_on_transient_error, retry_config_defaults_are_sensible, process_retries_drops_after_max_retries

Relay Permanent Errors (comp_req__fault_lib__relay_permanent_error)

handle_send_failure_drops_on_permanent_error, permanent_errors_classified_correctly

Relay Acknowledgement (comp_req__fault_lib__relay_success)

process_retries_succeeds_on_first_retry (checks removal from the queue on success; no test covers the missing acknowledgement wait)

Reporting Errors (comp_req__fault_lib__report_errors)

req2_sink_error_propagates_to_caller, publish_fail

Fault IDs (aou_req__fault_lib__fault_ids)

unicode_in_text_fault_id_rejected, unicode_in_env_data_rejected