openagent-aegis-policy · temporal
Declared module signatures, types, configuration, and source documentation.
Source: aegis/openagent-aegis-policy/src/temporal.rs. SHA-256: 1bb6e72f5cc87d20e111ffad01127805ee6e9ff889de94235efcab0ac3737539.
This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.
temporal::TemporalPolicyEvaluator
Evaluates temporal policy constraints.
pub struct TemporalPolicyEvaluator;Source line: 14.
temporal::TemporalPolicyEvaluator::evaluate
Evaluate temporal constraints without cooldown checking.
Checks:
- Validity window --
nowmust be betweenvalid_fromandvalid_until. - Active hours -- current hour must be within the active hours window.
Note: active_hours check uses UTC hour. The timezone field on ActiveHours
is recorded for documentation purposes but this evaluator operates in UTC
to maintain determinism. Callers should convert now to the appropriate
timezone before calling if timezone-aware checks are required.
pub fn evaluate(
constraints: &TemporalConstraints,
now: DateTime<Utc>,
) -> Result<PolicyDecision, PolicyError>;Source line: 27.
temporal::TemporalPolicyEvaluator::evaluate_with_cooldown
Evaluate temporal constraints with optional cooldown checking.
Checks all constraints from evaluate plus:
3. Cooldown -- if last_operation is provided, ensures enough time has
elapsed since the last operation per the cooldown duration.
The cooldown is specified as an ISO 8601 duration string. This evaluator
supports a simplified subset: PT{n}S (seconds), PT{n}M (minutes),
PT{n}H (hours), and P{n}D (days).
pub fn evaluate_with_cooldown(
constraints: &TemporalConstraints,
now: DateTime<Utc>,
last_operation: Option<DateTime<Utc>>,
) -> Result<PolicyDecision, PolicyError>;Source line: 43.