Files
cleveragents-core/features/cli_command_bus_decoupling.feature
HAL9000 7ed9c1279f
CI / push-validation (pull_request) Successful in 33s
CI / helm (pull_request) Successful in 36s
CI / lint (pull_request) Successful in 44s
CI / quality (pull_request) Successful in 51s
CI / build (pull_request) Successful in 47s
CI / typecheck (pull_request) Successful in 1m10s
CI / security (pull_request) Successful in 1m27s
CI / unit_tests (pull_request) Successful in 6m15s
CI / docker (pull_request) Successful in 1m46s
CI / integration_tests (pull_request) Successful in 9m40s
CI / coverage (pull_request) Successful in 8m29s
CI / status-check (pull_request) Successful in 3s
fix(cli): resolve lint errors and step name conflict in command bus
- Replace deprecated typing imports (Dict, Callable, Generic) with
  collections.abc.Callable and built-in dict
- Convert Command from ABC to plain base class (B024: no abstract methods)
- Convert CommandHandler to PEP 695 type parameter syntax (UP046)
- Remove unused PlanService/ProjectService imports from command_registry
- Fix ruff format: blank line before nested defs in command_registry and steps
- Rename @then('a ValueError should be raised') to domain-specific suffix
  to avoid AmbiguousStep collision with lsp_registry_steps.py

ISSUES CLOSED: #8880
2026-06-04 11:47:32 -04:00

49 lines
1.7 KiB
Gherkin

Feature: CLI Command Bus Decoupling
As a developer
I want the CLI layer to be decoupled from application services
So that the architecture maintains proper separation of concerns
Background:
Given the command bus is initialized
And no handlers are registered
Scenario: Command bus can be created
When I create a new command bus
Then the command bus should be empty
And no handlers should be registered
Scenario: Handler registration
Given a command bus
When I register a handler for a command type
Then the handler should be registered
And the command bus should have the handler
Scenario: Command dispatch to registered handler
Given a command bus with a registered handler
When I dispatch a command
Then the handler should be invoked
And the result should be returned
Scenario: Dispatch fails for unregistered command
Given a command bus with no handlers
When I dispatch a command without a registered handler
Then a ValueError should be raised for unregistered command dispatch
And the error message should mention the command type
Scenario: Handler check
Given a command bus
When I check if a handler exists for a command type
Then the result should be accurate
And reflect the registration status
Scenario: Global command bus instance
When I get the global command bus
Then I should receive a CommandBus instance
And subsequent calls should return the same instance
Scenario: Set global command bus
Given a new command bus
When I set it as the global command bus
Then subsequent calls to get_command_bus should return it
And the previous instance should be replaced