![]() |
Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
|
DEMO |
Sliding-window override rate monitor — EU AI Act Art.14(5). More...
#include <human_oversight.hpp>
Public Types | |
| using | AlertCallback = std::function< void(int64_t override_count, int64_t window_ns)> |
| using | HaltCallback = std::function< void(HaltReason reason, const std::string &detail)> |
Public Member Functions | |
| OverrideRateMonitor (OverrideRateMonitorOptions opts={}) | |
| void | set_alert_callback (AlertCallback cb) |
| Register a callback for when override rate exceeds threshold. | |
| void | set_halt_callback (HaltCallback cb) |
| Register a callback for system halt requests. | |
| int64_t | record_override (int64_t timestamp_ns) |
| Record an override event at the given timestamp. | |
| int64_t | current_count (int64_t now_ns) |
| Get the current override count within the window. | |
| void | trigger_halt (HaltReason reason, const std::string &detail="") |
| Manually trigger a system halt (Art.14(4) "stop button"). | |
| const OverrideRateMonitorOptions & | options () const noexcept |
| Get the configured options. | |
Sliding-window override rate monitor — EU AI Act Art.14(5).
Tracks the frequency of human override events within a configurable time window. When the override rate exceeds a threshold, fires an alert callback (and optionally a halt callback for Art.14(4) "stop button" automation).
Thread-safe: all methods are guarded by a mutex.
Definition at line 309 of file human_oversight.hpp.
| using signet::forge::OverrideRateMonitor::AlertCallback = std::function<void(int64_t override_count, int64_t window_ns)> |
Definition at line 311 of file human_oversight.hpp.
| using signet::forge::OverrideRateMonitor::HaltCallback = std::function<void(HaltReason reason, const std::string& detail)> |
Definition at line 312 of file human_oversight.hpp.
|
inlineexplicit |
Definition at line 314 of file human_oversight.hpp.
|
inline |
Get the current override count within the window.
Definition at line 359 of file human_oversight.hpp.
|
inlinenoexcept |
Get the configured options.
Definition at line 374 of file human_oversight.hpp.
|
inline |
Record an override event at the given timestamp.
Returns the current override count within the window, or -1 on error.
Definition at line 331 of file human_oversight.hpp.
|
inline |
Register a callback for when override rate exceeds threshold.
Definition at line 318 of file human_oversight.hpp.
|
inline |
Register a callback for system halt requests.
Definition at line 324 of file human_oversight.hpp.
|
inline |
Manually trigger a system halt (Art.14(4) "stop button").
Definition at line 366 of file human_oversight.hpp.