#[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: Self = Self::Trusted
pub const MISSING_ENTRY_FALLBACK: Self = 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: Self) -> Self
pub const fn min_trust(self, other: Self) -> Self
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);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 more