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
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