Expand description
Ctx and OperatorInfo — cross-cutting context threaded through the
engine.
The main pipeline (Engine → SpawnerAdapter → WorkerAdapter) 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 resolvedOperatorfaces (operator). - CtxMeta
- Namespaced free-form key/value bags attached to a
Ctx. Each namespace is a convention, not an enforced schema — e.g.runtimecarries per-dispatch values likeworker_handle. - Operator
Info - The bundle of Operator faces the engine injects into
Ctxat dispatch.
Enums§
- Operator
Kind - Who/what is driving a spawn: a plain automated worker, an interactive
MainAI operator, or a composite of both. Gates
MainAIMiddleware/OperatorDelegateMiddleware(seeOperatorInfodoc below) and feeds the 4-tier cascade resolved bycollapse_operator_kind.
Traits§
- Senior
Bridge - Escalation channel fired by
SeniorEscalationMiddlewarewhenever a worker returnsok = false: a chance for a “senior” judgment source to review and potentially upgrade the outcome to Pass. - Spawn
Hook - Pre-/post-spawn observation and gating hook fired by
MainAIMiddleware(only whenOperatorKindisMainAi/Composite).
Functions§
- collapse_
operator_ kind - The single canonical implementation of the 4-tier
OperatorKindcascade (schema doc:mlua_swarm_schema::Blueprint::default_operator_kind).