context-loading-wrong-file.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. id: example-context-loading-wrong-file
  2. name: "Example: Context Loading - Wrong File Detection"
  3. description: |
  4. This test demonstrates the explicit context file validation.
  5. The test asks about coding standards (expects code.md) but
  6. explicitly tells the agent to read docs.md instead.
  7. Expected behavior:
  8. - Agent reads docs.md (as instructed)
  9. - Evaluator detects wrong file was read
  10. - Test FAILS with "wrong-context-file" violation
  11. This shows that the evaluator validates the SPECIFIC file,
  12. not just "any context file".
  13. Use this test to verify the evaluator is working correctly.
  14. category: developer
  15. prompts:
  16. - text: |
  17. What are the coding standards?
  18. Read the file .opencode/context/core/standards/docs.md and tell me what it says.
  19. approvalStrategy:
  20. type: auto-approve
  21. behavior:
  22. mustUseTools: [read]
  23. requiresContext: true
  24. # Expect code.md, but agent will read docs.md (wrong file)
  25. expectedContextFiles:
  26. - .opencode/context/core/standards/code.md
  27. - standards/code.md
  28. - code.md
  29. expectedViolations:
  30. - rule: context-loading
  31. shouldViolate: true # We EXPECT this to violate (wrong file)
  32. severity: error
  33. timeout: 60000
  34. tags:
  35. - example
  36. - context-loading
  37. - negative-test
  38. - wrong-file