agent-policy 0.6.0

Schema-first generator for coding-agent repo policies and compatibility files.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
// YAML parsing — implemented in Phase 1

use crate::{error::Result, model::policy::RawPolicy};

/// Parse a raw YAML string into a [`RawPolicy`].
///
/// # Errors
///
/// Returns [`crate::Error::Yaml`] if the input is not valid YAML or cannot be
/// deserialized into [`RawPolicy`].
pub fn parse(input: &str) -> Result<RawPolicy> {
    serde_yaml::from_str(input).map_err(crate::error::Error::Yaml)
}