UAT: acms_advanced_strategies.py pipeline-protocol strategies (ArceStrategy, TemporalArchaeologyStrategy, PlanDecisionContextStrategy) are never registered in ACMSPipeline — dead code #3760

Open
opened 2026-04-05 22:31:32 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/acms-advanced-strategies-registration
  • Commit Message: fix(acms): register pipeline-protocol strategies from acms_advanced_strategies in ACMSPipeline
  • Milestone: None (Backlog)
  • Parent Epic: #396

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


Background and Context

src/cleveragents/application/services/acms_advanced_strategies.py defines three production-quality context strategies that implement the pipeline's ContextStrategy protocol (with assemble(fragments, budget) signature):

  • ArceStrategy (name="arce", quality=0.95)
  • TemporalArchaeologyStrategy (name="temporal-archaeology", quality=0.5)
  • PlanDecisionContextStrategy (name="plan-decision-context", quality=0.7)

These strategies represent the full, algorithm-complete implementations of the ARCE iterative refinement, temporal archaeology, and plan decision context assembly approaches. They are distinct from the domain-model stubs in strategy_stubs.py, which implement a different protocol signature (assemble(request, backends, budget, plan_context)).

This issue is related to but distinct from #3491 (dual incompatible ContextStrategy protocols). Issue #3491 tracks the protocol consolidation needed to fix the root cause. This issue specifically tracks the dead code problem: the advanced strategies exist and have tests, but are never invoked by the pipeline.

Current Behavior

ACMSPipeline.__init__ (acms_service.py lines 773–775) registers strategies via _get_spec_builtin_strategies(), which returns classes from strategy_stubs.py (domain-model protocol). These stubs are then wrapped in SpecStrategyAdapter instances.

The SpecStrategyAdapter.assemble() method (acms_service.py lines 333–349) falls back to simple relevance-based ranking, ignoring the actual strategy logic from the advanced implementations.

acms_advanced_strategies.py is imported in test step files (acms_pipeline_phase3_steps.py) but is never imported in acms_service.py or acms_pipeline.py. As a result, ArceStrategy, TemporalArchaeologyStrategy, and PlanDecisionContextStrategy are effectively dead code at runtime.

Expected Behavior

The pipeline should use the production-quality implementations from acms_advanced_strategies.py for the "arce", "temporal-archaeology", and "plan-decision-context" strategies. These should be registered directly in ACMSPipeline (since they already implement the pipeline ContextStrategy protocol) rather than using the stub-wrapped versions from strategy_stubs.py.

Acceptance Criteria

  • ArceStrategy, TemporalArchaeologyStrategy, and PlanDecisionContextStrategy from acms_advanced_strategies.py are imported and registered in ACMSPipeline.__init__
  • SpecStrategyAdapter is no longer used to wrap these three strategies
  • The pipeline invokes the actual ARCE, temporal archaeology, and plan decision context algorithms when those strategy names are selected
  • Existing ACMS pipeline tests continue to pass without modification (or are updated to reflect the corrected behavior)
  • New Behave unit tests assert that the three strategies are registered and invoked by the pipeline

Supporting Information

Code locations:

  • Dead code: src/cleveragents/application/services/acms_advanced_strategies.py (ArceStrategy, TemporalArchaeologyStrategy, PlanDecisionContextStrategy)
  • Registration site: src/cleveragents/application/services/acms_service.py lines 773–775 (ACMSPipeline.__init__)
  • Stub-wrapped versions: src/cleveragents/domain/models/acms/strategy_stubs.py (ARCEStrategy, TemporalArchaeologyStrategy, PlanDecisionContextStrategy)
  • Adapter: src/cleveragents/application/services/acms_service.py lines 333–349 (SpecStrategyAdapter.assemble())

Related issues:

  • #3491 — Dual incompatible ContextStrategy protocols (root cause; protocol consolidation)
  • #396 — Epic: ACMS Context Pipeline (parent)

Subtasks

  • Audit acms_advanced_strategies.py to confirm ArceStrategy, TemporalArchaeologyStrategy, and PlanDecisionContextStrategy fully implement the pipeline ContextStrategy protocol (assemble(fragments, budget))
  • Remove or deprecate the stub-wrapped entries for "arce", "temporal-archaeology", and "plan-decision-context" from _get_spec_builtin_strategies() in acms_service.py
  • Add imports for ArceStrategy, TemporalArchaeologyStrategy, and PlanDecisionContextStrategy from acms_advanced_strategies in acms_service.py
  • Register the three advanced strategies directly in ACMSPipeline.__init__ (acms_service.py lines 773–775)
  • Verify SpecStrategyAdapter is no longer used for these three strategies; remove adapter usage if no other strategies depend on it
  • Run existing ACMS pipeline tests and confirm no regressions
  • Add/update Behave unit tests to assert the three strategies are registered and invoked by the pipeline (not the stub-wrapped versions)
  • Run nox to confirm all quality gates pass

