1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! # agent-policy
//!
//! Schema-first generator for coding-agent repo policies and compatibility files.
//!
//! ## Usage
//!
//! ```no_run
//! use camino::Utf8Path;
//!
//! let (policy, warnings) = agent_policy::load(Utf8Path::new("agent-policy.yaml"))
//! .expect("failed to load policy");
//!
//! for w in &warnings { eprintln!("warning: {w}"); }
//! println!("Project: {}", policy.project.name);
//! ```
//!
//! ## Command-line interface
//!
//! See the [README](https://github.com/CameronBrooks11/agent-policy) for CLI documentation.
pub
pub use ;
pub use Policy;
/// Load, validate, and normalize an `agent-policy.yaml` from a file path.
///
/// This is the main entry point for the entire load pipeline.
///
/// Returns the normalized policy and any diagnostic warnings. Warnings are
/// non-fatal and should be printed to stderr so the user can clean up their
/// configuration.
///
/// # Errors
///
/// Returns an [`Error`] if the file cannot be read, the YAML is invalid, the
/// document fails schema validation, or normalization encounters invalid values.