*** Settings ***
Documentation    Smoke tests for Skill Registry flattened tool persistence
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

*** Variables ***
${HELPER}    ${CURDIR}/helper_skill_registry_persistence.py

*** Test Cases ***
Verify Skill Persistence Round Trip
    [Documentation]    Create a skill, persist flattened tools, and retrieve them
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    persist-round-trip    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    persist-round-trip-ok

Verify Skill Update Invalidation
    [Documentation]    Update a skill and verify cached fields are nulled
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    update-invalidation    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    update-invalidation-ok
