antecedent-validate 0.5.2

Effect refuters, sensitivity analysis, and validation diagnostics for the Antecedent engine; start with the `antecedent` crate
Documentation
//! Object-safe custom effect validators.
//!
//! SPDX-License-Identifier: MIT OR Apache-2.0

use antecedent_core::ExecutionContext;

use crate::common::{RefutationProblem, RefutationReport};
use crate::error::ValidationError;

/// Slow-path custom effect validator (Python / user callbacks).
///
/// Distinct from [`crate::Validator`] which uses associated types and is not dyn-safe.
///
/// Deliberately **not** sealed: object-safe extension for host languages (`PyO3`)
/// and app-level hooks. Prefer [`crate::Validator`] for in-crate refuters.
pub trait CustomEffectValidator: Send + Sync {
    /// Stable name written into [`RefutationReport::refuter`].
    fn name(&self) -> &str;

    /// Run the check against a prepared refutation problem.
    ///
    /// # Errors
    ///
    /// Validation / applicability failures.
    fn validate(
        &self,
        problem: &RefutationProblem<'_>,
        ctx: &ExecutionContext,
    ) -> Result<RefutationReport, ValidationError>;
}