@unit
Feature: plan correct passes decision tree and influence edges to CorrectionService
  The plan correct CLI handler must resolve DecisionService via the DI
  container, build the structural tree and influence DAG edges, and
  forward them to CorrectionService.analyze_impact() and
  CorrectionService.execute_correction() so that the BFS subtree
  traversal reports the full affected subtree—not just the single
  target decision.

  Fixes: https://git.cleverthis.com/cleveragents/cleveragents-core/issues/606

  Scenario: plan correct dry-run reports full affected subtree (not just target)
    Given pctw a plan with a three-level decision tree
    And pctw a CorrectionService that records analyze_impact arguments
    When pctw I invoke plan correct in dry-run mode
    Then pctw the dry-run output should list all three affected decisions
    And pctw analyze_impact received the decision_tree and influence_edges

  Scenario: plan correct execution reverts full affected subtree
    Given pctw a plan with a three-level decision tree
    And pctw a CorrectionService that records execute_correction arguments
    When pctw I invoke plan correct in execution mode
    Then pctw the execution output should show reverted decisions
    And pctw execute_correction received the decision_tree and influence_edges

  Scenario: plan correct with no children reports single decision
    Given pctw a plan with a single leaf decision
    And pctw a CorrectionService that records analyze_impact arguments
    When pctw I invoke plan correct in dry-run mode for a leaf
    Then pctw the dry-run output should list only the target decision
    And pctw analyze_impact received empty tree and edges
