Skip to content

[FEATURE]: YAML config parsing for RUST Core with routing rules. #16

Description

@terylt

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions