//! DevOps validator scaffold — long-horizon.
//!
//! PRD: "scaffold only: stubbed Terraform/Ansible validators
//! (`terraform validate`, `ansible-lint`) for the long-horizon phase."
//! Shipped as Unimplemented stubs so the execution-loop dispatcher
//! has a consistent failure shape to surface ("phase 43 not wired")
//! instead of a missing-impl panic.

use crate::{Artifact, Report, Validator, ValidationError};

pub struct TerraformValidator;

impl Validator for TerraformValidator {
    fn name(&self) -> &'static str { "devops.terraform" }
    fn validate(&self, _artifact: &Artifact) -> Result<Report, ValidationError> {
        Err(ValidationError::Unimplemented { artifact: "terraform_plan" })
    }
}

pub struct AnsibleValidator;

impl Validator for AnsibleValidator {
    fn name(&self) -> &'static str { "devops.ansible" }
    fn validate(&self, _artifact: &Artifact) -> Result<Report, ValidationError> {
        Err(ValidationError::Unimplemented { artifact: "ansible_playbook" })
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn terraform_scaffold_returns_unimplemented() {
        let r = TerraformValidator.validate(&Artifact::TerraformPlan(serde_json::json!({})));
        assert!(matches!(r, Err(ValidationError::Unimplemented { .. })));
    }

    #[test]
    fn ansible_scaffold_returns_unimplemented() {
        let r = AnsibleValidator.validate(&Artifact::AnsiblePlaybook(serde_json::json!({})));
        assert!(matches!(r, Err(ValidationError::Unimplemented { .. })));
    }
}
