pub struct DecisionTrace {
pub matched: Vec<PolicyVerdict>,
pub winning_kind: Option<VerdictKind>,
pub winning_source: Option<String>,
pub overrides: Vec<OverrideRecord>,
pub precedence: String,
}Expand description
Audit-grade explanation of how a policy decision was reached.
Fields§
§matched: Vec<PolicyVerdict>Every verdict that matched, in the order they were submitted to the
conflict resolver. This preserves what the policy plane saw; the
winning_* fields say which one survived precedence.
winning_kind: Option<VerdictKind>Kind of the winning verdict. None only when the policy plane saw
zero matches — i.e. the deny-by-default fallback at the caller is
what’s actually denying the action.
winning_source: Option<String>Stable source string of the winning verdict. See
PolicyVerdict::source for the conventions.
overrides: Vec<OverrideRecord>Each verdict that lost the precedence comparison, with the reason it was overridden.
precedence: StringHuman-readable precedence ordering. Frozen at decision time so a later code change can’t make an old audit record lie.
Implementations§
Source§impl DecisionTrace
impl DecisionTrace
Sourcepub fn from_resolution(
matched: Vec<PolicyVerdict>,
resolved: &ResolvedDecision,
) -> Self
pub fn from_resolution( matched: Vec<PolicyVerdict>, resolved: &ResolvedDecision, ) -> Self
Build a trace from the set of matched verdicts and the resolved decision they produced.
Sourcepub fn had_conflicts(&self) -> bool
pub fn had_conflicts(&self) -> bool
True iff the trace records at least one override — i.e. there was an actual conflict between matching policies. Useful for dashboards that want to badge “this decision had conflicts resolved”.
Trait Implementations§
Source§impl Clone for DecisionTrace
impl Clone for DecisionTrace
Source§fn clone(&self) -> DecisionTrace
fn clone(&self) -> DecisionTrace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DecisionTrace
impl Debug for DecisionTrace
Source§impl<'de> Deserialize<'de> for DecisionTrace
impl<'de> Deserialize<'de> for DecisionTrace
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>,
impl Eq for DecisionTrace
Source§impl PartialEq for DecisionTrace
impl PartialEq for DecisionTrace
Source§impl Serialize for DecisionTrace
impl Serialize for DecisionTrace
impl StructuralPartialEq for DecisionTrace
Auto Trait Implementations§
impl Freeze for DecisionTrace
impl RefUnwindSafe for DecisionTrace
impl Send for DecisionTrace
impl Sync for DecisionTrace
impl Unpin for DecisionTrace
impl UnsafeUnpin for DecisionTrace
impl UnwindSafe for DecisionTrace
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.