pub struct RunConfig {
pub schema: SchemaConfig,
pub predicate: Option<ToolPredicate>,
pub tool_filter: Option<ToolNamePredicate>,
pub assertions: AssertionSet,
pub in_band_error_forbidden: bool,
pub state_machine: StateMachineConfig,
pub pre_run_hook: Option<PreRunHook>,
pub full_trace: bool,
pub show_uncallable: bool,
pub trace_sink: Option<Arc<dyn TraceSink>>,
pub lints: LintSuite,
/* private fields */
}Expand description
Top-level configuration for executing a tooltest run.
Downstream crates cannot construct this type via a struct literal; use
RunConfig::new and the builder methods to ensure invariants are
validated.
use tooltest_core::RunConfig;
let _ = RunConfig {
uncallable_limit: 0,
..RunConfig::new()
};Fields§
§schema: SchemaConfigMCP schema configuration.
predicate: Option<ToolPredicate>Optional predicate to filter eligible tools.
tool_filter: Option<ToolNamePredicate>Optional predicate to filter eligible tools by name.
assertions: AssertionSetAssertion rules to evaluate during the run.
in_band_error_forbidden: boolWhether tool result error responses (isError) should fail the run.
state_machine: StateMachineConfigState-machine generator configuration.
pre_run_hook: Option<PreRunHook>Optional pre-run hook to execute before validation and each case.
full_trace: boolEmit full tool responses in traces instead of compact invocation-only entries.
show_uncallable: boolInclude uncallable tool traces when coverage validation fails.
trace_sink: Option<Arc<dyn TraceSink>>Optional trace sink for streaming per-case traces.
lints: LintSuiteConfigured lint rules for the run.
Implementations§
Source§impl RunConfig
impl RunConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a run configuration with defaults for schema and assertions.
The state-machine generator is always used, and it is strict by default (required values must come from the corpus unless lenient sourcing is enabled).
Sourcepub fn with_schema(self, schema: SchemaConfig) -> Self
pub fn with_schema(self, schema: SchemaConfig) -> Self
Sets the schema configuration.
Sourcepub fn with_predicate(self, predicate: ToolPredicate) -> Self
pub fn with_predicate(self, predicate: ToolPredicate) -> Self
Sets the tool predicate used for eligibility filtering.
Sourcepub fn with_tool_filter(self, predicate: ToolNamePredicate) -> Self
pub fn with_tool_filter(self, predicate: ToolNamePredicate) -> Self
Sets the tool name predicate used for eligibility filtering.
Sourcepub fn with_assertions(self, assertions: AssertionSet) -> Self
pub fn with_assertions(self, assertions: AssertionSet) -> Self
Sets the assertion rules for the run.
Sourcepub fn with_in_band_error_forbidden(self, forbidden: bool) -> Self
pub fn with_in_band_error_forbidden(self, forbidden: bool) -> Self
Sets whether tool result error responses (isError) should fail the run.
Sourcepub fn with_state_machine(self, state_machine: StateMachineConfig) -> Self
pub fn with_state_machine(self, state_machine: StateMachineConfig) -> Self
Sets the state-machine generator configuration.
Sourcepub fn with_pre_run_hook(self, hook: PreRunHook) -> Self
pub fn with_pre_run_hook(self, hook: PreRunHook) -> Self
Sets the pre-run hook for this run.
Sourcepub fn with_full_trace(self, enabled: bool) -> Self
pub fn with_full_trace(self, enabled: bool) -> Self
Enables full trace output with tool responses.
Sourcepub fn with_show_uncallable(self, enabled: bool) -> Self
pub fn with_show_uncallable(self, enabled: bool) -> Self
Enables uncallable tool trace output for coverage validation failures.
Sourcepub fn with_uncallable_limit(self, limit: usize) -> Result<Self, String>
pub fn with_uncallable_limit(self, limit: usize) -> Result<Self, String>
Sets the call limit for uncallable tool traces.
Sourcepub fn uncallable_limit(&self) -> usize
pub fn uncallable_limit(&self) -> usize
Returns the call limit for uncallable tool traces.
Sourcepub fn with_trace_sink(self, sink: Arc<dyn TraceSink>) -> Self
pub fn with_trace_sink(self, sink: Arc<dyn TraceSink>) -> Self
Sets a trace sink that receives per-case traces.
Sourcepub fn with_lints(self, lints: LintSuite) -> Self
pub fn with_lints(self, lints: LintSuite) -> Self
Sets the configured lints for this run.