feat(context): implement context view validation against budget constraints #5232

Open
opened 2026-04-09 03:49:32 +00:00 by HAL9000 · 1 comment
Owner

Background

Part of Epic #5167 (Context Budget Enforcement). Implements validation that assembled context views don't exceed configured budget constraints, with clear error messages when limits are exceeded.

Expected Behavior

  • ContextValidator.validate(view, budget) raises ContextBudgetExceededError if over limit
  • Validation checks token count, byte size, and file count
  • Error message includes which limit was exceeded and by how much
  • Validation is called after assembly and before sending to LLM

Subtasks

  • Define ContextBudgetExceededError exception with details
  • Implement ContextValidator with token, byte, and file count checks
  • Wire validation into ContextAssembler.assemble() pipeline
  • Add budget reporting to ContextView (used/limit for each dimension)
  • Write Behave unit tests for validation scenarios

Definition of Done

  • Validation catches all budget violations
  • Error messages are clear and actionable
  • Budget reporting included in ContextView
  • All nox stages pass
  • Coverage >= 97%

Metadata

  • Branch: feat/v3.4.0/acms-context-validation
  • Commit Message: feat(context): implement context view validation against budget constraints
  • Milestone: v3.4.0
  • Parent Epic: #5167
  • Depends on: #5231 (budget calculator must exist first)

Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planner

## Background Part of Epic #5167 (Context Budget Enforcement). Implements validation that assembled context views don't exceed configured budget constraints, with clear error messages when limits are exceeded. ## Expected Behavior - `ContextValidator.validate(view, budget)` raises `ContextBudgetExceededError` if over limit - Validation checks token count, byte size, and file count - Error message includes which limit was exceeded and by how much - Validation is called after assembly and before sending to LLM ## Subtasks - [ ] Define `ContextBudgetExceededError` exception with details - [ ] Implement `ContextValidator` with token, byte, and file count checks - [ ] Wire validation into `ContextAssembler.assemble()` pipeline - [ ] Add budget reporting to `ContextView` (used/limit for each dimension) - [ ] Write Behave unit tests for validation scenarios ## Definition of Done - [ ] Validation catches all budget violations - [ ] Error messages are clear and actionable - [ ] Budget reporting included in `ContextView` - [ ] All nox stages pass - [ ] Coverage >= 97% ## Metadata - **Branch**: `feat/v3.4.0/acms-context-validation` - **Commit Message**: `feat(context): implement context view validation against budget constraints` - **Milestone**: v3.4.0 - **Parent Epic**: #5167 - **Depends on**: #5231 (budget calculator must exist first) --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planner
HAL9000 added this to the v3.4.0 milestone 2026-04-09 03:49:39 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — ACMS context implementation required for v3.4.0 milestone
  • Story Points: 5 (L) — substantial implementation work
  • MoSCoW: Must Have — context management is core ACMS functionality
  • Assignee: HAL9000 — default assignment to maintain velocity

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

Issue triaged by project owner: - **State**: Verified - **Priority**: High — ACMS context implementation required for v3.4.0 milestone - **Story Points**: 5 (L) — substantial implementation work - **MoSCoW**: Must Have — context management is core ACMS functionality - **Assignee**: HAL9000 — default assignment to maintain velocity --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
HAL9000 self-assigned this 2026-04-09 03:53:25 +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#5232
No description provided.