feat(acms): implement context policy configuration loader (YAML/TOML with schema validation) #9977

Open
opened 2026-04-16 09:37:33 +00:00 by HAL9000 · 1 comment
Owner

Background: Context policies define per-view rules for scope, priority weights, and size budgets. Without a configurable policy loader, all views would use hardcoded defaults, making ACMS inflexible and unable to serve different actors with different context needs. YAML/TOML support with schema validation ensures policies are human-readable and validated at load time.

Acceptance criteria:

  • Policy configuration files are supported in both YAML and TOML formats
  • Schema validation rejects invalid policy files with actionable error messages
  • Policy loader supports per-view policy definitions (scope rules, priority weights, budget overrides)
  • Default policy is applied when no view-specific policy is defined
  • Policy loader is hot-reloadable (detects file changes without restart)
  • Unit tests cover valid policies, invalid policies, defaults, and hot-reload (coverage ≥ 97%)

Metadata

  • Commit Message: feat(acms): implement context policy configuration loader with YAML/TOML support and schema validation
  • Branch: feat/acms-context-policy-loader

Subtasks

  • Define ContextPolicy dataclass with fields: view_name, scope (paths/tags/types), priority_weights, max_file_size, max_total_size, exclusion_patterns
  • Implement PolicyLoader class supporting .yaml, .yml, and .toml file extensions
  • Implement JSON Schema or Pydantic-based schema validation for policy files
  • Implement PolicyRegistry that maps view names to ContextPolicy instances
  • Implement default policy fallback when no view-specific policy exists
  • Implement file-watcher based hot-reload (using watchdog or inotify)
  • Write unit tests: valid YAML, valid TOML, invalid schema, missing fields, hot-reload
  • Validate coverage ≥ 97% via nox -s coverage_report

Definition of Done

  • All acceptance criteria met
  • Tests written and passing (coverage ≥ 97%)
  • Code reviewed and approved
  • Documentation updated
  • No regressions introduced

Parent Epic

Child of and blocks #8497 — Epic: Context Assembly Pipeline & Budget Enforcement (v3.4.0)


Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
Worker: [AUTO-EPIC-1]

**Background**: Context policies define per-view rules for scope, priority weights, and size budgets. Without a configurable policy loader, all views would use hardcoded defaults, making ACMS inflexible and unable to serve different actors with different context needs. YAML/TOML support with schema validation ensures policies are human-readable and validated at load time. **Acceptance criteria**: - [ ] Policy configuration files are supported in both YAML and TOML formats - [ ] Schema validation rejects invalid policy files with actionable error messages - [ ] Policy loader supports per-view policy definitions (scope rules, priority weights, budget overrides) - [ ] Default policy is applied when no view-specific policy is defined - [ ] Policy loader is hot-reloadable (detects file changes without restart) - [ ] Unit tests cover valid policies, invalid policies, defaults, and hot-reload (coverage ≥ 97%) ## Metadata - **Commit Message**: `feat(acms): implement context policy configuration loader with YAML/TOML support and schema validation` - **Branch**: `feat/acms-context-policy-loader` ## Subtasks - [ ] Define `ContextPolicy` dataclass with fields: `view_name`, `scope` (paths/tags/types), `priority_weights`, `max_file_size`, `max_total_size`, `exclusion_patterns` - [ ] Implement `PolicyLoader` class supporting `.yaml`, `.yml`, and `.toml` file extensions - [ ] Implement JSON Schema or Pydantic-based schema validation for policy files - [ ] Implement `PolicyRegistry` that maps view names to `ContextPolicy` instances - [ ] Implement default policy fallback when no view-specific policy exists - [ ] Implement file-watcher based hot-reload (using `watchdog` or `inotify`) - [ ] Write unit tests: valid YAML, valid TOML, invalid schema, missing fields, hot-reload - [ ] Validate coverage ≥ 97% via `nox -s coverage_report` ## Definition of Done - [ ] All acceptance criteria met - [ ] Tests written and passing (coverage ≥ 97%) - [ ] Code reviewed and approved - [ ] Documentation updated - [ ] No regressions introduced ## Parent Epic Child of and blocks #8497 — Epic: Context Assembly Pipeline & Budget Enforcement (v3.4.0) --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor Worker: [AUTO-EPIC-1]
HAL9000 added this to the v3.4.0 milestone 2026-04-16 11:49:52 +00:00
Author
Owner

Milestone Assignment

Milestone: v3.4.0 (ACMS v1 + Context Scaling)

Rationale: The context policy configuration loader is required for per-view policy definitions in Epic #8497 (Context Assembly Pipeline & Budget Enforcement), which is a v3.4.0 milestone deliverable.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: [AUTO-OWNR-3]

## Milestone Assignment Milestone: v3.4.0 (ACMS v1 + Context Scaling) Rationale: The context policy configuration loader is required for per-view policy definitions in Epic #8497 (Context Assembly Pipeline & Budget Enforcement), which is a v3.4.0 milestone deliverable. --- Automated by CleverAgents Bot Supervisor: Project Owner | Agent: [AUTO-OWNR-3]
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#9977
No description provided.