//! # masl_validator
//!
//! Architectural validation pass over the HIR.
//!
//! Validates:
//! - public contract compliance (traversals use grants, not raw relations)
//! - expression normalization (deduplication, flattening)
//! - expression complexity limits
//!
//! Produces an optimized HIR on success.
//!
//! See RFC-0006 — Validator.

pub mod error;
pub mod rules;
pub mod validate;

use masl_diagnostics::diagnostic::Diagnostic;
use masl_hir::HirDocument;

/// Run the validation pass on a HIR Document.
pub fn validate(hir: HirDocument) -> Result<HirDocument, Vec<Diagnostic>> {
    validate::run_validation(hir)
}
