02-context-loading-explicit.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. id: golden-02-context-loading-explicit
  2. name: "Golden 02 (Explicit): Context Loading - Specific File Required"
  3. description: |
  4. Tests that the agent loads a SPECIFIC context file before answering.
  5. This test uses the NEW explicit mode where you specify exactly which
  6. file(s) the agent must read. This is useful for:
  7. - Testing custom context files not in the standard mapping
  8. - Ensuring critical files are read for compliance/security
  9. - Validating file-specific requirements
  10. Unlike the auto-detect version, this test EXPLICITLY requires:
  11. - .opencode/context/core/standards/code.md
  12. The evaluator will ONLY pass if the agent reads this exact file
  13. (or a file containing this path).
  14. Validates:
  15. - Agent reads the EXACT file specified in expectedContextFiles
  16. - Detection mode shows "Explicit (from YAML test)"
  17. - Wrong file causes violation even if it's a context file
  18. category: developer
  19. prompts:
  20. - text: |
  21. What are the coding standards for this project? Check the project documentation to find out.
  22. approvalStrategy:
  23. type: auto-approve
  24. behavior:
  25. # Agent should read docs or context files
  26. mustUseAnyOf:
  27. - [read]
  28. - [glob, read]
  29. - [list, read]
  30. minToolCalls: 1
  31. requiresContext: true
  32. # NEW: Explicit context file requirement (takes precedence over auto-detection)
  33. expectedContextFiles:
  34. - .opencode/context/core/standards/code.md
  35. - standards/code.md
  36. - code.md
  37. expectedViolations:
  38. - rule: context-loading
  39. shouldViolate: false
  40. severity: error
  41. - rule: approval-gate
  42. shouldViolate: false
  43. severity: error
  44. timeout: 90000
  45. tags:
  46. - golden
  47. - context-loading
  48. - explicit-mode
  49. - read-only
  50. - safe