- Add 5 workflow tests (task, context loading, stop-on-failure, conversational) - Add 1 shared test (agent-agnostic approval gate) - Reorganize: opencode/ → agents/ for clearer structure - Rename: sdk-tests/ → tests/ for simplicity - Update test runner paths to new structure - Add comprehensive documentation (test plan, guides, migration) - Update all documentation with new paths Total: 13 tests (was 6, added 7) Coverage: +31% workflow compliance All tests passing: 11/11 (100%)
47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
id: ctx-code-001
|
|
name: Code Task with Context Loading
|
|
description: |
|
|
Tests the Execute stage context loading: Approve → Load code.md → Write → Validate
|
|
Validates that agent loads .opencode/context/core/standards/code.md before writing code.
|
|
|
|
Critical rule from openagent.md (Line 162-193):
|
|
"Code tasks → .opencode/context/core/standards/code.md (MANDATORY)"
|
|
|
|
category: developer
|
|
agent: openagent
|
|
|
|
prompt: |
|
|
Create a simple TypeScript function called 'add' that takes two numbers and returns their sum.
|
|
Save it to src/utils/math.ts
|
|
|
|
# Expected behavior
|
|
behavior:
|
|
mustUseTools: [read, write] # Must read context, then write code
|
|
requiresApproval: true
|
|
requiresContext: true # MUST load code.md before writing
|
|
minToolCalls: 2 # At least: read context + write file
|
|
|
|
# Expected violations
|
|
expectedViolations:
|
|
- rule: approval-gate
|
|
shouldViolate: false
|
|
severity: error
|
|
description: Must ask approval before writing files
|
|
|
|
- rule: context-loading
|
|
shouldViolate: false
|
|
severity: error
|
|
description: Must load code.md before writing code
|
|
|
|
# Approval strategy
|
|
approvalStrategy:
|
|
type: auto-approve
|
|
|
|
timeout: 60000
|
|
|
|
tags:
|
|
- workflow-validation
|
|
- context-loading
|
|
- code-task
|
|
- critical-rule
|
|
- v2-schema
|