*** Settings ***
Documentation    Smoke tests for decision domain model persistence contract
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

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

*** Test Cases ***
Create Root Decision
    [Documentation]    Create a prompt_definition root decision
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    create_root    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    decision-create-root-ok

Create Child Decision
    [Documentation]    Create a strategy_choice child decision
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    create_child    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    decision-create-child-ok

Decision Type Enum Values
    [Documentation]    Verify all 11 decision type enum values
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    enum_values    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    decision-enums-ok

Context Snapshot
    [Documentation]    Create a decision with a populated context snapshot
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    context_snapshot    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    decision-snapshot-ok

Correction Metadata
    [Documentation]    Create a correction decision and verify metadata
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    correction    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    decision-correction-ok

Round Trip Serialization
    [Documentation]    Verify model_dump / model_validate round-trip
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    roundtrip    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    decision-roundtrip-ok

CLI Dict Output
    [Documentation]    Verify as_cli_dict produces expected keys
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    cli_dict    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    decision-cli-dict-ok
