{
  "additionalProperties": false,
  "$id": "https://usedino.dev/schema/dino-result.v1.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "DinoResult v1",
  "description": "The one canonical result of a Dino verification run (dinoResult 1.0).",
  "type": "object",
  "required": [
    "dinoResult",
    "identity",
    "scope",
    "operations",
    "verification",
    "findings",
    "verdict",
    "provenance"
  ],
  "properties": {
    "dinoResult": {
      "const": "1.0",
      "type": "string"
    },
    "identity": {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "runId",
        "tenantId",
        "environment",
        "trigger",
        "generatedAt",
        "engineVersion",
        "targets"
      ],
      "properties": {
        "runId": {
          "minLength": 1,
          "maxLength": 128,
          "type": "string"
        },
        "tenantId": {
          "minLength": 1,
          "maxLength": 200,
          "type": "string"
        },
        "environment": {
          "minLength": 1,
          "maxLength": 200,
          "type": "string"
        },
        "trigger": {
          "anyOf": [
            {
              "const": "pr",
              "type": "string"
            },
            {
              "const": "nightly",
              "type": "string"
            },
            {
              "const": "weekly",
              "type": "string"
            },
            {
              "const": "monthly",
              "type": "string"
            },
            {
              "const": "manual",
              "type": "string"
            },
            {
              "const": "watch",
              "type": "string"
            }
          ]
        },
        "generatedAt": {
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,3})?Z$",
          "type": "string"
        },
        "engineVersion": {
          "minLength": 1,
          "maxLength": 64,
          "type": "string"
        },
        "targets": {
          "additionalProperties": false,
          "type": "object",
          "properties": {
            "graphql": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "url",
                "protected"
              ],
              "properties": {
                "url": {
                  "minLength": 1,
                  "maxLength": 2048,
                  "type": "string"
                },
                "protected": {
                  "type": "boolean"
                }
              }
            },
            "rest": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "url",
                "protected"
              ],
              "properties": {
                "url": {
                  "minLength": 1,
                  "maxLength": 2048,
                  "type": "string"
                },
                "protected": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "scope": {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "snapshots",
        "scopeState",
        "gaps",
        "dispositions"
      ],
      "properties": {
        "snapshots": {
          "type": "array",
          "items": {
            "additionalProperties": false,
            "type": "object",
            "required": [
              "source",
              "digest",
              "capturedAt"
            ],
            "properties": {
              "source": {
                "anyOf": [
                  {
                    "const": "introspection",
                    "type": "string"
                  },
                  {
                    "const": "sdl",
                    "type": "string"
                  },
                  {
                    "const": "openapi",
                    "type": "string"
                  },
                  {
                    "const": "registry",
                    "type": "string"
                  },
                  {
                    "const": "targets",
                    "type": "string"
                  }
                ]
              },
              "digest": {
                "pattern": "^[0-9a-f]{64}$",
                "type": "string"
              },
              "capturedAt": {
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,3})?Z$",
                "type": "string"
              }
            }
          }
        },
        "scopeState": {
          "anyOf": [
            {
              "const": "KNOWN",
              "type": "string"
            },
            {
              "const": "UNKNOWN",
              "type": "string"
            }
          ]
        },
        "gaps": {
          "type": "array",
          "items": {
            "additionalProperties": false,
            "type": "object",
            "required": [
              "reason"
            ],
            "properties": {
              "tool": {
                "anyOf": [
                  {
                    "const": "input-fuzzer",
                    "type": "string"
                  },
                  {
                    "const": "response-validator",
                    "type": "string"
                  },
                  {
                    "const": "rbac-matrix",
                    "type": "string"
                  },
                  {
                    "const": "rate-limit-validator",
                    "type": "string"
                  },
                  {
                    "const": "error-code-validator",
                    "type": "string"
                  },
                  {
                    "const": "deprecation-tracker",
                    "type": "string"
                  },
                  {
                    "const": "rest-fuzzer",
                    "type": "string"
                  }
                ]
              },
              "source": {
                "anyOf": [
                  {
                    "const": "introspection",
                    "type": "string"
                  },
                  {
                    "const": "sdl",
                    "type": "string"
                  },
                  {
                    "const": "openapi",
                    "type": "string"
                  },
                  {
                    "const": "registry",
                    "type": "string"
                  },
                  {
                    "const": "targets",
                    "type": "string"
                  }
                ]
              },
              "reason": {
                "anyOf": [
                  {
                    "const": "no-discovery",
                    "type": "string"
                  },
                  {
                    "const": "reduced-introspection",
                    "type": "string"
                  },
                  {
                    "const": "not-in-discovery",
                    "type": "string"
                  },
                  {
                    "const": "operation-unresolved-in-spec",
                    "type": "string"
                  },
                  {
                    "const": "undeclared-source",
                    "type": "string"
                  },
                  {
                    "const": "historical-no-discovery",
                    "type": "string"
                  },
                  {
                    "const": "no-planner-outcome",
                    "type": "string"
                  },
                  {
                    "const": "plan-formation-gap",
                    "type": "string"
                  },
                  {
                    "const": "ambiguous-graphql-identity",
                    "type": "string"
                  }
                ]
              }
            }
          }
        },
        "dispositions": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "planned",
            "excluded"
          ],
          "properties": {
            "planned": {
              "minimum": 0,
              "type": "integer"
            },
            "excluded": {
              "minimum": 0,
              "type": "integer"
            }
          }
        }
      }
    },
    "operations": {
      "type": "array",
      "items": {
        "additionalProperties": false,
        "type": "object",
        "required": [
          "protocol",
          "operationKey",
          "name",
          "module",
          "deprecated",
          "schemaDescription",
          "coverageStatus",
          "args",
          "returnType",
          "tools",
          "worstSeverity",
          "healthScore",
          "tested",
          "executionCoverage"
        ],
        "properties": {
          "protocol": {
            "anyOf": [
              {
                "const": "graphql",
                "type": "string"
              },
              {
                "const": "rest",
                "type": "string"
              }
            ]
          },
          "operationKey": {
            "minLength": 1,
            "maxLength": 512,
            "type": "string"
          },
          "name": {
            "minLength": 1,
            "maxLength": 512,
            "type": "string"
          },
          "kind": {
            "anyOf": [
              {
                "const": "query",
                "type": "string"
              },
              {
                "const": "mutation",
                "type": "string"
              },
              {
                "const": "subscription",
                "type": "string"
              }
            ]
          },
          "module": {
            "minLength": 1,
            "maxLength": 200,
            "type": "string"
          },
          "deprecated": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "schemaDescription": {
            "anyOf": [
              {
                "maxLength": 4096,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "coverageStatus": {
            "anyOf": [
              {
                "const": "documented-and-tested",
                "type": "string"
              },
              {
                "const": "documented-only",
                "type": "string"
              },
              {
                "const": "absent",
                "type": "string"
              },
              {
                "const": "unknown",
                "type": "string"
              }
            ]
          },
          "args": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "name",
                    "type",
                    "isRequired"
                  ],
                  "properties": {
                    "name": {
                      "maxLength": 200,
                      "type": "string"
                    },
                    "type": {
                      "maxLength": 512,
                      "type": "string"
                    },
                    "isRequired": {
                      "type": "boolean"
                    }
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "returnType": {
            "anyOf": [
              {
                "maxLength": 512,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "parameters": {
            "type": "array",
            "items": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "name",
                "in"
              ],
              "properties": {
                "name": {
                  "minLength": 1,
                  "maxLength": 200,
                  "type": "string"
                },
                "in": {
                  "anyOf": [
                    {
                      "const": "path",
                      "type": "string"
                    },
                    {
                      "const": "query",
                      "type": "string"
                    },
                    {
                      "const": "header",
                      "type": "string"
                    },
                    {
                      "const": "cookie",
                      "type": "string"
                    }
                  ]
                },
                "required": {
                  "type": "boolean"
                },
                "description": {
                  "maxLength": 2048,
                  "type": "string"
                },
                "schema": {
                  "type": "object",
                  "patternProperties": {
                    "^(.*)$": {}
                  }
                },
                "deprecated": {
                  "type": "boolean"
                }
              }
            }
          },
          "requestBody": {
            "additionalProperties": false,
            "type": "object",
            "required": [
              "contentType"
            ],
            "properties": {
              "contentType": {
                "minLength": 1,
                "maxLength": 200,
                "type": "string"
              },
              "schema": {
                "type": "object",
                "patternProperties": {
                  "^(.*)$": {}
                }
              },
              "required": {
                "type": "boolean"
              },
              "description": {
                "maxLength": 2048,
                "type": "string"
              }
            }
          },
          "responseSchemas": {
            "type": "object",
            "patternProperties": {
              "^(.*)$": {
                "additionalProperties": false,
                "type": "object",
                "properties": {
                  "description": {
                    "maxLength": 2048,
                    "type": "string"
                  },
                  "contentType": {
                    "minLength": 1,
                    "maxLength": 200,
                    "type": "string"
                  },
                  "schema": {
                    "type": "object",
                    "patternProperties": {
                      "^(.*)$": {}
                    }
                  }
                }
              }
            }
          },
          "tools": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "tool",
                    "disposition",
                    "reason"
                  ],
                  "properties": {
                    "tool": {
                      "anyOf": [
                        {
                          "const": "input-fuzzer",
                          "type": "string"
                        },
                        {
                          "const": "response-validator",
                          "type": "string"
                        },
                        {
                          "const": "rbac-matrix",
                          "type": "string"
                        },
                        {
                          "const": "rate-limit-validator",
                          "type": "string"
                        },
                        {
                          "const": "error-code-validator",
                          "type": "string"
                        },
                        {
                          "const": "deprecation-tracker",
                          "type": "string"
                        },
                        {
                          "const": "rest-fuzzer",
                          "type": "string"
                        }
                      ]
                    },
                    "disposition": {
                      "const": "excluded",
                      "type": "string"
                    },
                    "reason": {
                      "anyOf": [
                        {
                          "const": "not-selected",
                          "type": "string"
                        },
                        {
                          "const": "not-applicable-protocol",
                          "type": "string"
                        },
                        {
                          "const": "requires-roles",
                          "type": "string"
                        },
                        {
                          "const": "not-planned",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "tool",
                    "disposition",
                    "cardinality"
                  ],
                  "properties": {
                    "tool": {
                      "anyOf": [
                        {
                          "const": "input-fuzzer",
                          "type": "string"
                        },
                        {
                          "const": "response-validator",
                          "type": "string"
                        },
                        {
                          "const": "rbac-matrix",
                          "type": "string"
                        },
                        {
                          "const": "rate-limit-validator",
                          "type": "string"
                        },
                        {
                          "const": "error-code-validator",
                          "type": "string"
                        },
                        {
                          "const": "deprecation-tracker",
                          "type": "string"
                        },
                        {
                          "const": "rest-fuzzer",
                          "type": "string"
                        }
                      ]
                    },
                    "disposition": {
                      "const": "planned",
                      "type": "string"
                    },
                    "cardinality": {
                      "const": "unknown",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "tool",
                    "disposition",
                    "cardinality",
                    "ledger",
                    "severity",
                    "findingCount",
                    "examples",
                    "classifications"
                  ],
                  "properties": {
                    "tool": {
                      "anyOf": [
                        {
                          "const": "input-fuzzer",
                          "type": "string"
                        },
                        {
                          "const": "response-validator",
                          "type": "string"
                        },
                        {
                          "const": "rbac-matrix",
                          "type": "string"
                        },
                        {
                          "const": "rate-limit-validator",
                          "type": "string"
                        },
                        {
                          "const": "error-code-validator",
                          "type": "string"
                        },
                        {
                          "const": "deprecation-tracker",
                          "type": "string"
                        },
                        {
                          "const": "rest-fuzzer",
                          "type": "string"
                        }
                      ]
                    },
                    "disposition": {
                      "const": "planned",
                      "type": "string"
                    },
                    "cardinality": {
                      "const": "known",
                      "type": "string"
                    },
                    "ledger": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "passed",
                        "failed",
                        "notTested",
                        "notTestedByReason"
                      ],
                      "properties": {
                        "passed": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "failed": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "notTested": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "notTestedByReason": {
                          "additionalProperties": false,
                          "type": "object",
                          "properties": {
                            "authUnavailable": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "unreachable": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "timeout": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "budgetExceeded": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "aborted": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "unsupported": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "dryRun": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "inconclusive": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "dependencyUnavailable": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "unknown": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "withheldUnsafe": {
                              "minimum": 0,
                              "type": "integer"
                            }
                          }
                        }
                      }
                    },
                    "severity": {
                      "anyOf": [
                        {
                          "const": "CRITICAL",
                          "type": "string"
                        },
                        {
                          "const": "HIGH",
                          "type": "string"
                        },
                        {
                          "const": "MEDIUM",
                          "type": "string"
                        },
                        {
                          "const": "LOW",
                          "type": "string"
                        },
                        {
                          "const": "CLEAN",
                          "type": "string"
                        },
                        {
                          "const": "UNTESTED",
                          "type": "string"
                        }
                      ]
                    },
                    "findingCount": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "examples": {
                      "type": "array",
                      "items": {
                        "maxLength": 2048,
                        "type": "string"
                      }
                    },
                    "classifications": {
                      "type": "array",
                      "items": {
                        "minLength": 1,
                        "maxLength": 200,
                        "type": "string"
                      }
                    }
                  }
                }
              ]
            }
          },
          "worstSeverity": {
            "anyOf": [
              {
                "const": "CRITICAL",
                "type": "string"
              },
              {
                "const": "HIGH",
                "type": "string"
              },
              {
                "const": "MEDIUM",
                "type": "string"
              },
              {
                "const": "LOW",
                "type": "string"
              },
              {
                "const": "CLEAN",
                "type": "string"
              },
              {
                "const": "UNTESTED",
                "type": "string"
              }
            ]
          },
          "healthScore": {
            "anyOf": [
              {
                "minimum": 0,
                "maximum": 100,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "tested": {
            "type": "boolean"
          },
          "executionCoverage": {
            "anyOf": [
              {
                "const": "tested",
                "type": "string"
              },
              {
                "const": "partially-tested",
                "type": "string"
              },
              {
                "const": "not-tested",
                "type": "string"
              }
            ]
          },
          "executionCoverageReason": {
            "maxLength": 2048,
            "type": "string"
          },
          "observedAuth": {
            "additionalProperties": false,
            "type": "object",
            "required": [
              "rolesTested",
              "minimumRole",
              "unauthenticated"
            ],
            "properties": {
              "rolesTested": {
                "type": "array",
                "items": {
                  "maxLength": 200,
                  "type": "string"
                }
              },
              "minimumRole": {
                "anyOf": [
                  {
                    "maxLength": 200,
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "unauthenticated": {
                "anyOf": [
                  {
                    "const": "allowed",
                    "type": "string"
                  },
                  {
                    "const": "denied",
                    "type": "string"
                  },
                  {
                    "const": "inconclusive",
                    "type": "string"
                  }
                ]
              }
            }
          },
          "observedResponses": {
            "additionalProperties": false,
            "type": "object",
            "required": [
              "statusCodes"
            ],
            "properties": {
              "statusCodes": {
                "type": "object",
                "patternProperties": {
                  "^[1-5]\\d{2}$": {
                    "additionalProperties": false,
                    "type": "object",
                    "properties": {
                      "contentType": {
                        "maxLength": 200,
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "verification": {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "targetUnreachable",
        "durationMs",
        "tools",
        "byUnit"
      ],
      "properties": {
        "targetUnreachable": {
          "type": "boolean"
        },
        "durationMs": {
          "minimum": 0,
          "type": "integer"
        },
        "tools": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "tool",
                  "status"
                ],
                "properties": {
                  "tool": {
                    "anyOf": [
                      {
                        "const": "input-fuzzer",
                        "type": "string"
                      },
                      {
                        "const": "response-validator",
                        "type": "string"
                      },
                      {
                        "const": "rbac-matrix",
                        "type": "string"
                      },
                      {
                        "const": "rate-limit-validator",
                        "type": "string"
                      },
                      {
                        "const": "error-code-validator",
                        "type": "string"
                      },
                      {
                        "const": "deprecation-tracker",
                        "type": "string"
                      },
                      {
                        "const": "rest-fuzzer",
                        "type": "string"
                      }
                    ]
                  },
                  "status": {
                    "const": "not-selected",
                    "type": "string"
                  }
                }
              },
              {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "tool",
                  "status",
                  "reason"
                ],
                "properties": {
                  "tool": {
                    "anyOf": [
                      {
                        "const": "input-fuzzer",
                        "type": "string"
                      },
                      {
                        "const": "response-validator",
                        "type": "string"
                      },
                      {
                        "const": "rbac-matrix",
                        "type": "string"
                      },
                      {
                        "const": "rate-limit-validator",
                        "type": "string"
                      },
                      {
                        "const": "error-code-validator",
                        "type": "string"
                      },
                      {
                        "const": "deprecation-tracker",
                        "type": "string"
                      },
                      {
                        "const": "rest-fuzzer",
                        "type": "string"
                      }
                    ]
                  },
                  "status": {
                    "const": "excluded",
                    "type": "string"
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "const": "not-applicable-protocol",
                        "type": "string"
                      },
                      {
                        "const": "requires-roles",
                        "type": "string"
                      }
                    ]
                  }
                }
              },
              {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "tool",
                  "status",
                  "reason",
                  "execution"
                ],
                "properties": {
                  "tool": {
                    "anyOf": [
                      {
                        "const": "input-fuzzer",
                        "type": "string"
                      },
                      {
                        "const": "response-validator",
                        "type": "string"
                      },
                      {
                        "const": "rbac-matrix",
                        "type": "string"
                      },
                      {
                        "const": "rate-limit-validator",
                        "type": "string"
                      },
                      {
                        "const": "error-code-validator",
                        "type": "string"
                      },
                      {
                        "const": "deprecation-tracker",
                        "type": "string"
                      },
                      {
                        "const": "rest-fuzzer",
                        "type": "string"
                      }
                    ]
                  },
                  "status": {
                    "const": "unavailable",
                    "type": "string"
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "const": "reduced-introspection",
                        "type": "string"
                      },
                      {
                        "const": "tool-failed",
                        "type": "string"
                      },
                      {
                        "const": "budget-cut",
                        "type": "string"
                      },
                      {
                        "const": "run-cancelled",
                        "type": "string"
                      },
                      {
                        "const": "requires-auth",
                        "type": "string"
                      },
                      {
                        "const": "no-testable-operations",
                        "type": "string"
                      },
                      {
                        "const": "not-executed",
                        "type": "string"
                      },
                      {
                        "const": "circuit-breaker",
                        "type": "string"
                      }
                    ]
                  },
                  "execution": {
                    "anyOf": [
                      {
                        "const": "completed",
                        "type": "string"
                      },
                      {
                        "const": "failed",
                        "type": "string"
                      },
                      {
                        "const": "timeout",
                        "type": "string"
                      },
                      {
                        "const": "budget-cut",
                        "type": "string"
                      },
                      {
                        "const": "cancelled",
                        "type": "string"
                      },
                      {
                        "const": "crashed",
                        "type": "string"
                      },
                      {
                        "const": "skipped",
                        "type": "string"
                      },
                      {
                        "const": "not-run",
                        "type": "string"
                      }
                    ]
                  }
                }
              },
              {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "tool",
                  "status",
                  "execution",
                  "unit",
                  "ledger",
                  "nonOperationUnits",
                  "examinedOperations",
                  "examinedProtocols",
                  "targetUnreachable",
                  "durationMs"
                ],
                "properties": {
                  "tool": {
                    "anyOf": [
                      {
                        "const": "input-fuzzer",
                        "type": "string"
                      },
                      {
                        "const": "response-validator",
                        "type": "string"
                      },
                      {
                        "const": "rbac-matrix",
                        "type": "string"
                      },
                      {
                        "const": "rate-limit-validator",
                        "type": "string"
                      },
                      {
                        "const": "error-code-validator",
                        "type": "string"
                      },
                      {
                        "const": "deprecation-tracker",
                        "type": "string"
                      },
                      {
                        "const": "rest-fuzzer",
                        "type": "string"
                      }
                    ]
                  },
                  "status": {
                    "const": "ran",
                    "type": "string"
                  },
                  "execution": {
                    "anyOf": [
                      {
                        "const": "completed",
                        "type": "string"
                      },
                      {
                        "const": "failed",
                        "type": "string"
                      },
                      {
                        "const": "timeout",
                        "type": "string"
                      },
                      {
                        "const": "budget-cut",
                        "type": "string"
                      },
                      {
                        "const": "cancelled",
                        "type": "string"
                      },
                      {
                        "const": "crashed",
                        "type": "string"
                      },
                      {
                        "const": "skipped",
                        "type": "string"
                      },
                      {
                        "const": "not-run",
                        "type": "string"
                      }
                    ]
                  },
                  "unit": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "const": "operation",
                            "type": "string"
                          },
                          {
                            "const": "operation-auth-state",
                            "type": "string"
                          },
                          {
                            "const": "operation-strategy",
                            "type": "string"
                          },
                          {
                            "const": "test-case",
                            "type": "string"
                          },
                          {
                            "const": "schema-element",
                            "type": "string"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ledger": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "passed",
                      "failed",
                      "notTested",
                      "notTestedByReason"
                    ],
                    "properties": {
                      "passed": {
                        "minimum": 0,
                        "type": "integer"
                      },
                      "failed": {
                        "minimum": 0,
                        "type": "integer"
                      },
                      "notTested": {
                        "minimum": 0,
                        "type": "integer"
                      },
                      "notTestedByReason": {
                        "additionalProperties": false,
                        "type": "object",
                        "properties": {
                          "authUnavailable": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "unreachable": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "timeout": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "budgetExceeded": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "aborted": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "unsupported": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "dryRun": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "inconclusive": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "dependencyUnavailable": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "unknown": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "withheldUnsafe": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      }
                    }
                  },
                  "nonOperationUnits": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "passed",
                      "failed",
                      "notTested",
                      "notTestedByReason"
                    ],
                    "properties": {
                      "passed": {
                        "minimum": 0,
                        "type": "integer"
                      },
                      "failed": {
                        "minimum": 0,
                        "type": "integer"
                      },
                      "notTested": {
                        "minimum": 0,
                        "type": "integer"
                      },
                      "notTestedByReason": {
                        "additionalProperties": false,
                        "type": "object",
                        "properties": {
                          "authUnavailable": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "unreachable": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "timeout": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "budgetExceeded": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "aborted": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "unsupported": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "dryRun": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "inconclusive": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "dependencyUnavailable": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "unknown": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "withheldUnsafe": {
                            "minimum": 0,
                            "type": "integer"
                          }
                        }
                      }
                    }
                  },
                  "examinedOperations": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "examinedProtocols": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "const": "graphql",
                          "type": "string"
                        },
                        {
                          "const": "rest",
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "targetUnreachable": {
                    "type": "boolean"
                  },
                  "durationMs": {
                    "minimum": 0,
                    "type": "integer"
                  }
                }
              }
            ]
          }
        },
        "byUnit": {
          "additionalProperties": false,
          "type": "object",
          "properties": {
            "operation": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "passed",
                "failed",
                "notTested",
                "notTestedByReason"
              ],
              "properties": {
                "passed": {
                  "minimum": 0,
                  "type": "integer"
                },
                "failed": {
                  "minimum": 0,
                  "type": "integer"
                },
                "notTested": {
                  "minimum": 0,
                  "type": "integer"
                },
                "notTestedByReason": {
                  "additionalProperties": false,
                  "type": "object",
                  "properties": {
                    "authUnavailable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unreachable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "timeout": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "budgetExceeded": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "aborted": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unsupported": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "dryRun": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "inconclusive": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "dependencyUnavailable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unknown": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "withheldUnsafe": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "operation-auth-state": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "passed",
                "failed",
                "notTested",
                "notTestedByReason"
              ],
              "properties": {
                "passed": {
                  "minimum": 0,
                  "type": "integer"
                },
                "failed": {
                  "minimum": 0,
                  "type": "integer"
                },
                "notTested": {
                  "minimum": 0,
                  "type": "integer"
                },
                "notTestedByReason": {
                  "additionalProperties": false,
                  "type": "object",
                  "properties": {
                    "authUnavailable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unreachable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "timeout": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "budgetExceeded": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "aborted": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unsupported": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "dryRun": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "inconclusive": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "dependencyUnavailable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unknown": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "withheldUnsafe": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "operation-strategy": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "passed",
                "failed",
                "notTested",
                "notTestedByReason"
              ],
              "properties": {
                "passed": {
                  "minimum": 0,
                  "type": "integer"
                },
                "failed": {
                  "minimum": 0,
                  "type": "integer"
                },
                "notTested": {
                  "minimum": 0,
                  "type": "integer"
                },
                "notTestedByReason": {
                  "additionalProperties": false,
                  "type": "object",
                  "properties": {
                    "authUnavailable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unreachable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "timeout": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "budgetExceeded": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "aborted": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unsupported": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "dryRun": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "inconclusive": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "dependencyUnavailable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unknown": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "withheldUnsafe": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "test-case": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "passed",
                "failed",
                "notTested",
                "notTestedByReason"
              ],
              "properties": {
                "passed": {
                  "minimum": 0,
                  "type": "integer"
                },
                "failed": {
                  "minimum": 0,
                  "type": "integer"
                },
                "notTested": {
                  "minimum": 0,
                  "type": "integer"
                },
                "notTestedByReason": {
                  "additionalProperties": false,
                  "type": "object",
                  "properties": {
                    "authUnavailable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unreachable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "timeout": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "budgetExceeded": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "aborted": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unsupported": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "dryRun": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "inconclusive": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "dependencyUnavailable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unknown": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "withheldUnsafe": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "schema-element": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "passed",
                "failed",
                "notTested",
                "notTestedByReason"
              ],
              "properties": {
                "passed": {
                  "minimum": 0,
                  "type": "integer"
                },
                "failed": {
                  "minimum": 0,
                  "type": "integer"
                },
                "notTested": {
                  "minimum": 0,
                  "type": "integer"
                },
                "notTestedByReason": {
                  "additionalProperties": false,
                  "type": "object",
                  "properties": {
                    "authUnavailable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unreachable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "timeout": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "budgetExceeded": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "aborted": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unsupported": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "dryRun": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "inconclusive": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "dependencyUnavailable": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "unknown": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "withheldUnsafe": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "findings": {
      "type": "array",
      "items": {
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tool",
          "target",
          "classification",
          "normalizedLevel",
          "count",
          "examples"
        ],
        "properties": {
          "tool": {
            "anyOf": [
              {
                "const": "input-fuzzer",
                "type": "string"
              },
              {
                "const": "response-validator",
                "type": "string"
              },
              {
                "const": "rbac-matrix",
                "type": "string"
              },
              {
                "const": "rate-limit-validator",
                "type": "string"
              },
              {
                "const": "error-code-validator",
                "type": "string"
              },
              {
                "const": "deprecation-tracker",
                "type": "string"
              },
              {
                "const": "rest-fuzzer",
                "type": "string"
              }
            ]
          },
          "target": {
            "anyOf": [
              {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "kind",
                  "protocol",
                  "operationKey"
                ],
                "properties": {
                  "kind": {
                    "const": "operation",
                    "type": "string"
                  },
                  "protocol": {
                    "anyOf": [
                      {
                        "const": "graphql",
                        "type": "string"
                      },
                      {
                        "const": "rest",
                        "type": "string"
                      }
                    ]
                  },
                  "operationKey": {
                    "minLength": 1,
                    "maxLength": 512,
                    "type": "string"
                  }
                }
              },
              {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "kind",
                  "elementKey"
                ],
                "properties": {
                  "kind": {
                    "const": "schema-element",
                    "type": "string"
                  },
                  "elementKey": {
                    "minLength": 1,
                    "maxLength": 512,
                    "type": "string"
                  },
                  "parentType": {
                    "minLength": 1,
                    "maxLength": 200,
                    "type": "string"
                  }
                }
              },
              {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "kind",
                  "tool"
                ],
                "properties": {
                  "kind": {
                    "const": "run",
                    "type": "string"
                  },
                  "tool": {
                    "anyOf": [
                      {
                        "const": "input-fuzzer",
                        "type": "string"
                      },
                      {
                        "const": "response-validator",
                        "type": "string"
                      },
                      {
                        "const": "rbac-matrix",
                        "type": "string"
                      },
                      {
                        "const": "rate-limit-validator",
                        "type": "string"
                      },
                      {
                        "const": "error-code-validator",
                        "type": "string"
                      },
                      {
                        "const": "deprecation-tracker",
                        "type": "string"
                      },
                      {
                        "const": "rest-fuzzer",
                        "type": "string"
                      }
                    ]
                  }
                }
              }
            ]
          },
          "authState": {
            "maxLength": 200,
            "type": "string"
          },
          "classification": {
            "minLength": 1,
            "maxLength": 200,
            "type": "string"
          },
          "normalizedLevel": {
            "anyOf": [
              {
                "const": "CRITICAL",
                "type": "string"
              },
              {
                "const": "HIGH",
                "type": "string"
              },
              {
                "const": "MEDIUM",
                "type": "string"
              },
              {
                "const": "LOW",
                "type": "string"
              },
              {
                "const": "INFO",
                "type": "string"
              }
            ]
          },
          "count": {
            "minimum": 1,
            "type": "integer"
          },
          "examples": {
            "type": "array",
            "items": {
              "maxLength": 2048,
              "type": "string"
            }
          }
        }
      }
    },
    "verdict": {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "overallSeverity",
        "health",
        "coverage",
        "completeness",
        "operationCount",
        "degraded",
        "emptyRun",
        "incomplete",
        "reasons"
      ],
      "properties": {
        "overallSeverity": {
          "anyOf": [
            {
              "const": "CRITICAL",
              "type": "string"
            },
            {
              "const": "HIGH",
              "type": "string"
            },
            {
              "const": "MEDIUM",
              "type": "string"
            },
            {
              "const": "LOW",
              "type": "string"
            },
            {
              "const": "CLEAN",
              "type": "string"
            },
            {
              "const": "UNTESTED",
              "type": "string"
            }
          ]
        },
        "health": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "score",
            "level",
            "verdict"
          ],
          "properties": {
            "score": {
              "anyOf": [
                {
                  "minimum": 0,
                  "maximum": 100,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "level": {
              "anyOf": [
                {
                  "const": "CRITICAL",
                  "type": "string"
                },
                {
                  "const": "HIGH",
                  "type": "string"
                },
                {
                  "const": "MEDIUM",
                  "type": "string"
                },
                {
                  "const": "LOW",
                  "type": "string"
                },
                {
                  "const": "CLEAN",
                  "type": "string"
                },
                {
                  "const": "UNTESTED",
                  "type": "string"
                }
              ]
            },
            "verdict": {
              "anyOf": [
                {
                  "const": "Critical",
                  "type": "string"
                },
                {
                  "const": "At risk",
                  "type": "string"
                },
                {
                  "const": "Needs attention",
                  "type": "string"
                },
                {
                  "const": "Healthy",
                  "type": "string"
                },
                {
                  "const": "Untested",
                  "type": "string"
                }
              ]
            }
          }
        },
        "coverage": {
          "anyOf": [
            {
              "const": "full",
              "type": "string"
            },
            {
              "const": "partial",
              "type": "string"
            }
          ]
        },
        "completeness": {
          "minimum": 0,
          "maximum": 1,
          "type": "number"
        },
        "operationCount": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "degraded": {
          "type": "boolean"
        },
        "emptyRun": {
          "type": "boolean"
        },
        "incomplete": {
          "type": "boolean"
        },
        "reasons": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "const": "ALL_TOOLS_FAILED",
                "type": "string"
              },
              {
                "const": "EMPTY_RUN",
                "type": "string"
              },
              {
                "const": "PARTIAL_TOOL_FAILURE",
                "type": "string"
              },
              {
                "const": "PARTIAL_COVERAGE",
                "type": "string"
              },
              {
                "const": "TARGET_UNREACHABLE",
                "type": "string"
              },
              {
                "const": "SCOPE_UNKNOWN",
                "type": "string"
              },
              {
                "const": "RESULT_TRIMMED",
                "type": "string"
              }
            ]
          }
        }
      }
    },
    "provenance": {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "trimmed"
      ],
      "properties": {
        "planSnapshots": {
          "additionalProperties": false,
          "type": "object",
          "properties": {
            "input-fuzzer": {
              "pattern": "^[0-9a-f]{64}$",
              "type": "string"
            },
            "response-validator": {
              "pattern": "^[0-9a-f]{64}$",
              "type": "string"
            },
            "rbac-matrix": {
              "pattern": "^[0-9a-f]{64}$",
              "type": "string"
            },
            "rate-limit-validator": {
              "pattern": "^[0-9a-f]{64}$",
              "type": "string"
            },
            "error-code-validator": {
              "pattern": "^[0-9a-f]{64}$",
              "type": "string"
            },
            "deprecation-tracker": {
              "pattern": "^[0-9a-f]{64}$",
              "type": "string"
            },
            "rest-fuzzer": {
              "pattern": "^[0-9a-f]{64}$",
              "type": "string"
            }
          }
        },
        "trimmed": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "const": "responseSchemas",
                "type": "string"
              },
              {
                "const": "requestBody",
                "type": "string"
              },
              {
                "const": "parameters",
                "type": "string"
              },
              {
                "const": "findingExamples",
                "type": "string"
              },
              {
                "const": "toolExamples",
                "type": "string"
              }
            ]
          }
        }
      }
    }
  }
}
