The production fix in plan.py now resolves DecisionService via the DI
container to build the structural tree and influence edges. The Behave
step definitions were updated but three Robot Framework helper scripts
were missed, causing 7 test failures (exit code 1) because get_container
was called without a mock.
- helper_m4_correction_subplan_smoke: add get_container mock to
correction_revert, correction_append, correction_dry_run, full_flow
- helper_m3_decision_validation_smoke: add get_container mock to
plan_correct_dry_run
- helper_m3_e2e_verification: add get_container mock and update
analyze_impact/execute_correction assertions to include the new
decision_tree and influence_edges keyword arguments
Resolve DecisionService via the DI container in correct_decision() to
build the structural tree (parent → children adjacency list) and fetch
influence DAG edges, then forward both to CorrectionService.analyze_impact()
and CorrectionService.execute_correction(). Previously these methods
received None for both arguments, causing _compute_affected_subtree() BFS
to return only the single target decision instead of the full affected
subtree.
Changes:
- src/cleveragents/cli/commands/plan.py: Added DI container resolution of
DecisionService, structural tree construction from list_decisions(), and
influence edge retrieval via get_influence_edges(). Both are passed as
keyword arguments to analyze_impact() and execute_correction().
- features/plan_correct_tree_wiring.feature: 3 BDD scenarios verifying
tree/edge forwarding for dry-run, execution, and leaf-node cases.
- features/steps/plan_correct_tree_wiring_steps.py: Step definitions with
mock container and argument-capturing CorrectionService.
- robot/plan_correct_tree_wiring.robot: Integration smoke tests.
- robot/helper_plan_correct_tree_wiring.py: Robot helper exercising CLI
via CliRunner with mock patches.
- benchmarks/plan_correct_tree_wiring_bench.py: ASV benchmarks for tree
building and analyze_impact overhead.
- Updated existing test steps (m3, m4, pec, uncov-rgn) to mock the DI
container so existing correction scenarios continue to pass.
ISSUES CLOSED: #606