92 lines
4.0 KiB
Gherkin
92 lines
4.0 KiB
Gherkin
Feature: Automation Profile Service
|
|
As a developer
|
|
I want to resolve automation profiles with precedence
|
|
So that plan execution autonomy is configured correctly
|
|
|
|
# ---- Precedence resolution ----
|
|
|
|
Scenario: Plan-level profile takes highest precedence
|
|
Given an automation profile service with global default "manual"
|
|
When I resolve profile with plan "full-auto" action "auto" project "supervised"
|
|
Then the resolved profile name should be "full-auto"
|
|
|
|
Scenario: Action-level profile used when plan is not set
|
|
Given an automation profile service with global default "manual"
|
|
When I resolve profile with plan None action "auto" project "supervised"
|
|
Then the resolved profile name should be "auto"
|
|
|
|
Scenario: Project-level profile used when plan and action are not set
|
|
Given an automation profile service with global default "manual"
|
|
When I resolve profile with plan None action None project "supervised"
|
|
Then the resolved profile name should be "supervised"
|
|
|
|
Scenario: Global default used when no level is set
|
|
Given an automation profile service with global default "cautious"
|
|
When I resolve profile with plan None action None project None
|
|
Then the resolved profile name should be "cautious"
|
|
|
|
Scenario: Default global is manual when nothing configured
|
|
Given an automation profile service with no configuration
|
|
When I resolve profile with plan None action None project None
|
|
Then the resolved profile name should be "manual"
|
|
|
|
# ---- Missing profile errors ----
|
|
|
|
Scenario: Missing profile raises NotFoundError
|
|
Given an automation profile service with global default "manual"
|
|
When I try to get profile "nonexistent-profile"
|
|
Then a profile not found error should be raised
|
|
And the profile service error should mention "nonexistent-profile"
|
|
|
|
Scenario: Missing profile in resolve raises NotFoundError
|
|
Given an automation profile service with global default "does-not-exist"
|
|
When I try to resolve profile with all None
|
|
Then a profile not found error should be raised
|
|
|
|
# ---- Environment variable override ----
|
|
|
|
Scenario: Env var overrides empty global default
|
|
Given an automation profile service with no configuration
|
|
And the env var CLEVERAGENTS_AUTOMATION_PROFILE is set to "ci"
|
|
When I resolve profile with plan None action None project None
|
|
Then the resolved profile name should be "ci"
|
|
|
|
Scenario: Explicit global default takes precedence over env var
|
|
Given an automation profile service with global default "review"
|
|
And the env var CLEVERAGENTS_AUTOMATION_PROFILE is set to "ci"
|
|
When I resolve profile with plan None action None project None
|
|
Then the resolved profile name should be "review"
|
|
|
|
# ---- CRUD via repository ----
|
|
|
|
Scenario: List profiles includes built-ins
|
|
Given an automation profile service with global default "manual"
|
|
When I list all profiles
|
|
Then the profile list should include "manual"
|
|
And the profile list should include "full-auto"
|
|
And the profile list should have at least 8 entries
|
|
|
|
# ---- Get built-in profile ----
|
|
|
|
Scenario: Get built-in profile by name
|
|
Given an automation profile service with global default "manual"
|
|
When I get profile "auto"
|
|
Then the retrieved profile name should be "auto"
|
|
And the retrieved profile auto_apply should be 1.0
|
|
|
|
# ---- Profile threshold checks ----
|
|
|
|
Scenario: Manual profile has all thresholds at 1.0
|
|
Given an automation profile service with global default "manual"
|
|
When I get profile "manual"
|
|
Then the retrieved profile auto_strategize should be 1.0
|
|
And the retrieved profile auto_execute should be 1.0
|
|
And the retrieved profile auto_apply should be 1.0
|
|
|
|
Scenario: Full-auto profile has all thresholds at 0.0
|
|
Given an automation profile service with global default "manual"
|
|
When I get profile "full-auto"
|
|
Then the retrieved profile auto_strategize should be 0.0
|
|
And the retrieved profile auto_execute should be 0.0
|
|
And the retrieved profile auto_apply should be 0.0
|