suite-schema.json 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "$id": "https://opencode.dev/schemas/test-suite.json",
  4. "title": "OpenCode Test Suite",
  5. "description": "Schema for test suite definitions",
  6. "type": "object",
  7. "required": ["name", "description", "version", "agent", "totalTests", "estimatedRuntime", "tests"],
  8. "properties": {
  9. "name": {
  10. "type": "string",
  11. "description": "Human-readable suite name",
  12. "minLength": 1,
  13. "examples": ["Core Test Suite", "Quick Smoke Tests"]
  14. },
  15. "description": {
  16. "type": "string",
  17. "description": "Brief description of what this suite tests",
  18. "minLength": 1
  19. },
  20. "version": {
  21. "type": "string",
  22. "description": "Semantic version of the suite",
  23. "pattern": "^\\d+\\.\\d+\\.\\d+$",
  24. "examples": ["1.0.0", "2.1.3"]
  25. },
  26. "agent": {
  27. "type": "string",
  28. "description": "Agent this suite is for",
  29. "enum": ["openagent", "opencoder"],
  30. "examples": ["openagent"]
  31. },
  32. "totalTests": {
  33. "type": "integer",
  34. "description": "Total number of tests in this suite",
  35. "minimum": 1
  36. },
  37. "estimatedRuntime": {
  38. "type": "string",
  39. "description": "Estimated runtime for the suite",
  40. "pattern": "^\\d+-\\d+ (minutes|seconds|hours)$",
  41. "examples": ["5-8 minutes", "30-60 seconds"]
  42. },
  43. "coverage": {
  44. "type": "object",
  45. "description": "Coverage areas tested by this suite",
  46. "additionalProperties": {
  47. "type": "boolean"
  48. }
  49. },
  50. "tests": {
  51. "type": "array",
  52. "description": "List of test definitions",
  53. "minItems": 1,
  54. "items": {
  55. "type": "object",
  56. "required": ["id", "name", "path", "category", "priority"],
  57. "properties": {
  58. "id": {
  59. "type": "integer",
  60. "description": "Unique test ID within suite",
  61. "minimum": 1
  62. },
  63. "name": {
  64. "type": "string",
  65. "description": "Human-readable test name",
  66. "minLength": 1
  67. },
  68. "path": {
  69. "type": "string",
  70. "description": "Relative path to test file from tests/ directory",
  71. "pattern": "^[^/].*\\.yaml$",
  72. "examples": [
  73. "01-critical-rules/approval-gate/05-approval-before-execution-positive.yaml"
  74. ]
  75. },
  76. "category": {
  77. "type": "string",
  78. "description": "Test category",
  79. "enum": [
  80. "critical-rules",
  81. "workflow-stages",
  82. "delegation",
  83. "execution-paths",
  84. "edge-cases",
  85. "integration",
  86. "negative",
  87. "behavior",
  88. "tool-usage"
  89. ]
  90. },
  91. "priority": {
  92. "type": "string",
  93. "description": "Test priority level",
  94. "enum": ["critical", "high", "medium", "low"]
  95. },
  96. "required": {
  97. "type": "boolean",
  98. "description": "Whether this test must exist (fails validation if missing)",
  99. "default": true
  100. },
  101. "estimatedTime": {
  102. "type": "string",
  103. "description": "Estimated runtime for this test",
  104. "pattern": "^\\d+-\\d+(s|m)$",
  105. "examples": ["30-60s", "1-2m"]
  106. },
  107. "description": {
  108. "type": "string",
  109. "description": "Brief description of what this test validates"
  110. }
  111. },
  112. "additionalProperties": false
  113. }
  114. },
  115. "rationale": {
  116. "type": "object",
  117. "description": "Explanation of suite design decisions",
  118. "properties": {
  119. "why7Tests": {
  120. "type": "string"
  121. },
  122. "coverageBreakdown": {
  123. "type": "object",
  124. "additionalProperties": {
  125. "type": "string"
  126. }
  127. },
  128. "useCases": {
  129. "type": "array",
  130. "items": {
  131. "type": "string"
  132. }
  133. }
  134. }
  135. },
  136. "usage": {
  137. "type": "object",
  138. "description": "Usage examples for this suite"
  139. },
  140. "comparison": {
  141. "type": "object",
  142. "description": "Comparison with other suites"
  143. }
  144. },
  145. "additionalProperties": false
  146. }