UAT: PlanLifecycleService uses EstimationStubActor instead of real actor dispatch — estimation actor config is ignored #3934

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

Metadata

  • Branch: feat/plan-real-estimation-actor-dispatch
  • Commit Message: feat(plan): replace EstimationStubActor with real actor registry dispatch
  • Milestone: None (Backlog)
  • Parent Epic: #392

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

Summary

The PlanLifecycleService._run_estimation_actor method in src/cleveragents/application/services/plan_lifecycle_service.py (lines 339–345) uses EstimationStubActor — a local stub that produces placeholder estimates — instead of dispatching to the configured estimation actor via the actor registry. The code contains an explicit TODO comment acknowledging this gap.

Expected Behavior (from spec)

Per docs/specification.md, the plan lifecycle includes an estimation actor that can be configured via agents plan use --estimation-actor <EST_ACTOR>. The estimation actor should be dispatched through the actor registry, allowing users to configure custom estimation actors.

Actual Behavior

# src/cleveragents/application/services/plan_lifecycle_service.py lines 339-345:
from cleveragents.application.services.plan_executor import (
    EstimationStubActor,
)
# TODO: Replace EstimationStubActor with real actor dispatch
# via actor registry
stub = EstimationStubActor()
result = stub.estimate(plan.identity.plan_id)

The EstimationStubActor in plan_executor.py (lines 270–290) produces a placeholder estimate with summary="Estimation skipped (stub actor)". The --estimation-actor flag in agents plan use is accepted but the configured actor is never actually invoked.

What Was Tested

Code-level analysis of src/cleveragents/application/services/plan_lifecycle_service.py and src/cleveragents/application/services/plan_executor.py.

Code Locations

  • src/cleveragents/application/services/plan_lifecycle_service.py lines 335–358 (_run_estimation_actor method)
  • src/cleveragents/application/services/plan_executor.py lines 270–290 (EstimationStubActor)

Steps to Reproduce

  1. Read src/cleveragents/application/services/plan_lifecycle_service.py around line 343
  2. Observe the TODO comment and stub actor usage
  3. Note that EstimationStubActor.estimate() returns summary="Estimation skipped (stub actor)"

Impact

The estimation actor feature is advertised in the CLI (--estimation-actor flag) and spec, but the configured actor is never invoked. All plan estimations use a stub that returns placeholder data. This means cost estimation is non-functional.

Subtasks

  • Identify the actor registry lookup interface (e.g., ActorRegistry.get(actor_name) or equivalent)
  • Resolve the configured estimation actor name from the plan's settings/config
  • Replace EstimationStubActor instantiation with a real actor registry dispatch call in _run_estimation_actor
  • Remove the EstimationStubActor import from plan_lifecycle_service.py (or move it to features/mocks/ if still needed for tests)
  • Ensure EstimationStubActor in plan_executor.py is relocated to features/mocks/ per CONTRIBUTING.md (production code must not contain mocking/test-specific logic)
  • Add/update Behave unit tests in features/ to cover real actor dispatch path
  • Add/update Behave unit tests to verify stub fallback behaviour (if applicable)
  • Run nox -e typecheck to verify no type errors
  • Run nox -e unit_tests and nox -e coverage_report to verify coverage ≥ 97%

Definition of Done

  • PlanLifecycleService._run_estimation_actor dispatches to the actor registry using the configured estimation actor name
  • EstimationStubActor is removed from production code (relocated to features/mocks/ if needed for tests)
  • The --estimation-actor CLI flag correctly influences which actor is invoked during estimation
  • Unit tests (Behave) cover the real actor dispatch path
  • No # type: ignore suppressions added
  • PR merged and issue closed
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `feat/plan-real-estimation-actor-dispatch` - **Commit Message**: `feat(plan): replace EstimationStubActor with real actor registry dispatch` - **Milestone**: None (Backlog) - **Parent Epic**: #392 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Summary The `PlanLifecycleService._run_estimation_actor` method in `src/cleveragents/application/services/plan_lifecycle_service.py` (lines 339–345) uses `EstimationStubActor` — a local stub that produces placeholder estimates — instead of dispatching to the configured estimation actor via the actor registry. The code contains an explicit `TODO` comment acknowledging this gap. ## Expected Behavior (from spec) Per `docs/specification.md`, the plan lifecycle includes an estimation actor that can be configured via `agents plan use --estimation-actor <EST_ACTOR>`. The estimation actor should be dispatched through the actor registry, allowing users to configure custom estimation actors. ## Actual Behavior ```python # src/cleveragents/application/services/plan_lifecycle_service.py lines 339-345: from cleveragents.application.services.plan_executor import ( EstimationStubActor, ) # TODO: Replace EstimationStubActor with real actor dispatch # via actor registry stub = EstimationStubActor() result = stub.estimate(plan.identity.plan_id) ``` The `EstimationStubActor` in `plan_executor.py` (lines 270–290) produces a placeholder estimate with `summary="Estimation skipped (stub actor)"`. The `--estimation-actor` flag in `agents plan use` is accepted but the configured actor is never actually invoked. ## What Was Tested Code-level analysis of `src/cleveragents/application/services/plan_lifecycle_service.py` and `src/cleveragents/application/services/plan_executor.py`. ## Code Locations - `src/cleveragents/application/services/plan_lifecycle_service.py` lines 335–358 (`_run_estimation_actor` method) - `src/cleveragents/application/services/plan_executor.py` lines 270–290 (`EstimationStubActor`) ## Steps to Reproduce 1. Read `src/cleveragents/application/services/plan_lifecycle_service.py` around line 343 2. Observe the TODO comment and stub actor usage 3. Note that `EstimationStubActor.estimate()` returns `summary="Estimation skipped (stub actor)"` ## Impact The estimation actor feature is advertised in the CLI (`--estimation-actor` flag) and spec, but the configured actor is never invoked. All plan estimations use a stub that returns placeholder data. This means cost estimation is non-functional. ## Subtasks - [ ] Identify the actor registry lookup interface (e.g., `ActorRegistry.get(actor_name)` or equivalent) - [ ] Resolve the configured estimation actor name from the plan's settings/config - [ ] Replace `EstimationStubActor` instantiation with a real actor registry dispatch call in `_run_estimation_actor` - [ ] Remove the `EstimationStubActor` import from `plan_lifecycle_service.py` (or move it to `features/mocks/` if still needed for tests) - [ ] Ensure `EstimationStubActor` in `plan_executor.py` is relocated to `features/mocks/` per CONTRIBUTING.md (production code must not contain mocking/test-specific logic) - [ ] Add/update Behave unit tests in `features/` to cover real actor dispatch path - [ ] Add/update Behave unit tests to verify stub fallback behaviour (if applicable) - [ ] Run `nox -e typecheck` to verify no type errors - [ ] Run `nox -e unit_tests` and `nox -e coverage_report` to verify coverage ≥ 97% ## Definition of Done - [ ] `PlanLifecycleService._run_estimation_actor` dispatches to the actor registry using the configured estimation actor name - [ ] `EstimationStubActor` is removed from production code (relocated to `features/mocks/` if needed for tests) - [ ] The `--estimation-actor` CLI flag correctly influences which actor is invoked during estimation - [ ] Unit tests (Behave) cover the real actor dispatch path - [ ] No `# type: ignore` suppressions added - [ ] PR merged and issue closed - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-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.

Blocks
#392 Epic: Actor YAML & Compiler
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3934
No description provided.