fix(acms): implement real retrieval logic in all 6 spec-required context strategies #3635
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#3500 UAT: All 6 spec-required built-in ACMS context strategies are no-op stubs returning empty fragment lists
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core!3635
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/m5-acms-strategy-stubs-implement-retrieval"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replaces all 6 no-op
assemble()stub implementations in the ACMS built-in context strategy classes (strategy_stubs.py) with real backend-driven retrieval logic, and registers each strategy with theACMSPipelineviaSpecStrategyAdapterinacms_service.py. This resolves the UAT failure where every spec-required built-in strategy silently returned an empty fragment list regardless of backend availability or request content.Changes
SimpleKeywordStrategy.assemble(): Replaced no-op stub with real retrieval logic that queriesTextBackend.search()using keywords extracted from theContextRequest. Results are packed greedily into the token budget via_budget_fragments().SemanticEmbeddingStrategy.assemble(): Replaced no-op stub with aVectorBackend.similarity_search()call using a character-frequency embedding computed from the request query as a v1 approximation of semantic similarity. Budget-aware greedy packing applied to results.BreadthDepthNavigatorStrategy.assemble(): Replaced no-op stub with aGraphBackendtraversal starting from the focus nodes declared in theContextRequest, expanding outward byrequest.breadthhops. Fragments are collected from visited nodes and packed within budget.ARCEStrategy.assemble(): Replaced no-op stub with a multi-modal pipeline that combines results from all three backends: text search (40% of budget), vector similarity search (40%), and graph traversal (20%). Results are merged and deduplicated before budget packing.TemporalArchaeologyStrategy.assemble(): Replaced no-op stub with a two-phase retrieval: first queriesTemporalBackend.query_by_tier()for historical nodes in the cold tier, then performs aGraphBackendtraversal from those nodes to surface related context. Budget packing applied to the combined result set.PlanDecisionContextStrategy.assemble(): Replaced no-op stub with aTemporalBackend-driven lookup that walks the parent and ancestor plan hierarchy, retrieving decision records from warm/cold tiers.acms_service.py— Strategy Registration: All 6 built-in strategies are now registered with theACMSPipelineat construction time viaSpecStrategyAdapter.context_strategy_registry.feature: Renamed the existing stub scenario and added 6 new real-retrieval scenarios.context_strategy_registry_steps.py: Added populated backend helper fixtures.context_strategy_registry.robot: Added 2 new Robot Framework integration test cases.helper_context_strategy_registry.py: Addedpipeline-integrationandreal-retrievalcommand handlers.Design Decisions
SpecStrategyAdapteras the bridge layer: Bridges the domain-modelContextStrategyprotocol with theACMSPipeline's internal protocol without modifying either interface.Budget-aware greedy packing via
_budget_fragments(): Centralised token-budget enforcement across all 6 strategies.Empty backends still return empty lists: Correct behaviour preserved and explicitly tested.
Character-frequency embedding for
SemanticEmbeddingStrategy: v1 approximation, documented for replacement with real embedding model.Closes
Closes #3500
Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-pr-api-creator
Code Review — PR #3635
Focus Areas: specification-compliance, test-coverage-quality, behavior-correctness
VERDICT: APPROVE ✅
Overview
This PR implements real retrieval logic for all 6 spec-required ACMS context strategies, replacing no-op stubs. This is a Priority/Critical fix that resolves a UAT failure where every built-in strategy silently returned empty fragment lists.
✅ Specification Compliance
SimpleKeywordStrategy: TextBackend.search() with keyword extraction ✅SemanticEmbeddingStrategy: VectorBackend.similarity_search() with character-frequency embedding (v1, documented) ✅BreadthDepthNavigatorStrategy: GraphBackend traversal from focus nodes ✅ARCEStrategy: Multi-modal pipeline (40% text + 40% vector + 20% graph) ✅TemporalArchaeologyStrategy: TemporalBackend cold tier + GraphBackend traversal ✅PlanDecisionContextStrategy: TemporalBackend warm/cold tier hierarchy walk ✅✅ Test Coverage Quality
✅ Design Decisions
SpecStrategyAdapteras bridge layer — correct architectural choice_budget_fragments()centralizes token-budget enforcement✅ Behavior Correctness
This PR is ready to merge.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
ContextStrategyprotocol inacms_service.pyuses wrong signature —can_handle(dict)andassemble(fragments, budget)instead of spec-requiredcan_handle(request, backends)andassemble(request, backends, budget, plan_context)#4560HAL9000 referenced this pull request2026-04-09 00:49:52 +00:00
HAL9000 referenced this pull request2026-04-09 05:48:51 +00:00