pub enum TaskReadiness {
Ready,
Blocked,
Waiting,
InProgress,
Review,
CompletionBlocked,
Complete,
Cancelled,
Undeclared,
}Expand description
Where a development task stands, as work.
use majordomus_cli::devtask::TaskReadiness;
// every state names the canonical status it refines, and refines only one
assert_eq!(TaskReadiness::Ready.canonical(), "READY");
assert_eq!(TaskReadiness::Waiting.canonical(), "BLOCKED");
assert_eq!(TaskReadiness::Blocked.canonical(), "BLOCKED");
assert_eq!(TaskReadiness::Review.canonical(), "VERIFY");
assert_eq!(TaskReadiness::CompletionBlocked.canonical(), "VERIFY");
// and one state is the absence of a record rather than a status of one
assert!(TaskReadiness::Undeclared.canonical().is_empty());Variants§
Ready
Nothing holds it back and nobody has started it. Canonical READY.
Blocked
At least one issue it depends on is not DONE. Canonical BLOCKED.
Waiting
Every issue dependency is satisfied; the milestone gate holds it. Canonical
BLOCKED, and a distinct situation because it is resolved in another milestone.
InProgress
Execution began: the record carries started_at. Canonical ACTIVE.
Review
Implementation is declared finished and completion has not been recorded: the record
carries verified_at. Canonical VERIFY.
CompletionBlocked
Completion was recorded and the evidence the record itself requires is not all
there, so the plan refuses to call it DONE. Canonical VERIFY, and the case the
evidence_missing finding is about.
Complete
Finished on its own terms: not cancelled, completion recorded, every required
evidence token present. Canonical DONE.
Cancelled
Withdrawn. Canonical CANCELLED.
Undeclared
The canonical model does not declare this id. Not a status: the absence of a record.
Implementations§
Source§impl TaskReadiness
impl TaskReadiness
Sourcepub const ALL: &'static [TaskReadiness]
pub const ALL: &'static [TaskReadiness]
Every state, in the order a board reads them: the executable ones first, the finished ones last. Declared once so that no surface writes the sequence down.
Sourcepub fn canonical(self) -> &'static str
pub fn canonical(self) -> &'static str
The canonical status this refines, or the empty string for TaskReadiness::Undeclared,
which refines none.
Sourcepub fn is_startable(self) -> bool
pub fn is_startable(self) -> bool
May a worker pick this up right now?
use majordomus_cli::devtask::TaskReadiness;
assert!(TaskReadiness::Ready.is_startable());
assert!(!TaskReadiness::InProgress.is_startable(), "somebody already has it");Sourcepub fn is_terminal(self) -> bool
pub fn is_terminal(self) -> bool
Is there nothing further to do, whatever happens elsewhere?
Sourcepub fn derive(
status: &str,
blockers: &[String],
completion_recorded: bool,
evidence_covered: bool,
) -> TaskReadiness
pub fn derive( status: &str, blockers: &[String], completion_recorded: bool, evidence_covered: bool, ) -> TaskReadiness
Derive the readiness from the facts the plan already holds.
The arguments are exactly what crate::plan derives and what the canonical record
declares; nothing is read here, and nothing is guessed. status is the canonical
status, blockers the plan’s own blocked_by list — whose milestone: prefix is
what separates TaskReadiness::Waiting from TaskReadiness::Blocked — and
completion_recorded / evidence_covered are what separate
TaskReadiness::CompletionBlocked from TaskReadiness::Review.
use majordomus_cli::devtask::TaskReadiness;
// blocked only by its milestone is waiting, not blocked
let waiting = TaskReadiness::derive("BLOCKED", &["milestone:m1".to_string()], false, true);
assert_eq!(waiting, TaskReadiness::Waiting);
// blocked by a peer, milestone gate or not, is blocked
let blocked = TaskReadiness::derive(
"BLOCKED",
&["I0002".to_string(), "milestone:m1".to_string()],
false,
true,
);
assert_eq!(blocked, TaskReadiness::Blocked);
// completion recorded without the evidence it requires
let stuck = TaskReadiness::derive("VERIFY", &[], true, false);
assert_eq!(stuck, TaskReadiness::CompletionBlocked);
// verified and waiting to be closed
assert_eq!(TaskReadiness::derive("VERIFY", &[], false, false), TaskReadiness::Review);
// a status the plan never derives is not silently mapped onto one that looks fine
assert_eq!(TaskReadiness::derive("NONESUCH", &[], false, false), TaskReadiness::Undeclared);Trait Implementations§
Source§impl Clone for TaskReadiness
impl Clone for TaskReadiness
Source§fn clone(&self) -> TaskReadiness
fn clone(&self) -> TaskReadiness
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 TaskReadiness
Source§impl Debug for TaskReadiness
impl Debug for TaskReadiness
Source§impl<'de> Deserialize<'de> for TaskReadiness
impl<'de> Deserialize<'de> for TaskReadiness
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for TaskReadiness
Source§impl Hash for TaskReadiness
impl Hash for TaskReadiness
Source§impl JsonSchema for TaskReadiness
impl JsonSchema for TaskReadiness
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for TaskReadiness
impl Ord for TaskReadiness
Source§fn cmp(&self, other: &TaskReadiness) -> Ordering
fn cmp(&self, other: &TaskReadiness) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TaskReadiness
impl PartialEq for TaskReadiness
Source§fn eq(&self, other: &TaskReadiness) -> bool
fn eq(&self, other: &TaskReadiness) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for TaskReadiness
impl PartialOrd for TaskReadiness
Source§impl Serialize for TaskReadiness
impl Serialize for TaskReadiness
impl StructuralPartialEq for TaskReadiness
Auto Trait Implementations§
impl Freeze for TaskReadiness
impl RefUnwindSafe for TaskReadiness
impl Send for TaskReadiness
impl Sync for TaskReadiness
impl Unpin for TaskReadiness
impl UnsafeUnpin for TaskReadiness
impl UnwindSafe for TaskReadiness
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.