UAT: ComponentResolver._import_component("builtin:X") fails with AttributeError — ConfidenceWeightedSelector, ProportionalBudgetAllocator, ParallelStrategyExecutor not exported from services package #3286

Open
opened 2026-04-05 09:09:51 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/component-resolver-missing-builtin-exports
  • Commit Message: fix(extensibility): export ConfidenceWeightedSelector, ProportionalBudgetAllocator, ParallelStrategyExecutor from services package
  • Milestone: None (Backlog)
  • Parent Epic: #552

Backlog note: This issue was discovered during autonomous operation
on milestone v3.6.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Description

The ComponentResolver._import_component() method in src/cleveragents/application/services/component_resolver.py handles "builtin:ClassName" module paths by importing from cleveragents.application.services. However, three of the ten allowed builtin components (ConfidenceWeightedSelector, ProportionalBudgetAllocator, ParallelStrategyExecutor) are NOT exported from the cleveragents.application.services package at runtime — they are only in the TYPE_CHECKING block of __init__.py.

What was tested:

  • Code analysis of src/cleveragents/application/services/component_resolver.py_import_component() method and _ALLOWED_BUILTIN_COMPONENTS constant
  • Code analysis of src/cleveragents/application/services/__init__.py — exports and TYPE_CHECKING block
  • Searched for ConfidenceWeightedSelector, ProportionalBudgetAllocator, ParallelStrategyExecutor in __init__.py

Expected behavior:
All 10 components listed in _ALLOWED_BUILTIN_COMPONENTS should be accessible via getattr(builtin_services, class_name) at runtime. The "builtin:ConfidenceWeightedSelector" config.toml extension path should work correctly.

Actual behavior:
_ALLOWED_BUILTIN_COMPONENTS includes:

  • ConfidenceWeightedSelector — defined in acms_pipeline.py, NOT exported from services/__init__.py
  • ProportionalBudgetAllocator — defined in acms_pipeline.py, NOT exported from services/__init__.py
  • ParallelStrategyExecutor — defined in acms_pipeline.py, NOT exported from services/__init__.py

The services/__init__.py exports (via TYPE_CHECKING only):

  • ContentHashDeduplicator (from acms_phase2)
  • GreedyKnapsackPacker (from acms_phase2)
  • MaxDepthResolver (from acms_phase2)
  • WeightedCompositeScorer (from acms_phase2)
  • ProvenancePreambleGenerator (from acms_phase3)
  • RelevanceCoherenceOrderer (from acms_phase3)
  • DepthReductionCompressor (from acms_skeleton_compressor)

But ConfidenceWeightedSelector, ProportionalBudgetAllocator, ParallelStrategyExecutor (from acms_pipeline.py) are missing from the exports entirely.

When _import_component("builtin:ConfidenceWeightedSelector") is called:

from cleveragents.application import services as builtin_services
cls = getattr(builtin_services, "ConfidenceWeightedSelector")  # AttributeError!

This will raise AttributeError: module 'cleveragents.application.services' has no attribute 'ConfidenceWeightedSelector'.

Code locations:

  • src/cleveragents/application/services/component_resolver.py_ALLOWED_BUILTIN_COMPONENTS (lines 105–117), _import_component() (lines 718–727)
  • src/cleveragents/application/services/__init__.py — missing exports for ConfidenceWeightedSelector, ProportionalBudgetAllocator, ParallelStrategyExecutor
  • src/cleveragents/application/services/acms_pipeline.py — class definitions (lines ~142, ~193, ~311)

Steps to reproduce:

  1. Configure a project extension: [extensions]\nstrategy_selector = "builtin:ConfidenceWeightedSelector"
  2. Call resolver.load_project_extensions(project_id, {"strategy_selector": "builtin:ConfidenceWeightedSelector"}, type_registry)
  3. Observe: AttributeError: module 'cleveragents.application.services' has no attribute 'ConfidenceWeightedSelector'

