vibe-action 0.1.2

Command router — execute shell commands and LLM prompts via simple YAML actions.
//! AppConfig validation.
//! Checks estimator and cluster configuration.

use anyhow::Result;

use crate::configs::app::AppConfig;
use crate::utils::constants;
use crate::validate::ValidateTrait;

impl ValidateTrait for AppConfig {
    /// Validate configuration.
    fn validate(&self) -> Result<()> {
        // Check version.
        if self.version != constants::CONFIG_VERSION {
            anyhow::bail!(
                "Config version mismatch: '{}', expected '{}'. Please update your config.",
                self.version,
                constants::CONFIG_VERSION
            );
        }
        // Validate each cluster node.
        for node in &self.cluster {
            node.validate()?;
        }
        Ok(())
    }
}