Files
cleveragents-core/features/acms_plan_execution_integration.feature
T
HAL9000 8a5567f5d8 feat(acms): implement context policy configuration loader and plan execution ACMS integration
Implemented a new context policy configuration loader and integrated plan execution context assembly for ACMS. Key additions include:

- New module: src/cleveragents/acms/context_policy_loader.py
  - ContextPolicyConfigurationLoader class for loading YAML/TOML configurations
  - Data models: PolicyScope and ContextPolicyConfig dataclasses
  - ViewPolicyConfiguration for per-view policy management
  - Schema validation to ensure policy configurations adhere to expected structure and constraints
  - Supports loading configurations from both files and strings, with robust error reporting

- New module: src/cleveragents/acms/plan_execution_integration.py
  - ACMSContextAssembler for assembling runtime context based on policy-driven decisions
  - PlanExecutionACMSIntegration to connect with the plan execution engine
  - Flexible policy loading from files or strings, allowing runtime configurability

- BDD tests
  - features/acms_context_policy_loader.feature (20 scenarios) validating loader behavior and policy scoping
  - features/acms_plan_execution_integration.feature (8 scenarios) validating end-to-end plan-context integration
  - features/steps/acms_context_policy_loader_steps.py (step definitions)
  - features/steps/acms_plan_execution_integration_steps.py (step definitions)
  - Tests cover YAML/TOML parsing, validation errors, per-view policy application, and plan integration flows

- Updated exports
  - Updated src/cleveragents/acms/__init__.py to export the two new modules, enabling easier imports and usage

ISSUES CLOSED: #9584
2026-06-17 23:15:50 -04:00

63 lines
2.7 KiB
Gherkin

Feature: Plan Execution ACMS Integration
As a developer
I want the plan execution engine to use ACMS-assembled context for LLM calls
So that LLM calls receive properly assembled context instead of raw file dumps
Background:
Given I have a plan execution ACMS integration
Scenario: Prepare LLM context without policy configuration
Given I have no policy configuration
When I prepare LLM context with raw context data
Then the LLM context should be the same as the raw context
Scenario: Prepare LLM context with policy configuration
Given I have a policy configuration with 1 policy
When I prepare LLM context with raw context data
Then the LLM context should be assembled using ACMS policies
Scenario: Load policy configuration from file
Given I have a policy configuration file
When I load the policy configuration from the file
Then the integration should have the policy configuration loaded
Scenario: Load policy configuration from YAML string
Given I have a YAML policy configuration string
When I load the policy configuration from the YAML string
Then the integration should have the policy configuration loaded
Scenario: Load policy configuration from TOML string
Given I have a TOML policy configuration string
When I load the policy configuration from the TOML string
Then the integration should have the policy configuration loaded
Scenario: End-to-end: Plan execution with ACMS context
Given I have a plan execution ACMS integration
And I have a policy configuration with scope rules
And I have raw context data from file analysis
When I prepare LLM context for plan execution
Then the LLM context should include applied policies
And the LLM context should include assembled data
And the LLM context should have the correct view name
Scenario: ACMS context assembly respects priority weights
Given I have a policy configuration with multiple policies
And policy1 has priority_weight 1.0
And policy2 has priority_weight 2.0
When I prepare LLM context
Then policy2 should be applied before policy1 in the assembled context
Scenario: ACMS context assembly applies budget overrides
Given I have a policy configuration with 1 policy
And the policy has budget_override 500
When I prepare LLM context
Then the assembled context should have budget 500
Scenario: ACMS context assembly filters by scope
Given I have a policy configuration with scope rules
And the scope rule is file_type equals python
When I prepare LLM context with file_type "python"
Then the policy should be applied
When I prepare LLM context with file_type "javascript"
Then the policy should not be applied