{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://law.arxo.io/schema/package-benchmark.schema.json",
  "type": "object",
  "properties": {
    "format": {
      "const": "law.package-benchmark/0.1"
    },
    "adapter": {
      "const": "native-ffi"
    },
    "environment": {
      "type": "object"
    },
    "loadHandleMs": {
      "type": "number",
      "minimum": 0
    },
    "worldHash": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "peakProcessRssBytes": {
      "type": "integer",
      "minimum": 0
    },
    "memoryScope": {
      "type": "string"
    },
    "expectationCheckerHash": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "scenarios": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "suite": {
            "type": "string"
          },
          "testIndex": {
            "type": "integer",
            "minimum": 0
          },
          "reason": {
            "type": "string"
          },
          "requestHashes": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^sha256:[0-9a-f]{64}$"
            }
          },
          "testHash": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$"
          },
          "inputFacts": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0
            }
          },
          "firstObservedCallsMs": {
            "type": "array",
            "items": {
              "type": "number",
              "minimum": 0
            }
          },
          "wallMs": {
            "type": "object",
            "properties": {
              "n": {
                "type": "integer",
                "minimum": 1
              },
              "p50": {
                "type": "number",
                "minimum": 0
              },
              "p95": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "n",
              "p50",
              "p95"
            ],
            "additionalProperties": false
          },
          "cpuMs": {
            "type": "object",
            "properties": {
              "n": {
                "type": "integer",
                "minimum": 1
              },
              "p50": {
                "type": "number",
                "minimum": 0
              },
              "p95": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "n",
              "p50",
              "p95"
            ],
            "additionalProperties": false
          },
          "raw": {
            "type": "object",
            "properties": {
              "wallMs": {
                "type": "array",
                "items": {
                  "type": "number",
                  "minimum": 0
                }
              },
              "cpuMs": {
                "type": "array",
                "items": {
                  "type": "number",
                  "minimum": 0
                }
              },
              "responseBytes": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "proofBytes": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "required": [
              "wallMs",
              "cpuMs",
              "responseBytes",
              "proofBytes"
            ],
            "additionalProperties": false
          },
          "responseBytes": {
            "type": "object",
            "properties": {
              "n": {
                "type": "integer",
                "minimum": 1
              },
              "p50": {
                "type": "number",
                "minimum": 0
              },
              "p95": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "n",
              "p50",
              "p95"
            ],
            "additionalProperties": false
          },
          "proofBytes": {
            "type": "object",
            "properties": {
              "n": {
                "type": "integer",
                "minimum": 1
              },
              "p50": {
                "type": "number",
                "minimum": 0
              },
              "p95": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "n",
              "p50",
              "p95"
            ],
            "additionalProperties": false
          },
          "outcome": {
            "const": "passed"
          },
          "successfulEvaluations": {
            "type": "integer",
            "minimum": 1
          },
          "failedEvaluations": {
            "const": 0
          },
          "serialMeasuredCallsPerSecond": {
            "type": "number",
            "minimum": 0
          }
        },
        "required": [
          "id",
          "title",
          "suite",
          "testIndex",
          "reason",
          "requestHashes",
          "testHash",
          "inputFacts",
          "firstObservedCallsMs",
          "wallMs",
          "cpuMs",
          "raw",
          "responseBytes",
          "proofBytes",
          "outcome",
          "successfulEvaluations",
          "failedEvaluations"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "format",
    "adapter",
    "environment",
    "loadHandleMs",
    "worldHash",
    "peakProcessRssBytes",
    "memoryScope",
    "expectationCheckerHash",
    "scenarios"
  ],
  "additionalProperties": false
}
