*** Settings ***
Library    Process
Library    String

*** Test Cases ***
TUI Persona Registry Initialization
    [Tags]    tdd_issue    tdd_issue_1928
    ${script}=    Catenate    SEPARATOR=\n
    ...    from cleveragents.tui.persona.registry import PersonaRegistry
    ...    registry = PersonaRegistry()
    ...    assert registry is not None, "PersonaRegistry should be initialized"
    ...    print("persona-registry-ok")
    ${result}=    Run Process    ${PYTHON}    -c    ${script}    shell=False
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    persona-registry-ok

TUI Persona Schema Validation
    [Tags]    tdd_issue    tdd_issue_1928
    ${script}=    Catenate    SEPARATOR=\n
    ...    from cleveragents.tui.persona.schema import Persona
    ...    persona = Persona(name="test", actor="local/test-actor", description="Test persona")
    ...    assert persona.name == "test", "Persona name should be set"
    ...    assert persona.actor == "local/test-actor", "Persona actor should be set"
    ...    print("persona-schema-ok")
    ${result}=    Run Process    ${PYTHON}    -c    ${script}    shell=False
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    persona-schema-ok

TUI Persona State Management
    [Tags]    tdd_issue    tdd_issue_1928
    ${script}=    Catenate    SEPARATOR=\n
    ...    from cleveragents.tui.persona.registry import PersonaRegistry
    ...    from cleveragents.tui.persona.state import PersonaState
    ...    registry = PersonaRegistry()
    ...    state = PersonaState(registry=registry)
    ...    assert state is not None, "PersonaState should be initialized"
    ...    assert state.registry is registry, "PersonaState registry should be the one passed in"
    ...    print("persona-state-ok")
    ${result}=    Run Process    ${PYTHON}    -c    ${script}    shell=False
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    persona-state-ok
