agent_policy/load/yaml.rs
1// YAML parsing — implemented in Phase 1
2
3use crate::{error::Result, model::policy::RawPolicy};
4
5/// Parse a raw YAML string into a [`RawPolicy`].
6///
7/// # Errors
8///
9/// Returns [`crate::Error::Yaml`] if the input is not valid YAML or cannot be
10/// deserialized into [`RawPolicy`].
11pub fn parse(input: &str) -> Result<RawPolicy> {
12 serde_yaml::from_str(input).map_err(crate::error::Error::Yaml)
13}