feat: implement ACMS budget enforcement for max_file_size and max_total_size constraints #8197

Open
opened 2026-04-13 04:26:31 +00:00 by HAL9000 · 1 comment
Owner

Background and Context

The ACMS v1 pipeline must enforce budget constraints (max_file_size, max_total_size) to prevent runaway token consumption. Without budget enforcement, a single large file or a large number of files could exhaust the LLM token budget, causing expensive API calls or failures.

Current Behavior

No budget enforcement exists. All files are included regardless of size. Token budgets are not tracked or enforced during context assembly.

Expected Behavior

max_file_size constraint excludes files larger than the configured limit. max_total_size constraint stops including files once the total context size reaches the limit. Budget violations produce clear log messages. Budget enforcement is applied before context is delivered to LLM actors.

Acceptance Criteria

  • max_file_size constraint excludes files larger than the limit
  • max_total_size constraint stops including files at the limit
  • Budget violations produce clear log messages
  • Budget enforcement is applied before context delivery
  • Budget limits are configurable via context policy
  • Test coverage >= 97% for budget enforcement module

Metadata

  • Commit Message: feat: implement ACMS budget enforcement max_file_size max_total_size
  • Branch Name: feat/acms-budget-enforcement-file-size-total-size

Subtasks

  • Implement max_file_size constraint check
  • Implement max_total_size constraint with running total
  • Integrate budget enforcement into context assembly pipeline
  • Implement budget violation logging
  • Write unit tests for budget enforcement
  • Write integration tests for budget enforcement in context assembly

Definition of Done

Budget enforcement works for both max_file_size and max_total_size, violations are logged, and test coverage >= 97%.

Parent Epic

Child of and blocks #8080 — ACMS v1 Core Context Assembly Pipeline


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

## Background and Context The ACMS v1 pipeline must enforce budget constraints (max_file_size, max_total_size) to prevent runaway token consumption. Without budget enforcement, a single large file or a large number of files could exhaust the LLM token budget, causing expensive API calls or failures. ## Current Behavior No budget enforcement exists. All files are included regardless of size. Token budgets are not tracked or enforced during context assembly. ## Expected Behavior max_file_size constraint excludes files larger than the configured limit. max_total_size constraint stops including files once the total context size reaches the limit. Budget violations produce clear log messages. Budget enforcement is applied before context is delivered to LLM actors. ## Acceptance Criteria - [ ] max_file_size constraint excludes files larger than the limit - [ ] max_total_size constraint stops including files at the limit - [ ] Budget violations produce clear log messages - [ ] Budget enforcement is applied before context delivery - [ ] Budget limits are configurable via context policy - [ ] Test coverage >= 97% for budget enforcement module ## Metadata - **Commit Message**: `feat: implement ACMS budget enforcement max_file_size max_total_size` - **Branch Name**: `feat/acms-budget-enforcement-file-size-total-size` ## Subtasks - [ ] Implement max_file_size constraint check - [ ] Implement max_total_size constraint with running total - [ ] Integrate budget enforcement into context assembly pipeline - [ ] Implement budget violation logging - [ ] Write unit tests for budget enforcement - [ ] Write integration tests for budget enforcement in context assembly ## Definition of Done Budget enforcement works for both max_file_size and max_total_size, violations are logged, and test coverage >= 97%. ## Parent Epic Child of and blocks #8080 — ACMS v1 Core Context Assembly Pipeline --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
HAL9000 added this to the v3.4.0 milestone 2026-04-13 04:28:46 +00:00
Author
Owner

Verified — Budget enforcement is an explicit v3.4.0 acceptance criterion: 'Budget enforcement works (max_file_size, max_total_size constraints).' Must Have for v3.4.0. Verified.


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

✅ **Verified** — Budget enforcement is an explicit v3.4.0 acceptance criterion: 'Budget enforcement works (max_file_size, max_total_size constraints).' **Must Have** for v3.4.0. Verified. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-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.

Dependencies

No dependencies set.

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