UAT: FixThenRevalidateOrchestrator registered in DI container with validation_pipeline=None - will raise ValidationError on resolution #3938

Open
opened 2026-04-06 07:38:41 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/di-fix-then-revalidate-validation-pipeline
  • Commit Message: fix(container): wire ValidationPipeline into FixThenRevalidateOrchestrator DI registration
  • Milestone: (none — see backlog note below)
  • Parent Epic: #394

Bug Report

Feature Area: Dependency Injection and Service Layer

Severity: High — resolving fix_then_revalidate_orchestrator from the DI container will immediately raise ValidationError because the required validation_pipeline dependency is hardcoded to None

What Was Tested

Code-level analysis of src/cleveragents/application/container.py against the FixThenRevalidateOrchestrator.__init__() validation logic in src/cleveragents/application/services/fix_then_revalidate.py.

Expected Behavior (from spec)

The FixThenRevalidateOrchestrator should be resolvable from the DI container with all required dependencies properly wired. The container registration should provide a valid ValidationPipeline instance.

Actual Behavior

In container.py, the fix_then_revalidate_orchestrator provider is registered with validation_pipeline=None:

# container.py
fix_then_revalidate_orchestrator = providers.Factory(
    FixThenRevalidateOrchestrator,
    validation_pipeline=None,  # ← PROBLEM: hardcoded None
    event_bus=event_bus,
)

However, FixThenRevalidateOrchestrator.__init__() explicitly validates that validation_pipeline is not None:

# fix_then_revalidate.py
def __init__(
    self,
    validation_pipeline: ValidationPipeline,
    ...
) -> None:
    if validation_pipeline is None:
        raise ValidationError("validation_pipeline must not be None")

This means any call to container.fix_then_revalidate_orchestrator() will immediately raise ValidationError: validation_pipeline must not be None.

Impact

  1. Broken DI registration: The fix_then_revalidate_orchestrator provider is effectively non-functional — it cannot be resolved without raising an exception.
  2. Silent failure: The container definition compiles without error, but the bug only manifests at runtime when the provider is first resolved.
  3. Spec violation: The Fix-then-Revalidate orchestration loop is a core part of the validation failure handling specification. If the orchestrator cannot be instantiated, this entire feature is broken.

Steps to Reproduce (Code Analysis)

  1. Open src/cleveragents/application/container.py
  2. Find the fix_then_revalidate_orchestrator provider (search for FixThenRevalidateOrchestrator)
  3. Observe validation_pipeline=None in the provider registration
  4. Open src/cleveragents/application/services/fix_then_revalidate.py
  5. Find __init__() and observe if validation_pipeline is None: raise ValidationError(...)

Code Locations

  • Container registration: src/cleveragents/application/container.pyfix_then_revalidate_orchestrator provider
  • Validation guard: src/cleveragents/application/services/fix_then_revalidate.pyFixThenRevalidateOrchestrator.__init__(), line ~if validation_pipeline is None: raise ValidationError(...)

Register ValidationPipeline in the DI container and wire it into the FixThenRevalidateOrchestrator:

# In Container class:
validation_pipeline = providers.Factory(
    ValidationPipeline,
    # ... appropriate dependencies
)

fix_then_revalidate_orchestrator = providers.Factory(
    FixThenRevalidateOrchestrator,
    validation_pipeline=validation_pipeline,  # Wire properly
    event_bus=event_bus,
)

Alternatively, if FixThenRevalidateOrchestrator is always constructed with a specific ValidationPipeline at call sites, the validation_pipeline parameter should be made optional with a default factory, or the guard should be relaxed to allow deferred pipeline injection.

Subtasks

  • Write a TDD issue-capture Behave scenario tagged @tdd_expected_fail that demonstrates the ValidationError raised when resolving fix_then_revalidate_orchestrator from the container
  • Register ValidationPipeline as a provider in container.py with all required dependencies wired
  • Update fix_then_revalidate_orchestrator provider to inject the ValidationPipeline provider instead of None
  • Remove @tdd_expected_fail tag from the capture test and verify it now passes
  • Verify container.fix_then_revalidate_orchestrator() resolves without raising any exception
  • Update any integration tests that exercise the Fix-then-Revalidate flow end-to-end

