Files
cleveragents-core/features/automation_profile_cli_coverage.feature
T
freemo 3bd02a7c6e feat(cli): add automation-profile commands
Add CLI command group `agents automation-profile` with add, remove,
list, and show subcommands for managing automation profiles that
control plan execution autonomy.

Changes:
- New `automation_profile.py` CLI module with YAML config input,
  schema_version guard, namespaced name validation, --update support,
  and all output formats (json/yaml/plain/table/rich)
- Register automation-profile in main CLI app
- Add deprecation warnings for --automation-level on plan use and
  set-automation-level commands
- Update CLI reference docs with command examples, built-in profiles
  list, and deprecation notes
- 26 Behave scenarios covering all commands and error paths
- 9 Robot Framework integration smoke tests
- ASV benchmarks for CLI parsing performance
- Mark A6.cli items complete in implementation_plan.md
2026-02-20 08:50:06 -05:00

73 lines
3.7 KiB
Gherkin

Feature: Automation Profile CLI coverage boost
As a developer
I want to cover remaining branches in automation_profile CLI module
So that coverage reaches the 97% threshold
Background:
Given an automation profile coverage CLI runner
Scenario: Delete from in-memory repo when profile does not exist
When I delete a non-existent profile from the in-memory repo
Then a NotFoundError should be raised from the repo
Scenario: Threshold summary returns compact string
When I call threshold summary on a built-in profile
Then the threshold summary should contain strategize execute and apply values
Scenario: Add profile with non-dict YAML content aborts
Given a YAML file containing a list instead of a dict
When I run automation-profile add with that non-dict YAML file
Then the automation-profile coverage command should abort
And the automation-profile coverage output should contain "mapping"
Scenario: Add profile triggers FileNotFoundError from open
When I run automation-profile add with a config that triggers FileNotFoundError
Then the automation-profile coverage command should abort
Scenario: Add profile triggers ValidationError from service
Given a YAML file that triggers a ValidationError from the service
When I run automation-profile add with that validation-error YAML file
Then the automation-profile coverage command should abort
And the automation-profile coverage output should contain "Validation"
Scenario: Add profile triggers CleverAgentsError from service
Given a YAML file that triggers a CleverAgentsError from the service
When I run automation-profile add with that cleveragents-error YAML file
Then the automation-profile coverage command should abort
And the automation-profile coverage output should contain "Error"
Scenario: Remove profile without --yes prompts confirmation and user declines
Given a custom coverage profile "acme/removable" has been added
When I run automation-profile remove "acme/removable" without --yes and decline
Then the automation-profile coverage output should contain "Cancelled"
Scenario: Remove profile without --yes prompts confirmation and user confirms
Given a custom coverage profile "acme/removable2" has been added
When I run automation-profile remove "acme/removable2" without --yes and confirm
Then the automation-profile coverage remove should succeed
And the automation-profile coverage output should contain "removed"
Scenario: Remove profile triggers ValidationError
Given a custom coverage profile "acme/valerr" has been added
When I run automation-profile remove "acme/valerr" with validation error
Then the automation-profile coverage command should abort
And the automation-profile coverage output should contain "Validation"
Scenario: Remove profile triggers CleverAgentsError
Given a custom coverage profile "acme/caerr" has been added
When I run automation-profile remove "acme/caerr" with CleverAgentsError
Then the automation-profile coverage command should abort
And the automation-profile coverage output should contain "Error"
Scenario: List profiles triggers CleverAgentsError
When I run automation-profile list with a CleverAgentsError from service
Then the automation-profile coverage command should abort
Scenario: Show profile triggers CleverAgentsError
When I run automation-profile show with a CleverAgentsError from service
Then the automation-profile coverage command should abort
Scenario: Emit automation level deprecation warning directly
When I call emit_automation_level_deprecation_warning
Then a DeprecationWarning should be emitted