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§
- Agent
RunSnapshot - Dependency-neutral snapshot of a single agent run.
- Budget
Summary - Scalar budget/spend facts for a run.
- Receipt
Ref - Reference to a durable artifact, gate, receipt, or approval.
- Terminal
Summary - Scalar summary of a terminal run.
Enums§
- Receipt
Kind - 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.
- Terminal
Outcome - How a terminal run ended.