UAT: StrategyRegistry not registered in DI container — spec-required built-in strategies (simple-keyword, semantic-embedding, breadth-depth-navigator) are never auto-populated #4009

Open
opened 2026-04-06 08:34:53 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/strategy-registry-di-registration
  • Commit Message: fix(acms): register StrategyRegistry in DI container and pre-populate spec-required built-in strategies
  • Milestone: (none — backlog)
  • Parent Epic: #396

Background and Context

The StrategyRegistry class in src/cleveragents/application/services/strategy_registry.py is the central registry for ACMS context strategies. Per docs/specification.md §25557-25562, the system should ship with built-in strategies pre-registered:

[context.strategies]
enabled = ["simple-keyword", "semantic-embedding", "arce", "breadth-depth-navigator"]

However, the StrategyRegistry is not registered in the DI container (src/cleveragents/application/container.py), and there is no initialization code that populates it with the spec-required built-in strategies.

Current Behavior

  1. src/cleveragents/application/container.py does not contain a strategy_registry provider.
  2. There is no factory function or initialization code that creates a StrategyRegistry and registers the built-in strategies (SimpleKeywordStrategy, SemanticEmbeddingStrategy, BreadthDepthNavigatorStrategy, etc.) from context_strategies.py.
  3. The ACMSPipeline in container.py is instantiated without a StrategyRegistry — it uses its own internal BUILTIN_STRATEGIES dict which only contains "relevance", "recency", and "tiered" (not the spec-required strategies).
# src/cleveragents/application/container.py lines 809-814
acms_pipeline = providers.Singleton(
    ACMSPipeline,
    settings=settings,
    unit_of_work=unit_of_work,
    plugin_manager=plugin_manager,
    # No strategy_registry passed!
)
# src/cleveragents/application/services/acms_service.py lines 633-637
BUILTIN_STRATEGIES: ClassVar[dict[str, type[ContextStrategy]]] = {
    "relevance": RelevanceStrategy,
    "recency": RecencyStrategy,
    "tiered": TieredStrategy,
    # Missing: simple-keyword, semantic-embedding, breadth-depth-navigator, arce
}

Expected Behavior

Per docs/specification.md §25546-25562, the following built-in strategies should be pre-registered and available by default:

  • simple-keyword (quality 0.3, text backend)
  • semantic-embedding (quality 0.6, vector backend)
  • breadth-depth-navigator (quality 0.85, graph backend)
  • arce (quality 0.95, all backends)
  • temporal-archaeology (quality 0.5, graph + cold tier)
  • plan-decision-context (quality 0.7, warm/cold tiers)

The StrategyRegistry should be:

  1. Registered as a singleton in the DI container
  2. Pre-populated with all spec-required built-in strategies at startup
  3. Wired into ACMSPipeline so the pipeline uses the registry for strategy selection

Steps to Reproduce

  1. Open src/cleveragents/application/container.py
  2. Search for strategy_registry — it is absent
  3. Open src/cleveragents/application/services/acms_service.py lines 633-637
  4. Observe BUILTIN_STRATEGIES only contains relevance, recency, tiered
  5. Compare with docs/specification.md §25546-25562 which requires simple-keyword, semantic-embedding, breadth-depth-navigator, arce, etc.

Impact

The spec-required ACMS context strategies (simple-keyword, semantic-embedding, breadth-depth-navigator, arce) are not available through the StrategyRegistry at runtime. Any code that attempts to look up these strategies via StrategyRegistry.get("simple-keyword") will receive a StrategyNotFoundError. The context.strategies.enabled configuration setting references strategy names that are not registered.

Code locations affected:

  • src/cleveragents/application/container.py (missing strategy_registry provider)
  • src/cleveragents/application/services/acms_service.py lines 633-637 (BUILTIN_STRATEGIES missing spec strategies)
  • src/cleveragents/application/services/context_strategies.py (strategies defined but never auto-registered)

Backlog note: This issue was discovered during autonomous UAT operation on milestone v3.5.0 (Corrections + Context). It does not block milestone completion and has been placed in the backlog for human review and future milestone assignment.

Subtasks

  • Add strategy_registry as a singleton provider in container.py
  • Create a factory function that instantiates StrategyRegistry and registers all spec-required built-in strategies
  • Wire StrategyRegistry into ACMSPipeline so the pipeline uses it for strategy selection
  • Add simple-keyword, semantic-embedding, breadth-depth-navigator, arce, temporal-archaeology, plan-decision-context to BUILTIN_STRATEGIES or the registry factory
  • Write BDD tests verifying all spec-required strategies are available via the registry at startup
  • Verify nox -e coverage_report reports >= 97% coverage

