4 Commits

Author SHA1 Message Date
CleverAgents Bot 641a8ed67d test(acms): cover context policy edge cases 2026-06-17 23:15:50 -04:00
HAL9000 8280bd5ee2 fix(acms): resolve remaining AmbiguousStep conflicts, NameError bugs, and function name duplicates
Fix two critical issues identified by HAL9001 review #8271:

1. Rename literal step 'policy{1,2} has priority_weight' in loader
   steps to 'loader policy{1,2} has priority_weight' to disambiguate
   from parameterised 'policy(\d+) has priority_weight' in integration
   steps (fixes AmbiguousStep Conflicts 1 & 2 - root cause of CI failures).

2. Fix NameError: change undefined variable 'weight' to float(weight_str)
   in step_policy1_priority and step_policy2_priority functions.

3. Rename duplicate Python function names across step files to prevent
   namespace shadowing: step_check_view_name, step_have_multiple_policies,
   step_have_policy_config, step_policy_not_applied → suffixed with _loader
   or _integration.

ISSUES CLOSED: #9584
2026-06-17 23:15:50 -04:00
HAL9000 7faab96582 fix(acms): resolve all reviewer feedback for context policy loader and plan execution integration
Fixed all blocking issues identified in 4 REQUEST_CHANGES reviews:

- Removed broken ContextPolicy import (root cause of all CI failures)
- Fixed all ruff lint violations: deprecated typing aliases, format parameter shadowing built-in, unused imports, imports inside functions, SIM115/SIM102
- Fixed Behave step ambiguity and duplicate step definitions across files
- Fixed context.config collision with Behave's internal config attribute
- Added CHANGELOG entry for the new ACMS context policy feature
- Added CONTRIBUTORS.md entry for HAL9000
- Added performance benchmark file: benchmarks/acms_context_policy_bench.py
- Fixed pre-existing lint errors in scripts/validate_automation_tracking.py
- Wired PlanExecutionACMSIntegration documentation to explain integration point

ISSUES CLOSED: #9584
2026-06-17 23:15:50 -04:00
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