Skip to main content

Module config

Module config 

Source
Expand description

Configuration management for behavior trees

Loads and validates behavior tree configs from a 2-tier config.json scope layout.

Structs§

BehaviorConfig
A behavior tree definition loaded from a JSON configuration file.
NodeConfig
Configuration referencing a behavior node type and its inline configuration.
NodeReference
SubsumptionLayerConfig
A single priority layer within a Subsumption composition node.
ValidationResult

Enums§

CompositionConfig
A node in a behavior tree: either a composite control-flow node or a leaf behavior node.
ParallelPolicyConfig
Determines when a Parallel composition node succeeds, based on its children’s outcomes.

Functions§

behavior_capabilities_satisfied
Returns true if every capability config declares via requires_capabilities is present in available_capabilities – the same subset check [validate_required_capabilities] uses to produce validation errors, exposed for runtime filtering (e.g. excluding a behavior from /behavior/available when the robot doesn’t provide a capability it needs).
detect_project_root
Detect project root by looking for mecha10.json
get_current_environment
Get the current environment from environment variable
list_available_behaviors
List the names of every behavior available to a project, across both tiers (configs/behaviors/{name}/config.json and configs/behaviors/@mecha10/{name}/config.json). A name present in both tiers is only listed once.
list_capable_behaviors
List the names of every behavior available to a project (see list_available_behaviors), excluding any whose requires_capabilities isn’t fully satisfied by available_capabilities – e.g. so a robot with no Flight capability never reports a flight-only behavior as available on /behavior/available. A behavior whose config can’t be loaded or parsed is excluded rather than reported as available.
load_behavior_config
Load a behavior’s config.json, resolved via resolve_behavior_config_path.
resolve_behavior_config_path
Resolve the on-disk config.json path for a behavior, checking the 2 tiers in override precedence order (project -> framework) and returning the highest-precedence one that exists. Returns an error listing both attempted paths if neither exists.
validate_behavior_composition_json
Validate a behavior composition JSON value against the schemars-derived BehaviorConfig JSON Schema – structural validation only, no NodeRegistry required. Returns an error describing every schema violation found.
validate_behavior_config
Validate a behavior tree configuration: checks it against the real BehaviorConfig JSON Schema (see validate_behavior_composition_json), that every leaf node’s node type exists in registry, and that every capability it declares via requires_capabilities is present in available_capabilities – rules a JSON Schema can’t express on its own since they cross-reference the live node registry / the project’s other nodes.