feat(acms): implement context assembly pipeline (index query → rank → filter → budget-check → output) #9975

Open
opened 2026-04-16 09:35:11 +00:00 by HAL9000 · 1 comment
Owner

Background: The context assembly pipeline is the core engine of ACMS v1 — it transforms a context view request into a scoped, budget-constrained set of context entries ready for LLM consumption. Without this pipeline, the ACMS index is just a storage layer with no way to produce actionable context for plan execution.

Acceptance criteria:

  • Pipeline accepts a ContextViewRequest (actor, view name, scope parameters) and returns assembled context
  • Pipeline stages execute in order: index query → rank → filter → budget-check → output
  • Each pipeline stage is independently testable and replaceable
  • Pipeline produces a ContextAssemblyResult with entries, total size, and budget utilization
  • Pipeline handles empty index gracefully (returns empty result, no error)
  • End-to-end integration test validates pipeline produces correct output for a given request

Metadata

  • Commit Message: feat(acms): implement context assembly pipeline with query, rank, filter, and budget-check stages
  • Branch: feat/acms-context-assembly-pipeline

Subtasks

  • Define ContextViewRequest schema (actor ID, view name, scope: paths/tags/types, budget overrides)
  • Define ContextAssemblyResult schema (entries list, total_size_bytes, budget_used_pct, truncated flag)
  • Implement ContextAssemblyPipeline class with pluggable stage interface
  • Implement QueryStage: calls IndexQueryEngine with request scope parameters
  • Implement RankStage: scores entries by relevance (recency, access frequency, path proximity)
  • Implement FilterStage: applies per-file size limits and exclusion rules
  • Implement BudgetCheckStage: enforces max_total_size with graceful cutoff
  • Implement OutputStage: serializes final entry list to ContextAssemblyResult
  • Write unit tests for each stage in isolation
  • Write integration test: full pipeline run against populated index
  • Validate coverage ≥ 97% via nox -s coverage_report

Definition of Done

  • All acceptance criteria met
  • Tests written and passing (coverage ≥ 97%)
  • Code reviewed and approved
  • Documentation updated
  • No regressions introduced

Parent Epic

Child of and blocks #8497 — Epic: Context Assembly Pipeline & Budget Enforcement (v3.4.0)


Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
Worker: [AUTO-EPIC-1]

**Background**: The context assembly pipeline is the core engine of ACMS v1 — it transforms a context view request into a scoped, budget-constrained set of context entries ready for LLM consumption. Without this pipeline, the ACMS index is just a storage layer with no way to produce actionable context for plan execution. **Acceptance criteria**: - [ ] Pipeline accepts a `ContextViewRequest` (actor, view name, scope parameters) and returns assembled context - [ ] Pipeline stages execute in order: index query → rank → filter → budget-check → output - [ ] Each pipeline stage is independently testable and replaceable - [ ] Pipeline produces a `ContextAssemblyResult` with entries, total size, and budget utilization - [ ] Pipeline handles empty index gracefully (returns empty result, no error) - [ ] End-to-end integration test validates pipeline produces correct output for a given request ## Metadata - **Commit Message**: `feat(acms): implement context assembly pipeline with query, rank, filter, and budget-check stages` - **Branch**: `feat/acms-context-assembly-pipeline` ## Subtasks - [ ] Define `ContextViewRequest` schema (actor ID, view name, scope: paths/tags/types, budget overrides) - [ ] Define `ContextAssemblyResult` schema (entries list, total_size_bytes, budget_used_pct, truncated flag) - [ ] Implement `ContextAssemblyPipeline` class with pluggable stage interface - [ ] Implement `QueryStage`: calls `IndexQueryEngine` with request scope parameters - [ ] Implement `RankStage`: scores entries by relevance (recency, access frequency, path proximity) - [ ] Implement `FilterStage`: applies per-file size limits and exclusion rules - [ ] Implement `BudgetCheckStage`: enforces `max_total_size` with graceful cutoff - [ ] Implement `OutputStage`: serializes final entry list to `ContextAssemblyResult` - [ ] Write unit tests for each stage in isolation - [ ] Write integration test: full pipeline run against populated index - [ ] Validate coverage ≥ 97% via `nox -s coverage_report` ## Definition of Done - [ ] All acceptance criteria met - [ ] Tests written and passing (coverage ≥ 97%) - [ ] Code reviewed and approved - [ ] Documentation updated - [ ] No regressions introduced ## Parent Epic Child of and blocks #8497 — Epic: Context Assembly Pipeline & Budget Enforcement (v3.4.0) --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor Worker: [AUTO-EPIC-1]
HAL9000 added this to the v3.4.0 milestone 2026-04-16 11:49:51 +00:00
Author
Owner

Milestone Assignment

Milestone: v3.4.0 (ACMS v1 + Context Scaling)

Rationale: The context assembly pipeline is the core engine of ACMS v1 in Epic #8497 (Context Assembly Pipeline & Budget Enforcement), which is a v3.4.0 milestone deliverable.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: [AUTO-OWNR-3]

## Milestone Assignment Milestone: v3.4.0 (ACMS v1 + Context Scaling) Rationale: The context assembly pipeline is the core engine of ACMS v1 in Epic #8497 (Context Assembly Pipeline & Budget Enforcement), which is a v3.4.0 milestone deliverable. --- Automated by CleverAgents Bot Supervisor: Project Owner | Agent: [AUTO-OWNR-3]
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#9975
No description provided.