{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "ruleSetVersion": {
      "const": "x402-readiness-preflight/1.0.1"
    },
    "requestSha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "startedAt": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
    },
    "observation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "requestedUrl": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        },
        "method": {
          "enum": [
            "GET",
            "HEAD",
            "OPTIONS"
          ]
        },
        "bodyShape": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "none"
            }
          },
          "required": [
            "type"
          ]
        },
        "finalUrl": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ]
        },
        "httpStatus": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 200,
              "maximum": 599
            },
            {
              "type": "null"
            }
          ]
        },
        "observedAt": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "complete": {
          "type": "boolean"
        },
        "failure": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ]
        },
        "rawBodySha256": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "rawBytes": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 1048576
            },
            {
              "type": "null"
            }
          ]
        },
        "contentEncoding": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 0,
              "maxLength": 16384
            },
            {
              "type": "null"
            }
          ]
        },
        "paymentRequiredValues": {
          "type": "array",
          "maxItems": 128,
          "items": {
            "type": "string",
            "minLength": 0,
            "maxLength": 16384
          }
        },
        "headerSha256": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "decodedChallengeSha256": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "redirects": {
          "type": "array",
          "maxItems": 3,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "from": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              },
              "to": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              },
              "status": {
                "type": "integer",
                "minimum": 0,
                "maximum": 399
              }
            },
            "required": [
              "from",
              "to",
              "status"
            ]
          }
        }
      },
      "required": [
        "requestedUrl",
        "method",
        "bodyShape",
        "finalUrl",
        "httpStatus",
        "observedAt",
        "complete",
        "failure",
        "rawBodySha256",
        "rawBytes",
        "contentEncoding",
        "paymentRequiredValues",
        "headerSha256",
        "decodedChallengeSha256",
        "redirects"
      ]
    },
    "verdict": {
      "enum": [
        "PASS",
        "FAIL",
        "INCONCLUSIVE"
      ]
    },
    "findings": {
      "type": "array",
      "maxItems": 128,
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "check": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "option": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 7
              },
              {
                "type": "null"
              }
            ]
          },
          "verdict": {
            "enum": [
              "PASS",
              "FAIL",
              "INCONCLUSIVE"
            ]
          },
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "pointer": {
            "type": "string",
            "minLength": 0,
            "maxLength": 256
          },
          "detail": {
            "type": "string",
            "minLength": 1,
            "maxLength": 384
          }
        },
        "required": [
          "check",
          "option",
          "verdict",
          "code",
          "pointer",
          "detail"
        ]
      }
    },
    "options": {
      "type": "array",
      "maxItems": 8,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0,
            "maximum": 7
          },
          "verdict": {
            "enum": [
              "PASS",
              "FAIL",
              "INCONCLUSIVE"
            ]
          },
          "scheme": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 0,
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ]
          },
          "network": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 0,
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ]
          },
          "asset": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 0,
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ]
          },
          "amount": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 0,
                "maxLength": 78
              },
              {
                "type": "null"
              }
            ]
          },
          "displayPrice": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 0,
                "maxLength": 86
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 12
              },
              {
                "type": "null"
              }
            ]
          },
          "decimals": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 18
              },
              {
                "type": "null"
              }
            ]
          },
          "payTo": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 0,
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ]
          },
          "maxTimeoutSeconds": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "domainName": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 0,
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          },
          "domainVersion": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 0,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "signability": {
            "enum": [
              "METADATA_PRESENT",
              "MISSING_OR_INVALID",
              "UNSUPPORTED"
            ]
          }
        },
        "required": [
          "index",
          "verdict",
          "scheme",
          "network",
          "asset",
          "amount",
          "displayPrice",
          "currency",
          "decimals",
          "payTo",
          "maxTimeoutSeconds",
          "domainName",
          "domainVersion",
          "signability"
        ]
      }
    },
    "usage": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "requests": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4
        },
        "redirects": {
          "type": "integer",
          "minimum": 0,
          "maximum": 3
        },
        "rawBytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1048576
        }
      },
      "required": [
        "requests",
        "redirects",
        "rawBytes"
      ]
    },
    "claims": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "paidSettlement": {
          "const": false
        },
        "replaySafety": {
          "const": false
        },
        "deliveryCorrectness": {
          "const": false
        },
        "merchantHonesty": {
          "const": false
        },
        "generalSecurity": {
          "const": false
        },
        "actualSignability": {
          "const": false
        }
      },
      "required": [
        "paidSettlement",
        "replaySafety",
        "deliveryCorrectness",
        "merchantHonesty",
        "generalSecurity",
        "actualSignability"
      ]
    },
    "limitations": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 384
      }
    },
    "signature": {
      "type": "null"
    },
    "evidenceId": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    }
  },
  "required": [
    "ruleSetVersion",
    "requestSha256",
    "startedAt",
    "observation",
    "verdict",
    "findings",
    "options",
    "usage",
    "claims",
    "limitations",
    "signature",
    "evidenceId"
  ]
}
