#[non_exhaustive]pub enum TaskProvenance {
Static,
UserAdded,
External,
}Expand description
Trust level assigned to a scheduled task, used by the RTW-A re-entry defense.
Provenance determines how strictly the tick-fence and injection-detection mechanisms are applied when a task is dispatched.
§Invariants
Statictasks have their config set at binary startup and are never overwritten by DB writes between ticks.Externaltasks originate from out-of-process writes (CLI, direct SQL) and are subject to the full quarantine and injection-detection pipeline.UserAddedtasks are user-initiated via the control channel and receive a single-tick quarantine before their prompt enters the LLM.
§Examples
use zeph_scheduler::TaskProvenance;
assert_eq!(TaskProvenance::Static.as_str(), "static");
assert_eq!(TaskProvenance::from_provenance_str("external"), TaskProvenance::External);
assert_eq!(TaskProvenance::from_provenance_str("unknown_value"), TaskProvenance::External);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Static
Registered at binary startup via crate::Scheduler::add_task — config is immutable.
UserAdded
Added via the runtime control channel (e.g. CLI zeph schedule add) — user-originated.
External
Loaded from the DB on hydration or written by an external process — untrusted.
Implementations§
Source§impl TaskProvenance
impl TaskProvenance
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Return the stable persistence string for this provenance level.
§Examples
use zeph_scheduler::TaskProvenance;
assert_eq!(TaskProvenance::Static.as_str(), "static");
assert_eq!(TaskProvenance::UserAdded.as_str(), "user_added");
assert_eq!(TaskProvenance::External.as_str(), "external");Sourcepub fn from_provenance_str(s: &str) -> Self
pub fn from_provenance_str(s: &str) -> Self
Parse a provenance string from the database.
Unknown strings default to TaskProvenance::External — the most restrictive
level — so future schema additions degrade safely.
§Examples
use zeph_scheduler::TaskProvenance;
assert_eq!(TaskProvenance::from_provenance_str("static"), TaskProvenance::Static);
assert_eq!(TaskProvenance::from_provenance_str("user_added"), TaskProvenance::UserAdded);
assert_eq!(TaskProvenance::from_provenance_str("external"), TaskProvenance::External);
// Unknown values fall back to External (most restrictive).
assert_eq!(TaskProvenance::from_provenance_str("hydrated"), TaskProvenance::External);Sourcepub fn is_external(&self) -> bool
pub fn is_external(&self) -> bool
Returns true if this task originated from a potentially untrusted external source.
§Examples
use zeph_scheduler::TaskProvenance;
assert!(TaskProvenance::External.is_external());
assert!(!TaskProvenance::Static.is_external());
assert!(!TaskProvenance::UserAdded.is_external());Trait Implementations§
Source§impl Clone for TaskProvenance
impl Clone for TaskProvenance
Source§fn clone(&self) -> TaskProvenance
fn clone(&self) -> TaskProvenance
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 TaskProvenance
impl Debug for TaskProvenance
impl Eq for TaskProvenance
Source§impl PartialEq for TaskProvenance
impl PartialEq for TaskProvenance
Source§fn eq(&self, other: &TaskProvenance) -> bool
fn eq(&self, other: &TaskProvenance) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TaskProvenance
Auto Trait Implementations§
impl Freeze for TaskProvenance
impl RefUnwindSafe for TaskProvenance
impl Send for TaskProvenance
impl Sync for TaskProvenance
impl Unpin for TaskProvenance
impl UnsafeUnpin for TaskProvenance
impl UnwindSafe for TaskProvenance
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§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<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 more