#[non_exhaustive]pub enum SkillTrustLevel {
Trusted,
Verified,
Quarantined,
Blocked,
}Expand description
Trust tier controlling what a skill is allowed to do.
The ordering from most to least trusted is: Trusted → Verified → Quarantined →
Blocked. Use SkillTrustLevel::severity to compare levels numerically, or
SkillTrustLevel::min_trust to find the least-trusted of two levels.
§Examples
use zeph_common::SkillTrustLevel;
let level = SkillTrustLevel::Quarantined;
assert!(level.is_active());
assert_eq!(level.severity(), 2);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Trusted
Built-in or user-audited skill: full tool access.
Verified
Signature or hash verified: default tool access.
Quarantined
Newly imported or hash-mismatch: restricted tool access.
Blocked
Explicitly disabled by user or auto-blocked by anomaly detector.
Implementations§
Source§impl SkillTrustLevel
impl SkillTrustLevel
Sourcepub const MISSING_ENTRY_FALLBACK: SkillTrustLevel = Self::Trusted
pub const MISSING_ENTRY_FALLBACK: SkillTrustLevel = Self::Trusted
Trust level to assume when a skill has no entry in the trust map.
A missing entry means “never classified yet” (e.g. persistence not wired, or a
transient trust-map read failure), not “known untrusted” — callers must not fall
back to SkillTrustLevel::default (Quarantined) for this
case, as that would misclassify legitimately trusted, already-vetted skills.
§Examples
use zeph_common::SkillTrustLevel;
let trust_levels: std::collections::HashMap<String, SkillTrustLevel> =
std::collections::HashMap::new();
let trust = trust_levels
.get("some-skill")
.copied()
.unwrap_or(SkillTrustLevel::MISSING_ENTRY_FALLBACK);
assert_eq!(trust, SkillTrustLevel::Trusted);Sourcepub const fn severity(self) -> u8
pub const fn severity(self) -> u8
Ordered severity: lower value = more trusted.
§Examples
use zeph_common::SkillTrustLevel;
assert!(SkillTrustLevel::Trusted.severity() < SkillTrustLevel::Blocked.severity());Sourcepub const fn min_trust(self, other: SkillTrustLevel) -> SkillTrustLevel
pub const fn min_trust(self, other: SkillTrustLevel) -> SkillTrustLevel
Returns the least-trusted (highest severity) of two levels.
§Examples
use zeph_common::SkillTrustLevel;
let result = SkillTrustLevel::Trusted.min_trust(SkillTrustLevel::Quarantined);
assert_eq!(result, SkillTrustLevel::Quarantined);Sourcepub const fn from_severity(v: u8) -> SkillTrustLevel
pub const fn from_severity(v: u8) -> SkillTrustLevel
Inverse of severity: reconstructs a level from its ordinal.
Any value >= 3 maps to Blocked — the most restrictive level —
so a corrupted or out-of-range stored ordinal fails closed rather than open.
§Examples
use zeph_common::SkillTrustLevel;
assert_eq!(SkillTrustLevel::from_severity(0), SkillTrustLevel::Trusted);
assert_eq!(SkillTrustLevel::from_severity(3), SkillTrustLevel::Blocked);
assert_eq!(SkillTrustLevel::from_severity(255), SkillTrustLevel::Blocked);Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
Returns the string representation used for database storage.
Sourcepub const fn is_active(self) -> bool
pub const fn is_active(self) -> bool
Returns true if the level is not Blocked.
§Examples
use zeph_common::SkillTrustLevel;
assert!(SkillTrustLevel::Quarantined.is_active());
assert!(!SkillTrustLevel::Blocked.is_active());Returns true for trust levels that must never appear on a listing surface with no
trust-annotation mechanism — Blocked (explicitly disabled) and
Quarantined (unreviewed / hash-mismatched) alike.
This is the hide strategy for surfaces that cannot show a trust level inline, e.g.
the mention-picker catalog (SkillCatalogItem carries only name/description, no
trust field). Contrast with the annotate strategy used by the XML skill-prompt
catalog (zeph_skills::prompt::format_skills_catalog’s trust_levels parameter),
which keeps a Quarantined/Blocked skill visible with a trust="..." attribute so
the model/operator can still name it and promote it — that surface intentionally does
not use this method. This method says nothing about matching-candidate selection or
per-turn dispatch gating (TurnTrustFloor, weakest-link trust fold) either — those are
separate concerns with their own filtering logic.
§Examples
use zeph_common::SkillTrustLevel;
assert!(SkillTrustLevel::Blocked.is_hidden_from_catalog());
assert!(SkillTrustLevel::Quarantined.is_hidden_from_catalog());
assert!(!SkillTrustLevel::Trusted.is_hidden_from_catalog());Trait Implementations§
Source§impl Clone for SkillTrustLevel
impl Clone for SkillTrustLevel
Source§fn clone(&self) -> SkillTrustLevel
fn clone(&self) -> SkillTrustLevel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SkillTrustLevel
Source§impl Debug for SkillTrustLevel
impl Debug for SkillTrustLevel
Source§impl Default for SkillTrustLevel
impl Default for SkillTrustLevel
Source§fn default() -> SkillTrustLevel
fn default() -> SkillTrustLevel
Source§impl<'de> Deserialize<'de> for SkillTrustLevel
impl<'de> Deserialize<'de> for SkillTrustLevel
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SkillTrustLevel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SkillTrustLevel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for SkillTrustLevel
impl Display for SkillTrustLevel
impl Eq for SkillTrustLevel
Source§impl FromStr for SkillTrustLevel
impl FromStr for SkillTrustLevel
Source§impl Hash for SkillTrustLevel
impl Hash for SkillTrustLevel
Source§impl PartialEq for SkillTrustLevel
impl PartialEq for SkillTrustLevel
Source§impl Serialize for SkillTrustLevel
impl Serialize for SkillTrustLevel
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for SkillTrustLevel
Auto Trait Implementations§
impl Freeze for SkillTrustLevel
impl RefUnwindSafe for SkillTrustLevel
impl Send for SkillTrustLevel
impl Sync for SkillTrustLevel
impl Unpin for SkillTrustLevel
impl UnsafeUnpin for SkillTrustLevel
impl UnwindSafe for SkillTrustLevel
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<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.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<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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request