use std::path::Path;
use async_trait::async_trait;
use crate::dag::{Node, OnFail};
use crate::Result;
pub enum Gate {
Pass,
Fail { critique: String, policy: OnFail },
Park { question: String },
}
#[async_trait(?Send)]
pub trait EvalContext {
fn workspace(&self) -> &Path;
async fn run_tool(&self, node: &Node, command: &str, must_exit: i32) -> Result<(bool, String)>;
async fn run_ai(&self, node: &Node, extra_instruction: &str) -> Result<Option<String>>;
}
#[async_trait(?Send)]
pub trait Evaluator {
async fn grade(&self, node: &Node, ctx: &dyn EvalContext) -> Result<Gate>;
}