Skip to main content

Module shadow

Module shadow 

Source
Expand description

MAGE shadow memory stream — trajectory-level risk accumulation (spec 004-16).

TrajectoryRiskAccumulator maintains a per-session rolling risk score by ingesting AuditSignalType events from zeph-sanitizer. The score decays exponentially between turns and is used to gate tool execution when it exceeds a configured threshold.

When enabled = false (default), every method is a zero-cost no-op — no allocations, no computation.

§Example

use zeph_memory::shadow::{TrajectoryRiskAccumulator, AuditSignalType, Severity};
use zeph_config::TrajectoryRiskAccumulatorConfig;

let mut acc = TrajectoryRiskAccumulator::new_noop();
assert_eq!(acc.current_risk(), 0.0);
assert!(!acc.is_blocked());

Structs§

SignalEvent
A recorded safety signal ingested during a specific turn.
TrajectoryRiskAccumulator
Per-session trajectory risk accumulator (MAGE spec 004-16).

Enums§

AuditSignalType
Signal type emitted by a sanitizer subsystem.
Severity
Severity level for an AuditSignalType.