Commit Graph

396 Commits

Author SHA1 Message Date
brent.edwards 11c246b7c0 feat: merge branch 'master' into feature/m1-cli-tests 2026-02-18 00:57:00 +00:00
brent.edwards 60d10cef7c Merge branch 'master' into feature/m1-cli-tests 2026-02-18 00:42:19 +00:00
freemo 740e08b2a4 Docs: Updated ADRs and specification to include details about standards 2026-02-17 19:31:27 -05:00
brent.edwards 9db88a9541 fix(test): commit edge row so delete step sees it in its own session
The "Deleting a resource with edges is rejected" scenario was failing
because the ResourceEdgeModel row was flushed but never committed.
Since ResourceRepository.delete() obtains its own session from the
factory, the uncommitted edge was invisible and ResourceHasEdgesError
was never raised.
2026-02-17 23:38:45 +00:00
brent.edwards 08c911a41d Merge pull request 'feature/m3-actor-schema-examples' (#93) from feature/m3-actor-schema-examples into master
Reviewed-on: cleveragents/cleveragents-core#93
2026-02-17 22:31:32 +00:00
brent.edwards b9984cac57 Merge branch 'master' into feature/m3-actor-schema-examples 2026-02-17 12:58:19 -08:00
brent.edwards 8386ce0f76 Merge pull request 'feat(tool): add tool registry persistence' (#80) from feature/m3-tool-registry into master
Reviewed-on: cleveragents/cleveragents-core#80
2026-02-17 20:50:32 +00:00
brent.edwards bc5fa83d06 Merge branch 'master' into feature/m3-actor-schema-examples 2026-02-17 12:41:17 -08:00
CoreRasurae 798db9088e feat(tool): add tool registry persistence 2026-02-17 20:28:20 +00:00
brent.edwards b8d2bfe252 test(cli): expand lifecycle command coverage 2026-02-17 20:01:18 +00:00
brent.edwards 767d9d0f82 Merge pull request 'test(cov): Fix coverage test failures' (#94) from fix/behave_tests_coverage into master
Reviewed-on: cleveragents/cleveragents-core#94
2026-02-17 19:04:45 +00:00
brent.edwards 7538add6bb fix: merge with master to fix lint 2026-02-17 18:45:55 +00:00
CoreRasurae ef905baff6 test(cov): Fix coverage test failures 2026-02-17 16:40:18 +00:00
brent.edwards 1f8760f94a Merge pull request 'fix(test): correct project list scenario that expected abort on empty db' (#90) from fix/project-list-test into master
Reviewed-on: cleveragents/cleveragents-core#90
2026-02-17 16:04:05 +00:00
khyari hamza 46f697bd95 fix(test): add temp directory and DB bootstrap to project list scenario
The 'Test project list command with no projects' scenario was missing a
Given step to set up a writable working directory. Without it, the
container fell back to CWD/.cleveragents/db.sqlite which could not be
opened (directory did not exist), causing sqlite3.OperationalError.

- Add 'Given I have a temporary working directory' to the scenario
- Bootstrap the SQLite schema in the When step so the ns_projects table
  exists for the empty-list query
2026-02-17 14:40:16 +00:00
aditya 6a84132078 fix(actor): fix actor schema validation and tests
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.
2026-02-17 14:31:11 +00:00
aditya a5a134826e docs(actor): add C1.schema implementation notes and development log
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).
2026-02-17 14:09:53 +00:00
khyari hamza 4ba714c389 style: shorten docstring markdown tables to satisfy E501 (88 cols) 2026-02-17 14:04:24 +00:00
aditya 419168fd95 perf(actor): add ASV benchmarks for actor schema
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).
2026-02-17 13:54:27 +00:00
aditya 1f05648b2a test(actor): add Robot Framework integration tests for actor schema
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).
2026-02-17 13:46:04 +00:00
aditya 1049634d0d test(actor): add Behave step definitions for actor schema
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).
2026-02-17 13:43:07 +00:00
aditya 9ca1ceea49 test(actor): add comprehensive Behave scenarios for actor schema
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).
2026-02-17 13:34:48 +00:00
aditya 411bc3325f docs(actor): add comprehensive actor schema reference documentation
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).
2026-02-17 13:26:15 +00:00
khyari hamza 4d63b5af7e fix(test): correct project list scenario that expected abort on empty db
The 'Test project list command with no database' scenario asserted the
command should abort, but the DI container creates a default SQLite DB
so list_projects() returns an empty list and exits 0 with 'No projects
found'.  Update the scenario to match the actual (correct) behavior.
2026-02-17 13:19:06 +00:00
aditya 41f90afaf9 docs(actor): add comprehensive actor YAML examples
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).
2026-02-17 12:52:07 +00:00
aditya aaad293b6d feat(actor): add main ActorConfigSchema and YAML I/O
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).
2026-02-17 12:40:07 +00:00
aditya a39dd1115d feat(actor): add graph topology models (nodes, edges, routes)
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).
2026-02-17 12:35:44 +00:00
aditya 40190e0f2b feat(actor): add tool and config Pydantic 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).
2026-02-17 12:30:21 +00:00
aditya b01178e214 feat(actor): add core enums (ActorType, NodeType, ContextView)
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).
2026-02-17 12:19:39 +00:00
freemo 43b231b33b Docs: Fixed some missing check-off marks on todo items 2026-02-17 00:08:44 -05:00
Jeffrey Phillips Freeman 4dc05051dd feat(cli): add project commands (core) 2026-02-16 23:56:55 -05:00
Jeffrey Phillips Freeman 827c241baa feat(service): wire resource registry and project services 2026-02-16 23:53:50 -05:00
Jeffrey Phillips Freeman 0c6ed1c709 feat(repo): add project repositories 2026-02-16 23:50:59 -05:00
Jeffrey Phillips Freeman 96ceedbef4 Docs: Cleaned up ADR home page with better descriptions of content 2026-02-16 23:49:18 -05:00
Jeffrey Phillips Freeman ee5f0376d7 Replaced hand written Reference section with one generated from docstrings 2026-02-16 23:40:33 -05:00
brent.edwards 002eafd6f7 Merge pull request 'feat(qa): enforce coverage >=97% in CI' (#50) from feature/q0-min-coverage into master
Reviewed-on: cleveragents/cleveragents-core#50
2026-02-17 04:01:09 +00:00
Jeffrey Phillips Freeman 339b7de700 Docs: Added ADRs and improved TOC handling 2026-02-16 22:11:01 -05:00
brent.edwards 6f7ab08e12 Merge branch 'master' into feature/q0-min-coverage
# Conflicts:
#	benchmarks/cli_format_bench.py
#	benchmarks/plan_phase_migration_bench.py
#	benchmarks/project_migration_bench.py
#	benchmarks/resource_registry_migration_bench.py
#	benchmarks/uow_lifecycle_bench.py
2026-02-17 02:35:20 +00:00
brent.edwards 2f681b74ca docs(implementation_plan.md): Added what was accomplished 2026-02-17 02:27:59 +00:00
brent.edwards 122af46305 fix(tests): resolve unit test and benchmark failures
- Fix project_repository_steps session mismatch: use shared session
  for repos so context.pr_session.commit() commits flushed data
- Fix cli_format_bench setup/teardown to accept fmt parameter for
  parameterized ASV benchmarks
- Fix plan_model_bench PlanPhase.APPLIED -> PlanPhase.APPLY
- Fix benchmark idempotency: use batch counters to generate unique IDs
  across repeated ASV iterations (plan_phase_migration_bench,
  project_migration_bench, resource_registry_migration_bench)
- Fix uow_lifecycle_bench FK constraint by reusing pre-seeded action
- Fix plan_lifecycle_persistence_bench to create fresh plan per iteration
2026-02-17 02:24:35 +00:00
brent.edwards 7ddd99b07d chore(merge): integrate master into feature/q0-min-coverage
Resolve three merge conflicts from master integration:

- benchmarks/coverage_report_bench.py: remove duplicate PYPROJECT_PATH
  constant (already defined below the conflict region)
- noxfile.py: combine HEAD's os.makedirs('build') guard with master's
  resolved PYTHONPATH (Path('src').resolve())
- implementation_plan.md: take master for completed Q0-min-ci block,
  preserve HEAD's in-progress Q0-min-coverage state, adopt master's
  Q0-Advanced consolidation (no standalone commits)
2026-02-17 00:56:43 +00:00
brent.edwards 5254708146 Merge branch 'master' into fix/benchmark-tests 2026-02-17 00:41:16 +00:00
Jeffrey Phillips Freeman 1fb91cba28 refactor(plan): remove legacy plan persistence 2026-02-17 00:38:33 +00:00
Jeffrey Phillips Freeman 44533444ed feat(service): persist plan lifecycle via repositories 2026-02-17 00:38:33 +00:00
Jeffrey Phillips Freeman d0f265ef62 feat(service): persist plan lifecycle via repositories 2026-02-17 00:37:53 +00:00
freemo ea76990bb6 Docs: Fixed some bugs int he ToC's javascript 2026-02-16 19:26:49 -05:00
freemo 155a5d7819 Docs: Updated ADRs and referenced them from the specification 2026-02-16 18:53:06 -05:00
CoreRasurae 946933139c fix(bench): Benchmark tests database issues on concurrent test calls 2026-02-16 23:13:08 +00:00
CoreRasurae d111157573 fix(bench): use unique names per iteration to avoid UNIQUE constraint failures 2026-02-16 22:28:04 +00:00
Jeffrey Phillips Freeman f7d2f63ab8 feat(cli): add resource commands (core) 2026-02-16 16:46:54 -05:00