feat(estimation): wire actor.default.estimation config fallback and Strategize-to-Estimate lifecycle hook #1310

Merged
freemo merged 1 commits from feature/m6-estimation-lifecycle-hook into master 2026-04-02 17:07:49 +00:00

1 Commits

Author SHA1 Message Date
freemo 27adad7b48 feat(estimation): wire actor.default.estimation config fallback and Strategize-to-Estimate lifecycle hook
CI / build (pull_request) Successful in 18s
CI / helm (pull_request) Successful in 23s
CI / lint (pull_request) Successful in 3m19s
CI / typecheck (pull_request) Successful in 3m57s
CI / quality (pull_request) Successful in 3m58s
CI / security (pull_request) Successful in 4m7s
CI / unit_tests (pull_request) Failing after 5m54s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 12m55s
CI / e2e_tests (pull_request) Successful in 20m29s
CI / integration_tests (pull_request) Successful in 24m54s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Failing after 35m40s
Implemented a comprehensive estimation workflow with a robust fallback for actor resolution, domain model enhancements, DB schema updates, and test coverage.

What was implemented
- Added a 4-level fallback chain in use_action() for estimation_actor:
  - CLI override > action YAML > project config > actor.default.estimation global config
  - The resolved actor is stored on the plan at creation time for consistency and traceability
- Introduced PLAN_ESTIMATION_COMPLETE to the EventType enum with the value "plan.estimation_complete"
- Wired _run_estimation() to emit PLAN_ESTIMATION_COMPLETE after a successful estimation
- Extended Plan domain model with cost_estimate_usd and estimation_report fields
- Extended LifecyclePlanModel DB model with a new estimation_report_json column
- Wired cost_estimate_usd and estimation_report_json through from_domain(), to_domain(), and update()
- Created Alembic migration m6_006_estimation_report_json to add the new column
- Added a Behave BDD feature file with 11 scenarios covering all acceptance criteria

Key design decisions
- The fallback chain is implemented in use_action() so the resolved actor is stored on the plan at creation time
- The estimation step runs in execute_plan() (Strategize-to-Execute transition), not in complete_strategize()
- Estimation failures are non-fatal (logged as warnings, never block Execute transition)
- The estimation_report field stores the full EstimationResult as a JSON dict for future use

ISSUES CLOSED: #651
2026-04-02 10:39:45 +00:00