pub struct AiCheck {
pub prompt: String,
pub model: Option<String>,
pub reason: ReasonMode,
pub threshold: Option<f64>,
pub if_true: Option<String>,
pub if_false: Option<String>,
}Expand description
Optional AI confirmation step for a rule. When present, the rule’s rule
AST pattern acts as a cheap pre-filter: matches become candidates that an
LLM (or the System One classifier) must confirm before they are reported.
The AST layer never executes this field; the AI pipeline in slopguard-ai
reads it.
Fields§
§prompt: StringPrompt template. Double use: the generative LLM prompt (variables
{{code}}, {{filename}}, {{rule_context}}), and the instructions
of the System One classifier’s noul question.
model: Option<String>Model override for this rule. Falls back to [ai].model in config.
reason: ReasonModeHow the finding’s reason is produced: a static note (default) or a
per-instance generated note written by the LLM.
threshold: Option<f64>Per-rule classifier probability threshold, overriding
[ai.classifier].threshold. Fires when p >= threshold.
if_true: Option<String>Classifier calibration: what a “yes” (issue) looks like. Maps to the
noul question’s criteria.true.
if_false: Option<String>Classifier calibration: what a “no” (not an issue) looks like. Maps to
the noul question’s criteria.false.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AiCheck
impl<'de> Deserialize<'de> for AiCheck
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>,
impl StructuralPartialEq for AiCheck
Auto Trait Implementations§
impl Freeze for AiCheck
impl RefUnwindSafe for AiCheck
impl Send for AiCheck
impl Sync for AiCheck
impl Unpin for AiCheck
impl UnsafeUnpin for AiCheck
impl UnwindSafe for AiCheck
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more