Skip to main content

Expect

Struct Expect 

Source
pub struct Expect {
Show 16 fields pub tools: Vec<String>, pub tools_in_order: Vec<String>, pub forbid_tools: Vec<String>, pub no_tools: bool, pub contains: Vec<String>, pub not_contains: Vec<String>, pub contains_any: Vec<String>, pub args: Vec<ArgExpect>, pub max_turns: Option<u32>, pub stop_cause: Option<StopCause>, pub taint: Option<TaintExpect>, pub blocked_sends: Option<u32>, pub min_compactions: Option<u32>, pub ended_on_failed_call: Option<bool>, pub judge: Option<String>, pub verify: Option<String>,
}
Expand description

What a correct run looks like. Every populated field becomes one check; a case passes only if all of its checks pass.

Fields§

§tools: Vec<String>

These tools must each be called at least once, in any order.

§tools_in_order: Vec<String>

These tools must be called in this relative order (other calls may be interleaved). Use for genuine dependencies, not incidental sequence.

§forbid_tools: Vec<String>

These tools must never be called.

§no_tools: bool

No tool may be called at all — the discrimination test. A model that reaches for a tool to answer “what is 2+2” will waste turns on real work.

§contains: Vec<String>

Case-insensitive substrings that must appear in the final answer.

§not_contains: Vec<String>

Case-insensitive substrings that must not appear.

§contains_any: Vec<String>

At least one of these must appear. Use when several phrasings are equally correct — grading a model down for word choice measures nothing.

§args: Vec<ArgExpect>

Argument-level assertions.

§max_turns: Option<u32>

Fail if the run took more turns than this — catches models that flail.

§stop_cause: Option<StopCause>

Why the loop had to stop, as a wire name (completed, interrupted, max_turns, output_token_budget, cost_budget).

The difference between “the model decided it was done” and “the harness cut it off” is invisible in the answer text, and a case that means to test a budget has no other way to say so.

§taint: Option<TaintExpect>

What must have entered the conversation by the end.

Only expressible across turns, which is the point: taint is a property of the conversation, and a single-prompt case cannot demonstrate that a turn boundary is not a security boundary.

§blocked_sends: Option<u32>

Exactly this many outbound calls must have been refused by the interlock.

Exact rather than a minimum: a case asserting the trifecta fires wants to know it fired once, not that the model kept hammering a blocked tool until something else stopped the run.

§min_compactions: Option<u32>

The transcript must have been summarised at least this many times.

Paired with contains, this is the only way to assert compaction fidelity rather than mere legality: the cut points are unit-tested, but whether a summary carried the running total forward can only be answered by a model that had to use it.

§ended_on_failed_call: Option<bool>

Whether the run may finish on a failed tool call.

Almost always false, and it is worth having as a check rather than as a global rule because the exceptions are real: a case whose right answer is “that file does not exist” should end on a failed call. What it catches is the shape no other check can see — the model stops on its own after a failure and writes an answer as though it had succeeded. Grading that from the text needs a judge, and judges measure near chance at it (AUROC 0.65 on tau2-bench, 0.54 on AppWorld) while this costs nothing.

§judge: Option<String>

A rubric for a second model to grade the answer against.

For cases where the right answer is a judgement — did it ask instead of guessing, did it notice the two sources disagree — and no substring can express that. Deliberately alongside the deterministic checks rather than replacing them: where a substring works it is worth more, because it costs nothing and cannot change its mind.

Write the rubric as the pass condition, in full sentences. The judge sees the case prompt and the answer, and nothing else.

§verify: Option<String>

A command run in the case’s workspace after the agent finishes. It passes if the command exits 0.

This is the honest grader for anything that writes code: not whether the model claimed the tests pass, but whether they do. Requires sandbox, since it is asserting on what the run left behind.

Trait Implementations§

Source§

impl Clone for Expect

Source§

fn clone(&self) -> Expect

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 Expect

Source§

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

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

impl Default for Expect

Source§

fn default() -> Expect

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

impl<'de> Deserialize<'de> for Expect
where Expect: Default,

Source§

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

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Expect

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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<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> 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> 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> 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, <T as TryFrom<U>>::Error>

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