Skip to main content

Defaults

Struct Defaults 

Source
pub struct Defaults {
    pub runner: Option<String>,
    pub env_from: Vec<String>,
    pub max_hops: u32,
    pub fuel_usd: f64,
    pub max_runs: u32,
    pub timeout_sec: u64,
    pub max_recovery_attempts: u32,
    pub max_concurrent_runs: usize,
    pub max_spawn_generations: u32,
}
Expand description

Factory-wide defaults, overridable per agent.

Fields§

§runner: Option<String>

Runner used by agents that do not name one.

§env_from: Vec<String>

Names of environment variables forwarded to every agent’s CLI.

Most factories run one CLI that needs one credential, and repeating it under every agent is a list that falls out of step the first time an agent is added. Per-agent crate::Agent::env_from adds to this rather than replacing it, so an agent that needs a token nobody else should hold names only that token.

§max_hops: u32

Maximum depth of a chain, in flights.

A hop is spent per flight and branches inherit the remaining count, so this bounds depth and not breadth. See crate::itinerary.

§fuel_usd: f64

Shared cost budget for an entire itinerary, in US dollars.

§max_runs: u32

Deterministic backstop on total runs per itinerary.

Fuel is the intended bound on breadth, but it depends on runners reporting cost. This cap needs no runner cooperation and is therefore always enforced.

§timeout_sec: u64

Wall-clock limit for a single run.

§max_recovery_attempts: u32

How many times interrupted work may be restarted automatically.

A crash loop that restarts itself forever is a fork bomb that looks like resilience, so recovery is bounded like every other rail. Zero disables automatic recovery.

§max_concurrent_runs: usize

How many runs may be live at once, across the whole factory.

The one rail that protects the machine rather than a budget. Hops bounds depth, Fuel and the Reserve bound money, the run cap bounds a chain’s total — none of them bounds how many headless CLIs start simultaneously, which is what a fan-out over an unknown number of items produces. Excess work queues rather than being refused: a busy machine will not be busy in a minute, so delaying is right where refusing would silently drop work.

§max_spawn_generations: u32

How many generations of spawning separate a chain from the trigger that began it.

A spawned itinerary gets fresh Hops, so Hops cannot see across chains: without this an agent that spawns an agent that spawns an agent recurses forever while every individual chain stays perfectly inside its rails. This is Hops, one level up.

Trait Implementations§

Source§

impl Clone for Defaults

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Defaults

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Defaults

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Defaults

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V