feat(context): implement ContextStrategy protocol and plugin registration system #8616

Open
opened 2026-04-13 21:15:53 +00:00 by HAL9000 · 2 comments
Owner

Metadata

  • Commit message type: feat
  • Scope: context
  • Branch name prefix: feat/v3.6.0-context-strategy-protocol

Background and Context

As part of Epic #8505 (Advanced Context Strategies & LLM Provider Extensions), the first step is to define the ContextStrategy protocol and plugin registration system. This provides the foundation for all pluggable context strategies.

This issue blocks Epic #8505.

Expected Behavior

  • ContextStrategy protocol is defined with a select_context(index, budget, scope) method
  • Strategies can be registered via Python entry points
  • Strategy registry allows lookup by name
  • Built-in strategies are registered automatically

Acceptance Criteria

  • ContextStrategy protocol is defined and documented
  • Strategy registry allows registration and lookup by name
  • Strategies can be registered via Python entry points
  • Built-in strategies are registered automatically on import
  • Unit tests achieve >= 97% coverage

Subtasks

  • Define ContextStrategy protocol (ABC or Protocol class)
  • Implement StrategyRegistry class
  • Implement entry-point-based strategy discovery
  • Implement automatic registration of built-in strategies
  • Write unit tests for registry and protocol

Definition of Done

  1. ContextStrategy protocol and registry are implemented
  2. Unit tests pass with >= 97% coverage
  3. Code reviewed and merged to main branch

Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor

## Metadata - **Commit message type**: `feat` - **Scope**: `context` - **Branch name prefix**: `feat/v3.6.0-context-strategy-protocol` ## Background and Context As part of Epic #8505 (Advanced Context Strategies & LLM Provider Extensions), the first step is to define the `ContextStrategy` protocol and plugin registration system. This provides the foundation for all pluggable context strategies. This issue blocks Epic #8505. ## Expected Behavior - `ContextStrategy` protocol is defined with a `select_context(index, budget, scope)` method - Strategies can be registered via Python entry points - Strategy registry allows lookup by name - Built-in strategies are registered automatically ## Acceptance Criteria - [x] `ContextStrategy` protocol is defined and documented - [x] Strategy registry allows registration and lookup by name - [x] Strategies can be registered via Python entry points - [x] Built-in strategies are registered automatically on import - [x] Unit tests achieve >= 97% coverage ## Subtasks - [x] Define `ContextStrategy` protocol (ABC or Protocol class) - [x] Implement `StrategyRegistry` class - [x] Implement entry-point-based strategy discovery - [x] Implement automatic registration of built-in strategies - [x] Write unit tests for registry and protocol ## Definition of Done 1. `ContextStrategy` protocol and registry are implemented 2. Unit tests pass with >= 97% coverage 3. Code reviewed and merged to main branch --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
HAL9000 added this to the v3.6.0 milestone 2026-04-13 21:16:30 +00:00
HAL9000 reopened this issue 2026-05-17 05:29:41 +00:00
Author
Owner

test comment

test comment
HAL9000 reopened this issue 2026-05-17 21:46:14 +00:00
Author
Owner

[GROOMED] Quality analysis complete.

Checks performed:

  • Duplicate detection: Not a duplicate. Linked PR #11183 references this issue via Closes keyword with matching titles, expected relationship.
  • Hierarchy: This issue (as Type/Feature) has no parent Epic dependency link despite body referencing Epic #8505. Dependencies API on this Forgejo instance returns IsErrRepoNotExist preventing automated fix. Flagged for manual review.
  • Activity / staleness: This item has had recent activity through PR reviews. Below 7-day stale threshold.
  • Labels (State/Type/Priority): All required labels present. State was In Progress (now corrected to match PR), Type/Feature, Priority/High, MoSCoW/Must have.
  • Label contradictions: FIXED. Item was in closed state with State/In Progress label - contradiction. Reopened and corrected State label but encountered Forgejo auto-labeling override that placed State/Completed instead of requested State/In Review (see notes).
  • Milestone: Match verified. Assigned to v3.6.0 (id 109, open).
  • Closure consistency: FIXED. Item was prematurely closed on 2026-05-13 while linked PR #11183 remained open. Reopened the issue.
  • Epic completeness: N/A - not an Epic issue.
  • Tracking cleanup: N/A - not Automation Tracking.

Fixes applied:

  • Reopened this issue (was prematurely closed before linked PR merged).
  • Corrected State label via PATCH (auto-overridden to State/Completed by Forgejo, see Notes for manual correction required).

Unable to apply:

  • Dependency link to PR #11183 (depends API IsErrRepoNotExist error). Auto-link will trigger on merge via Closes keyword.
  • Epic #8505 parent dependency link (same depend API error).
  • Manual State/In Review label placement due to Forgejo auto-labeling conflict.

Notes:

  • Please change this issue from State/Completed back to State/In Review (via PATCH) to match PR current stage. State/Completed is inappropriate while PR is still open in review.
  • Per CONTRIBUTING.md, regular issues MUST link to parent Epic. This issue references Epic #8505 but lacks explicit dependency link. Manually add after verifying Epic #8505 exists and is Type/Epic.
  • State/Completed label on an OPEN item indicates a Forgejo auto-labeling artifact. Please correct to State/In Review.

Automated by CleverAgents Bot
Supervisor: Grooming | Agent: grooming-worker

[GROOMED] Quality analysis complete. Checks performed: - Duplicate detection: Not a duplicate. Linked PR #11183 references this issue via Closes keyword with matching titles, expected relationship. - Hierarchy: This issue (as Type/Feature) has no parent Epic dependency link despite body referencing Epic #8505. Dependencies API on this Forgejo instance returns IsErrRepoNotExist preventing automated fix. Flagged for manual review. - Activity / staleness: This item has had recent activity through PR reviews. Below 7-day stale threshold. - Labels (State/Type/Priority): All required labels present. State was In Progress (now corrected to match PR), Type/Feature, Priority/High, MoSCoW/Must have. - Label contradictions: FIXED. Item was in closed state with State/In Progress label - contradiction. Reopened and corrected State label but encountered Forgejo auto-labeling override that placed State/Completed instead of requested State/In Review (see notes). - Milestone: Match verified. Assigned to v3.6.0 (id 109, open). - Closure consistency: FIXED. Item was prematurely closed on 2026-05-13 while linked PR #11183 remained open. Reopened the issue. - Epic completeness: N/A - not an Epic issue. - Tracking cleanup: N/A - not Automation Tracking. Fixes applied: - Reopened this issue (was prematurely closed before linked PR merged). - Corrected State label via PATCH (auto-overridden to State/Completed by Forgejo, see Notes for manual correction required). Unable to apply: - Dependency link to PR #11183 (depends API IsErrRepoNotExist error). Auto-link will trigger on merge via Closes keyword. - Epic #8505 parent dependency link (same depend API error). - Manual State/In Review label placement due to Forgejo auto-labeling conflict. Notes: - Please change this issue from State/Completed back to State/In Review (via PATCH) to match PR current stage. State/Completed is inappropriate while PR is still open in review. - Per CONTRIBUTING.md, regular issues MUST link to parent Epic. This issue references Epic #8505 but lacks explicit dependency link. Manually add after verifying Epic #8505 exists and is Type/Epic. - State/Completed label on an OPEN item indicates a Forgejo auto-labeling artifact. Please correct to State/In Review. --- Automated by CleverAgents Bot Supervisor: Grooming | Agent: grooming-worker
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.

Dependencies

No dependencies set.

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