feature/m3-actor-schema-examples #93

Merged
brent.edwards merged 14 commits from feature/m3-actor-schema-examples into master 2026-02-17 22:31:33 +00:00
Member
No description provided.
Add three fundamental enums for actor YAML schema validation:
- ActorType: LLM, TOOL, GRAPH execution models
- NodeType: AGENT, TOOL, CONDITIONAL, SUBGRAPH node types
- ContextView: STRATEGIST, EXECUTOR, REVIEWER, FULL context filtering

Part 1 of C1.schema implementation (Actor YAML Schema Models).
Add base configuration models for actor YAML schema:

Tool Models:
- ToolParameter: parameter definitions for inline tools
- ToolDefinition: complete inline tool with Python code

Configuration Models:
- MemoryConfig: conversation history and memory settings
- ContextConfigSchema: file inclusion and context window config

All models include comprehensive validation:
- Parameter name validation (valid Python identifiers)
- Tool name validation (namespace/name format)
- Field validators using Pydantic v2 patterns

Part 2 of C1.schema implementation (Actor YAML Schema Models).
Add graph workflow models for ActorType.GRAPH:

Graph Models:
- EdgeDefinition: connections between nodes with conditional routing
- NodeDefinition: node specifications (agent, tool, conditional, subgraph)
- RouteDefinition: complete graph topology with validation

Validation Features:
- Unique node ID validation
- Reference validation for all edges and entry/exit points
- Cycle detection using DFS algorithm
- Node ID format validation (alphanumeric with underscores/hyphens)

Part 3 of C1.schema implementation (Actor YAML Schema Models).
Add complete actor configuration schema:

Main Schema:
- ActorConfigSchema: top-level model bringing all components together
- Type-specific field requirements (LLM, TOOL, GRAPH)
- Model validator for cross-field validation
- Environment variable mappings

YAML I/O Methods:
- from_yaml_file(): load and validate from YAML
- to_yaml_file(): save configuration to YAML
- Proper error handling (FileNotFoundError, YAMLError, ValidationError)

Validation Logic:
- LLM actors require 'model' field
- TOOL actors require at least one tool
- GRAPH actors require 'model' and 'route' with cycle detection
- Namespaced name validation (namespace/name format)

Part 4 of C1.schema implementation (Actor YAML Schema Models).
Add 5 example actor configurations demonstrating all actor types:

Simple Examples:
- simple_llm.yaml: Basic LLM actor with code review prompt
- llm_with_tools.yaml: LLM with mix of tool references and inline tools
- tool_collection.yaml: Tool-only actor (no LLM)

Graph Examples:
- simple_graph.yaml: 3-node linear workflow (extract → analyze → summarize)
- graph_workflow.yaml: Complex TDD workflow with 10 nodes
  * Conditional routing based on test results
  * Retry logic with max attempts
  * Subgraph composition (code review)
  * Error escalation paths

Each example demonstrates:
- Proper namespaced naming (namespace/name)
- Type-specific configurations
- Context and memory settings
- Environment variable usage
- Tool definitions (inline and references)

Part 5 of C1.schema implementation (Actor YAML Schema Models).
Add complete reference documentation for actor YAML schema:

Documentation Sections:
- Actor types overview (LLM, TOOL, GRAPH)
- Complete field definitions for all models
- Tool node semantics (references vs inline definitions)
- Graph constraints and topology rules
- Comprehensive validation rules with examples
- Error messages with causes and fixes

Field Definitions:
- Top-level actor fields (name, type, model, etc.)
- ToolParameter and ToolDefinition fields
- MemoryConfig and ContextConfigSchema fields
- ContextView enum (strategist, executor, reviewer, full)

Graph Documentation:
- Node types (AGENT, TOOL, CONDITIONAL, SUBGRAPH)
- Edge definition and conditional routing
- RouteDefinition structure
- Cycle detection explanation

Validation Rules:
1. Unique node IDs
2. Entry node existence
3. Exit nodes existence
4. Edge reference validity
5. Acyclic graph requirement
6. Node reachability

Examples:
- Simple LLM actor
- LLM with inline tools
- Simple graph workflow
- Complex graph with conditionals
- Error examples with fixes

Part 6 of C1.schema implementation (Actor YAML Schema Models).
Add 50+ Behave test scenarios covering all validation rules:

Valid Scenarios (20):
- LLM actors (minimal, with prompt, tools, memory, context)
- TOOL actors (minimal, inline definitions)
- GRAPH actors (linear, conditional, subgraphs)
- All example YAML files (simple_llm, llm_with_tools, etc.)
- Context views (strategist, executor, reviewer, full)
- Memory configurations
- Environment variables

