Files
cleveragents-core/features/acms_service_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

91 lines
4.6 KiB
Gherkin

@acms @coverage_boost
Feature: ACMS service coverage boost — uncovered lines
As a developer maintaining the ACMS pipeline
I want to exercise uncovered code paths in acms_service.py
So that the test suite achieves higher coverage
# -----------------------------------------------------------------------
# Line 413: DefaultBudgetAllocator.allocate returns [] for empty candidates
# -----------------------------------------------------------------------
Scenario: Budget allocator returns empty list for empty candidates
Given the default budget allocator
When I allocate budget 1000 to an empty candidate list
Then the allocation result should be an empty list
# -----------------------------------------------------------------------
# Line 436: DefaultBudgetAllocator proportional allocation with remainder
# -----------------------------------------------------------------------
Scenario: Budget allocator distributes fractional remainder tokens
Given the default budget allocator
When I allocate budget 100 across two candidates with confidences 0.5 and 0.3
Then the total allocated tokens should equal exactly 100
And each candidate should receive a positive allocation
Scenario: Budget allocator remainder distribution with three uneven confidences
Given the default budget allocator
When I allocate budget 97 across three candidates with confidences 0.6 0.3 0.1
Then the total allocated tokens should equal exactly 97
# -----------------------------------------------------------------------
# Line 463: DefaultStrategyExecutor.execute returns [] for empty allocations
# -----------------------------------------------------------------------
Scenario: Strategy executor returns empty list for empty allocations
Given the default strategy executor
When I execute with an empty allocations list
Then the executor result should be an empty list
# -----------------------------------------------------------------------
# Line 467: DefaultStrategyExecutor.execute skips zero-token allocations
# -----------------------------------------------------------------------
Scenario: Strategy executor skips allocations with zero tokens
Given the default strategy executor
And a test strategy and fragments for execution
When I execute with a zero-token allocation for the test strategy
Then the executor result should be an empty list
Scenario: Strategy executor processes positive tokens but skips zero tokens
Given the default strategy executor
And a test strategy and fragments for execution
When I execute with mixed allocations including zero and positive tokens
Then the executor result should contain only fragments from the positive allocation
# -----------------------------------------------------------------------
# Lines 616-620: ACMSPipeline.__init__ rejects unknown default_strategy
# -----------------------------------------------------------------------
Scenario: Pipeline constructor rejects unknown default strategy name
When I create a pipeline with default strategy "nonexistent_strategy"
Then the pipeline creation should fail with a ValueError about "Unknown strategy"
And the pipeline error message should list available strategies
Scenario: Pipeline constructor rejects empty string as default strategy
When I create a pipeline with an empty default strategy
Then the pipeline creation should fail with a ValueError about "Unknown strategy"
# -----------------------------------------------------------------------
# Zero-confidence equal-split remainder in DefaultBudgetAllocator
# Lines 418-423: zero confidence path with remainder distribution
# -----------------------------------------------------------------------
Scenario: Budget allocator zero-confidence split with non-divisible budget
Given the default budget allocator
When I allocate budget 10 across three zero-confidence candidates
Then the total allocated tokens should equal exactly 10
And allocations should be 4 or 3 tokens each
# -----------------------------------------------------------------------
# Full pipeline with budget that forces remainder in allocator
# (Exercises line 436 via pipeline.assemble end-to-end)
# -----------------------------------------------------------------------
Scenario: Full pipeline assembly exercises proportional remainder allocation
Given a pipeline with a custom selector that returns multiple candidates
And a context budget with 100 max tokens
And simple test fragments totalling 80 tokens
When I assemble the fragments through the full pipeline
Then the assembly should succeed without error