Skip to main content

Module process

Module process 

Source
Expand description

The process model (spec 3.2 §7.3).

A process is a durable run (§6 D-2, K-I1): its id is the run id, its state is the run’s RunState, and Waiting is sleep. The kernel keeps what the run store does not in a side table, ProcessMeta in a ProcessStore, and serves a live ProcessView of each process without adk-eval (§7.10, §13 Q4).

OS notionKernel mapping
Process statesRunState::{Queued, Running, Waiting, Completed, Failed, Cancelled}; Waiting is sleep
Process treeProcessMeta::parent: the run that caused the process
Time sliceThe lease; a process yields at every model-call boundary
kill -TERM / kill -KILLrequest_cancel at the next checkpoint / lease revocation
ZombieA Running run whose lease expired; the next claim resumes it

ProcessTable is the view over DurableRunStore plus the side table, with ps, kill, nice, suspend and resume.

Structs§

GoalProgress
Where a goal process stands (spec 3.2 §7.3, §10 HK3): iteration of max, spend, duration, and the last check’s exit code and output tail.
Process
A process as ps shows it: the run, the kernel’s side table and the live view (spec 3.2 §7.3).
ProcessHandle
A handle on a running kernel’s processes that does not keep the kernel alive, given to a ProgressSource by ProgressSource::attach (spec 3.2 §7.3).
ProcessMeta
The kernel-owned side table of one process, keyed by run id (spec 3.2 §7.3, §6 D-2).
ProcessSpec
What ProcessTable::spawn records beside the run it enqueues (spec 3.2 §7.3).
ProcessTable
The process table: a view over DurableRunStore plus the kernel’s ProcessStore (spec 3.2 §7.3).
ProcessView
A process’s live aggregates (spec 3.2 §7.3, §7.10, §13 Q4): what ps and top show, computed by sum and count over the kernel’s records. Spend is in micro-USD, as SpendLedger counts it; the kernel attributes each charge to the run that made it and keeps daily totals per process (ProcessStore::spend).
RunUsage
What a session’s runs have used so far, as the hosted agent counts it (spec 3.2 §7.3, §7.10): model calls, tool calls, cost in micro-USD, total tokens and the usage per UsageUnit (BudgetTracker::units).

Enums§

ProcessKind
What kind of work a process is (spec 3.2 §7.3).
Suspension
Why a process is parked by a suspension rather than a wake set (spec 3.2 §7.3).

Traits§

ProgressSource
Reports what only the hosted agent knows about a process: a goal’s progress, the loop guard’s verdict and the session’s usage (spec 3.2 §7.3, §10 HK3).