forked from cleveragents/cleveragents-core
7235d46ade
Add Alembic migration m4_002_skill_flattened_tools to extend the skills table with five new columns: flattened_tools_json, includes_json, capability_summary_json, yaml_text, and flattening_hash (SHA-256). A defence-in-depth uniqueness constraint (uq_skills_name) is also added. Update SkillModel with the new column definitions and extend SkillRepository with update_flattened_tools(), get_flattened_tools(), needs_refresh(), recompute_flattening_hash(), and invalidate_cached_summaries() methods. The existing update() method now nulls all cached fields on mutation (hash-based invalidation). All new repository methods follow the session-factory pattern with @database_retry and flush-but-don-t-commit semantics. Structured logging via structlog records cache updates and invalidations. Database schema docs updated with the new skills table columns and a persistence-field-to-domain-model mapping table. Tests: - 6 Behave scenarios covering create, invalidation, hash staleness, refresh recomputation, uniqueness constraint, and namespace filtering - 2 Robot Framework smoke tests (round-trip and invalidation) - 3 ASV benchmarks (persist, refresh check, namespace list) ISSUES CLOSED: #166
26 lines
1.1 KiB
Plaintext
26 lines
1.1 KiB
Plaintext
*** 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
|