dekopon-process 0.15.2

Joined Tokio process lifecycle for Dekopon frontends
Documentation

dekopon-process

dekopon-process is Dekopon's small, unprivileged Tokio lifecycle seam for frontend operations. It runs one asynchronous Process as one payload-free traced Tokio node and joins that task before returning. While the owning Tokio runtime remains alive, its supervisor keeps joining and observing the node even when the outer execute future is dropped. A completed operation preserves its own typed success or error; a task panic or cancellation preserves Tokio's JoinError.

A process is either non-interruptible or cancellable. A cancellable process is built from a CancelSignal; its paired CancelHandle requests cancellation. Cancellation is cooperative and minimal: the supervisor aborts the node's Tokio task, which lands at the node's next .await, and then joins that task before reporting ProcessOutcome::TaskFailed with is_cancelled(). It never returns while the node's own task could be running, a node that returned before the abort landed keeps its real result, and dropping every handle never cancels (CancelSignal::never is a signal nobody can request). The supervisor joins the node's own Tokio task and nothing else: work the node handed to spawn_blocking or spawned as another task is detached by the abort, is not joined, and can outlive a cancelled outcome. A node that must not leave such work behind must stay non_interruptible. The node span records process.interruptibility as non-interruptible or cancellable and a requested cancellation as process.outcome = "cancelled", distinct from the task-cancelled a runtime-driven abort records.

dekopon-agent's broker leg runs each command word as one cancellable broker-command node around the broker round trip. dekopond ties its CancelSignal to the session's Stop, so a run in flight is aborted at its next await and joined before the script reads session-cancelled. CancelSignal::is_cancelled is the same request read synchronously, for a caller deciding whether to start work rather than awaiting the end of work already running; the leg takes it before proposing a capability call at all, so a stopped session opens no further round trip. Embedders may instead supply CancelSignal::never. Dropping the outer execute future detaches the supervisor, not the process node: while the runtime lives, the supervisor awaits and records the node. The result travels in an RAII envelope whose drop invokes the required abandonment observer, including when a queued result is never polled by the outer future. Runtime shutdown is the ownership boundary. Shell values, pipelines, output, status, and limits belong to dekopon-shell.

The crate provides no structured process trees, scopes, ports, deadlines, graph scheduling, Bash parsing, provider loading, authorization, or credentials, and its cancellation is the abort-then-join contract above: no deadline, no propagation to child work, no way to interrupt a blocking thread. Retries and persistence are constitution non-goals. The broker is the only authorization boundary.