Impact:
The pluggable scope chain resolution feature is broken for the three ACMS pipeline components that are most commonly configured as builtins. Any project or plan that tries to use "builtin:ConfidenceWeightedSelector", "builtin:ProportionalBudgetAllocator", or "builtin:ParallelStrategyExecutor" in their extensions config will fail with AttributeError.

Subtasks

  • Add runtime imports for ConfidenceWeightedSelector, ProportionalBudgetAllocator, and ParallelStrategyExecutor from acms_pipeline in services/__init__.py
  • Add all three class names to the __all__ list in services/__init__.py
  • Verify all 10 _ALLOWED_BUILTIN_COMPONENTS are accessible via getattr on the services module at runtime
  • Add or update unit tests for _import_component("builtin:ConfidenceWeightedSelector"), _import_component("builtin:ProportionalBudgetAllocator"), and _import_component("builtin:ParallelStrategyExecutor")
  • Audit remaining _ALLOWED_BUILTIN_COMPONENTS entries to confirm no other classes are missing from runtime exports

Definition of Done

  • ConfidenceWeightedSelector, ProportionalBudgetAllocator, and ParallelStrategyExecutor are importable from cleveragents.application.services at runtime (not only under TYPE_CHECKING)
  • All 10 entries in _ALLOWED_BUILTIN_COMPONENTS resolve successfully via ComponentResolver._import_component("builtin:<ClassName>")
  • Unit tests covering all three previously-broken builtin paths pass
  • No regressions in existing _import_component tests
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Metadata - **Branch**: `fix/component-resolver-missing-builtin-exports` - **Commit Message**: `fix(extensibility): export ConfidenceWeightedSelector, ProportionalBudgetAllocator, ParallelStrategyExecutor from services package` - **Milestone**: None (Backlog) - **Parent Epic**: #552 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Description The `ComponentResolver._import_component()` method in `src/cleveragents/application/services/component_resolver.py` handles `"builtin:ClassName"` module paths by importing from `cleveragents.application.services`. However, three of the ten allowed builtin components (`ConfidenceWeightedSelector`, `ProportionalBudgetAllocator`, `ParallelStrategyExecutor`) are NOT exported from the `cleveragents.application.services` package at runtime — they are only in the `TYPE_CHECKING` block of `__init__.py`. **What was tested:** - Code analysis of `src/cleveragents/application/services/component_resolver.py` — `_import_component()` method and `_ALLOWED_BUILTIN_COMPONENTS` constant - Code analysis of `src/cleveragents/application/services/__init__.py` — exports and `TYPE_CHECKING` block - Searched for `ConfidenceWeightedSelector`, `ProportionalBudgetAllocator`, `ParallelStrategyExecutor` in `__init__.py` **Expected behavior:** All 10 components listed in `_ALLOWED_BUILTIN_COMPONENTS` should be accessible via `getattr(builtin_services, class_name)` at runtime. The `"builtin:ConfidenceWeightedSelector"` config.toml extension path should work correctly. **Actual behavior:** `_ALLOWED_BUILTIN_COMPONENTS` includes: - `ConfidenceWeightedSelector` — defined in `acms_pipeline.py`, NOT exported from `services/__init__.py` - `ProportionalBudgetAllocator` — defined in `acms_pipeline.py`, NOT exported from `services/__init__.py` - `ParallelStrategyExecutor` — defined in `acms_pipeline.py`, NOT exported from `services/__init__.py` The `services/__init__.py` exports (via `TYPE_CHECKING` only): - `ContentHashDeduplicator` ✅ (from `acms_phase2`) - `GreedyKnapsackPacker` ✅ (from `acms_phase2`) - `MaxDepthResolver` ✅ (from `acms_phase2`) - `WeightedCompositeScorer` ✅ (from `acms_phase2`) - `ProvenancePreambleGenerator` ✅ (from `acms_phase3`) - `RelevanceCoherenceOrderer` ✅ (from `acms_phase3`) - `DepthReductionCompressor` ✅ (from `acms_skeleton_compressor`) But `ConfidenceWeightedSelector`, `ProportionalBudgetAllocator`, `ParallelStrategyExecutor` (from `acms_pipeline.py`) are missing from the exports entirely. When `_import_component("builtin:ConfidenceWeightedSelector")` is called: ```python from cleveragents.application import services as builtin_services cls = getattr(builtin_services, "ConfidenceWeightedSelector") # AttributeError! ``` This will raise `AttributeError: module 'cleveragents.application.services' has no attribute 'ConfidenceWeightedSelector'`. **Code locations:** - `src/cleveragents/application/services/component_resolver.py` — `_ALLOWED_BUILTIN_COMPONENTS` (lines 105–117), `_import_component()` (lines 718–727) - `src/cleveragents/application/services/__init__.py` — missing exports for `ConfidenceWeightedSelector`, `ProportionalBudgetAllocator`, `ParallelStrategyExecutor` - `src/cleveragents/application/services/acms_pipeline.py` — class definitions (lines ~142, ~193, ~311) **Steps to reproduce:** 1. Configure a project extension: `[extensions]\nstrategy_selector = "builtin:ConfidenceWeightedSelector"` 2. Call `resolver.load_project_extensions(project_id, {"strategy_selector": "builtin:ConfidenceWeightedSelector"}, type_registry)` 3. Observe: `AttributeError: module 'cleveragents.application.services' has no attribute 'ConfidenceWeightedSelector'` **Impact:** The pluggable scope chain resolution feature is broken for the three ACMS pipeline components that are most commonly configured as builtins. Any project or plan that tries to use `"builtin:ConfidenceWeightedSelector"`, `"builtin:ProportionalBudgetAllocator"`, or `"builtin:ParallelStrategyExecutor"` in their extensions config will fail with `AttributeError`. ## Subtasks - [ ] Add runtime imports for `ConfidenceWeightedSelector`, `ProportionalBudgetAllocator`, and `ParallelStrategyExecutor` from `acms_pipeline` in `services/__init__.py` - [ ] Add all three class names to the `__all__` list in `services/__init__.py` - [ ] Verify all 10 `_ALLOWED_BUILTIN_COMPONENTS` are accessible via `getattr` on the `services` module at runtime - [ ] Add or update unit tests for `_import_component("builtin:ConfidenceWeightedSelector")`, `_import_component("builtin:ProportionalBudgetAllocator")`, and `_import_component("builtin:ParallelStrategyExecutor")` - [ ] Audit remaining `_ALLOWED_BUILTIN_COMPONENTS` entries to confirm no other classes are missing from runtime exports ## Definition of Done - [ ] `ConfidenceWeightedSelector`, `ProportionalBudgetAllocator`, and `ParallelStrategyExecutor` are importable from `cleveragents.application.services` at runtime (not only under `TYPE_CHECKING`) - [ ] All 10 entries in `_ALLOWED_BUILTIN_COMPONENTS` resolve successfully via `ComponentResolver._import_component("builtin:<ClassName>")` - [ ] Unit tests covering all three previously-broken builtin paths pass - [ ] No regressions in existing `_import_component` tests - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.6.0 milestone 2026-04-05 09:32:59 +00:00
freemo modified the milestone from v3.6.0 to v3.8.0 2026-04-05 09:33:58 +00:00
Author
Owner

Label fix: Removed conflicting MoSCoW/Could Have label. This issue now has only MoSCoW/Should Have, which is the correct classification — ComponentResolver._import_component("builtin:X") failing with AttributeError is a functional bug that affects the component resolution system, making it important but not strictly blocking.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

**Label fix**: Removed conflicting `MoSCoW/Could Have` label. This issue now has only `MoSCoW/Should Have`, which is the correct classification — `ComponentResolver._import_component("builtin:X")` failing with `AttributeError` is a functional bug that affects the component resolution system, making it important but not strictly blocking. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo modified the milestone from v3.8.0 to v3.7.0 2026-04-05 17:25:16 +00:00
freemo removed this from the v3.7.0 milestone 2026-04-07 00:10:36 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#3286
No description provided.