pub struct EffectVector {
pub risk: f64,
pub fairness: f64,
pub privacy: f64,
pub novelty: f64,
pub security: f64,
}Expand description
5-dimensional effect vector for scoring agent actions.
Each dimension is scored from 0.0 (no impact) to 1.0 (maximum impact). The magnitude of the vector determines whether an action exceeds the environment’s governance threshold.
Fields§
§risk: f64Risk score: probability of negative outcome.
fairness: f64Fairness score: impact on equitable treatment.
privacy: f64Privacy score: impact on data privacy.
novelty: f64Novelty score: how unprecedented the action is.
security: f64Security score: impact on system security.
Implementations§
Source§impl EffectVector
impl EffectVector
Sourcepub fn magnitude(&self) -> f64
pub fn magnitude(&self) -> f64
Compute the magnitude of the effect vector (L2 norm).
Preserved as the stable hardcoded scalar. The EML-backed variant
is Self::score, which consults an optional
GovernanceScorerModel
and falls back to this value when the model is untrained.
Sourcepub fn score(&self, model: Option<&GovernanceScorerModel>) -> f64
pub fn score(&self, model: Option<&GovernanceScorerModel>) -> f64
Compute the composite governance score for this effect vector.
When model is None or untrained, returns
Self::magnitude unchanged (bit-for-bit identical to the
pre-EML behaviour). When the model is trained, delegates to
[GovernanceScorerModel::predict] which combines the five
dimensions into a learned scalar.
Without the ecc feature the learned path is unavailable and
this always returns Self::magnitude (WEFT-114 no-mesh/wasm).
NOTE(eml-swap): wired — Finding #5 (GovernanceScorerModel).
Sourcepub fn any_exceeds(&self, threshold: f64) -> bool
pub fn any_exceeds(&self, threshold: f64) -> bool
Check if any dimension exceeds a threshold.
Sourcepub fn max_dimension(&self) -> f64
pub fn max_dimension(&self) -> f64
Get the maximum dimension value.
Sourcepub fn to_context_json(&self) -> Value
pub fn to_context_json(&self) -> Value
Serialize into the gate-context "effect" object shape expected by
crate::gate::GovernanceGate::extract_effect.
Sourcepub fn for_gate(kind: GateEffectKind) -> Self
pub fn for_gate(kind: GateEffectKind) -> Self
Explicit EffectVector schema for a privileged gate family (WEFT-506).
Dimensions are auditable constants — not inferred from free-form context — so governance decisions remain explainable in chain logs.
Trait Implementations§
Source§impl Clone for EffectVector
impl Clone for EffectVector
Source§impl Debug for EffectVector
impl Debug for EffectVector
Source§impl Default for EffectVector
impl Default for EffectVector
Source§impl<'de> Deserialize<'de> for EffectVector
impl<'de> Deserialize<'de> for EffectVector
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for EffectVector
impl RefUnwindSafe for EffectVector
impl Send for EffectVector
impl Sync for EffectVector
impl Unpin for EffectVector
impl UnsafeUnpin for EffectVector
impl UnwindSafe for EffectVector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more