{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/schemas/crawl-evidence.schema.json",
  "title": "Crawl Evidence",
  "type": "object",
  "required": [
    "description",
    "objective",
    "crawl_evidence"
  ],
  "properties": {
    "description": {
      "type": "string",
      "minLength": 1
    },
    "objective": {
      "type": "string",
      "minLength": 1
    },
    "crawl_evidence": {
      "type": "object",
      "required": [
        "objective",
        "why",
        "crawlTool",
        "approvedWrapper",
        "command",
        "runnerCommands",
        "defaultReportPath",
        "repoReportDirectory",
        "requiredExports",
        "issueExports",
        "optionalExports",
        "severityRules",
        "passCriteria",
        "warningCriteria",
        "failCriteria",
        "objectiveAlignment",
        "stressSuite"
      ],
      "properties": {
        "objective": {
          "type": "string",
          "minLength": 1
        },
        "why": {
          "type": "string",
          "minLength": 1
        },
        "crawlTool": {
          "type": "string",
          "minLength": 1
        },
        "approvedWrapper": {
          "type": "string",
          "minLength": 1
        },
        "command": {
          "type": "string",
          "minLength": 1
        },
        "runnerCommands": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": [
              "id",
              "command",
              "why"
            ]
          }
        },
        "defaultReportPath": {
          "type": "string",
          "minLength": 1
        },
        "repoReportDirectory": {
          "type": "string",
          "minLength": 1
        },
        "requiredExports": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": [
              "id",
              "fileName",
              "severity",
              "why"
            ]
          }
        },
        "optionalExports": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "fileName",
              "why"
            ]
          }
        },
        "issueExports": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": [
              "id",
              "fileName",
              "severity",
              "why"
            ]
          }
        },
        "severityRules": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": [
              "id",
              "severity",
              "condition"
            ]
          }
        },
        "passCriteria": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "warningCriteria": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "failCriteria": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "objectiveAlignment": {
          "type": "string",
          "minLength": 1
        },
        "stressSuite": {
          "type": "object",
          "required": [
            "command",
            "why",
            "reportPath",
            "responseBudgets",
            "failureRules",
            "negativeControls"
          ],
          "properties": {
            "command": {
              "type": "string",
              "minLength": 1
            },
            "why": {
              "type": "string",
              "minLength": 1
            },
            "reportPath": {
              "type": "string",
              "minLength": 1
            },
            "responseBudgets": {
              "type": "array",
              "minItems": 3,
              "items": {
                "type": "object",
                "required": [
                  "id",
                  "limit",
                  "severity",
                  "why"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "limit": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "severity": {
                    "enum": [
                      "critical",
                      "high",
                      "medium",
                      "info"
                    ]
                  },
                  "why": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            },
            "failureRules": {
              "type": "array",
              "minItems": 3,
              "items": {
                "type": "object",
                "required": [
                  "id",
                  "severity",
                  "condition"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "severity": {
                    "enum": [
                      "critical",
                      "high",
                      "medium",
                      "info"
                    ]
                  },
                  "condition": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            },
            "negativeControls": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    }
  }
}
