Epic: Context Assembly Pipeline & Budget Enforcement (v3.4.0) #8497

Open
opened 2026-04-13 20:12:01 +00:00 by HAL9000 · 2 comments
Owner

Metadata

  • Commit message: feat(acms): implement context assembly pipeline with budget enforcement and policy configuration
  • Branch name: feat/v3.4.0-context-assembly-pipeline-budget-enforcement

Background and Context

As part of the v3.4.0 milestone (M5: ACMS v1 + Context Scaling), the Advanced Context Management System must produce scoped, budget-constrained context views for actors making LLM calls. Without budget enforcement, actors risk exceeding token limits or including irrelevant context, degrading plan quality and increasing cost.

This Epic covers the context assembly and policy layer of ACMS v1:

  • Context assembly pipeline: A pipeline that takes a context request (actor, view, scope) and assembles a ranked, filtered set of context entries from the ACMS index
  • Budget enforcement: Hard constraints on max_file_size and max_total_size that the assembled context must not exceed, with graceful truncation/exclusion strategies
  • Context policy configuration: Per-view policy definitions that specify scope rules, priority weights, size budgets, and inclusion/exclusion filters
  • Plan execution integration: Plan execution engine updated to pass ACMS-assembled context to LLM calls instead of raw file dumps

This Epic BLOCKS Legendary #8495.

Expected Behavior

When this Epic is complete:

  • Context assembly pipeline accepts a view request and returns a scoped, budget-compliant context set
  • Budget constraints (max_file_size, max_total_size) are enforced — no assembled context exceeds configured limits
  • Context policies are configurable per view with scope rules, priority weights, and size budgets
  • Plan execution uses ACMS-assembled context for all LLM calls
  • Policy violations are reported with actionable error messages

Acceptance Criteria

  • Context assembly pipeline produces scoped context output for a given view request
  • max_file_size constraint is enforced — files exceeding the limit are excluded or truncated
  • max_total_size constraint is enforced — total assembled context does not exceed the budget
  • Context policies are configurable with view-specific settings (scope, priority, budget)
  • Plan execution engine passes ACMS-assembled context to LLM calls
  • Policy configuration supports YAML/TOML format with schema validation
  • Budget enforcement produces clear error/warning messages when limits are hit
  • Unit and integration tests cover assembly pipeline, budget enforcement, and policy loading
  • Test coverage for this Epic's code >= 97%

Subtasks

  • Design context view request schema (actor, view name, scope parameters)
  • Implement context assembly pipeline (index query → rank → filter → budget-check → output)
  • Implement max_file_size enforcement (per-file size check with exclusion/truncation strategy)
  • Implement max_total_size enforcement (cumulative budget tracking with graceful cutoff)
  • Implement context policy configuration loader (YAML/TOML with schema validation)
  • Implement per-view policy application (scope rules, priority weights, budget overrides)
  • Integrate ACMS context assembly into plan execution engine (replace raw file dumps)
  • Implement budget violation reporting (warnings, errors, summary stats)
  • Write unit and integration tests for all pipeline and enforcement components
  • End-to-end test: plan execution with ACMS context produces correct LLM call payloads

Child Issues / Child Epics

This Epic will be decomposed into child Feature/Task issues.

  • Child issues TBD during sprint planning

Definition of Done

This Epic is closed when:

  1. All subtasks above are completed and merged
  2. All acceptance criteria are verified and checked off
  3. Budget enforcement is validated with both max_file_size and max_total_size scenarios
  4. Plan execution integration test passes with ACMS context
  5. Test coverage >= 97% for all code introduced in this Epic
  6. Legendary #8495 is updated to reflect this Epic's completion

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

