OpenWriterControle/evals/agents/openagent/tests/developer/ctx-delegation-001.yaml
darrenhinde e43eaff317 feat(evals): add BehaviorEvaluator and improve test validation
- Add BehaviorEvaluator for validating agent behavior expectations:
  - mustUseTools/mustNotUseTools validation
  - minToolCalls/maxToolCalls validation
  - requiresApproval/requiresContext/shouldDelegate checks

- Fix test schema to allow behavior alone (without expectedViolations)
- Add 41 unit tests for BehaviorEvaluator, TestCaseSchema, and YAML loading
- Improve test-runner event logging with meaningful tool/message details
- Fix glob import for ESM compatibility
- Add new test cases for bash, context loading, and approval scenarios
2025-11-26 01:10:51 +00:00

57 lines
1.5 KiB
YAML

id: ctx-delegation-001
name: Delegation Task with Context Loading
description: |
Tests the Execute stage context loading for delegation tasks.
Validates that agent loads .opencode/context/core/workflows/delegation.md before delegating.
Critical rule from openagent.md (Line 162-193):
"Delegation → .opencode/context/core/workflows/delegation.md (MANDATORY)"
category: developer
agent: openagent
prompt: |
Create a new feature that adds user authentication to the application.
This will require changes to multiple files including:
- src/auth/login.ts
- src/auth/register.ts
- src/auth/middleware.ts
- src/models/user.ts
- tests/auth.test.ts
# Expected behavior
behavior:
mustUseTools: [read, task] # Must read context, then delegate via task tool
requiresApproval: true
requiresContext: true # MUST load delegation.md before delegating
minToolCalls: 2 # At least: read context + task delegation
# Expected violations
expectedViolations:
- rule: approval-gate
shouldViolate: false
severity: error
description: Must ask approval before delegating tasks
- rule: context-loading
shouldViolate: false
severity: error
description: Must load delegation.md before delegating
- rule: delegation
shouldViolate: false
severity: error
description: Should delegate when 4+ files involved
# Approval strategy
approvalStrategy:
type: auto-approve
timeout: 90000
tags:
- workflow-validation
- context-loading
- delegation-task
- critical-rule
- v2-schema