freemo
61fc70d84b
fix(cli): pass decision tree and influence edges to CorrectionService in plan correct handler ( #639 )
...
## Summary
Fixes the `plan correct` CLI handler which never passes the decision tree or influence edges to `CorrectionService`, producing single-node impact analysis regardless of the plan's actual decision structure.
Closes #606
## Root Cause
The `correct_decision()` handler in `plan.py` created a bare `CorrectionService()` and called `analyze_impact()` and `execute_correction()` without passing `decision_tree` or `influence_edges`. Both parameters default to `None` -> empty dicts, causing `_compute_affected_subtree()` BFS to return only the single target decision, ignoring all descendants and influence-DAG dependents.
## Changes
### Production Fix (`src/cleveragents/cli/commands/plan.py`)
- Resolve `DecisionService` via `get_container()` (following the pattern used by `plan explain` and `plan tree`)
- Build structural tree adjacency list from `decision_svc.list_decisions(plan_id)` using `parent_decision_id` relationships
- Fetch influence edges from `decision_svc.get_influence_edges(plan_id)`
- Pass both `decision_tree` and `influence_edges` to `svc.analyze_impact()` and `svc.execute_correction()`
### Existing Test Fixups
- Updated 4 step definition files that mock `CorrectionService` to also mock the new `DecisionService` resolution path
### New Tests
- **Behave BDD**: 3 scenarios verifying tree/edge forwarding (dry-run subtree, execution subtree, leaf node)
- **Robot Framework**: 3 integration smoke tests
- **ASV Benchmark**: Tree building and analyze_impact overhead benchmarks
## Quality Gates
- `nox -s lint` — PASSED
- `nox -s typecheck` — 0 errors
- `nox -s unit_tests` — 9,109 scenarios, 0 failures
- `nox -s coverage_report` — 97%
ISSUES CLOSED : #606
Reviewed-on: cleveragents/cleveragents-core#639
Co-authored-by: Jeffrey Phillips Freeman <jeffrey.freeman@cleverthis.com >
Co-committed-by: Jeffrey Phillips Freeman <jeffrey.freeman@cleverthis.com >
2026-03-08 23:28:05 +00:00
..
2026-03-02 22:05:53 +00:00
2026-03-06 18:16:47 +00:00
2026-03-08 23:28:05 +00:00
2026-03-03 03:29:31 +00:00
2026-03-05 15:13:19 +00:00
2026-03-05 10:27:36 -05:00
2026-03-07 14:53:18 +00:00
2026-03-05 01:28:50 +00:00
2026-03-02 22:45:55 -05:00
2026-02-14 12:16:39 -05:00
2026-02-14 12:16:39 -05:00
2026-02-14 12:16:39 -05:00
2026-02-14 12:16:39 -05:00
2026-02-17 20:25:12 +00:00
2026-02-13 09:41:28 -05:00
2026-02-12 20:19:42 +00:00
2026-02-08 11:33:30 -05:00
2026-02-24 19:12:01 +00:00
2026-02-12 22:58:15 -05:00
2026-03-02 08:17:21 +00:00
2026-02-20 20:24:10 +00:00
2026-02-12 22:01:51 +00:00
2026-02-08 11:33:30 -05:00
2026-02-25 10:30:42 +00:00
2026-02-26 09:10:35 +00:00
2026-02-25 10:01:57 +00:00
2026-02-12 20:19:42 +00:00
2026-03-04 23:47:20 +00:00
2025-12-22 11:18:57 -05:00
2025-12-23 20:57:14 -05:00
2026-02-12 20:19:42 +00:00
2026-02-20 08:50:06 -05:00
2026-02-20 15:57:21 +00:00
2026-02-28 22:06:57 +00:00
2026-03-01 03:09:51 +00:00
2026-02-26 02:47:14 +00:00
2026-02-27 13:47:42 -05:00
2026-03-01 03:09:51 +00:00
2026-03-02 10:18:14 +00:00
2026-02-12 22:01:51 +00:00
2026-02-22 00:43:08 -05:00
2026-02-22 00:43:08 -05:00
2026-03-03 14:55:58 -05:00
2026-02-16 23:50:59 -05:00
2026-02-24 20:11:42 +00:00
2026-03-07 19:36:09 +00:00
2026-02-20 15:57:21 +00:00
2026-02-19 22:44:34 +00:00
2026-02-22 00:43:08 -05:00
2026-02-14 13:51:12 -05:00
2025-12-23 17:12:16 -05:00
2026-03-02 02:01:27 +00:00
2026-01-17 12:54:03 -05:00
2026-02-18 12:18:03 +00:00
2026-03-07 11:49:14 -05:00
2026-02-25 10:48:05 -05:00
2026-03-01 04:38:30 +00:00
2026-03-01 04:38:30 +00:00
2026-03-01 04:38:30 +00:00
2026-03-02 15:05:20 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 17:44:18 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-02-12 22:58:15 -05:00
2026-02-12 22:01:51 +00:00
2026-03-03 23:36:15 +00:00
2026-03-05 14:11:23 +00:00
2026-02-12 22:58:15 -05:00
2026-02-12 22:01:51 +00:00
2026-03-05 12:58:57 +00:00
2026-03-05 22:00:15 +00:00
2026-03-03 17:01:57 +00:00
2026-02-08 11:33:30 -05:00
2026-02-24 12:19:04 -05:00
2026-02-25 12:08:01 -05:00
2026-02-16 16:46:54 -05:00
2025-12-23 17:12:16 -05:00
2026-02-13 18:54:15 +00:00
2026-03-04 21:20:47 +00:00
2026-03-02 14:32:31 +00:00
2026-02-16 21:35:54 +00:00
2026-02-13 20:34:57 +00:00
2026-02-24 12:19:04 -05:00
2026-02-22 15:29:41 -05:00
2026-02-22 00:43:08 -05:00
2026-02-27 02:33:42 +00:00
2026-02-26 16:13:44 +00:00
2026-03-03 12:53:28 +00:00
2026-03-03 12:53:28 +00:00
2026-03-06 23:14:30 +00:00
2026-03-02 22:09:37 -05:00
2026-03-06 20:07:03 +00:00
2026-03-06 20:07:03 +00:00
2026-02-13 20:34:57 +00:00
2026-03-05 01:28:50 +00:00
2026-02-25 10:05:10 +00:00
2026-02-25 10:07:09 +00:00
2026-03-02 11:54:53 +00:00
2026-03-03 14:48:55 -05:00
2026-02-19 13:46:48 +00:00
2026-02-21 16:30:33 +00:00
2026-02-16 21:35:54 +00:00
2026-02-14 04:01:20 +00:00
2026-03-04 15:36:34 +00:00
2026-02-22 15:29:41 -05:00
2026-03-04 20:26:42 +00:00
2026-03-03 21:44:20 +00:00
2026-02-17 00:38:33 +00:00
2026-03-03 17:04:17 -05:00
2026-02-27 13:47:42 -05:00
2026-02-22 15:29:41 -05:00
2026-03-06 18:16:47 +00:00
2026-02-25 04:50:43 +00:00
2026-02-25 22:09:26 +00:00
2026-02-26 02:01:47 +00:00
2026-03-03 23:36:15 +00:00
2026-02-25 13:17:26 +00:00
2026-02-25 19:38:43 -05:00
2026-02-25 19:38:43 -05:00
2026-02-25 19:38:43 -05:00
2026-03-03 14:55:58 -05:00
2026-02-21 10:23:33 -05:00
2026-02-28 20:21:18 +00:00
2026-02-20 00:28:15 +00:00
2026-02-23 10:45:01 +00:00
2026-02-21 10:18:26 -05:00
2026-03-01 03:09:51 +00:00
2026-02-24 12:19:04 -05:00
2026-02-25 19:38:43 -05:00
2026-02-16 21:35:54 +00:00
2026-02-27 13:47:42 -05:00
2026-02-14 13:42:02 -05:00
2026-02-12 22:58:15 -05:00
2026-03-01 03:09:51 +00:00
2026-03-02 02:01:27 +00:00
2026-02-22 15:29:41 -05:00
2026-02-08 11:33:30 -05:00
2026-03-08 23:28:05 +00:00
2026-02-22 00:43:08 -05:00
2026-02-21 10:23:33 -05:00
2026-02-27 13:47:42 -05:00
2026-03-01 03:09:51 +00:00
2026-02-22 15:29:41 -05:00
2026-03-03 12:10:25 +00:00
2026-03-03 12:10:25 +00:00
2026-02-12 20:19:42 +00:00
2026-02-20 15:57:21 +00:00
2026-03-01 03:09:51 +00:00
2026-02-25 19:38:43 -05:00
2026-02-17 00:37:53 +00:00
2026-02-25 14:00:04 -05:00
2026-02-15 00:12:07 -05:00
2026-03-02 02:01:27 +00:00
2026-02-15 06:16:19 +00:00
2026-03-08 22:31:40 +00:00
2026-02-15 08:29:31 +00:00
2026-02-25 14:00:04 -05:00
2026-01-14 17:35:09 -05:00
2026-03-02 02:01:27 +00:00
2026-03-02 08:17:21 +00:00
2026-03-06 20:07:03 +00:00
2026-02-17 16:40:18 +00:00
2026-02-18 03:27:00 +00:00
2026-02-16 23:56:55 -05:00
2026-02-17 14:40:16 +00:00
2026-03-03 23:36:15 +00:00
2026-02-16 16:46:54 -05:00
2026-02-15 11:04:18 -05:00
2026-03-08 22:19:40 +00:00
2026-02-27 09:47:10 -05:00
2026-02-08 11:33:30 -05:00
2026-02-24 12:19:04 -05:00
2026-02-23 03:11:12 +00:00
2026-02-17 00:37:53 +00:00
2026-02-27 13:47:42 -05:00
2026-02-17 22:59:16 -05:00
2026-03-01 03:09:51 +00:00
2026-02-22 00:43:08 -05:00
2026-02-18 03:27:00 +00:00
2026-02-18 00:10:15 +00:00
2026-02-18 03:27:00 +00:00
2026-02-16 16:46:54 -05:00
2026-02-20 08:48:33 -05:00
2026-03-07 19:36:09 +00:00
2026-02-18 03:27:00 +00:00
2026-02-16 16:46:54 -05:00
2026-02-18 03:27:00 +00:00
2026-02-17 21:07:54 +00:00
2026-02-16 21:35:54 +00:00
2026-03-07 19:36:09 +00:00
2026-03-07 19:36:09 +00:00
2026-02-18 03:27:00 +00:00
2026-02-18 03:27:00 +00:00
2026-03-03 22:21:14 +00:00
2026-03-03 22:21:14 +00:00
2026-03-04 15:59:15 +00:00
2026-02-12 20:19:42 +00:00
2026-02-12 20:19:42 +00:00
2026-03-06 00:49:33 +00:00
2026-02-26 14:30:43 +00:00
2026-02-19 20:10:56 +00:00
2026-02-13 19:24:24 +00:00
2026-02-25 10:06:59 +00:00
2026-03-04 12:18:51 -05:00
2026-03-02 22:05:53 +00:00
2026-02-28 17:46:54 +00:00
2026-03-02 09:47:40 -05:00
2026-02-22 00:43:08 -05:00
2026-02-20 01:10:19 +00:00
2026-02-18 00:10:15 +00:00
2026-03-05 21:38:55 +00:00
2026-03-08 02:57:44 +00:00
2026-02-25 19:38:43 -05:00
2026-02-27 13:47:42 -05:00
2026-02-24 12:19:04 -05:00
2026-02-26 10:57:07 +00:00
2026-02-21 10:23:33 -05:00
2026-02-20 08:50:08 -05:00
2026-03-02 14:56:13 +00:00
2026-02-27 20:09:26 +00:00
2026-02-21 16:30:40 +00:00
2026-02-21 16:30:40 +00:00
2026-02-16 19:52:47 +05:30
2026-02-21 10:23:33 -05:00
2026-03-01 09:07:06 +00:00
2026-03-02 09:41:25 -05:00
2026-03-08 22:11:49 +00:00
2026-02-14 14:03:28 -05:00
2026-02-20 08:49:30 -05:00
2026-02-22 00:43:08 -05:00
2026-02-20 08:49:30 -05:00
2026-02-14 18:55:48 +00:00
2026-02-17 20:28:20 +00:00
2026-02-21 10:23:33 -05:00
2026-03-04 18:21:19 +00:00
2026-03-05 19:20:39 +00:00
2026-03-06 23:14:30 +00:00
2026-03-06 23:14:30 +00:00
2026-03-05 21:38:55 +00:00
2026-02-15 09:04:17 +00:00
2026-02-22 00:43:08 -05:00
2026-02-25 10:03:57 +00:00
2026-02-12 20:19:42 +00:00
2026-02-12 22:58:15 -05:00