pub struct TaskLaunchInput {Show 14 fields
pub blueprint: Blueprint,
pub operator_id: String,
pub role: Role,
pub ttl: Duration,
pub operator_kind: Option<OperatorKind>,
pub bridge_id: Option<String>,
pub hook_id: Option<String>,
pub operator_backend_id: Option<String>,
pub operator_pin: Option<String>,
pub operator_kind_overrides: HashMap<String, OperatorKind>,
pub init_ctx: Value,
pub task_input: Option<TaskInputSpec>,
pub run_ctx: Option<RunContext>,
pub check_policy: Option<CheckPolicy>,
}Expand description
Input to TaskLaunchService::launch.
Fields§
§blueprint: BlueprintThe Blueprint to compile, link, and run.
operator_id: StringCaller-supplied id for the Operator that owns this run.
role: RoleThe Operator’s role for this run.
ttl: DurationHow long the attached session is allowed to live.
operator_kind: Option<OperatorKind>“Runtime Global” tier of the OperatorKind cascade. Some(_) is
always an explicit request — including Some(OperatorKind::Automate)
— that outranks the BP-level tiers (OperatorDef.kind /
Blueprint.default_operator_kind); None leaves it unspecified so
those tiers / the final default decide. Under MainAi or
Composite, MainAIMiddleware’s spawn_hook before/after
callbacks become effective. See
crate::core::ctx::collapse_operator_kind.
bridge_id: Option<String>SeniorBridge registry ID. None — no bridge; Some(id) —
attach a bridge previously registered via
engine.register_senior_bridge.
hook_id: Option<String>SpawnHook registry ID. Same shape as above, via
engine.register_spawn_hook.
operator_backend_id: Option<String>Operator registry ID — used on the path that hands the whole
spawn off to an external Operator. Name previously registered
with engine.register_operator; resolved by
OperatorDelegateMiddleware, which — for kind = MainAi or
Composite — bypasses inner.spawn and calls
operator.execute.
operator_pin: Option<String>Run-scoped Operator session pin — the session id (S-<hex>) this
launch binds its whole Spawn stream to, independent of which axis
carries the spawn.
A Blueprint’s spec.operator_ref names a logical role; the role’s
holder is process-global, so with two drivers on one process “the
role” and “the session this launch belongs to” are different facts.
Some(sid) makes the second one authoritative for this launch: the
binding provider attests through the pinned session
(crate::binding::AgentBindingProvider::pinned_to_session) and the
compiler resolves every kind = Operator agent against it
(Compiler::compile_bound_pinned). A pin naming no live session
fails the launch rather than falling back to the role.
None (the default via Self::automate) leaves both resolutions
exactly as they were — role lookup, byte-for-byte.
Orthogonal to Self::operator_backend_id: that field is the
opt-in operator_delegate layer’s session-wide backend, which
bypasses the per-agent spawners entirely when a Blueprint declares
the layer. A launch may carry both; the delegate layer keeps winning
where it applies, and the pin decides the AgentSpec axis underneath.
operator_kind_overrides: HashMap<String, OperatorKind>“Runtime Agent-level” tier (highest priority) of the OperatorKind
cascade — per-agent override, keyed by AgentDef.name. Empty by
default (no override for any agent). See
crate::core::ctx::collapse_operator_kind for the full tier list.
init_ctx: ValueThe initial ctx (JSON Value) that flow.ir’s eval_async
starts from. Every Step.in $.<path> reference reads from
here. Issue #19 ST2: a pure flow-ir eval seed — no Task-level
field is folded into it anymore; see Self::task_input.
task_input: Option<TaskInputSpec>Task-level canonical fields (issue #19 ST2). Some layers a
crate::middleware::task_input::TaskInputMiddleware (built via
crate::middleware::task_input::TaskInputMiddleware::new_from_fields)
onto the spawner stack just before spawn; None is a no-op,
identical to today’s behavior for callers with no Task-level
fields to propagate.
run_ctx: Option<RunContext>Issue #13 run_id propagation: when Some, every step this launch
dispatches is traced into RunRecord.step_entries and exposes its
run_id via Ctx.meta.runtime["run_id"] (see
EngineDispatcher::with_run). None (the default via
Self::automate) preserves the pre-existing behavior — no run
tracing.
check_policy: Option<CheckPolicy>The “launch request” tier (tier 1, highest
priority) of the check_policy cascade
(launch request > blueprint > server config).
TaskLaunchService::launch
collapses check_policy.or(blueprint.check_policy) exactly once and
threads the result into every spawned step’s TaskSpec.check_policy.
None (the default via Self::automate) leaves this tier
unspecified so the Blueprint tier / server-wide default decide —
backward-compat with every pre-cascade caller.
TaskLaunchService::launch also collapses this same cascade one
step further
(adding the server-wide EngineCfg.check_policy tier) into a
pre-dispatch guard: when the resulting effective policy is
CheckPolicy::Strict and neither Self::task_input’s
project_root nor work_dir is set, the launch is rejected with
TaskLaunchError::PreDispatch before any step is dispatched — a
strict task with no resolvable root would deterministically fail
at its first submit-time file materialize anyway. Setting this
field to Some(CheckPolicy::Warn) on the launch-request tier is
the escape hatch: it outranks a Blueprint- or server-declared
Strict and lets the guard pass.
Implementations§
Source§impl TaskLaunchInput
impl TaskLaunchInput
Sourcepub fn automate(
blueprint: Blueprint,
operator_id: impl Into<String>,
role: Role,
ttl: Duration,
init_ctx: Value,
) -> Self
pub fn automate( blueprint: Blueprint, operator_id: impl Into<String>, role: Role, ttl: Duration, init_ctx: Value, ) -> Self
Helper for existing callers on the default path — no hooks and no
per-agent OperatorKind overrides. Leaves the “Runtime Global” tier
unspecified (None), so the BP-level tiers / final default
(OperatorKind::Automate) decide — this preserves today’s
behaviour for every existing caller without silently forcing
Automate as an explicit override that would outrank a BP-declared
MainAi/Composite kind. run_ctx and task_input both default
to None (no run tracing, no Task-level fields); construct the
struct literal directly to set either.
Trait Implementations§
Source§impl Clone for TaskLaunchInput
impl Clone for TaskLaunchInput
Source§fn clone(&self) -> TaskLaunchInput
fn clone(&self) -> TaskLaunchInput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TaskLaunchInput
impl !UnwindSafe for TaskLaunchInput
impl Freeze for TaskLaunchInput
impl Send for TaskLaunchInput
impl Sync for TaskLaunchInput
impl Unpin for TaskLaunchInput
impl UnsafeUnpin for TaskLaunchInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more