//! Inventory record for one statically-registered validator.

use crate::validation::traits::ValidatorFn;

/// Link-time record emitted by `#[onto_validator]`. Aggregated via
/// `inventory::collect!(ValidatorEntry)` (see `validation/mod.rs`).
#[derive(Debug)]
pub struct ValidatorEntry {
    /// Canonical id — matches `catalog/validators/<id>.ncl::id`.
    pub id: &'static str,
    /// One-line description. Surfaces to MCP tool descriptions, CLI help.
    pub description: &'static str,
    /// `"Structural"` or `"Contextual"` (parsed at runtime by
    /// [`crate::validation::ValidatorCategory::parse`]).
    pub category: &'static str,
    /// Slice query identifier. Empty when category == Structural.
    pub slice_query: &'static str,
    /// Name of the Rust function annotated with `#[onto_validator]`.
    /// Useful for diagnostics; `predicate` carries the actual pointer.
    pub predicate_ref: &'static str,
    /// File path where the validator is declared. Populated at expansion
    /// time via `file!()` — surfaces in failure messages so consumers
    /// can navigate to the impl.
    pub source_file: &'static str,
    /// Function pointer for dispatch. Same signature for every entry —
    /// callers pass the same `Slice + ValidationCtx` regardless of
    /// the validator's category.
    pub predicate: ValidatorFn,
}
