Skip to main content

Crate pai_drift

Crate pai_drift 

Source
Expand description

§PAI Drift Correlation Engine (Component #4)

Per PHASE1-TZ-001 Section 7 / P0-1 Section 7.4.

Cross-dimension drift correlation across 7 monitored dimensions:

DimensionSourceWeight
Identity changesConsent / Delegation mutations1.0
Objective adjustmentsObjective Registry mutations1.5
Personalization modificationsIdentity Layer changes1.0
Classification rule updatesTier reassignments2.0
Upgrade eventsGovernance logic changes2.0
Upgrade frequencyCount per rolling window1.0
Governance modificationsEnforcement scope changes2.5

§Architecture

  • Time-based rolling window: events older than window_secs are expired on every record() call.
  • Per-dimension score = sum of deltas within the window.
  • Composite score = sum(weight_i * dim_score_i).
  • When composite >= threshold, record() returns true and DriftReport::breached is set — the caller MUST activate Conservative Mode.
  • Thresholds are immutable once the engine is constructed (absent Amendment — DFT-I5).

§Invariants

  • DFT-I1: Dimension scores are monotonically non-decreasing within a window until events expire.
  • DFT-I2: Window eviction is time-based (old events expire).
  • DFT-I3: Composite score is deterministic for the same event sequence.
  • DFT-I4: Threshold breach always signals Conservative Mode.
  • DFT-I5: Thresholds are immutable after construction.

Structs§

DriftEngine
Cross-dimension drift correlation engine.
DriftReport
Snapshot of the engine’s current drift state.
DriftThresholds
Drift thresholds. Immutable once constructed (absent Amendment).

Enums§

DriftDimension
The 7 drift dimensions per PHASE1-TZ-001 Section 7.2.

Constants§

DIMENSION_COUNT
Number of monitored drift dimensions.