Definition of Done

  • All subtasks above are completed and checked off
  • ArceStrategy, TemporalArchaeologyStrategy, and PlanDecisionContextStrategy from acms_advanced_strategies.py are registered in ACMSPipeline and invoked by the pipeline at runtime
  • SpecStrategyAdapter is no longer wrapping these three strategies
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (fix(acms): register pipeline-protocol strategies from acms_advanced_strategies in ACMSPipeline), followed by a blank line, then additional lines providing relevant details about the implementation
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (fix/acms-advanced-strategies-registration)
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: Acting on behalf of: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/acms-advanced-strategies-registration` - **Commit Message**: `fix(acms): register pipeline-protocol strategies from acms_advanced_strategies in ACMSPipeline` - **Milestone**: None (Backlog) - **Parent Epic**: #396 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.4.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- ## Background and Context `src/cleveragents/application/services/acms_advanced_strategies.py` defines three production-quality context strategies that implement the pipeline's `ContextStrategy` protocol (with `assemble(fragments, budget)` signature): - `ArceStrategy` (name="arce", quality=0.95) - `TemporalArchaeologyStrategy` (name="temporal-archaeology", quality=0.5) - `PlanDecisionContextStrategy` (name="plan-decision-context", quality=0.7) These strategies represent the full, algorithm-complete implementations of the ARCE iterative refinement, temporal archaeology, and plan decision context assembly approaches. They are distinct from the domain-model stubs in `strategy_stubs.py`, which implement a different protocol signature (`assemble(request, backends, budget, plan_context)`). This issue is related to but distinct from #3491 (dual incompatible `ContextStrategy` protocols). Issue #3491 tracks the protocol consolidation needed to fix the root cause. This issue specifically tracks the dead code problem: the advanced strategies exist and have tests, but are never invoked by the pipeline. ## Current Behavior `ACMSPipeline.__init__` (acms_service.py lines 773–775) registers strategies via `_get_spec_builtin_strategies()`, which returns classes from `strategy_stubs.py` (domain-model protocol). These stubs are then wrapped in `SpecStrategyAdapter` instances. The `SpecStrategyAdapter.assemble()` method (acms_service.py lines 333–349) falls back to simple relevance-based ranking, ignoring the actual strategy logic from the advanced implementations. `acms_advanced_strategies.py` is imported in test step files (`acms_pipeline_phase3_steps.py`) but is **never imported** in `acms_service.py` or `acms_pipeline.py`. As a result, `ArceStrategy`, `TemporalArchaeologyStrategy`, and `PlanDecisionContextStrategy` are effectively dead code at runtime. ## Expected Behavior The pipeline should use the production-quality implementations from `acms_advanced_strategies.py` for the "arce", "temporal-archaeology", and "plan-decision-context" strategies. These should be registered directly in `ACMSPipeline` (since they already implement the pipeline `ContextStrategy` protocol) rather than using the stub-wrapped versions from `strategy_stubs.py`. ## Acceptance Criteria - `ArceStrategy`, `TemporalArchaeologyStrategy`, and `PlanDecisionContextStrategy` from `acms_advanced_strategies.py` are imported and registered in `ACMSPipeline.__init__` - `SpecStrategyAdapter` is no longer used to wrap these three strategies - The pipeline invokes the actual ARCE, temporal archaeology, and plan decision context algorithms when those strategy names are selected - Existing ACMS pipeline tests continue to pass without modification (or are updated to reflect the corrected behavior) - New Behave unit tests assert that the three strategies are registered and invoked by the pipeline ## Supporting Information **Code locations:** - Dead code: `src/cleveragents/application/services/acms_advanced_strategies.py` (`ArceStrategy`, `TemporalArchaeologyStrategy`, `PlanDecisionContextStrategy`) - Registration site: `src/cleveragents/application/services/acms_service.py` lines 773–775 (`ACMSPipeline.__init__`) - Stub-wrapped versions: `src/cleveragents/domain/models/acms/strategy_stubs.py` (`ARCEStrategy`, `TemporalArchaeologyStrategy`, `PlanDecisionContextStrategy`) - Adapter: `src/cleveragents/application/services/acms_service.py` lines 333–349 (`SpecStrategyAdapter.assemble()`) **Related issues:** - #3491 — Dual incompatible `ContextStrategy` protocols (root cause; protocol consolidation) - #396 — Epic: ACMS Context Pipeline (parent) ## Subtasks - [ ] Audit `acms_advanced_strategies.py` to confirm `ArceStrategy`, `TemporalArchaeologyStrategy`, and `PlanDecisionContextStrategy` fully implement the pipeline `ContextStrategy` protocol (`assemble(fragments, budget)`) - [ ] Remove or deprecate the stub-wrapped entries for "arce", "temporal-archaeology", and "plan-decision-context" from `_get_spec_builtin_strategies()` in `acms_service.py` - [ ] Add imports for `ArceStrategy`, `TemporalArchaeologyStrategy`, and `PlanDecisionContextStrategy` from `acms_advanced_strategies` in `acms_service.py` - [ ] Register the three advanced strategies directly in `ACMSPipeline.__init__` (acms_service.py lines 773–775) - [ ] Verify `SpecStrategyAdapter` is no longer used for these three strategies; remove adapter usage if no other strategies depend on it - [ ] Run existing ACMS pipeline tests and confirm no regressions - [ ] Add/update Behave unit tests to assert the three strategies are registered and invoked by the pipeline (not the stub-wrapped versions) - [ ] Run `nox` to confirm all quality gates pass ## Definition of Done - [ ] All subtasks above are completed and checked off - [ ] `ArceStrategy`, `TemporalArchaeologyStrategy`, and `PlanDecisionContextStrategy` from `acms_advanced_strategies.py` are registered in `ACMSPipeline` and invoked by the pipeline at runtime - [ ] `SpecStrategyAdapter` is no longer wrapping these three strategies - [ ] A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`fix(acms): register pipeline-protocol strategies from acms_advanced_strategies in ACMSPipeline`), followed by a blank line, then additional lines providing relevant details about the implementation - [ ] The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`fix/acms-advanced-strategies-registration`) - [ ] The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: Acting on behalf of: UAT Testing | Agent: ca-new-issue-creator
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#3760
No description provided.