*** Settings ***
Documentation    Smoke tests for plan correct decision-tree wiring (issue #606)
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

*** Variables ***
${HELPER_SCRIPT}    robot/helper_plan_correct_tree_wiring.py

*** Test Cases ***
Plan Correct Dry Run Passes Tree To CorrectionService
    [Documentation]    Verify analyze_impact receives decision_tree and influence_edges
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    dry_run_tree    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    plan-correct-tree-wiring-dry-run-ok

Plan Correct Execution Passes Tree To CorrectionService
    [Documentation]    Verify execute_correction receives decision_tree and influence_edges
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    execute_tree    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    plan-correct-tree-wiring-execute-ok

Plan Correct Single Leaf Passes Empty Tree
    [Documentation]    Verify a leaf decision produces empty tree/edges
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    leaf_empty    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    plan-correct-tree-wiring-leaf-ok
