diff --git a/features/acms_context_policy_loader.feature b/features/acms_context_policy_loader.feature index d423838ba..6fc75bbd6 100644 --- a/features/acms_context_policy_loader.feature +++ b/features/acms_context_policy_loader.feature @@ -90,8 +90,8 @@ Feature: ACMS Context Policy Configuration Loader Scenario: Apply per-view policy with priority weights Given I have a context policy configuration with multiple policies - And policy1 has priority_weight 1.0 - And policy2 has priority_weight 2.0 + And loader policy1 has priority_weight 1.0 + And loader policy2 has priority_weight 2.0 When I assemble context with both policies Then policy2 should be applied before policy1 diff --git a/features/steps/acms_context_policy_loader_steps.py b/features/steps/acms_context_policy_loader_steps.py index 2c9fe9deb..b546661e3 100644 --- a/features/steps/acms_context_policy_loader_steps.py +++ b/features/steps/acms_context_policy_loader_steps.py @@ -81,7 +81,7 @@ def step_try_load_toml_file(context: Any) -> None: @then("the configuration should have view_name {view_name}") -def step_check_view_name(context: Any, view_name: str) -> None: +def step_check_view_name_loader(context: Any, view_name: str) -> None: """Check the view name in the configuration.""" assert context.loaded_config is not None assert context.loaded_config.view_name == view_name @@ -215,7 +215,7 @@ def step_load_toml_string(context: Any) -> None: @given("I have a context policy configuration with:") -def step_have_policy_config(context: Any) -> None: +def step_have_policy_config_loader(context: Any) -> None: """Create a context policy configuration from table.""" config_dict: dict[str, Any] = {} @@ -265,7 +265,7 @@ def step_policy_matches_context(context: Any) -> None: @given("I have a context policy configuration with multiple policies") -def step_have_multiple_policies(context: Any) -> None: +def step_have_multiple_policies_loader(context: Any) -> None: """Create a configuration with multiple policies.""" context.policy_config = ViewPolicyConfiguration( view_name="test_view", @@ -276,11 +276,11 @@ def step_have_multiple_policies(context: Any) -> None: ) -@given(r"policy1 has priority_weight ([\d.]+)") -def step_policy1_priority(context: Any, weight_str: str) -> None: +@given(r"loader policy1 has priority_weight ([\d.]+)") +def step_policy1_priority_loader(context: Any, weight_str: str) -> None: """Set priority weight for policy1.""" if context.policy_config.policies: - context.policy_config.policies[0].priority_weight = weight + context.policy_config.policies[0].priority_weight = float(weight_str) # Reinitialize integration if present (for plan execution integration tests) if hasattr(context, "integration"): context.integration = PlanExecutionACMSIntegration( @@ -288,11 +288,11 @@ def step_policy1_priority(context: Any, weight_str: str) -> None: ) -@given(r"policy2 has priority_weight ([\d.]+)") -def step_policy2_priority(context: Any, weight_str: str) -> None: +@given(r"loader policy2 has priority_weight ([\d.]+)") +def step_policy2_priority_loader(context: Any, weight_str: str) -> None: """Set priority weight for policy2.""" if len(context.policy_config.policies) > 1: - context.policy_config.policies[1].priority_weight = weight + context.policy_config.policies[1].priority_weight = float(weight_str) # Reinitialize integration if present (for plan execution integration tests) if hasattr(context, "integration"): context.integration = PlanExecutionACMSIntegration( @@ -348,7 +348,7 @@ def step_policy_disabled(context: Any) -> None: @then("the policy should not be applied") -def step_policy_not_applied(context: Any) -> None: +def step_policy_not_applied_loader(context: Any) -> None: """Check that the policy was not applied.""" # Support both direct assembler context and integration context assembled = getattr(context, "assembled", None) or getattr( diff --git a/features/steps/acms_plan_execution_integration_steps.py b/features/steps/acms_plan_execution_integration_steps.py index 6747a059d..af3a5b3f2 100644 --- a/features/steps/acms_plan_execution_integration_steps.py +++ b/features/steps/acms_plan_execution_integration_steps.py @@ -289,7 +289,7 @@ def step_policy_applied(context: Any) -> None: @then("the policy should not be applied to the LLM context") -def step_policy_not_applied(context: Any) -> None: +def step_policy_not_applied_integration(context: Any) -> None: """Check that the policy was NOT applied.""" assert context.llm_context is not None policies_applied = context.llm_context.get("policies_applied", [])