feat(acms): implement ACMS pipeline post-processing components — FragmentDeduplicator, DetailDepthResolver, FragmentScorer, BudgetPacker, FragmentOrderer #7402

Open
opened 2026-04-10 19:02:45 +00:00 by HAL9000 · 0 comments
Owner

Metadata

  • Commit Message: feat(acms): implement ACMS pipeline post-processing components — deduplicator, resolver, scorer, packer, orderer
  • Branch: feature/m5-acms-pipeline-postprocess
  • Milestone: v3.4.0
  • Parent Epic: #935

Background and Context

After the StrategyExecutor produces raw fragments, the ACMS pipeline runs 5 post-processing components to refine, score, and pack fragments into the final context budget. These components are currently stubs or missing.

Expected Behavior

The 5 post-processing pipeline stages execute correctly:

  1. FragmentDeduplicator: Removes duplicate fragments (same content hash or overlapping file ranges)
  2. DetailDepthResolver: Adjusts fragment detail level based on DetailLevelMap configuration
  3. FragmentScorer: Scores fragments by relevance using configurable scoring functions
  4. BudgetPacker: Selects fragments using a knapsack algorithm to maximize relevance within token budget
  5. FragmentOrderer: Orders selected fragments for optimal LLM consumption

Acceptance Criteria

  • FragmentDeduplicator removes exact duplicates and overlapping file ranges
  • DetailDepthResolver applies DetailLevelMap to adjust fragment detail depth
  • FragmentScorer scores fragments — default scorer uses keyword overlap + recency
  • BudgetPacker selects fragments within token budget using greedy knapsack
  • FragmentOrderer orders fragments: imports first, then by relevance score
  • All components are pluggable (overridable at plan/project/global scope)
  • BDD scenarios cover each component's behavior
  • Coverage >= 97%

Dependencies

  • Must be done after: #7400 (ACMS pipeline core components)

Subtasks

  • Implement FragmentDeduplicator.deduplicate() with content hash comparison
  • Implement DetailDepthResolver.resolve() with DetailLevelMap application
  • Implement FragmentScorer.score() with default keyword+recency scorer
  • Implement BudgetPacker.pack() with greedy knapsack algorithm
  • Implement FragmentOrderer.order() with imports-first ordering
  • Tests (Behave): Add scenarios for each post-processing component
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above 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.
  • 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.

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

## Metadata - **Commit Message**: `feat(acms): implement ACMS pipeline post-processing components — deduplicator, resolver, scorer, packer, orderer` - **Branch**: `feature/m5-acms-pipeline-postprocess` - **Milestone**: v3.4.0 - **Parent Epic**: #935 ## Background and Context After the StrategyExecutor produces raw fragments, the ACMS pipeline runs 5 post-processing components to refine, score, and pack fragments into the final context budget. These components are currently stubs or missing. ## Expected Behavior The 5 post-processing pipeline stages execute correctly: 1. **FragmentDeduplicator**: Removes duplicate fragments (same content hash or overlapping file ranges) 2. **DetailDepthResolver**: Adjusts fragment detail level based on `DetailLevelMap` configuration 3. **FragmentScorer**: Scores fragments by relevance using configurable scoring functions 4. **BudgetPacker**: Selects fragments using a knapsack algorithm to maximize relevance within token budget 5. **FragmentOrderer**: Orders selected fragments for optimal LLM consumption ## Acceptance Criteria - [ ] `FragmentDeduplicator` removes exact duplicates and overlapping file ranges - [ ] `DetailDepthResolver` applies `DetailLevelMap` to adjust fragment detail depth - [ ] `FragmentScorer` scores fragments — default scorer uses keyword overlap + recency - [ ] `BudgetPacker` selects fragments within token budget using greedy knapsack - [ ] `FragmentOrderer` orders fragments: imports first, then by relevance score - [ ] All components are pluggable (overridable at plan/project/global scope) - [ ] BDD scenarios cover each component's behavior - [ ] Coverage >= 97% ## Dependencies - [ ] Must be done after: #7400 (ACMS pipeline core components) ## Subtasks - [ ] Implement `FragmentDeduplicator.deduplicate()` with content hash comparison - [ ] Implement `DetailDepthResolver.resolve()` with `DetailLevelMap` application - [ ] Implement `FragmentScorer.score()` with default keyword+recency scorer - [ ] Implement `BudgetPacker.pack()` with greedy knapsack algorithm - [ ] Implement `FragmentOrderer.order()` with imports-first ordering - [ ] Tests (Behave): Add scenarios for each post-processing component - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above 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. - 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. --- **Automated by CleverAgents Bot** Supervisor: Epic Planner | Agent: epic-planning-pool-supervisor
HAL9000 added this to the v3.4.0 milestone 2026-04-10 19:04:04 +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.

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