Feature: Correction Service Coverage R3
  Additional scenarios targeting remaining uncovered lines in
  correction_service.py:
    - Line 137: mode without .value attribute in event emission
    - Lines 245-247: oversized tree/DAG rejection in analyze_impact
    - Line 351: dry-run report restoring a pre-existing impact
    - Lines 1060-1063, 1065: sibling isolation violation in validate_subtree_isolation

  Background:
    Given a cscov3 fresh correction service

  # -------------------------------------------------------------------
  # Line 137 – _emit_correction_applied: mode without .value attribute
  # -------------------------------------------------------------------

  Scenario: Event emission falls back to str(mode) when mode has no .value attribute
    Given a cscov3 correction service with a working event bus
    And a cscov3 REVERT correction request for plan "plan-ev" targeting "dec-ev"
    And the cscov3 correction request mode is patched to a plain string "revert"
    When I cscov3 execute the revert correction
    Then the cscov3 event bus should have received 1 event
    And the cscov3 emitted event details mode should be "revert"

  # -------------------------------------------------------------------
  # Lines 245-247 – analyze_impact: oversized tree+DAG rejection
  # -------------------------------------------------------------------

  Scenario: analyze_impact rejects oversized decision tree
    Given a cscov3 revert correction for plan "plan-big" targeting "root-big"
    When I cscov3 analyze impact with a tree exceeding the max node limit
    Then a cscov3 ValidationError should have been raised
    And the cscov3 error message should contain "too large"

  Scenario: analyze_impact rejects oversized influence DAG
    Given a cscov3 revert correction for plan "plan-dag" targeting "root-dag"
    When I cscov3 analyze impact with a DAG exceeding the max node limit
    Then a cscov3 ValidationError should have been raised
    And the cscov3 error message should contain "too large"

  # -------------------------------------------------------------------
  # Line 351 – generate_dry_run_report: restoring pre-existing impact
  # -------------------------------------------------------------------

  Scenario: Dry-run report restores a pre-existing cached impact
    Given a cscov3 revert correction for plan "plan-dr" targeting "root-dr"
    And the cscov3 correction already has a cached impact with 2 affected decisions
    When I cscov3 generate a dry-run report with adjacency "root-dr->child1,child2,child3"
    Then the cscov3 dry-run report should have been generated
    And the cscov3 original cached impact should be restored with 2 affected decisions

  # -------------------------------------------------------------------
  # Lines 1060-1063, 1065 – validate_subtree_isolation: sibling violation
  # -------------------------------------------------------------------

  Scenario: Sibling isolation violation returns false
    Given a cscov3 tree where sibling is reachable from target
    When I cscov3 validate subtree isolation for target "target" on that tree
    Then the cscov3 isolation result should be false

  Scenario: No sibling isolation violation returns true
    Given a cscov3 tree where siblings are not reachable from target
    When I cscov3 validate subtree isolation for target "B" on that tree
    Then the cscov3 isolation result should be true
