pub struct Harness {
pub handle: SessionHandle,
pub provider: Arc<ScriptedProvider>,
pub seen: Vec<String>,
pub ask_reply: AskReply,
pub steer_on_tool_start: Option<String>,
pub snapshots: Arc<Mutex<Vec<String>>>,
/* private fields */
}Fields§
§handle: SessionHandle§provider: Arc<ScriptedProvider>§seen: Vec<String>Debug strings of every event seen, in order.
ask_reply: AskReplyAnswer for every Ask event (T1: defaults to Allow).
steer_on_tool_start: Option<String>One-shot steer to send when the next ToolStart is observed.
snapshots: Arc<Mutex<Vec<String>>>Labels of every shadow snapshot the engine requested, in order.
Implementations§
Source§impl Harness
impl Harness
Source§impl Harness
impl Harness
pub fn new( scripts: Vec<Vec<Result<StreamEvent, ProviderError>>>, config: EngineConfig, ) -> Self
Sourcepub fn with_items(
scripts: Vec<Vec<Result<StreamEvent, ProviderError>>>,
config: EngineConfig,
initial_items: Vec<Item>,
) -> Self
pub fn with_items( scripts: Vec<Vec<Result<StreamEvent, ProviderError>>>, config: EngineConfig, initial_items: Vec<Item>, ) -> Self
Construct a harness with a pre-seeded projection (resume scenarios).
Sourcepub fn with_hooks(
scripts: Vec<Vec<Result<StreamEvent, ProviderError>>>,
config: EngineConfig,
hooks: Arc<dyn Hooks>,
) -> Self
pub fn with_hooks( scripts: Vec<Vec<Result<StreamEvent, ProviderError>>>, config: EngineConfig, hooks: Arc<dyn Hooks>, ) -> Self
Construct a harness with extension hooks (M5 scenarios).
Sourcepub fn with_registry(
scripts: Vec<Vec<Result<StreamEvent, ProviderError>>>,
config: EngineConfig,
registry: Registry,
) -> Self
pub fn with_registry( scripts: Vec<Vec<Result<StreamEvent, ProviderError>>>, config: EngineConfig, registry: Registry, ) -> Self
Construct a harness with a custom tool registry (concurrency probes, scripted tools).
Sourcepub fn with_rules(
scripts: Vec<Vec<Result<StreamEvent, ProviderError>>>,
config: EngineConfig,
rules: Rules,
) -> Self
pub fn with_rules( scripts: Vec<Vec<Result<StreamEvent, ProviderError>>>, config: EngineConfig, rules: Rules, ) -> Self
Construct a harness with custom permission rules (mode/deny/admin scenarios).
Sourcepub async fn prompt_and_wait(&mut self, text: &str) -> Outcome
pub async fn prompt_and_wait(&mut self, text: &str) -> Outcome
Send a prompt and drain events until the turn finishes.
pub async fn wait_for_outcome(&mut self) -> Outcome
Sourcepub fn kinds(&self) -> Vec<String>
pub fn kinds(&self) -> Vec<String>
The persisted entry kinds, in order — the coarse golden signature.
Sourcepub fn transcript(&self) -> String
pub fn transcript(&self) -> String
The full normalized transcript: ids/parents/timestamps zeroed so runs are byte-comparable.
pub fn entries(&self) -> Vec<Entry>
Sourcepub fn tool_calls(&self) -> Vec<(String, Value)>
pub fn tool_calls(&self) -> Vec<(String, Value)>
(tool name, input) for every persisted assistant tool_use, in log order — the trajectory a scenario produced.
Sourcepub fn assert_trajectory(&self, expected: &[&str], mode: TrajectoryMatch)
pub fn assert_trajectory(&self, expected: &[&str], mode: TrajectoryMatch)
Assert on the tool-call sequence a scenario produced (not just entry kinds). Panics — with both sequences — when the mode’s relation fails.