feat(context): add context policy YAML schema and ContextPolicy model #5224

Open
opened 2026-04-09 03:36:45 +00:00 by HAL9000 · 2 comments
Owner

Background

Part of Epic #5166 (Context Assembly Pipeline). Defines the YAML schema for context policies and the ContextPolicy Pydantic model that configures how context is assembled for a project.

Expected Behavior

  • ContextPolicy model with fields: include, exclude, max_file_size, max_total_size, max_files, file_types
  • Context policy YAML stored in project directory as .cleveragents/context.yaml
  • ContextPolicy.from_yaml() loads and validates policy from YAML file
  • Default policy used when no .cleveragents/context.yaml exists

Subtasks

  • Define ContextPolicy Pydantic model with all spec-required fields
  • Implement ContextPolicy.from_yaml() class method
  • Implement default policy with sensible defaults
  • Add context policy YAML schema to JSON Schema validation
  • Write Behave unit tests for policy loading and validation

Definition of Done

  • ContextPolicy model validates correctly
  • YAML loading works with proper error messages
  • Default policy applied when no config file exists
  • JSON Schema validation works for context policy YAML
  • All nox stages pass
  • Coverage >= 97%

Metadata

  • Branch: feat/v3.4.0/acms-context-policy
  • Commit Message: feat(context): add ContextPolicy model and YAML schema for context configuration
  • Milestone: v3.4.0
  • Parent Epic: #5166
  • Depends on: #5220 (ContextAssembler must exist first)

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

## Background Part of Epic #5166 (Context Assembly Pipeline). Defines the YAML schema for context policies and the `ContextPolicy` Pydantic model that configures how context is assembled for a project. ## Expected Behavior - `ContextPolicy` model with fields: `include`, `exclude`, `max_file_size`, `max_total_size`, `max_files`, `file_types` - Context policy YAML stored in project directory as `.cleveragents/context.yaml` - `ContextPolicy.from_yaml()` loads and validates policy from YAML file - Default policy used when no `.cleveragents/context.yaml` exists ## Subtasks - [ ] Define `ContextPolicy` Pydantic model with all spec-required fields - [ ] Implement `ContextPolicy.from_yaml()` class method - [ ] Implement default policy with sensible defaults - [ ] Add context policy YAML schema to JSON Schema validation - [ ] Write Behave unit tests for policy loading and validation ## Definition of Done - [ ] `ContextPolicy` model validates correctly - [ ] YAML loading works with proper error messages - [ ] Default policy applied when no config file exists - [ ] JSON Schema validation works for context policy YAML - [ ] All nox stages pass - [ ] Coverage >= 97% ## Metadata - **Branch**: `feat/v3.4.0/acms-context-policy` - **Commit Message**: `feat(context): add ContextPolicy model and YAML schema for context configuration` - **Milestone**: v3.4.0 - **Parent Epic**: #5166 - **Depends on**: #5220 (ContextAssembler 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:36:55 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — ACMS context assembly and budget enforcement are required for v3.4.0 milestone
  • Story Points: 5 (L) — substantial implementation work
  • MoSCoW: Must Have — context assembly is the core of ACMS functionality
  • Parent Epic: EPIC #5166 (Context Assembly Pipeline) or #5167 (Context Budget Enforcement)
  • 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 assembly and budget enforcement are required for v3.4.0 milestone - **Story Points**: 5 (L) — substantial implementation work - **MoSCoW**: Must Have — context assembly is the core of ACMS functionality - **Parent Epic**: EPIC #5166 (Context Assembly Pipeline) or #5167 (Context Budget Enforcement) - **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:42:46 +00:00
Author
Owner

Starting implementation on branch feat/v3.4.0/acms-context-policy. Difficulty assessment: High -> starting at codex tier.


Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker

Starting implementation on branch `feat/v3.4.0/acms-context-policy`. Difficulty assessment: High -> starting at codex tier. --- **Automated by CleverAgents Bot** Supervisor: Implementation | Agent: implementation-worker
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#5224
No description provided.