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 notion | Kernel mapping |
|---|---|
| Process states | RunState::{Queued, Running, Waiting, Completed, Failed, Cancelled}; Waiting is sleep |
| Process tree | ProcessMeta::parent: the run that caused the process |
| Time slice | The lease; a process yields at every model-call boundary |
kill -TERM / kill -KILL | request_cancel at the next checkpoint / lease revocation |
| Zombie | A 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§
- Goal
Progress - 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
psshows it: the run, the kernel’s side table and the live view (spec 3.2 §7.3). - Process
Handle - A handle on a running kernel’s processes that does not keep the kernel alive, given to
a
ProgressSourcebyProgressSource::attach(spec 3.2 §7.3). - Process
Meta - The kernel-owned side table of one process, keyed by run id (spec 3.2 §7.3, §6 D-2).
- Process
Spec - What
ProcessTable::spawnrecords beside the run it enqueues (spec 3.2 §7.3). - Process
Table - The process table: a view over
DurableRunStoreplus the kernel’sProcessStore(spec 3.2 §7.3). - Process
View - A process’s live aggregates (spec 3.2 §7.3, §7.10, §13 Q4): what
psandtopshow, computed by sum and count over the kernel’s records. Spend is in micro-USD, asSpendLedgercounts 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§
- Process
Kind - 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§
- Progress
Source - 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).