Files
cleveragents-core/robot/actor_loading.robot
T
aditya e476d2de0e feat(actor): extend hierarchical actor YAML schema and loader
Extend actor YAML schema to support hierarchical graphs with explicit
node types (agent, tool, conditional, subgraph), per-node LSP bindings
(lsp_binding with server, languages, auto, capabilities), and tool-source
references (skills, mcp_servers, agent_skills).

Add schema validation for namespaced actor references, duplicate node IDs,
edge target existence, and graph reachability — all nodes must be reachable
from entry_node via explicit edges or conditional node routing targets.

Update loader to report YAML parse errors with precise line/column positions
and schema validation errors with dotted field paths and remediation hints
pointing to docs/reference/actor_config.md.

Add docs/reference/actor_config.md as the practical configuration reference
covering hierarchical graph examples, node type table, topology rules, and
common error cases with fix guidance.

Refresh examples/actors/graph_workflow.yaml to replace deprecated actor_path
with actor_ref. Add benchmarks/actor_yaml_bench.py for schema load overhead.

Tests: 95 Behave scenarios, 10 Robot smoke tests (including hierarchical
loader smoke test), security scan clean, coverage 99% (threshold 97%).

ISSUES CLOSED: #157
2026-02-25 10:30:42 +00:00

59 lines
2.9 KiB
Plaintext

*** Settings ***
Documentation Smoke tests for actor YAML loader and discovery
Resource ${CURDIR}/common.resource
Suite Setup Setup Test Environment
Suite Teardown Cleanup Test Environment
*** Variables ***
${HELPER} ${CURDIR}/helper_actor_loading.py
*** Test Cases ***
Discover Example Actors
[Documentation] Load all actors from examples/actors/ and verify count
${result}= Run Process ${PYTHON} ${HELPER} discover-examples cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} actor-count:
Discover Actors From Custom Directory
[Documentation] Discover actors from a temporary directory with a valid YAML
${tmp}= Set Variable ${TEMPDIR}${/}actor_loading_robot
Run Keyword And Ignore Error Remove Directory ${tmp} recursive=True
Create Directory ${tmp}
Create File ${tmp}${/}test.yaml name: local/robot-test\ntype: llm\ndescription: Robot test actor\nversion: "1.0"\nmodel: gpt-4\n
${result}= Run Process ${PYTHON} ${HELPER} discover ${tmp} cwd=${WORKSPACE}
Log ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} actor-loaded: local/robot-test
Should Contain ${result.stdout} actor-count: 1
Reject Invalid Actor YAML
[Documentation] Attempt to discover from a directory with invalid YAML and assert failure
${tmp}= Set Variable ${TEMPDIR}${/}actor_loading_invalid
Run Keyword And Ignore Error Remove Directory ${tmp} recursive=True
Create Directory ${tmp}
Create File ${tmp}${/}bad.yaml name: [\ninvalid yaml content\n
${result}= Run Process ${PYTHON} ${HELPER} discover-invalid ${tmp} cwd=${WORKSPACE}
Log ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} actor-loading-expected-fail
Default Namespace Applied
[Documentation] Verify that actors without namespace get local/ prefix
${result}= Run Process ${PYTHON} ${HELPER} namespace-default cwd=${WORKSPACE}
Log ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} namespace-default-ok: local/bare-name
Load Hierarchical Actor YAML Via Loader
[Documentation] Discover hierarchical_workflow.yaml via ActorLoader and verify graph properties
${result}= Run Process ${PYTHON} ${HELPER} discover-hierarchical cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} actor-loaded: workflows/dev-workflow
Should Contain ${result.stdout} actor-type: graph
Should Contain ${result.stdout} node-count: 3
Should Contain ${result.stdout} edge-count: 2