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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! Configuration management for behavior trees
//!
//! This module provides utilities for loading and validating behavior tree configurations,
//! resolved via a `config.json` scope layout rooted at `configs/behaviors/` (LAB-2072 moved it
//! under `configs/` so `mecha10 config push`/`pull`/`list` actually sync it - see
//! `mecha10_cli_core::paths::config`).
//!
//! # Configuration Hierarchy
//!
//! Behavior configurations follow a two-tier hierarchy, override precedence lowest to highest:
//!
//! 1. **Framework default** (`configs/behaviors/@mecha10/{name}/config.json`) - bundled at
//! scaffold time
//! 2. **Project override** (`configs/behaviors/{name}/config.json`) - project-committed, wins
//!
//! There is no `@local` tier for behaviors (LAB-1990) - node configs have one, but it predates
//! and means something different from a "machine-local" scope, and behaviors never had a real
//! backing for that framing (nothing gitignores it, and `mecha10 config push` syncs it like any
//! other config).
//!
//! Resolution picks the highest-precedence tier present on disk - there's no field-level merging
//! across tiers (LAB-1990).
//!
//! # Example Structure
//!
//! ```text
//! my-robot/
//! └── configs/
//! └── behaviors/
//! ├── @mecha10/
//! │ └── idle_wander/
//! │ └── config.json # Bundled framework default
//! └── idle_wander/
//! └── config.json # Project-committed override (highest precedence)
//! ```
//!
//! # Usage
//!
//! ```rust,ignore
//! use mecha10_behavior_runtime::config::{load_behavior_config, validate_behavior_config};
//! use std::path::Path;
//!
//! // Resolve and load the highest-precedence tier present on disk
//! let config = load_behavior_config("idle_wander", Path::new("/path/to/project")).await?;
//!
//! // Validate before loading
//! let registry = NodeRegistry::new();
//! let result = validate_behavior_config(&config, ®istry)?;
//! if !result.valid {
//! for error in result.errors {
//! eprintln!("Validation error: {}", error);
//! }
//! }
//! ```
pub use ;
pub use ;
pub use ;