pub struct GateDef {
pub id: String,
pub cmd: Vec<String>,
pub timeout_ms: u64,
pub judge: Option<JudgeDef>,
}Expand description
A user-defined gate (SPEC §8.1). Exactly one kind per definition:
- subprocess (
cmd): any executable that reads the candidate as JSON on stdin (never argv — injection-resistant) and emits{"verdict":"pass|fail|abstain", ...}on stdout. - judge (
judge): a native LLM-judge gate that grades the candidate against a rubric.
Fields§
§id: StringThe id a route references this gate by (must be unique and not shadow a built-in gate id).
cmd: Vec<String>Subprocess command: program first, then its args — e.g. ["pytest", "-q"]. Set this or
judge, not both.
timeout_ms: u64Hard timeout in milliseconds for a subprocess gate; it abstains (timeout) if the process
runs longer.
judge: Option<JudgeDef>LLM-judge configuration. Set this or cmd, not both.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GateDef
impl<'de> Deserialize<'de> for GateDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GateDef
impl RefUnwindSafe for GateDef
impl Send for GateDef
impl Sync for GateDef
impl Unpin for GateDef
impl UnsafeUnpin for GateDef
impl UnwindSafe for GateDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more