Skip to main content

StepEnv

Struct StepEnv 

Source
pub struct StepEnv<'a> {
    pub plan: &'a PlanGraph,
    pub executors: &'a [NodeExecutor],
    pub budgets: Budgets,
    pub reduce: &'a dyn Fn(&str, Option<&Value>, &Value) -> Value,
    pub eval_cond: &'a dyn Fn(&PlanEdge, &Value) -> bool,
    pub ask_ttl_sec: Option<i64>,
    pub validate_args: &'a dyn Fn(&str, &Value) -> Result<(), String>,
    pub llm_reserve_tokens: u64,
    pub max_effects_per_attempt: u32,
    pub llm_tool_result_chars: Option<usize>,
    pub llm_context_tokens: Option<u64>,
    pub decide: Option<DecideEnv<'a>>,
}
Expand description

The injected pure behavior. Everything here is REQUIRED to be pure — enforced by the journaled decision record + replay assertion, not trust.

Fields§

§plan: &'a PlanGraph§executors: &'a [NodeExecutor]

Per node: the resolved executor (the driver’s V7 freeze).

§budgets: Budgets§reduce: &'a dyn Fn(&str, Option<&Value>, &Value) -> Value

Merge one result key into the accumulated state: (key, prev, new) -> merged. The driver’s registry with LWW fallback; must be pure, deterministic, batching-invariant (§6.5).

§eval_cond: &'a dyn Fn(&PlanEdge, &Value) -> bool

Evaluate an edge’s condition against the state — the built-in (cond::eval over the parsed form) or a host evaluator over the raw string. Must be pure; only consulted for edges that carry a cond.

§ask_ttl_sec: Option<i64>

TTL for Client asks (seconds); None = asks never expire.

§validate_args: &'a dyn Fn(&str, &Value) -> Result<(), String>

Validate a model-issued tool call’s arguments against the pinned Definition’s input_schema (§6.11 — the driver wires validate_instance over strict definitions; Ok(()) for non-strict). Must be pure: it runs identically on replay.

§llm_reserve_tokens: u64

The per-call token reservation for LLM dispatches (§6.7’s per-dispatch enforcement: spent + reserve must fit before an LLM effect is emitted). The driver sets this to the request’s mandatory max_tokens.

§max_effects_per_attempt: u32

Hard bound on effects per node attempt — an abstract node’s LLM loop (turns + tool calls + re-prompts) that exceeds it fails the node with ExecutorError rather than looping forever. Frozen in the run manifest, so a resume bounds the loop exactly as the start did; DEFAULT_MAX_EFFECTS_PER_ATTEMPT when the manifest pins none.

§llm_tool_result_chars: Option<usize>

Bound on ONE tool result’s size in the TRANSCRIPT (characters — there is no tokenizer here, and calling it tokens would be a lie). None = unbounded, which is what every run did before the knob existed. The journal is never bounded: see bound_tool_content.

§llm_context_tokens: Option<u64>

Ceiling on the WHOLE transcript, in the provider’s own prompt tokens (AbstractFlow.last_prompt_tokens). None = no ceiling, which is what every run did before the fold existed. Reaching it emits one journaled summarizer turn and splices its result over the folded range; failing to find a foldable range is RUN-E024.

§decide: Option<DecideEnv<'a>>

The decision backend the manifest pinned, if any (C1/C2). None — every run before decisions existed, and every host without one — asks nothing and builds exactly the commands it always did.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for StepEnv<'a>

§

impl<'a> !Send for StepEnv<'a>

§

impl<'a> !Sync for StepEnv<'a>

§

impl<'a> !UnwindSafe for StepEnv<'a>

§

impl<'a> Freeze for StepEnv<'a>

§

impl<'a> Unpin for StepEnv<'a>

§

impl<'a> UnsafeUnpin for StepEnv<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more