pub struct WorkItem {
pub id: WorkItemId,
pub key: Key,
pub project: ProjectId,
pub parent: Option<WorkItemId>,
pub kind: WorkKind,
pub title: String,
pub order: SiblingOrder,
pub contract: WorkContract,
pub execution: ExecutionRecord,
pub schedule: ScheduleInputs,
}Expand description
Execution contract and authoritative lifecycle for a unit of work.
Fields§
§id: WorkItemIdStable entity identity; it must match its containing map key.
key: KeyHuman-readable key, unique in this entity category.
project: ProjectIdProject that owns this entity.
parent: Option<WorkItemId>Optional parent; containment must be acyclic.
kind: WorkKindDomain category of this value.
title: StringNon-empty human-readable title.
order: SiblingOrderStable sibling position, independent of titles and keys.
contract: WorkContractAuthor-approved scope, requirements and applicability.
execution: ExecutionRecordLifecycle and evidence recorded only by semantic commands.
schedule: ScheduleInputsAuthoritative scheduling inputs; derived dates remain projections.
Implementations§
Source§impl WorkItem
impl WorkItem
Sourcepub fn attempt(&self, number: u32) -> Option<&SubmissionAttempt>
pub fn attempt(&self, number: u32) -> Option<&SubmissionAttempt>
Attempt with the given ordinal.
Sourcepub fn current_attempt(&self) -> Option<&SubmissionAttempt>
pub fn current_attempt(&self) -> Option<&SubmissionAttempt>
Latest attempt unless it was rejected: the pending or verified result a basis may rely on.
Sourcepub fn effective_basis(&self) -> Vec<&DependencyBasis>
pub fn effective_basis(&self) -> Vec<&DependencyBasis>
Latest basis recorded for each edge, in first-recorded edge order.
Source§impl WorkItem
impl WorkItem
Sourcepub fn held_by(&self, actor: &ActorId) -> bool
pub fn held_by(&self, actor: &ActorId) -> bool
Whether the actor owns this work now or held it before a handoff or release.
Independent review reads this rather than the current owner alone, so handing work away or releasing a claim never turns an actor that held it into its reviewer.
Sourcepub fn holding_at(&self, actor: &ActorId, at: DateTime<Utc>) -> Option<Holding>
pub fn holding_at(&self, actor: &ActorId, at: DateTime<Utc>) -> Option<Holding>
How the actor held this work at or before at, if it did.
A recorded review stays independent after its reviewer later takes the work over, so the records are judged at their own time. Only started work is reviewed and a release only ends an unstarted claim, so the current owner with no later handoff has held the work since before any review. A handoff at the review instant counts as preceding it, because equal times cannot be ordered and independence must not be assumed.
Source§impl WorkItem
impl WorkItem
Sourcepub fn expected_duration_hours(&self) -> f64
pub fn expected_duration_hours(&self) -> f64
Expected task duration; containers and milestones contribute zero.
Sourcepub fn is_executable(&self) -> bool
pub fn is_executable(&self) -> bool
Whether this work kind supports task lifecycle commands.
Sourcepub fn start_event(&self) -> Option<EventTime>
pub fn start_event(&self) -> Option<EventTime>
When the task started: its recorded time, or an unknown time when it started before start times were recorded.
Gate evaluation, resuming blocked work and progress reports all read this, so a legacy start is never forgotten by one of them while another still honours it.