Definition of Done

  • StrategyRegistry is registered in the DI container
  • All spec-required built-in strategies are pre-registered at startup
  • ACMSPipeline uses the registry for strategy selection
  • StrategyRegistry.get("simple-keyword") succeeds without error
  • All BDD unit tests pass
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/strategy-registry-di-registration` - **Commit Message**: `fix(acms): register StrategyRegistry in DI container and pre-populate spec-required built-in strategies` - **Milestone**: *(none — backlog)* - **Parent Epic**: #396 ## Background and Context The `StrategyRegistry` class in `src/cleveragents/application/services/strategy_registry.py` is the central registry for ACMS context strategies. Per `docs/specification.md` §25557-25562, the system should ship with built-in strategies pre-registered: ```toml [context.strategies] enabled = ["simple-keyword", "semantic-embedding", "arce", "breadth-depth-navigator"] ``` However, the `StrategyRegistry` is **not registered in the DI container** (`src/cleveragents/application/container.py`), and there is no initialization code that populates it with the spec-required built-in strategies. ## Current Behavior 1. `src/cleveragents/application/container.py` does not contain a `strategy_registry` provider. 2. There is no factory function or initialization code that creates a `StrategyRegistry` and registers the built-in strategies (`SimpleKeywordStrategy`, `SemanticEmbeddingStrategy`, `BreadthDepthNavigatorStrategy`, etc.) from `context_strategies.py`. 3. The `ACMSPipeline` in `container.py` is instantiated without a `StrategyRegistry` — it uses its own internal `BUILTIN_STRATEGIES` dict which only contains `"relevance"`, `"recency"`, and `"tiered"` (not the spec-required strategies). ```python # src/cleveragents/application/container.py lines 809-814 acms_pipeline = providers.Singleton( ACMSPipeline, settings=settings, unit_of_work=unit_of_work, plugin_manager=plugin_manager, # No strategy_registry passed! ) ``` ```python # src/cleveragents/application/services/acms_service.py lines 633-637 BUILTIN_STRATEGIES: ClassVar[dict[str, type[ContextStrategy]]] = { "relevance": RelevanceStrategy, "recency": RecencyStrategy, "tiered": TieredStrategy, # Missing: simple-keyword, semantic-embedding, breadth-depth-navigator, arce } ``` ## Expected Behavior Per `docs/specification.md` §25546-25562, the following built-in strategies should be pre-registered and available by default: - `simple-keyword` (quality 0.3, text backend) - `semantic-embedding` (quality 0.6, vector backend) - `breadth-depth-navigator` (quality 0.85, graph backend) - `arce` (quality 0.95, all backends) - `temporal-archaeology` (quality 0.5, graph + cold tier) - `plan-decision-context` (quality 0.7, warm/cold tiers) The `StrategyRegistry` should be: 1. Registered as a singleton in the DI container 2. Pre-populated with all spec-required built-in strategies at startup 3. Wired into `ACMSPipeline` so the pipeline uses the registry for strategy selection ## Steps to Reproduce 1. Open `src/cleveragents/application/container.py` 2. Search for `strategy_registry` — it is absent 3. Open `src/cleveragents/application/services/acms_service.py` lines 633-637 4. Observe `BUILTIN_STRATEGIES` only contains `relevance`, `recency`, `tiered` 5. Compare with `docs/specification.md` §25546-25562 which requires `simple-keyword`, `semantic-embedding`, `breadth-depth-navigator`, `arce`, etc. ## Impact The spec-required ACMS context strategies (`simple-keyword`, `semantic-embedding`, `breadth-depth-navigator`, `arce`) are not available through the `StrategyRegistry` at runtime. Any code that attempts to look up these strategies via `StrategyRegistry.get("simple-keyword")` will receive a `StrategyNotFoundError`. The `context.strategies.enabled` configuration setting references strategy names that are not registered. **Code locations affected:** - `src/cleveragents/application/container.py` (missing `strategy_registry` provider) - `src/cleveragents/application/services/acms_service.py` lines 633-637 (`BUILTIN_STRATEGIES` missing spec strategies) - `src/cleveragents/application/services/context_strategies.py` (strategies defined but never auto-registered) > **Backlog note:** This issue was discovered during autonomous UAT operation on milestone v3.5.0 (Corrections + Context). It does not block milestone completion and has been placed in the backlog for human review and future milestone assignment. ## Subtasks - [ ] Add `strategy_registry` as a singleton provider in `container.py` - [ ] Create a factory function that instantiates `StrategyRegistry` and registers all spec-required built-in strategies - [ ] Wire `StrategyRegistry` into `ACMSPipeline` so the pipeline uses it for strategy selection - [ ] Add `simple-keyword`, `semantic-embedding`, `breadth-depth-navigator`, `arce`, `temporal-archaeology`, `plan-decision-context` to `BUILTIN_STRATEGIES` or the registry factory - [ ] Write BDD tests verifying all spec-required strategies are available via the registry at startup - [ ] Verify `nox -e coverage_report` reports >= 97% coverage ## Definition of Done - [ ] `StrategyRegistry` is registered in the DI container - [ ] All spec-required built-in strategies are pre-registered at startup - [ ] `ACMSPipeline` uses the registry for strategy selection - [ ] `StrategyRegistry.get("simple-keyword")` succeeds without error - [ ] All BDD unit tests pass - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:12:01 +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.

Blocks
#396 Epic: ACMS Context Pipeline
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#4009
No description provided.