Commit Graph

9 Commits

Author SHA1 Message Date
hurui200320 8953449dc2 fix(actor): validate v3 YAML via ActorConfigSchema in agents actor add CLI
CI / lint (pull_request) Successful in 30s
CI / typecheck (pull_request) Successful in 1m15s
CI / security (pull_request) Successful in 1m18s
CI / quality (pull_request) Successful in 30s
CI / build (pull_request) Successful in 37s
CI / helm (pull_request) Successful in 29s
CI / push-validation (pull_request) Successful in 26s
CI / e2e_tests (pull_request) Successful in 3m58s
CI / integration_tests (pull_request) Successful in 6m49s
CI / unit_tests (pull_request) Successful in 8m39s
CI / docker (pull_request) Successful in 1m23s
CI / coverage (pull_request) Successful in 13m32s
CI / benchmark-regression (push) Failing after 0s
CI / benchmark-publish (push) Failing after 0s
CI / status-check (pull_request) Successful in 1s
CI / lint (push) Successful in 25s
CI / typecheck (push) Successful in 1m1s
CI / quality (push) Successful in 55s
CI / security (push) Successful in 1m9s
CI / build (push) Successful in 24s
CI / helm (push) Successful in 30s
CI / push-validation (push) Successful in 20s
CI / e2e_tests (push) Successful in 5m13s
CI / integration_tests (push) Successful in 7m17s
CI / unit_tests (push) Successful in 8m50s
CI / docker (push) Successful in 1m30s
CI / coverage (push) Successful in 11m57s
CI / status-check (push) Successful in 2s
- schema.py: provider field changed to Optional[str] with model validator
  validate_provider_required_for_llm_graph() that requires it only for LLM
  and GRAPH actor types; TOOL actors do not require provider
- schema.py: is_v3_yaml() uses version_str == "3" or version_str.startswith("3.")
  to avoid false positives from "30" or "300" version strings
- schema.py: tool namespace validation uses strict 2-part split to reject
  empty namespace or empty name (e.g. "/tool", "ns/", "a/b/c")
