Files
cleveragents-core/features/m4_correction_subplan_smoke.feature
T
brent.edwards 3c9a3efdf1
CI / lint (pull_request) Successful in 22s
CI / typecheck (pull_request) Successful in 55s
CI / security (pull_request) Successful in 48s
CI / quality (pull_request) Successful in 28s
CI / integration_tests (pull_request) Successful in 5m6s
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 23s
CI / unit_tests (pull_request) Successful in 34m47s
CI / benchmark-regression (pull_request) Successful in 25m45s
CI / docker (pull_request) Successful in 1m15s
CI / coverage (pull_request) Has been cancelled
fix(test): correct mock targets, method names, ULIDs, and CLI args in M4 smoke suite
- Patch CorrectionService at its module path, not the local-import site
- Use request_correction/execute_correction/analyze_impact (real API)
- Replace invalid 27-char subplan_id values with valid 26-char ULIDs
- Add required --guidance flag to dry-run CLI invocation
- Fix feature file assertions to match actual CLI output

Resolves CI failures in unit_tests (job 4) and coverage (job 6) for
run 645 on PR #441.
2026-02-26 02:01:47 +00:00

108 lines
4.8 KiB
Gherkin

Feature: M4 correction and subplan lifecycle smoke tests
As a developer working with the CleverAgents M4 milestone
I want to verify correction flows and subplan execution end-to-end
So that decision tree corrections and parallel subplan merges work correctly
Background:
Given a m4 smoke test runner
And a m4 smoke mocked lifecycle service
# --- Fixture loading ---
Scenario: M4 smoke load correction flows fixture
When I m4 smoke load the correction flows fixture
Then the m4 smoke correction fixture should have a revert entry
And the m4 smoke correction fixture should have an append entry
Scenario: M4 smoke load subplan execution fixture
When I m4 smoke load the subplan execution fixture
Then the m4 smoke subplan fixture should have a sequential entry
And the m4 smoke subplan fixture should have a parallel entry
Scenario: M4 smoke load conflict simulations fixture
When I m4 smoke load the conflict simulations fixture
Then the m4 smoke conflict fixture should have a no-conflict entry
And the m4 smoke conflict fixture should have a conflict entry
# --- Correction flows ---
Scenario: M4 smoke correction revert via CLI
Given a m4 smoke plan exists with a decision tree
When I m4 smoke invoke plan correct with mode "revert" and guidance "Use FastAPI instead"
Then the m4 smoke correction should succeed
And the m4 smoke output should contain "revert"
Scenario: M4 smoke correction append via CLI
Given a m4 smoke plan exists with a decision tree
When I m4 smoke invoke plan correct with mode "append" and guidance "Add caching layer"
Then the m4 smoke correction should succeed
And the m4 smoke output should contain "applied"
Scenario: M4 smoke correction dry-run shows impact
Given a m4 smoke plan exists with a decision tree
When I m4 smoke invoke plan correct with dry-run
Then the m4 smoke correction should succeed
And the m4 smoke output should contain "impact"
Scenario: M4 smoke correction with invalid mode fails
Given a m4 smoke plan exists with a decision tree
When I m4 smoke invoke plan correct with mode "invalid-mode" and guidance "test"
Then the m4 smoke correction should fail
# --- Subplan execution ---
Scenario: M4 smoke subplan sequential execution
Given a m4 smoke parent plan with sequential subplan config
When I m4 smoke invoke plan status for the parent
Then the m4 smoke status should succeed
And the m4 smoke output should contain "plan_id"
Scenario: M4 smoke subplan parallel execution with merge
Given a m4 smoke parent plan with parallel subplan config
When I m4 smoke invoke plan status for the parent
Then the m4 smoke status should succeed
And the m4 smoke output should contain "plan_id"
Scenario: M4 smoke subplan failure handler stop-others
Given a m4 smoke subplan config with fail-fast enabled
When I m4 smoke evaluate failure handler should-stop-others
Then the m4 smoke failure handler should return true for stop-others
Scenario: M4 smoke subplan failure handler retry retriable
Given a m4 smoke subplan config with retry enabled
And a m4 smoke subplan status with retriable error "ValidationError"
When I m4 smoke evaluate failure handler should-retry
Then the m4 smoke failure handler should return true for retry
Scenario: M4 smoke subplan failure handler skip non-retriable
Given a m4 smoke subplan config with retry enabled
And a m4 smoke subplan status with non-retriable error "ConfigurationError"
When I m4 smoke evaluate failure handler should-retry
Then the m4 smoke failure handler should return false for retry
# --- Conflict simulations ---
Scenario: M4 smoke merge strategy git-three-way no conflict
Given a m4 smoke conflict fixture with strategy "git_three_way" and no overlap
Then the m4 smoke conflict fixture should expect no conflict
Scenario: M4 smoke merge strategy fail-on-conflict detects overlap
Given a m4 smoke conflict fixture with strategy "fail_on_conflict" and overlap
Then the m4 smoke conflict fixture should expect a conflict
And the m4 smoke conflict fixture should expect error "MergeConflictError"
Scenario: M4 smoke merge strategy last-wins resolves overlap
Given a m4 smoke conflict fixture with strategy "last_wins" and overlap
Then the m4 smoke conflict fixture should expect no conflict
And the m4 smoke conflict fixture should expect result "last_wins_applied"
# --- Negative cases ---
Scenario: M4 smoke correction on non-existent plan fails
When I m4 smoke invoke plan correct on non-existent plan
Then the m4 smoke correction should fail
Scenario: M4 smoke correction with empty decision ID fails
When I m4 smoke invoke plan correct with empty decision id
Then the m4 smoke correction should fail