## Metadata - **Commit message**: `feat(acms): implement context assembly pipeline with budget enforcement and policy configuration` - **Branch name**: `feat/v3.4.0-context-assembly-pipeline-budget-enforcement` ## Background and Context As part of the v3.4.0 milestone (M5: ACMS v1 + Context Scaling), the Advanced Context Management System must produce scoped, budget-constrained context views for actors making LLM calls. Without budget enforcement, actors risk exceeding token limits or including irrelevant context, degrading plan quality and increasing cost. This Epic covers the context assembly and policy layer of ACMS v1: - **Context assembly pipeline**: A pipeline that takes a context request (actor, view, scope) and assembles a ranked, filtered set of context entries from the ACMS index - **Budget enforcement**: Hard constraints on `max_file_size` and `max_total_size` that the assembled context must not exceed, with graceful truncation/exclusion strategies - **Context policy configuration**: Per-view policy definitions that specify scope rules, priority weights, size budgets, and inclusion/exclusion filters - **Plan execution integration**: Plan execution engine updated to pass ACMS-assembled context to LLM calls instead of raw file dumps **This Epic BLOCKS Legendary #8495.** ## Expected Behavior When this Epic is complete: - Context assembly pipeline accepts a view request and returns a scoped, budget-compliant context set - Budget constraints (max_file_size, max_total_size) are enforced — no assembled context exceeds configured limits - Context policies are configurable per view with scope rules, priority weights, and size budgets - Plan execution uses ACMS-assembled context for all LLM calls - Policy violations are reported with actionable error messages ## Acceptance Criteria - [ ] Context assembly pipeline produces scoped context output for a given view request - [ ] `max_file_size` constraint is enforced — files exceeding the limit are excluded or truncated - [ ] `max_total_size` constraint is enforced — total assembled context does not exceed the budget - [ ] Context policies are configurable with view-specific settings (scope, priority, budget) - [ ] Plan execution engine passes ACMS-assembled context to LLM calls - [ ] Policy configuration supports YAML/TOML format with schema validation - [ ] Budget enforcement produces clear error/warning messages when limits are hit - [ ] Unit and integration tests cover assembly pipeline, budget enforcement, and policy loading - [ ] Test coverage for this Epic's code >= 97% ## Subtasks - [ ] Design context view request schema (actor, view name, scope parameters) - [ ] Implement context assembly pipeline (index query → rank → filter → budget-check → output) - [ ] Implement `max_file_size` enforcement (per-file size check with exclusion/truncation strategy) - [ ] Implement `max_total_size` enforcement (cumulative budget tracking with graceful cutoff) - [ ] Implement context policy configuration loader (YAML/TOML with schema validation) - [ ] Implement per-view policy application (scope rules, priority weights, budget overrides) - [ ] Integrate ACMS context assembly into plan execution engine (replace raw file dumps) - [ ] Implement budget violation reporting (warnings, errors, summary stats) - [ ] Write unit and integration tests for all pipeline and enforcement components - [ ] End-to-end test: plan execution with ACMS context produces correct LLM call payloads ## Child Issues / Child Epics > This Epic will be decomposed into child Feature/Task issues. - [ ] Child issues TBD during sprint planning ## Definition of Done This Epic is closed when: 1. All subtasks above are completed and merged 2. All acceptance criteria are verified and checked off 3. Budget enforcement is validated with both `max_file_size` and `max_total_size` scenarios 4. Plan execution integration test passes with ACMS context 5. Test coverage >= 97% for all code introduced in this Epic 6. Legendary #8495 is updated to reflect this Epic's completion --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
HAL9000 added this to the v3.4.0 milestone 2026-04-13 20:12:45 +00:00
Author
Owner

[AUTO-OWNR-4] Triage Decision

Status: Verified

MoSCoW: Must Have
Priority: Critical

Rationale: This Epic directly satisfies two explicit v3.4.0 milestone acceptance criteria: "Budget enforcement works (max_file_size, max_total_size constraints)" and "Context policies configurable with view-specific settings" and "Plan execution leverages ACMS context for LLM calls". Budget enforcement is non-negotiable — without it, actors will overflow token limits and degrade plan quality. It blocks Legendary #8495 and is therefore Critical priority.

Next Steps: Decompose into child Feature/Task issues during sprint planning. Key deliverables: context view request schema, assembly pipeline (query → rank → filter → budget-check → output), max_file_size and max_total_size enforcement, YAML/TOML policy loader, plan execution integration, and end-to-end tests.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

## [AUTO-OWNR-4] Triage Decision **Status**: ✅ Verified **MoSCoW**: Must Have **Priority**: Critical **Rationale**: This Epic directly satisfies two explicit v3.4.0 milestone acceptance criteria: *"Budget enforcement works (max_file_size, max_total_size constraints)"* and *"Context policies configurable with view-specific settings"* and *"Plan execution leverages ACMS context for LLM calls"*. Budget enforcement is non-negotiable — without it, actors will overflow token limits and degrade plan quality. It blocks Legendary #8495 and is therefore Critical priority. **Next Steps**: Decompose into child Feature/Task issues during sprint planning. Key deliverables: context view request schema, assembly pipeline (query → rank → filter → budget-check → output), `max_file_size` and `max_total_size` enforcement, YAML/TOML policy loader, plan execution integration, and end-to-end tests. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Author
Owner

🧩 Child Issues Created for Epic #8497

The following child implementation issues have been created for Context Assembly Pipeline & Budget Enforcement (v3.4.0). Each child issue blocks this Epic and is assigned to milestone v3.4.0 (ID: 107).

# Issue Branch Prefix
1 #8561feat(acms): implement context assembly pipeline for scoped context views feat/v3.4.0-acms-assembly-pipeline
2 #8562feat(acms): implement budget enforcement for context assembly (max_file_size, max_total_size) feat/v3.4.0-acms-budget-enforcement
3 #8563feat(acms): integrate ACMS context assembly into plan execution LLM calls feat/v3.4.0-acms-llm-integration

Labels Applied to All Child Issues

  • Type/Feature · Priority/High · MoSCoW/Must have · State/Verified

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

## 🧩 Child Issues Created for Epic #8497 The following child implementation issues have been created for **Context Assembly Pipeline & Budget Enforcement (v3.4.0)**. Each child issue blocks this Epic and is assigned to milestone **v3.4.0** (ID: 107). | # | Issue | Branch Prefix | |---|---|---| | 1 | #8561 — `feat(acms): implement context assembly pipeline for scoped context views` | `feat/v3.4.0-acms-assembly-pipeline` | | 2 | #8562 — `feat(acms): implement budget enforcement for context assembly (max_file_size, max_total_size)` | `feat/v3.4.0-acms-budget-enforcement` | | 3 | #8563 — `feat(acms): integrate ACMS context assembly into plan execution LLM calls` | `feat/v3.4.0-acms-llm-integration` | ### Labels Applied to All Child Issues - `Type/Feature` · `Priority/High` · `MoSCoW/Must have` · `State/Verified` --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
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.

Depends on
Reference
cleveragents/cleveragents-core#8497
No description provided.