- cli/commands/actor.py: schema_version extraction uses raw_version pattern
  (no # type: ignore[assignment]) for clean static typing
- actor/__init__.py: is_v3_yaml removed from __all__ and _LAZY_IMPORTS
  since it is a module-private helper, not a public API
- robot/actor_add_v3_schema_validation.robot: YAML fixtures for 'Reject v3
  LLM Actor Without Model Field' and 'Reject v3 TOOL Actor Without Tools
  Field' now include required provider field (and model for TOOL fixture)
- robot/helper_actor_add_v3_schema_validation.py: except clauses unified to
  catch (subprocess.TimeoutExpired, FileNotFoundError) in both add_actor()
  and update_actor() functions
- features/actor_add_v3_schema_validation.feature: 'Update a v3 actor with
  valid YAML succeeds' scenario now includes 'And the actor should be
  validated via ActorConfigSchema'; error assertions tightened to exact
  messages (e.g. "Input should be 'llm', 'tool' or 'graph'", "Node ID must
  be alphanumeric", "must be namespaced")
- features/steps/actor_add_v3_schema_validation_steps.py: step_run_actor_update
  now spies on ActorConfigSchema.model_validate; failure paths assert
  isinstance(result.exception, SystemExit)

ISSUES CLOSED: #5869
2026-04-17 16:28:45 +08:00
brent.edwards 714d799ae9 feat(examples/actors/code_review.yaml): add a new code review tool (#458)
CI / lint (push) Successful in 20s
CI / quality (push) Successful in 30s
CI / typecheck (push) Successful in 43s
CI / security (push) Successful in 44s
CI / build (push) Successful in 24s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 3m30s
CI / integration_tests (push) Successful in 3m49s
CI / docker (push) Successful in 1m6s
CI / coverage (push) Successful in 7m23s
CI / e2e_tests (push) Failing after 14m42s
CI / benchmark-publish (push) Failing after 19m42s
## Summary

Add a `code_review.yaml` actor example that uses Claude Opus 4 with file and git tools to perform automated code reviews against the project's review playbook.

### Changes
- **New file**: `examples/actors/code_review.yaml` — LLM actor configured with `files/read_file`, `files/list_directory`, and `builtin/git-*` tools, with a system prompt that reads `docs/development/review-playbook.md` and diffs against `master`
- **Updated**: `features/actor_examples.feature` — bumped example count from 7 to 8 and added `code_review.yaml` to the file listing assertion

### Verification
- `nox -e lint` — passed
- `nox -e typecheck` — 0 errors
- `nox -e format -- --check` — all files formatted
- `nox -s unit_tests -- features/actor_examples.feature` — 25 scenarios passed

### Rebase Notes
- Rebased onto current master (`4d3499dc`)
- Squashed 2 commits into 1 (eliminated 3 merge commits)
- Resolved conflict in `actor_examples.feature`: master added `strategy_with_subplan.yaml` (count 7), our branch adds `code_review.yaml` (count now 8)

Reviewed-on: #458
Reviewed-by: Jeffrey Phillips Freeman <jeffrey.freeman@cleverthis.com>
Co-authored-by: Brent Edwards <brent.edwards@cleverthis.com>
Co-committed-by: Brent Edwards <brent.edwards@cleverthis.com>
2026-03-19 22:42:15 +00:00
aditya 26ad778aee feat(estimation): add estimation actor YAML template and role-aware registration validation
- Add `role_hint` and `response_format` support to actor schema.
- Add non-fatal estimation-role compatibility warnings in actor registration CLI flows.
- Add preflight warning path when `estimation` actor is missing `response_format`.
- Add `examples/actors/estimator.yaml` and update actor examples documentation/tests.
- Update integration helper expectations (m1/m2/m3/m6) for missing provider config in local test env.

ISSUES CLOSED: #650
2026-03-18 06:46:14 +00:00
aditya ef65996ca2 fix(actor): address code review findings on plan_subplan tool
- Return parent_decision_id in handler result dict and add meaningful
  assertion to the corresponding Behave scenario (B1)
- Add ULID format validators to SubplanPayload for plan_id, dependencies,
  and parent_decision_id, consistent with Decision model validation (S1)
- Add non-empty string validator for resource_scopes items (S2)
- Narrow broad except Exception to except (ValidationError, ValueError)
  so programming errors surface as real failures (S3)
- Document strategy_with_subplan.yaml in actors_examples.md and assert
  it is referenced in the "Verify all examples are documented" scenario (B2)

ISSUES CLOSED: #198
2026-03-02 08:17:21 +00:00
aditya 131be21e80 fix(tests): update actor_examples count to 7 after subplan example
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 13s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 31s
CI / security (pull_request) Successful in 35s
CI / integration_tests (pull_request) Successful in 2m50s
CI / unit_tests (pull_request) Successful in 20m54s
CI / docker (pull_request) Successful in 39s
CI / benchmark-regression (pull_request) Successful in 26m10s
CI / coverage (pull_request) Successful in 48m2s
Refs: #198
2026-02-27 09:24:34 +00:00
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
aditya 4ae7f2d6fe test(actor): fix actor examples test suite issues
- Add missing node descriptions in Behave test scenarios
- Fix context_view and parallel execution step definitions
- Update llm_with_tools.yaml max_context_tokens (10000 → 16000)
- Add context.error compatibility for error assertions

Results: Behave 25/25, Robot 16/16, ASV 7/7 all newly added tests passing.
2026-02-18 12:18:37 +00:00
aditya a5fd451a3b fix(actor): resolve Behave test conflicts and add missing step definitions
- Fix ActorType import error in actor_schema_steps.py
- Simplify actor_examples_steps.py to remove duplicate steps
- Add missing Background step and actor validation steps
- Add llm_with_tools.yaml documentation section
- Rename conflicting Given step patterns with 'examples' suffix
- Add comprehensive Then steps for actor config validation
- Fix step patterns to include trailing colons for docstring steps

Test Results:
- 8 scenarios passing (up from 0)
- 138 steps passing (critical path tests working)
- 5 undefined steps remaining (minor edge cases)
- Basic actor example validation fully functional
2026-02-18 11:41:05 +00:00
aditya 02466864ef test(actor): add comprehensive Behave scenarios for actor examples
Create features/actor_examples.feature with 30+ test scenarios covering:
- All 5 example YAML files load and validate successfully
- Strategist actor pattern (planning, large context, read-only tools)
- Executor actor pattern (write-capable tools, implementation focus)
- Reviewer actor pattern (quality gates, linting tools)
- Tool-only actors (no LLM, pure tool collections)
- Validation-node actors (stateless validators, security scanning)
- Linear graph workflows (sequential 3-step pipelines)
- Complex graphs (conditionals, retry logic, tool nodes)
- Hierarchical graphs (subgraph invocation, parallel execution)
- Multi-level patterns (strategic → tactical → execution)
- Invalid example rejection (missing fields, cycles, bad names)
- Documentation completeness verification

Each scenario validates schema correctness, required fields, and
actor-specific patterns aligned with CleverAgents specification.
2026-02-18 08:52:08 +00:00