1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! # io-harness
//!
//! A production-grade Rust agent harness: run an AI agent from a typed
//! [`TaskContract`] to a *verified* result. Provider-agnostic, embeddable
//! in-process, with a deterministic verification layer.
//!
//! v0.1 scope: the agent edits one file to meet a [`Verification`] criterion,
//! using the filesystem tool and the OpenRouter provider, persisting every step
//! to rusqlite, and stopping on success or a step cap.
//!
//! ```no_run
//! use io_harness::{run, OpenRouter, Store, TaskContract, Verification};
//!
//! # async fn demo() -> io_harness::Result<()> {
//! let provider = OpenRouter::from_env()?; // OPENROUTER_API_KEY + OPENROUTER_MODEL
//! let store = Store::memory()?;
//! let contract = TaskContract::new(
//! "add a hello function returning 42",
//! "src/hello.rs",
//! Verification::FileContains("fn hello".into()),
//! );
//! let result = run(&contract, &provider, &store).await?;
//! println!("{:?}", result.outcome);
//! # Ok(())
//! # }
//! ```
pub use TaskContract;
pub use ;
pub use ;
pub use ;
pub use ;
pub use Verification;