Invalid Name Scenarios (4):
- Missing namespace
- Multiple slashes
- Empty namespace
- Empty name

Invalid LLM/TOOL/GRAPH Scenarios (7):
- LLM without model
- TOOL without tools
- TOOL with empty tools list
- GRAPH without model
- GRAPH without route

Graph Topology Validation (6):
- Duplicate node IDs
- Invalid entry node
- Invalid exit nodes
- Invalid edge references (from_node, to_node)
- Cyclic graphs

Tool/Node Validation (3):
- Inline tool without namespace
- Invalid parameter names
- Invalid node ID formats

Additional Scenarios (10):
- YAML I/O (save/reload, missing files)
- Edge priorities
- Memory configurations (disabled, limits, summarization)

Part 7 of C1.schema implementation (Actor YAML Schema Models).
Add step definitions for 50+ test scenarios:

- Given steps: YAML templates for LLM/TOOL/GRAPH actors and invalid configs
- When steps: Schema validation from string/file and YAML I/O
- Then steps: Assertions for validation, fields, collections, and errors
- Test data: Minimal and complex configurations for all scenarios
- Full coverage: All actor types, graph topologies, and error cases

Part 8 of C1.schema implementation (Actor YAML Schema Models).
Add Robot Framework smoke tests for actor schema validation:

- Valid actor tests: All 5 example YAMLs (LLM, tool, graph actors)
- Invalid name tests: Missing namespace validation
- Invalid LLM tests: Missing model field validation
- Invalid TOOL tests: Missing tools field validation
- Invalid GRAPH tests: Missing route and duplicate node IDs
- Helper script: CLI interface for schema validation from Robot

Part 9 of C1.schema implementation (Actor YAML Schema Models).
Add performance benchmarks for actor schema operations:

- Minimal/full LLM actor parsing benchmarks
- Tool actor validation benchmarks
- Simple/complex graph topology validation (cycle detection)
- File I/O operations (load/save YAML)
- Serialization benchmarks (model_dump)

Part 10 of C1.schema implementation (Actor YAML Schema Models).
Add comprehensive documentation for C1.schema task:

- Notes section in Implementation Checklist with design decisions
- Development Log entry with full implementation summary
- Traceability for all deliverables (code, docs, tests, benchmarks)
- Quality metrics and next steps documented
- Complete file/line number references for all artifacts

Part 11 (final) of C1.schema implementation (Actor YAML Schema Models).
fix(actor): fix actor schema validation and tests
Some checks failed
CI / lint (pull_request) Failing after 24s
CI / typecheck (pull_request) Successful in 1m0s
CI / coverage (pull_request) Has been skipped
CI / security (pull_request) Successful in 48s
CI / quality (pull_request) Successful in 17s
CI / integration_tests (pull_request) Successful in 5m14s
CI / build (pull_request) Successful in 15s
CI / unit_tests (pull_request) Successful in 28m20s
CI / docker (pull_request) Has been skipped
6a84132078
Fix issues identified during test execution:

- Improve name validation to reject multiple slashes and empty parts
- Fix conditional routing YAML to include all exit nodes
- Fix QuotedString parse type to standard quoted format
- Fix line length in error message (split across lines)
- All 47 Behave scenarios pass (0 failures)
- All Robot Framework integration tests pass (283 passed, 3 skipped)
- All ASV benchmarks execute successfully

Part 12 (bugfix) of C1.schema implementation.
Merge branch 'master' into feature/m3-actor-schema-examples
Some checks failed
CI / lint (pull_request) Successful in 16s
CI / typecheck (pull_request) Successful in 28s
CI / security (pull_request) Successful in 39s
CI / quality (pull_request) Successful in 15s
CI / build (pull_request) Successful in 14s
CI / unit_tests (pull_request) Has been cancelled
CI / integration_tests (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / coverage (pull_request) Has been cancelled
bc5fa83d06
Merge branch 'master' into feature/m3-actor-schema-examples
All checks were successful
CI / lint (pull_request) Successful in 25s
CI / typecheck (pull_request) Successful in 1m1s
CI / security (pull_request) Successful in 49s
CI / quality (pull_request) Successful in 32s
CI / build (pull_request) Successful in 16s
CI / integration_tests (pull_request) Successful in 5m9s
CI / unit_tests (pull_request) Successful in 33m0s
CI / coverage (pull_request) Successful in 13m18s
CI / docker (pull_request) Successful in 58s
b9984cac57
brent.edwards deleted branch feature/m3-actor-schema-examples 2026-02-17 22:31:34 +00:00
freemo added this to the v3.1.0 milestone 2026-02-23 17:25:44 +00:00
Owner

Closes #293

Closes #293
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core!93
No description provided.