pub struct NativeLoopConfig {
pub steering: Option<Arc<SteeringInbox>>,
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§
§steering: Option<Arc<SteeringInbox>>§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: u32Contract-evaluation rounds before giving up.
max_turns_per_iteration: u32Model turns within one iteration before forcing evaluation.
max_tokens_per_turn: usizeGeneration 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: boolWhether 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: DurationHow 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: BaselineCapturesThe 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
impl NativeLoopConfig
Sourcepub fn merge_harness(&mut self, h: &HarnessConfig)
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
impl Clone for NativeLoopConfig
Source§impl Debug for NativeLoopConfig
impl Debug for NativeLoopConfig
Auto Trait Implementations§
impl !RefUnwindSafe for NativeLoopConfig
impl !UnwindSafe for NativeLoopConfig
impl Freeze for NativeLoopConfig
impl Send for NativeLoopConfig
impl Sync for NativeLoopConfig
impl Unpin for NativeLoopConfig
impl UnsafeUnpin for NativeLoopConfig
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,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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