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
This commit is contained in:
@@ -134,8 +134,7 @@ route:
|
||||
type: subgraph
|
||||
name: Code Reviewer
|
||||
description: Runs code review workflow
|
||||
config:
|
||||
actor_path: examples/actors/simple_llm.yaml
|
||||
actor_ref: local/code-reviewer
|
||||
|
||||
# Escalate if tests keep failing
|
||||
- id: escalate
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
# Hierarchical Actor - Multi-Agent Development Workflow
|
||||
# Demonstrates LSP bindings, tool-source references, subgraph nodes,
|
||||
# and skills integration in a graph actor.
|
||||
|
||||
name: workflows/dev-workflow
|
||||
type: graph
|
||||
description: >-
|
||||
Multi-agent development workflow with a strategist, implementer, and
|
||||
reviewer. Each node has fine-grained LSP and tool-source control.
|
||||
version: "1.0"
|
||||
model: gpt-4
|
||||
|
||||
# Actor-level skill references
|
||||
skills:
|
||||
- local/file-ops
|
||||
- local/git-ops
|
||||
|
||||
# Actor-level LSP binding (default for all nodes)
|
||||
lsp:
|
||||
- local/pyright
|
||||
lsp_capabilities:
|
||||
- diagnostics
|
||||
- hover
|
||||
- definitions
|
||||
- references
|
||||
lsp_context_enrichment:
|
||||
diagnostics: true
|
||||
type_annotations: false
|
||||
max_diagnostics_per_file: 50
|
||||
|
||||
route:
|
||||
nodes:
|
||||
- id: strategist
|
||||
type: agent
|
||||
name: Strategy Planner
|
||||
description: Plans the implementation strategy using read-only LSP
|
||||
config:
|
||||
model: gpt-4
|
||||
prompt: |
|
||||
Plan the implementation strategy. Use LSP diagnostics to assess
|
||||
codebase health before proposing changes.
|
||||
lsp_binding:
|
||||
server: local/pyright
|
||||
languages:
|
||||
- python
|
||||
capabilities:
|
||||
- diagnostics
|
||||
- hover
|
||||
tool_sources:
|
||||
- type: skill
|
||||
name: local/file-ops
|
||||
|
||||
- id: implementer
|
||||
type: agent
|
||||
name: Code Implementer
|
||||
description: Implements code changes with full LSP and tools
|
||||
config:
|
||||
model: gpt-4
|
||||
prompt: |
|
||||
Implement the changes as planned. Use full LSP capabilities
|
||||
for navigation and refactoring.
|
||||
lsp_binding:
|
||||
auto: true
|
||||
tool_sources:
|
||||
- type: skill
|
||||
name: local/file-ops
|
||||
- type: skill
|
||||
name: local/git-ops
|
||||
- type: mcp
|
||||
name: local/filesystem
|
||||
|
||||
- id: reviewer
|
||||
type: subgraph
|
||||
name: Code Review
|
||||
description: Delegates to the code-reviewer actor for review
|
||||
actor_ref: local/code-reviewer
|
||||
|
||||
edges:
|
||||
- from_node: strategist
|
||||
to_node: implementer
|
||||
- from_node: implementer
|
||||
to_node: reviewer
|
||||
|
||||
entry_node: strategist
|
||||
exit_nodes:
|
||||
- reviewer
|
||||
|
||||
context_view: strategist
|
||||
memory:
|
||||
enabled: true
|
||||
max_messages: 50
|
||||
max_tokens: 16000
|
||||
summarize_old: true
|
||||
|
||||
context:
|
||||
include_dirs:
|
||||
- src/
|
||||
- tests/
|
||||
exclude_patterns:
|
||||
- "**/__pycache__/**"
|
||||
- "*.pyc"
|
||||
max_context_tokens: 32000
|
||||
Reference in New Issue
Block a user