05-content-validation.yaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. id: int-content-001
  2. name: Content Validation Integration Test
  3. description: |
  4. Test that verifies content validation works correctly with the new
  5. ContentEvaluator. Ensures written files contain expected content.
  6. category: business
  7. agent: openagent
  8. model: anthropic/claude-sonnet-4-5
  9. prompts:
  10. - text: |
  11. Create a TypeScript function called 'multiply' that multiplies two numbers.
  12. It should take two parameters of type number and return a number.
  13. Save it to evals/test_tmp/multiply.ts
  14. Make sure to use proper TypeScript types, no 'any' types allowed.
  15. expectContext: true
  16. contextFile: ".opencode/context/core/standards/code.md"
  17. - text: |
  18. Yes, create the file.
  19. delayMs: 2000
  20. # Expected behavior with content validation
  21. behavior:
  22. mustUseTools: [read, write]
  23. requiresApproval: true
  24. requiresContext: true
  25. minToolCalls: 2
  26. # NEW - Content validation
  27. contentExpectations:
  28. - filePath: "evals/test_tmp/multiply.ts"
  29. mustContain:
  30. - "function multiply"
  31. - "number"
  32. - "return"
  33. - "*"
  34. mustNotContain:
  35. - "any"
  36. - "console.log"
  37. - "debugger"
  38. minLength: 50
  39. maxLength: 500
  40. mustMatch: "function\\s+multiply\\s*\\("
  41. # Expected violations
  42. expectedViolations:
  43. - rule: context-loading
  44. shouldViolate: false
  45. severity: error
  46. description: Must load code.md before writing code
  47. # Approval strategy
  48. approvalStrategy:
  49. type: auto-approve
  50. timeout: 120000
  51. tags:
  52. - integration
  53. - content-validation
  54. - typescript
  55. - v2-schema