Skip to main content

NativeLoopConfig

Struct NativeLoopConfig 

Source
pub struct NativeLoopConfig {
    pub model: Option<String>,
    pub exclude_models: Vec<String>,
    pub max_iterations: u32,
    pub max_turns_per_iteration: u32,
    pub max_tokens_per_turn: usize,
    pub prompt_overlay: Option<String>,
    pub deadline: Arc<SessionDeadline>,
    pub auth_gate: Option<Arc<dyn AuthGate>>,
    pub can_adjudicate_no_change: bool,
    pub auth_wait: Duration,
    pub baseline_captures: BaselineCaptures,
}
Expand description

Tuning for the native loop.

Fields§

§model: Option<String>

Pinned model id; None routes adaptively (TaskHint::Code).

§exclude_models: Vec<String>

Models the adaptive arm must not use. Ignored when Self::model is pinned: a caller’s explicit model is either honored or refused by its own admission gate, never silently routed around.

§max_iterations: u32

Contract-evaluation rounds before giving up.

§max_turns_per_iteration: u32

Model turns within one iteration before forcing evaluation.

§max_tokens_per_turn: usize

Generation budget per turn.

§prompt_overlay: Option<String>

Extra guidance appended to the system prompt, set by the harness evolution loop (car#708). None = the byte-identical prompt the coder used before overlays existed.

§deadline: Arc<SessionDeadline>

The session’s absolute deadline, SHARED with every other rung of the fallback ladder. An Arc rather than a value so a rung cannot restart a clock it does not own — the defect that made the first version a per-loop ceiling calling itself a session one.

§auth_gate: Option<Arc<dyn AuthGate>>

Lets a session blocked on sign-in wait for the human rather than dying. None keeps the previous behaviour byte for byte.

§can_adjudicate_no_change: bool

Whether this caller can adjudicate a no-change nomination — i.e. it holds the baseline results, the contract’s provenance and the mutation ledger, and will run super::no_change::evaluate_nomination on whatever the loop hands back.

The report_no_change tool is offered ONLY when this is set. A caller that cannot judge a nomination must not invite one: LoopOutcome would come back neither green nor failed, and a caller not looking for that third shape reads it as an ordinary red and silently discards the finding. Advertising a tool nobody can honour is worse than not having it.

Defaults to false, which is the correct answer for every caller that has not been taught the third shape — this is a capability declaration, not a behaviour switch.

§auth_wait: Duration

How long to wait for the human to re-authenticate before giving up.

Generous because it bounds a person, not a process — they may be away from the machine. The session deadline still applies on top, so this can never extend a run past its own ceiling.

§baseline_captures: BaselineCaptures

The session-start baseline captures differential checks compare against (car#1067). Empty when the contract declares none — and under an empty map a differential check fails closed with a “never captured” message rather than passing silently.

Implementations§

Source§

impl NativeLoopConfig

Source

pub fn merge_harness(&mut self, h: &HarnessConfig)

Fold the general harness knobs the Evolution Agent tunes (car_memgine::HarnessConfig) onto the coder’s own budgets, so a harness patch applied through evolution.run’s gated path actually changes coder behavior. The coder’s native loop does NOT read HarnessConfig directly (it lives on the general car_engine::Runtime executor), so without this an applied patch would be inert and the A/B improvement loop could never converge. Mapping: planning_max_replans (how many replan/repair rounds the runtime grants) → the coder’s max_iterations (contract-eval repair rounds); max_retries (per-action retry budget) → a floor on max_turns_per_iteration. Only ever RAISES a budget — a harness fix grants headroom; it never starves the coder below its base config.

The session wall clock (deadline) is deliberately NOT raised here. It is an operator-owned safety ceiling, not a tuning knob, and the Evolution Agent granting itself more wall time would defeat the one bound that stops a runaway session. The consequence is real and worth stating: a patch raising max_iterations 8 -> 16 can be capped by a wall clock the harness cannot touch, so a converged-looking A/B result may in fact have been cut off. Raise max_session_wall_secs in ~/.car/coder.toml when running long-budget experiments.

Trait Implementations§

Source§

impl Clone for NativeLoopConfig

Source§

fn clone(&self) -> NativeLoopConfig

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 NativeLoopConfig

Source§

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

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

impl Default for NativeLoopConfig

Source§

fn default() -> Self

Returns the “default value” for a type. 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<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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

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