pub enum TaskLifecycle {
PendingLaunch,
Starting,
Ready,
Running,
Suspended,
Done(TerminationReason),
}Expand description
Schedulability lifecycle of a task — orthogonal to the intra-turn step,
which stays on crate::scheduler::state_machine::LoopPhase, and distinct from
the task-goal blackboard crate::context::task_state::TaskState.
Variants§
PendingLaunch
Spec §10.4 · the kernel has minted this task’s identity (task/attempt/launch token) but the launch effect that carries it is not published yet. A child exists as a committed fact before any host is asked to start it — that is what stops a resolution from creating process identity.
Every spawn constructs this state; publication advances it to Self::Starting and only a
correlated launch acknowledgement advances it to Self::Running.
Starting
Spec §10.4 · the launch effect is published and the host has been asked to start the child,
but no acknowledgement has arrived. Distinct from Self::Running because “we asked” and
“it is running” are different facts, and only the second may be reported as one.
Ready
Eligible to run, not yet picked by the scheduler.
Running
Currently executing a turn (ProcessState::Running).
Suspended
Suspended awaiting external resolution (human approval / sub-agent join).
Done(TerminationReason)
Finished. Carries the termination reason (ProcessState::{Joined,Failed}).
Implementations§
Source§impl TaskLifecycle
impl TaskLifecycle
pub fn label(self) -> &'static str
pub fn is_terminal(self) -> bool
Sourcepub fn occupies_slot(self) -> bool
pub fn occupies_slot(self) -> bool
Whether this task holds one of the operation’s concurrency slots.
A launch the kernel has already decided on occupies a slot even before the host confirms it
— otherwise every in-flight launch would be invisible to the spawn quota and an ack-gated
run could overshoot max_concurrent_subagents by the size of its launch window. Legacy runs
never construct the two launch states, so this reads exactly as == Running for them.
Trait Implementations§
Source§impl Clone for TaskLifecycle
impl Clone for TaskLifecycle
Source§fn clone(&self) -> TaskLifecycle
fn clone(&self) -> TaskLifecycle
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 TaskLifecycle
Source§impl Debug for TaskLifecycle
impl Debug for TaskLifecycle
Source§impl<'de> Deserialize<'de> for TaskLifecycle
impl<'de> Deserialize<'de> for TaskLifecycle
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 TaskLifecycle
Source§impl From<ProcessState> for TaskLifecycle
A successful join maps to Done(Completed); any other termination is Done(<reason>).
impl From<ProcessState> for TaskLifecycle
A successful join maps to Done(Completed); any other termination is Done(<reason>).