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

53 lines
2.5 KiB
Gherkin

Feature: Decomposition clustering — uncovered code paths
As a developer
I want to exercise the cluster_by_language method and the
estimate_tokens_for_path fallback in cluster_by_size
So that lines 122-131 and 160 of decomposition_clustering.py are covered
# ---- cluster_by_language (lines 122-131) --------------------------------
Scenario: cluster_by_language groups files by extension
Given a list of mixed-language file paths
When I cluster by language with max_per_cluster 10
Then the language clusters should separate Python and TypeScript files
And each language cluster should contain only one extension
Scenario: cluster_by_language splits oversized language buckets
Given a list of 8 Python file paths
When I cluster by language with max_per_cluster 3
Then the language clusters should contain at least 3 clusters
And no language cluster should exceed 3 files
Scenario: cluster_by_language with single language returns one cluster
Given a list of 4 Python file paths
When I cluster by language with max_per_cluster 10
Then exactly 1 language cluster should be returned
Scenario: cluster_by_language with empty list returns no clusters
Given an empty list of file paths
When I cluster by language with max_per_cluster 5
Then no language clusters should be returned
Scenario: cluster_by_language sorts files within each cluster
Given an unsorted list of mixed-language file paths
When I cluster by language with max_per_cluster 20
Then files within each language cluster should be in sorted order
Scenario: cluster_by_language orders clusters by extension
Given a list of files with js py and ts extensions
When I cluster by language with max_per_cluster 20
Then the language clusters should be ordered by extension alphabetically
# ---- cluster_by_size fallback to estimate_tokens_for_path (line 160) ----
Scenario: cluster_by_size falls back to estimate_tokens_for_path without token_map
Given a set of temporary files with known byte sizes
When I cluster by size with max_tokens 50 and no token_map
Then the size clusters should respect the estimated token limits
Scenario: cluster_by_size falls back for files missing from partial token_map
Given a set of temporary files with known byte sizes
And a partial token_map covering only some files
When I cluster by size with max_tokens 50 and the partial token_map
Then the size clusters should include all files