Epic: CPEX Rust Core (#12)
Summary
Implement the unified YAML config parser in cpex-core (config.rs). Parses the single config format that combines global policies, defaults, plugin declarations, and per-entity routes into typed Rust structs via serde.
Motivation
Currently, plugins must be registered programmatically. Config-driven registration enables declarative plugin setup from a single YAML file. We will add routing rules to the current plugin configuration, and provide experimental integrations with APL eventually.
Scope
CpexConfig top-level struct: global, plugins, routes
GlobalConfig: policies (named policy groups with all reserved), defaults (per entity type), delegation, identity, session
PluginDeclConfig: per-plugin declaration (name, kind, hooks, mode, priority, capabilities, conditions, config)
RouteEntry: entity matcher (tool/resource/prompt/llm), meta (tags, scope, properties), policy, post_policy, args, result, taint
- Validation at load time: duplicate plugin names, unknown hook names, invalid mode/capability values
- Integration with
PluginManager — config drives register_handler calls
Acceptance Criteria
- Parse the example YAML from the unified config proposal without errors
- Type validation catches malformed configs at startup
PluginManager can be initialized from a config file path
- Route matching: exact name > name list > glob > meta tag match > when expression > defaults
References
Epic: CPEX Rust Core (#12)
Summary
Implement the unified YAML config parser in
cpex-core(config.rs). Parses the single config format that combines global policies, defaults, plugin declarations, and per-entity routes into typed Rust structs via serde.Motivation
Currently, plugins must be registered programmatically. Config-driven registration enables declarative plugin setup from a single YAML file. We will add routing rules to the current plugin configuration, and provide experimental integrations with APL eventually.
Scope
CpexConfigtop-level struct:global,plugins,routesGlobalConfig:policies(named policy groups withallreserved),defaults(per entity type),delegation,identity,sessionPluginDeclConfig: per-plugin declaration (name, kind, hooks, mode, priority, capabilities, conditions, config)RouteEntry: entity matcher (tool/resource/prompt/llm),meta(tags, scope, properties),policy,post_policy,args,result,taintPluginManager— config drivesregister_handlercallsAcceptance Criteria
PluginManagercan be initialized from a config file pathReferences
crates/cpex-core/src/config.rs