Definition of Done

  • fix_then_revalidate_orchestrator resolves from the DI container without raising ValidationError
  • ValidationPipeline is a first-class provider in container.py with all dependencies properly wired
  • TDD capture test passes (no longer @tdd_expected_fail)
  • No validation_pipeline=None hardcoding remains in the container
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone v3.5.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/di-fix-then-revalidate-validation-pipeline` - **Commit Message**: `fix(container): wire ValidationPipeline into FixThenRevalidateOrchestrator DI registration` - **Milestone**: _(none — see backlog note below)_ - **Parent Epic**: #394 ## Bug Report **Feature Area:** Dependency Injection and Service Layer **Severity:** High — resolving `fix_then_revalidate_orchestrator` from the DI container will immediately raise `ValidationError` because the required `validation_pipeline` dependency is hardcoded to `None` ### What Was Tested Code-level analysis of `src/cleveragents/application/container.py` against the `FixThenRevalidateOrchestrator.__init__()` validation logic in `src/cleveragents/application/services/fix_then_revalidate.py`. ### Expected Behavior (from spec) The `FixThenRevalidateOrchestrator` should be resolvable from the DI container with all required dependencies properly wired. The container registration should provide a valid `ValidationPipeline` instance. ### Actual Behavior In `container.py`, the `fix_then_revalidate_orchestrator` provider is registered with `validation_pipeline=None`: ```python # container.py fix_then_revalidate_orchestrator = providers.Factory( FixThenRevalidateOrchestrator, validation_pipeline=None, # ← PROBLEM: hardcoded None event_bus=event_bus, ) ``` However, `FixThenRevalidateOrchestrator.__init__()` explicitly validates that `validation_pipeline` is not `None`: ```python # fix_then_revalidate.py def __init__( self, validation_pipeline: ValidationPipeline, ... ) -> None: if validation_pipeline is None: raise ValidationError("validation_pipeline must not be None") ``` This means **any call to `container.fix_then_revalidate_orchestrator()`** will immediately raise `ValidationError: validation_pipeline must not be None`. ### Impact 1. **Broken DI registration**: The `fix_then_revalidate_orchestrator` provider is effectively non-functional — it cannot be resolved without raising an exception. 2. **Silent failure**: The container definition compiles without error, but the bug only manifests at runtime when the provider is first resolved. 3. **Spec violation**: The Fix-then-Revalidate orchestration loop is a core part of the validation failure handling specification. If the orchestrator cannot be instantiated, this entire feature is broken. ### Steps to Reproduce (Code Analysis) 1. Open `src/cleveragents/application/container.py` 2. Find the `fix_then_revalidate_orchestrator` provider (search for `FixThenRevalidateOrchestrator`) 3. Observe `validation_pipeline=None` in the provider registration 4. Open `src/cleveragents/application/services/fix_then_revalidate.py` 5. Find `__init__()` and observe `if validation_pipeline is None: raise ValidationError(...)` ### Code Locations - Container registration: `src/cleveragents/application/container.py` — `fix_then_revalidate_orchestrator` provider - Validation guard: `src/cleveragents/application/services/fix_then_revalidate.py` — `FixThenRevalidateOrchestrator.__init__()`, line ~`if validation_pipeline is None: raise ValidationError(...)` ### Recommended Fix Register `ValidationPipeline` in the DI container and wire it into the `FixThenRevalidateOrchestrator`: ```python # In Container class: validation_pipeline = providers.Factory( ValidationPipeline, # ... appropriate dependencies ) fix_then_revalidate_orchestrator = providers.Factory( FixThenRevalidateOrchestrator, validation_pipeline=validation_pipeline, # Wire properly event_bus=event_bus, ) ``` Alternatively, if `FixThenRevalidateOrchestrator` is always constructed with a specific `ValidationPipeline` at call sites, the `validation_pipeline` parameter should be made optional with a default factory, or the guard should be relaxed to allow deferred pipeline injection. ## Subtasks - [ ] Write a TDD issue-capture Behave scenario tagged `@tdd_expected_fail` that demonstrates the `ValidationError` raised when resolving `fix_then_revalidate_orchestrator` from the container - [ ] Register `ValidationPipeline` as a provider in `container.py` with all required dependencies wired - [ ] Update `fix_then_revalidate_orchestrator` provider to inject the `ValidationPipeline` provider instead of `None` - [ ] Remove `@tdd_expected_fail` tag from the capture test and verify it now passes - [ ] Verify `container.fix_then_revalidate_orchestrator()` resolves without raising any exception - [ ] Update any integration tests that exercise the Fix-then-Revalidate flow end-to-end ## Definition of Done - [ ] `fix_then_revalidate_orchestrator` resolves from the DI container without raising `ValidationError` - [ ] `ValidationPipeline` is a first-class provider in `container.py` with all dependencies properly wired - [ ] TDD capture test passes (no longer `@tdd_expected_fail`) - [ ] No `validation_pipeline=None` hardcoding remains in the container - [ ] All nox stages pass - [ ] Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.5.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
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.

Blocks
#394 Epic: Decision Framework
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3938
No description provided.