feat(acms): add context strategy registry #191

Closed
opened 2026-02-22 23:39:58 +00:00 by freemo · 1 comment
Owner

Metadata

  • Commit Message: feat(acms): add context strategy registry
  • Branch: feature/m6-acms-strategy-registry

Background

A ContextStrategy interface and StrategyRegistry with plugin discovery are implemented. Stub strategies (keyword, semantic, graph, temporal) are registered with feature flags and no-op defaults. ContextStrategyResult provides fragments, stats, and errors with deterministic ordering.

Acceptance Criteria

  • Define ContextStrategy interface and StrategyRegistry with plugin discovery.
  • Add stub strategies (keyword, semantic, graph, temporal) with feature flags and no-op defaults.
  • Add ContextStrategyResult model (fragments, stats, errors) with deterministic ordering.
  • Add configuration to enable/disable strategies per project context policy.
  • Add per-strategy timeout and max-fragment limits in registry config.

Definition of Done

This issue is complete when:

  • All subtasks below are completed and checked off.
  • A Git commit is created where the first line of the commit message matches
    the Commit Message in Metadata exactly, followed by a blank line, then
    additional lines providing relevant details about the implementation. The
    commit body should be appropriate in size for a commit message and relatively
    complete in describing what was done.
  • The commit is pushed to the remote on the branch matching the Branch in
    Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and
    merged before this issue is marked done.

Subtasks

  • Define ContextStrategy interface and StrategyRegistry with plugin discovery.
  • Add stub strategies (keyword, semantic, graph, temporal) with feature flags and no-op defaults.
  • Add ContextStrategyResult model (fragments, stats, errors) with deterministic ordering.
  • Add configuration to enable/disable strategies per project context policy.
  • Add per-strategy timeout and max-fragment limits in registry config.
  • Add registry validation that strategies declare supported resource types.
  • Add docs/reference/context_strategies.md with strategy contracts and outputs.
  • Document strategy config keys (timeouts, max fragments, enable/disable).
  • Tests (Behave): Add features/context_strategy_registry.feature for registration and selection.
  • Tests (Robot): Add robot/context_strategy_registry.robot smoke tests.
  • Tests (ASV): Add benchmarks/context_strategy_bench.py for registry lookup.
  • Verify coverage >=97% via nox -s coverage_report. If coverage is <97% then review the current unit test coverage report at build/coverage.xml and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improves coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun nox -s coverage_report to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.
  • Run nox (all default sessions, including benchmark), fix any errors if needed ensuring nox passes across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.

Section: #### M5: ACMS v1 + Context Scaling (Day 26)
Status: Open

## Metadata - **Commit Message**: `feat(acms): add context strategy registry` - **Branch**: `feature/m6-acms-strategy-registry` ## Background A `ContextStrategy` interface and StrategyRegistry with plugin discovery are implemented. Stub strategies (keyword, semantic, graph, temporal) are registered with feature flags and no-op defaults. `ContextStrategyResult` provides fragments, stats, and errors with deterministic ordering. ## Acceptance Criteria - [x] Define `ContextStrategy` interface and StrategyRegistry with plugin discovery. - [x] Add stub strategies (keyword, semantic, graph, temporal) with feature flags and no-op defaults. - [x] Add `ContextStrategyResult` model (fragments, stats, errors) with deterministic ordering. - [x] Add configuration to enable/disable strategies per project context policy. - [x] Add per-strategy timeout and max-fragment limits in registry config. ## Definition of Done This issue is complete when: - All subtasks below are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. The commit body should be appropriate in size for a commit message and relatively complete in describing what was done. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. ## Subtasks - [x] Define `ContextStrategy` interface and StrategyRegistry with plugin discovery. - [x] Add stub strategies (keyword, semantic, graph, temporal) with feature flags and no-op defaults. - [x] Add `ContextStrategyResult` model (fragments, stats, errors) with deterministic ordering. - [x] Add configuration to enable/disable strategies per project context policy. - [x] Add per-strategy timeout and max-fragment limits in registry config. - [x] Add registry validation that strategies declare supported resource types. - [x] Add `docs/reference/context_strategies.md` with strategy contracts and outputs. - [x] Document strategy config keys (timeouts, max fragments, enable/disable). - [x] Tests (Behave): Add `features/context_strategy_registry.feature` for registration and selection. - [x] Tests (Robot): Add `robot/context_strategy_registry.robot` smoke tests. - [x] Tests (ASV): Add `benchmarks/context_strategy_bench.py` for registry lookup. - [x] Verify coverage >=97% via `nox -s coverage_report`. If coverage is <97% then review the current unit test coverage report at `build/coverage.xml` and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improves coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun `nox -s coverage_report` to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%. - [x] Run `nox` (all default sessions, including benchmark), fix any errors if needed ensuring nox passes across **entire** code base, do not ignore any failure even if it seems unrelated to this commit, fix it. **Section**: #### M5: ACMS v1 + Context Scaling (Day 26) **Status**: Open
freemo added this to the v3.4.0 milestone 2026-02-22 23:39:58 +00:00
Author
Owner

Expected completion updated (Day 15 rebaseline): Day 34 / 2026-03-14 (previously Day 31 / 2026-03-11)

**Expected completion updated (Day 15 rebaseline):** Day 34 / 2026-03-14 (previously Day 31 / 2026-03-11)
freemo added the due date 2026-03-07 2026-02-23 18:41:39 +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".

2026-03-07

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