#[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);Sourcepub const fn from_severity(v: u8) -> Self
pub const fn from_severity(v: u8) -> Self
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 more