pub struct Tcb {Show 16 fields
pub id: TaskId,
pub parent: Option<TaskId>,
pub children: BTreeSet<TaskId>,
pub state: TaskLifecycle,
pub runnable_cause: RunnableCause,
pub budget: BudgetLedger,
pub wait_set: Option<DurableWaitSet>,
pub caps: Vec<CompactString>,
pub capabilities: Vec<Capability>,
pub proc: Option<ProcInfo>,
pub supervision: SupervisionPolicy,
pub supervision_events: Vec<SupervisionEvent>,
pub detached: bool,
pub child_budget_remaining: Option<ResourceBudget>,
pub budget_grant: Option<BudgetGrant>,
pub mailbox: Mailbox,
}Expand description
One schedulable entity. The root loop and every sub-agent are uniform Tcbs.
Fields§
§id: TaskId§parent: Option<TaskId>§children: BTreeSet<TaskId>spc_002: child task ids spawned under this task. Populated by TaskTable insertion
(spc_002-05); empty for leaf tasks and for every task predating recursive spawn.
state: TaskLifecycle§runnable_cause: RunnableCauseWhy a Ready child entered the unified local runnable set.
budget: BudgetLedger§wait_set: Option<DurableWaitSet>Canonical recoverable wait state.
caps: Vec<CompactString>Capability ids permitted to this task (mirrors AgentProcess.permitted_capability_ids).
capabilities: Vec<Capability>spc_004 debt closure: this task’s own held Capability grants (spc_004’s resource/
action-scoped shape) — what a spawn from this task may legally attenuate into. Empty by
default; only set when IsolationManifest.requested_capabilities (spc_004) was non-empty
at spawn time.
proc: Option<ProcInfo>Sub-agent identity for child tasks; None for the root loop.
supervision: SupervisionPolicyspc_002-07: read by terminate() (spc_008-04) when this task’s own terminal transition
commits, to decide what happens to any still-running children.
supervision_events: Vec<SupervisionEvent>Durable attempt-level failure history. Logical-task state may continue after a relaunch.
detached: boolspc_008-05: when true, this task is exempt from cancel_subtree/cancel_children —
it (and its own descendants) are never cancelled as a side effect of an ancestor’s
cancellation or termination. false by default (existing behavior unchanged).
child_budget_remaining: Option<ResourceBudget>spc_005: this task’s own currently-grantable budget pool for its children — reserve()’s
parent_remaining argument. None (the default) means no hierarchical budget is in play
on this task, so spawn-time budget checks are skipped entirely and behavior is unchanged
from before spc_005.
budget_grant: Option<BudgetGrant>spc_005: the grant this task itself received from its parent at spawn time, if the
spawner set IsolationManifest.requested_budget. None for the root and for any child
spawned without a hierarchical budget request.
mailbox: Mailboxspc_006-03: this task’s point-to-point inbox. Empty by default; populated via
TaskTable::send_message.
Implementations§
Source§impl Tcb
impl Tcb
Sourcepub fn root(id: impl Into<TaskId>, budget: SchedulerBudget) -> Self
pub fn root(id: impl Into<TaskId>, budget: SchedulerBudget) -> Self
The root loop task. Constructed from the runtime task at Start.
Sourcepub fn spawned(manifest: &IsolationManifest, budget: SchedulerBudget) -> Self
pub fn spawned(manifest: &IsolationManifest, budget: SchedulerBudget) -> Self
A sub-agent task spawned under the root, seeded Running, carrying the manifest’s
process identity. The single source of truth for what the AgentProcess view exposes.
Sourcepub fn spawned_in(
manifest: &IsolationManifest,
budget: SchedulerBudget,
state: TaskLifecycle,
parent: Option<TaskId>,
) -> Self
pub fn spawned_in( manifest: &IsolationManifest, budget: SchedulerBudget, state: TaskLifecycle, parent: Option<TaskId>, ) -> Self
The same child, seeded in an explicit lifecycle state under an explicit parent.
The acknowledged spawn arc is PendingLaunch → Starting → Running(ack). Callers that have
already observed the host launch use Self::spawned; callers that are publishing a launch
use this constructor with its explicit lifecycle state.
spc_002-02: parent is no longer hardcoded to root — callers must supply the real caller.
This card does not derive that caller from syscall causation (spc_002-04); every call site
still passes Some("root") explicitly, preserving today’s behavior byte-for-byte.