Skip to main content

Module agent_run

Module agent_run 

Source
Expand description

Dependency-neutral agent-run read model.

AgentRunSnapshot is a uniform, serializable projection of “one unit of agent work” regardless of which subsystem owns it: a direct sub-agent worker, a workflow run, a fleet run, a core background job, or a managed task. It carries serialized IDs, neutral enums, and scalar summaries only — never handles, callbacks, or owner-internal types — so any surface can consume it without depending on the owning subsystem.

Ownership contract:

  • Each owner keeps its own richer record type and maps it here through a pure adapter function living in the owner’s crate/module. This crate depends on nothing new; owners depend on it, never the reverse.
  • Adapters must apply the durable-outranks-live rule: when both a durable record and a live in-memory handle exist, a terminal durable state always wins over lagging live enrichment. Live state may only refine a run that the durable record still considers in-flight.
  • Adapters never fabricate values: unknown budgets and timestamps stay None, and references are logical identifiers within the owner’s namespace — never filesystem paths and never secrets.

This is a staging slice: the model compiles and is tested, but nothing consumes it yet. Consumers arrive with later slices.

Structs§

AgentRunSnapshot
Dependency-neutral snapshot of a single agent run.
BudgetSummary
Scalar budget/spend facts for a run.
ReceiptRef
Reference to a durable artifact, gate, receipt, or approval.
TerminalSummary
Scalar summary of a terminal run.

Enums§

ReceiptKind
Category of a durable reference attached to a run.
RunSource
Which subsystem owns the run behind a snapshot.
RunState
Neutral lifecycle state of a run.
TerminalOutcome
How a terminal run ended.