pub enum Class {
Mechanical,
Privileged,
Specified,
Judgment,
Never,
}Expand description
Classes from docs/dev/design-review.md, “Classes of maintenance work”.
Variants§
Mechanical
A. Mechanical: accepted by the existing suite, confined to manifests.
Privileged
A-. Mechanical but privileged: a workflow runs with repository tokens, so this is never unattended whatever its complexity.
Specified
B. Specified: acceptance is a test, scope is what the task names.
Judgment
C. Judgment: no automatic acceptance. Reserved for the propose
approval mode; nothing produces it yet.
Never
D. Never dispatched: releases, credentials, licences, and work the
user marked #manual.
Implementations§
Source§impl Class
impl Class
pub fn name(self) -> &'static str
pub fn parse(s: &str) -> Option<Class>
Sourcepub fn of(key: &str, tags: &[String]) -> Class
pub fn of(key: &str, tags: &[String]) -> Class
The class of a task, from its key and the tags it carries on origin.
#manual wins over everything, including a signal, so marking a task
always takes it out of dispatch. An unclassified item is B: the
conservative choice, since B is never unattended without a test that
discriminates the base from the candidate.
Sourcepub fn scope(self) -> Vec<String>
pub fn scope(self) -> Vec<String>
Globs a correct change may touch, or an empty list when the class states no bound. B names files the task alone knows, so it has none; the privileged paths still apply.
Sourcepub fn violations<'a>(
self,
scope: &[String],
paths: &'a [String],
) -> Vec<&'a str>
pub fn violations<'a>( self, scope: &[String], paths: &'a [String], ) -> Vec<&'a str>
Paths the run changed that its class does not permit. Privileged paths are judged against the paths actually changed, not against the class predicted at dispatch, so a task misread as mechanical cannot edit a workflow.
Sourcepub fn dispatchable(self) -> bool
pub fn dispatchable(self) -> bool
Whether an agent may be dispatched to this class at all.
Trait Implementations§
impl Copy for Class
impl Eq for Class
impl StructuralPartialEq for Class
Auto Trait Implementations§
impl Freeze for Class
impl RefUnwindSafe for Class
impl Send for Class
impl Sync for Class
impl Unpin for Class
impl UnsafeUnpin for Class
impl UnwindSafe for Class
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.