1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Safety monitor for fault latching and fail-fast process termination.
//!
//! `CuSafetyMon` is designed for safety-critical deployments where "keep running"
//! is less important than deterministic fault containment.
//!
//! Behavior:
//! - Maintains a CopperList heartbeat (`process_copperlist`) and exits if no progress
//! is observed within `copperlist_deadline_ms`.
//! - Consumes the runtime execution probe to report the last known
//! `(component_id, step, culistid)` when a lock is detected.
//! - Registers with Copper's shared panic hook and turns panics into explicit process exit codes.
//! - Latches runtime errors (`process_error`) as shutdown faults with their own exit code.
//! The `process_error` index is a monitored component index into
//! `CuMonitoringMetadata::components()`.
//!
//! Config (monitor `config` map keys):
//! - `copperlist_deadline_ms` (u64, default: 1000)
//! - `watchdog_period_ms` (u64, default: `max(deadline/4, 10)`)
//! - `exit_code_shutdown` (i32, default: 70)
//! - `exit_code_lock` (i32, default: 71)
//! - `exit_code_panic` (i32, default: 72)
//!
//! Implementation is split by target profile:
//! - `std_impl`: full watchdog/panic/exit behavior.
//! - `nostd_impl`: compile-only placeholder (behavior intentionally deferred).
extern crate alloc;
pub use CuSafetyMon;
pub use CuSafetyMon;