pub struct Explanation {
pub overall: Verdict,
pub segments: Vec<SegmentReport>,
pub parsed: bool,
pub stateful: bool,
}Expand description
A per-segment breakdown of why a command would or would not auto-approve.
“Segment” means a top-level list element — the pieces a user separates with
&&, ||, ;, or &. This is the granularity that matters for the common
failure mode: one un-allowlisted command torpedoing an otherwise-safe chain.
Fields§
§overall: Verdict§segments: Vec<SegmentReport>§parsed: boolFalse when the input could not be parsed at all.
stateful: boolTrue when segments share shell state (a cd, export, assignment, or
source) so that splitting them into separate calls would break them.
Implementations§
Source§impl Explanation
impl Explanation
pub fn is_allowed(&self) -> bool
Sourcepub fn should_surface(&self) -> bool
pub fn should_surface(&self) -> bool
Whether this explanation is worth injecting into an agent’s context automatically. The teachable case is a mix: an otherwise-auto-approving chain dragged into a manual prompt by one un-allowlisted segment. A single denied command, or an all-denied chain, carries no chaining lesson — so we stay quiet and let the normal approval flow handle it.
Trait Implementations§
Source§impl Clone for Explanation
impl Clone for Explanation
Source§fn clone(&self) -> Explanation
fn clone(&self) -> Explanation
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 Explanation
impl Debug for Explanation
impl Eq for Explanation
Source§impl PartialEq for Explanation
impl PartialEq for Explanation
Source§fn eq(&self, other: &Explanation) -> bool
fn eq(&self, other: &Explanation) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Explanation
Auto Trait Implementations§
impl Freeze for Explanation
impl RefUnwindSafe for Explanation
impl Send for Explanation
impl Sync for Explanation
impl Unpin for Explanation
impl UnsafeUnpin for Explanation
impl UnwindSafe for Explanation
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,
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.