Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
DEMO
Loading...
Searching...
No Matches
signet::forge::OverrideRateMonitor Class Reference

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 OverrideRateMonitorOptionsoptions () const noexcept
 Get the configured options.
 

Detailed Description

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.

Member Typedef Documentation

◆ AlertCallback

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.

◆ HaltCallback

using signet::forge::OverrideRateMonitor::HaltCallback = std::function<void(HaltReason reason, const std::string& detail)>

Definition at line 312 of file human_oversight.hpp.

Constructor & Destructor Documentation

◆ OverrideRateMonitor()

signet::forge::OverrideRateMonitor::OverrideRateMonitor ( OverrideRateMonitorOptions  opts = {})
inlineexplicit

Definition at line 314 of file human_oversight.hpp.

Member Function Documentation

◆ current_count()

int64_t signet::forge::OverrideRateMonitor::current_count ( int64_t  now_ns)
inline

Get the current override count within the window.

Definition at line 359 of file human_oversight.hpp.

◆ options()

const OverrideRateMonitorOptions & signet::forge::OverrideRateMonitor::options ( ) const
inlinenoexcept

Get the configured options.

Definition at line 374 of file human_oversight.hpp.

◆ record_override()

int64_t signet::forge::OverrideRateMonitor::record_override ( int64_t  timestamp_ns)
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.

◆ set_alert_callback()

void signet::forge::OverrideRateMonitor::set_alert_callback ( AlertCallback  cb)
inline

Register a callback for when override rate exceeds threshold.

Definition at line 318 of file human_oversight.hpp.

◆ set_halt_callback()

void signet::forge::OverrideRateMonitor::set_halt_callback ( HaltCallback  cb)
inline

Register a callback for system halt requests.

Definition at line 324 of file human_oversight.hpp.

◆ trigger_halt()

void signet::forge::OverrideRateMonitor::trigger_halt ( HaltReason  reason,
const std::string &  detail = "" 
)
inline

Manually trigger a system halt (Art.14(4) "stop button").

Definition at line 366 of file human_oversight.hpp.


The documentation for this class was generated from the following file: