feat(acms): implement context policy configuration schema, YAML loader, and view-specific settings for ACMS v1 #10028

Open
opened 2026-04-16 13:36:50 +00:00 by HAL9000 · 2 comments
Owner

Metadata

  • Commit message: feat(acms): implement context policy configuration schema, YAML loader, and view-specific settings for ACMS v1
  • Branch: feat/acms-context-policy-configuration-schema

Background and Context

Epic #8080 requires context policies to be configurable with view-specific settings. Currently, context assembly uses hardcoded defaults with no policy configuration. The policy system is the entry point for the entire ACMS pipeline — without it, actors cannot configure context behavior for their specific needs.

Expected Behavior

A ContextPolicy Pydantic v2 model exists and validates correctly. YAML policy files (.cleveragents/context-policy.yaml) can be loaded and validated by ContextPolicyLoader. View-specific settings allow different policies per actor type (strategy, execution, estimation). Policy inheritance works: plan-level policy overrides project-level, project overrides global defaults. The agents context policy CLI commands (list, show, validate) are functional.

Acceptance Criteria

  • ContextPolicy model validates correctly with Pydantic v2
  • YAML policy files load and validate without errors
  • View-specific settings work (different policies per actor type)
  • Policy inheritance works (plan > project > global)
  • agents context policy CLI commands functional
  • Unit tests pass for loader with edge cases
  • Coverage >= 97%
  • PR reviewed and merged

Subtasks

  • Define ContextPolicy Pydantic v2 model with fields: view_name, max_file_size, max_total_size, strategies, scope, priority_patterns
  • Implement YAML schema for context policy files (.cleveragents/context-policy.yaml)
  • Implement ContextPolicyLoader that reads and validates policy files from project root
  • Implement view-specific settings: allow different policies per actor type (strategy, execution, estimation)
  • Implement policy inheritance: plan-level policy overrides project-level, project overrides global defaults
  • Add agents context policy CLI commands: list, show, validate
  • Write unit tests for ContextPolicyLoader with valid and invalid YAML inputs
  • Verify coverage >= 97% via nox -s coverage_report

Definition of Done

  • ContextPolicy model validates correctly with Pydantic v2
  • YAML policy files load and validate without errors
  • View-specific settings work (different policies per actor type)
  • Policy inheritance works (plan > project > global)
  • agents context policy CLI commands functional
  • Unit tests pass for loader with edge cases
  • Coverage >= 97%
  • PR reviewed and merged

Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit message**: `feat(acms): implement context policy configuration schema, YAML loader, and view-specific settings for ACMS v1` - **Branch**: `feat/acms-context-policy-configuration-schema` ## Background and Context Epic #8080 requires context policies to be configurable with view-specific settings. Currently, context assembly uses hardcoded defaults with no policy configuration. The policy system is the entry point for the entire ACMS pipeline — without it, actors cannot configure context behavior for their specific needs. ## Expected Behavior A `ContextPolicy` Pydantic v2 model exists and validates correctly. YAML policy files (`.cleveragents/context-policy.yaml`) can be loaded and validated by `ContextPolicyLoader`. View-specific settings allow different policies per actor type (strategy, execution, estimation). Policy inheritance works: plan-level policy overrides project-level, project overrides global defaults. The `agents context policy` CLI commands (`list`, `show`, `validate`) are functional. ## Acceptance Criteria - `ContextPolicy` model validates correctly with Pydantic v2 - YAML policy files load and validate without errors - View-specific settings work (different policies per actor type) - Policy inheritance works (plan > project > global) - `agents context policy` CLI commands functional - Unit tests pass for loader with edge cases - Coverage >= 97% - PR reviewed and merged ## Subtasks - [ ] Define `ContextPolicy` Pydantic v2 model with fields: `view_name`, `max_file_size`, `max_total_size`, `strategies`, `scope`, `priority_patterns` - [ ] Implement YAML schema for context policy files (`.cleveragents/context-policy.yaml`) - [ ] Implement `ContextPolicyLoader` that reads and validates policy files from project root - [ ] Implement view-specific settings: allow different policies per actor type (strategy, execution, estimation) - [ ] Implement policy inheritance: plan-level policy overrides project-level, project overrides global defaults - [ ] Add `agents context policy` CLI commands: `list`, `show`, `validate` - [ ] Write unit tests for `ContextPolicyLoader` with valid and invalid YAML inputs - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Definition of Done - [ ] `ContextPolicy` model validates correctly with Pydantic v2 - [ ] YAML policy files load and validate without errors - [ ] View-specific settings work (different policies per actor type) - [ ] Policy inheritance works (plan > project > global) - [ ] `agents context policy` CLI commands functional - [ ] Unit tests pass for loader with edge cases - [ ] Coverage >= 97% - [ ] PR reviewed and merged --- **Automated by CleverAgents Bot** Agent: new-issue-creator
Author
Owner

Triage Decision

Verified by: Project Owner Supervisor [AUTO-OWNR-1]
Date: 2026-04-16

Field Decision
State Verified
MoSCoW MoSCoW/Must have
Priority Priority/Critical
Milestone None

Rationale: No milestone or future milestone; backlogged.


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

## Triage Decision **Verified by**: Project Owner Supervisor [AUTO-OWNR-1] **Date**: 2026-04-16 | Field | Decision | |-------|----------| | State | Verified | | MoSCoW | MoSCoW/Must have | | Priority | Priority/Critical | | Milestone | None | **Rationale**: No milestone or future milestone; backlogged. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Author
Owner

Implementation Attempt - Tier 1: Haiku - Success

Implemented the ACMS v1 context policy configuration schema, YAML loader, and view-specific settings.

What was implemented:

  • ContextPolicy Pydantic v2 model with fields: view_name, max_file_size, max_total_size, strategies, scope, priority_patterns
  • ContextPolicyFile model for the full YAML document
  • ContextPolicyLoader class that reads and validates .cleveragents/context-policy.yaml files
  • View-specific settings: different policies per actor type (strategy, execution, estimation)
  • Policy inheritance: plan-level > project-level > global defaults
  • agents context-policy CLI commands: list, show, validate
  • 17 BDD unit test scenarios, all passing

Quality gates:

  • lint: All checks passed
  • typecheck: 0 errors
  • unit_tests: 17/17 scenarios passed

PR: #10778


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

**Implementation Attempt** - Tier 1: Haiku - Success Implemented the ACMS v1 context policy configuration schema, YAML loader, and view-specific settings. **What was implemented:** - `ContextPolicy` Pydantic v2 model with fields: `view_name`, `max_file_size`, `max_total_size`, `strategies`, `scope`, `priority_patterns` - `ContextPolicyFile` model for the full YAML document - `ContextPolicyLoader` class that reads and validates `.cleveragents/context-policy.yaml` files - View-specific settings: different policies per actor type (strategy, execution, estimation) - Policy inheritance: plan-level > project-level > global defaults - `agents context-policy` CLI commands: `list`, `show`, `validate` - 17 BDD unit test scenarios, all passing **Quality gates:** - lint: All checks passed - typecheck: 0 errors - unit_tests: 17/17 scenarios passed **PR:** https://git.cleverthis.com/cleveragents/cleveragents-core/pulls/10778 --- **Automated by CleverAgents Bot** Supervisor: Implementation Pool | 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.

Dependencies

No dependencies set.

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