Files
cleveragents-core/features/plan_model_coverage_boost.feature
freemo a808c395f9
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 35s
CI / security (pull_request) Successful in 50s
CI / unit_tests (pull_request) Successful in 2m46s
CI / integration_tests (pull_request) Successful in 3m16s
CI / docker (pull_request) Successful in 40s
CI / coverage (pull_request) Successful in 5m6s
CI / lint (push) Successful in 13s
CI / quality (push) Successful in 16s
CI / build (push) Successful in 18s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 35s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m52s
CI / integration_tests (push) Successful in 3m8s
CI / docker (push) Successful in 39s
CI / coverage (push) Successful in 5m53s
CI / benchmark-publish (push) Successful in 16m55s
CI / benchmark-regression (pull_request) Successful in 33m0s
test(coverage): add Behave BDD tests to improve unit test coverage across 53 source modules
Add 53 new .feature files and corresponding step definition files targeting
uncovered lines identified in build/coverage.xml. Fix AmbiguousStep conflicts
in 7 pre-existing step files by disambiguating step text.

New tests cover: ACP clients/facade, actor CLI/config, application container,
ACMS service/strategies, async worker, automation profile CLI, autonomy
guardrail, bridge, change model, config CLI/service, context service,
cross-plan correction, database models, decision service, decomposition
clustering/service, discovery handler, langchain chat provider, langgraph
nodes, materializers, multi-project service, plan apply/CLI/lifecycle/model/
preflight/resume/service, PostgreSQL analyzer, project CLI/context CLI,
provider registry, reactive application/route, repositories, resolver handler,
resource registry service, resume model, retry patterns, sandbox protocol,
server CLI, skill CLI/service, skills registry, subplan execution/service,
system CLI, UKO loader, UoW, and YAML template engine.

Closes #645
2026-03-09 13:01:58 -04:00

95 lines
5.1 KiB
Gherkin

Feature: Plan domain model coverage boost
Exercise uncovered code paths in src/cleveragents/domain/models/core/plan.py
that were identified with hits=0 in build/coverage.xml.
# ---------------------------------------------------------------
# Line 792: can_transition_to_next_phase returns True for ACTION
# ---------------------------------------------------------------
Scenario: ACTION phase plan can always transition to next phase
Given a coverage-boost plan in the ACTION phase
When I check whether the coverage-boost plan can transition to the next phase
Then the coverage-boost transition check should return True
# ---------------------------------------------------------------
# Lines 867, 870: get_project_scope returns scope matched by alias
# ---------------------------------------------------------------
Scenario: get_project_scope resolves a scope by alias
Given a coverage-boost plan with multi-project metadata containing aliased scopes
When I look up the coverage-boost project scope by alias "api"
Then the coverage-boost resolved scope project name should be "local/api-service"
Scenario: get_project_scope resolves a scope by project name
Given a coverage-boost plan with multi-project metadata containing aliased scopes
When I look up the coverage-boost project scope by name "local/web-app"
Then the coverage-boost resolved scope project name should be "local/web-app"
Scenario: get_project_scope returns None when no match found
Given a coverage-boost plan with multi-project metadata containing aliased scopes
When I look up the coverage-boost project scope by name "local/nonexistent"
Then the coverage-boost resolved scope should be None
Scenario: get_project_scope returns None when multi-project metadata is absent
Given a coverage-boost plan without multi-project metadata
When I look up the coverage-boost project scope by name "local/anything"
Then the coverage-boost resolved scope should be None
# ---------------------------------------------------------------
# Lines 893, 895: can_revert_to returns False for terminal states
# ---------------------------------------------------------------
Scenario: APPLIED plan cannot revert to any phase
Given a coverage-boost plan in APPLY phase with APPLIED state
When I check whether the coverage-boost plan can revert to STRATEGIZE
Then the coverage-boost reversion check should return False
Scenario: CANCELLED plan cannot revert to any phase
Given a coverage-boost plan in APPLY phase with CANCELLED state
When I check whether the coverage-boost plan can revert to STRATEGIZE
Then the coverage-boost reversion check should return False
Scenario: Plan that exhausted MAX_REVERSIONS cannot revert
Given a coverage-boost plan that has used all allowed reversions
When I check whether the coverage-boost plan can revert to STRATEGIZE
Then the coverage-boost reversion check should return False
Scenario: Plan below MAX_REVERSIONS with valid transition can revert
Given a coverage-boost plan in EXECUTE phase with ERRORED state and zero reversions
When I check whether the coverage-boost plan can revert to STRATEGIZE
Then the coverage-boost reversion check should return True
# ---------------------------------------------------------------
# Lines 970-980: as_cli_dict includes scope alias, read_only, changeset_summary
# ---------------------------------------------------------------
Scenario: as_cli_dict includes multi-project scope alias and read_only
Given a coverage-boost plan with multi-project scopes having alias and read-only flags
When I generate the coverage-boost CLI dict
Then the coverage-boost CLI dict multi_project scope should contain alias "api"
And the coverage-boost CLI dict multi_project scope should contain read_only True
Scenario: as_cli_dict includes multi-project changeset summary
Given a coverage-boost plan with a multi-project scope that has a changeset summary
When I generate the coverage-boost CLI dict
Then the coverage-boost CLI dict multi_project scope should contain changeset details
# ---------------------------------------------------------------
# Lines 985-991: as_cli_dict includes cross_project_dependencies
# ---------------------------------------------------------------
Scenario: as_cli_dict includes cross-project dependencies
Given a coverage-boost plan with cross-project dependencies in metadata
When I generate the coverage-boost CLI dict
Then the coverage-boost CLI dict multi_project should contain cross_project_dependencies
# ---------------------------------------------------------------
# Lines 995, 997: as_cli_dict includes last_completed_step and last_checkpoint_id
# ---------------------------------------------------------------
Scenario: as_cli_dict includes resume metadata when step completed
Given a coverage-boost plan with last_completed_step 2 and a checkpoint ID
When I generate the coverage-boost CLI dict
Then the coverage-boost CLI dict should contain last_completed_step 2
And the coverage-boost CLI dict should contain last_checkpoint_id