Skip to main content

Module ctx

Module ctx 

Source
Expand description

Ctx and OperatorInfo — cross-cutting context threaded through the engine.

The main pipeline (Engine → SpawnerAdapterWorkerAdapter) does not know about Operators. Middleware watches Ctx.operator and branches on it.

Structs§

Ctx
Per-attempt context threaded through the engine and into worker/spawner code. Carries identity (task_id / attempt / agent), free-form metadata (meta), and the resolved Operator faces (operator).
CtxMeta
Namespaced free-form key/value bags attached to a Ctx. Each namespace is a convention, not an enforced schema — e.g. runtime carries per-dispatch values like worker_handle.
OperatorInfo
The bundle of Operator faces the engine injects into Ctx at dispatch.

Enums§

OperatorKind
Who/what is driving a spawn: a plain automated worker, an interactive MainAI operator, or a composite of both. Gates MainAIMiddleware / OperatorDelegateMiddleware (see OperatorInfo doc below) and feeds the 4-tier cascade resolved by collapse_operator_kind.

Traits§

SeniorBridge
Escalation channel fired by SeniorEscalationMiddleware whenever a worker returns ok = false: a chance for a “senior” judgment source to review and potentially upgrade the outcome to Pass.
SpawnHook
Pre-/post-spawn observation and gating hook fired by MainAIMiddleware (only when OperatorKind is MainAi / Composite).

Functions§

collapse_operator_kind
The single canonical implementation of the 4-tier OperatorKind cascade (schema doc: mlua_swarm_schema::Blueprint::default_operator_kind).