Expand description
EngineState — the single Mutex-guarded state object — plus the
supporting types.
EngineState holds every mutable piece of engine flow state (task
table, session table, prompts, token records, worker handles, resume
table, per-task notifiers, resources, per-attempt output events, and the
event log tail). It sits on the Domain side of the Data / Domain split
and is unchanged by the Data-plane (output_store module) refactor.
Structs§
- CapToken
Record - Server-side counter/state holder paired 1:1 with a minted
CapToken(keyed by nonce inEngineState.tokens). Tracks remaining uses, revocation, and — for Worker tokens — the task the token is bound to. - Engine
State - The single
Mutex-guarded blob of engine flow state, accessed only throughEngine::with_state(see the R1-R4 discipline documented there). - Operator
Session - Persisted record of one attached Operator session: identity, role,
heartbeat bookkeeping, owned tasks, and the
OperatorKindcascade inputs plus registry IDs used to rebuildOperatorInfoon dispatch (seeEngine::resolve_operator_info). - Resume
Key - Opaque handle identifying one
query_seniorsuspend/resumecycle. Stored onTaskState.suspended_onand as the key ofEngineState.pending_resumes. - Resume
Pending - Entry for a task suspended via
query_senior, waiting to be resumed. - Task
Spec - Static task definition supplied to
start_task: which agent runs it and the initial prompt/directive text. - Task
State - The full mutable record of one task: its static
spec, currentstatus, attempt counter, and bookkeeping timestamps. Cloned out ofEngineStateon every read (e.g. byread_task_state/poll_task).
Enums§
- CapToken
Consume Error - Why
CapTokenRecord::consumerefused to spend a use. - Dispatch
Outcome - Result of a
dispatch_attempt_withcall (or the conceptual outcome of a task attempt more broadly). - Event
- Engine lifecycle event. Every event is both appended to
EngineState.event_log_tail(in-process ring buffer) and broadcast onEngine::event_txfor live subscribers. - Task
Status - Lifecycle state of a task.
Pendingis the only non-terminal, non-Suspendedstate before the firstdispatch_attempt_with;Pass/Blocked/Cancelledare terminal.
Type Aliases§
- Event
Stream - Receiver half of the engine-wide
Eventbroadcast channel, obtained viaEngine::subscribe.