Skip to content

Task state

A task is the nucleus-owned record of one structured unit of execution inside a project runtime. It binds a logical task, one logical call and each concrete attempt to the grant and cell authority that admitted them, between the run that requested it and the provider that carries it out. This page explains the task tree, lifecycle, attempt receipts, deadlines and terminal evidence.

The task and attempt lifecycle

stateDiagram-v2
  direction TB
  [*] --> created
  created --> admitted
  admitted --> queued
  queued --> dispatched: dispatch committed, channel, provider
  dispatched --> started: monitor dispatch facts
  dispatched --> cancelled_before_start
  dispatched --> queued: admitted retry, fresh AttemptId
  started --> queued: admitted retry, fresh AttemptId
  started --> completed: monitor accepted completion
  started --> cancel_requested_after_start
  started --> faulted
  started --> ambiguous_completion
  cancel_requested_after_start --> completed
  cancel_requested_after_start --> ambiguous_completion
  completed --> acknowledged: caller acknowledged
  acknowledged --> [*]: terminal task evidence
  cancelled_before_start --> [*]
  faulted --> [*]
  ambiguous_completion --> [*]

A task ends in acknowledged, cancelled_before_start, faulted or ambiguous_completion. cancel_requested_after_start records a cancellation that arrived after execution began, and execution may still complete.

The attempt sequence is stricter than the high-level state. Receipts must move monotonically through dispatch commitment, channel dispatch, provider dispatch, monitor-accepted completion and caller acknowledgement. A receipt cannot skip an authoritative step or change the task, call or attempt identity.

When an admitted retry starts, the task returns to queued while retaining its task and logical-call identity. Attempt-local receipts, cell placement and completion state are cleared, and the next dispatch must carry a fresh AttemptId. The original effect intent remains installed throughout. See Effect receipts and effect retry.

Task trees and inherited controls

Every task may name one parent task. A child remains under the same installed grant, cannot attach to a terminal parent, and cannot outlive the deadline budget it inherits. A root task receives an explicit finite deadline. A child may keep or shorten that deadline but cannot widen it.

Each admitted task also records whether cancellation addresses one attempt, one logical call or the task scope. The scope is part of the dispatch authority; the runtime provider cannot broaden or reinterpret it. See Deadline and cancellation forwarding.

What counts as started

started is set from trusted facts only. The nucleus derives it from monitor-owned dispatch facts after the attempt has been dispatched to the provider. A provider's provider_entered_adapter observation is retained for diagnostics, but it cannot start or complete a task and cannot authorise a retry.

Terminal task evidence

After the monitor accepts completion, the nucleus admits the typed result and waits for caller acknowledgement. It then seals terminal task evidence over:

  • task, call and attempt identity;
  • the success or failure classification and result digest;
  • the complete authoritative receipt sequence;
  • whether the diagnostic adapter-entry observation was seen.

The evidence digest travels on the return lane. The supervising data plane node relays the acknowledged return proof, and the control plane admits and stores that exact proof. A result that reaches completed without acknowledged is refused at that boundary.

Boundaries

Task state owns logical lifecycle and correlation. The cell monitor owns the dispatch and accepted-completion facts it observes. Attempt supervision owns ambiguity and retry classification for one concrete attempt. The provider owns none of these authority decisions; it supplies a bounded observation that the monitor and nucleus validate.