UAT: ValidationPipeline not wired into PlanLifecycleService — phase transitions bypass validation gate #6259

Open
opened 2026-04-09 18:19:30 +00:00 by HAL9000 · 0 comments
Owner

Background and Context

The CleverAgents specification (§Plan Lifecycle) describes phase transitions as gated by a validation pipeline. The ValidationPipeline class exists and is fully implemented (src/cleveragents/application/services/validation_pipeline.py), but it is not injected into PlanLifecycleService and is never invoked during plan phase transitions.

Current Behavior

In src/cleveragents/application/container.py, the fix_then_revalidate_orchestrator factory at line 815 is created with validation_pipeline=None, and PlanLifecycleService does not have a validation_pipeline parameter at all. The execute_plan and apply_plan methods do not invoke the ValidationPipeline before or during execution.

Evidence:

  • grep -rn "ValidationPipeline|validation_pipeline" src/cleveragents/application/services/plan_lifecycle_service.pyno results
  • Container at line 815: validation_pipeline=None (passed as null to fix_then_revalidate orchestrator)
  • PlanLifecycleService.__init__ at line 183: no validation_pipeline parameter

Expected Behavior

Per the spec (§Validation Abstraction, Acceptance Test Matrix row 11: "Validation runner executes required and informational validations"), before transitioning to Apply phase and as part of Execute phase completion, the ValidationPipeline should be run against the plan's changeset. Required validation failures must block the transition to Apply; informational failures are recorded but do not block.

The ValidationPipeline and associated services (ValidationApply) are fully implemented but are disconnected from the lifecycle.

Acceptance Criteria

  • PlanLifecycleService accepts a validation_pipeline: ValidationPipeline | None constructor parameter.
  • Before transitioning Execute → Apply (in apply_plan), required validations are executed.
  • Required validation failures raise an appropriate error and prevent the transition.
  • Informational validation failures are recorded in plan.validation_summary but do not block.
  • The DI container wires ValidationPipeline into PlanLifecycleService.
  • Unit tests (Behave) cover required-validation-blocks-apply and informational-validation-passes scenarios.
  • Coverage remains ≥ 97%.

Code Location

  • src/cleveragents/application/services/plan_lifecycle_service.pyapply_plan (line 1679): no validation call
  • src/cleveragents/application/services/validation_pipeline.py — fully implemented but unused in lifecycle
  • src/cleveragents/application/container.py — line 815: validation_pipeline=None

Metadata

  • Commit Message: fix(plan-lifecycle): wire ValidationPipeline gate into PlanLifecycleService phase transitions
  • Branch: fix/plan-lifecycle-validation-pipeline

Subtasks

  • Add validation_pipeline: ValidationPipeline | None to PlanLifecycleService.__init__
  • Invoke ValidationPipeline before Execute → Apply transition in apply_plan
  • Block Apply on required validation failures; record informational failures in validation_summary
  • Wire ValidationPipeline into plan_lifecycle_service provider in container
  • Tests (Behave): required-fail blocks apply, informational-fail passes
  • Run nox -s coverage_report, verify ≥ 97%
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line matches the Commit Message in Metadata exactly.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Background and Context The CleverAgents specification (§Plan Lifecycle) describes phase transitions as gated by a validation pipeline. The `ValidationPipeline` class exists and is fully implemented (`src/cleveragents/application/services/validation_pipeline.py`), but it is **not injected into `PlanLifecycleService`** and is never invoked during plan phase transitions. ## Current Behavior In `src/cleveragents/application/container.py`, the `fix_then_revalidate_orchestrator` factory at line 815 is created with `validation_pipeline=None`, and `PlanLifecycleService` does not have a `validation_pipeline` parameter at all. The `execute_plan` and `apply_plan` methods do not invoke the `ValidationPipeline` before or during execution. **Evidence:** - `grep -rn "ValidationPipeline|validation_pipeline" src/cleveragents/application/services/plan_lifecycle_service.py` → **no results** - Container at line 815: `validation_pipeline=None` (passed as null to fix_then_revalidate orchestrator) - `PlanLifecycleService.__init__` at line 183: no `validation_pipeline` parameter ## Expected Behavior Per the spec (§Validation Abstraction, Acceptance Test Matrix row 11: "Validation runner executes required and informational validations"), before transitioning to Apply phase and as part of Execute phase completion, the `ValidationPipeline` should be run against the plan's changeset. Required validation failures must block the transition to Apply; informational failures are recorded but do not block. The `ValidationPipeline` and associated services (`ValidationApply`) are fully implemented but are disconnected from the lifecycle. ## Acceptance Criteria - `PlanLifecycleService` accepts a `validation_pipeline: ValidationPipeline | None` constructor parameter. - Before transitioning Execute → Apply (in `apply_plan`), required validations are executed. - Required validation failures raise an appropriate error and prevent the transition. - Informational validation failures are recorded in `plan.validation_summary` but do not block. - The DI container wires `ValidationPipeline` into `PlanLifecycleService`. - Unit tests (Behave) cover required-validation-blocks-apply and informational-validation-passes scenarios. - Coverage remains ≥ 97%. ## Code Location - `src/cleveragents/application/services/plan_lifecycle_service.py` — `apply_plan` (line 1679): no validation call - `src/cleveragents/application/services/validation_pipeline.py` — fully implemented but unused in lifecycle - `src/cleveragents/application/container.py` — line 815: `validation_pipeline=None` ## Metadata - **Commit Message**: `fix(plan-lifecycle): wire ValidationPipeline gate into PlanLifecycleService phase transitions` - **Branch**: `fix/plan-lifecycle-validation-pipeline` ## Subtasks - [ ] Add `validation_pipeline: ValidationPipeline | None` to `PlanLifecycleService.__init__` - [ ] Invoke `ValidationPipeline` before Execute → Apply transition in `apply_plan` - [ ] Block Apply on required validation failures; record informational failures in `validation_summary` - [ ] Wire `ValidationPipeline` into `plan_lifecycle_service` provider in container - [ ] Tests (Behave): required-fail blocks apply, informational-fail passes - [ ] Run `nox -s coverage_report`, verify ≥ 97% - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the first line matches the Commit Message in Metadata exactly. - The commit is pushed to the remote on the branch matching the Branch in Metadata exactly. - The commit is submitted as a pull request to `master`, reviewed, and merged before this issue is marked done. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
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#6259
No description provided.