{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://eips.ethereum.org/assets/eip-8506/schemas/assessment.schema.json",
  "title": "AITO Assessment",
  "description": "Who found what, about which subject, under which conditions. An Assessment is an observation, not a promise.",
  "type": "object",
  "required": [
    "aito",
    "kind",
    "subject",
    "assessor",
    "standing",
    "metric",
    "state",
    "asOf",
    "validUntil",
    "evidence"
  ],
  "properties": {
    "aito": {
      "const": "1",
      "description": "Record format version."
    },
    "kind": {
      "const": "assessment"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "supersedes": {
      "$ref": "#/$defs/bytes32",
      "description": "Identifier of the record this one replaces."
    },
    "subject": {
      "type": "object"
    },
    "assessor": {
      "$ref": "#/$defs/account"
    },
    "standing": {
      "enum": [
        "self",
        "counterparty",
        "third-party"
      ]
    },
    "metric": {
      "type": "object",
      "required": [
        "family",
        "name",
        "version"
      ],
      "properties": {
        "family": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "version": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "value": {
      "type": "string"
    },
    "state": {
      "enum": [
        "measured",
        "not-observed",
        "not-applicable",
        "undeterminable"
      ]
    },
    "conditions": {
      "type": "object",
      "description": "Required for empirical measurements."
    },
    "method": {
      "$ref": "#/$defs/bytes32",
      "description": "Required for empirical measurements."
    },
    "scope": {
      "type": "string"
    },
    "uncertainty": {
      "type": "string"
    },
    "asOf": {
      "$ref": "#/$defs/time"
    },
    "validUntil": {
      "$ref": "#/$defs/time"
    },
    "baseline": {
      "type": "object",
      "description": "Required for marginal-capability metrics."
    },
    "evidence": {
      "description": "Evidence commitment, or the string none."
    }
  },
  "additionalProperties": true,
  "$defs": {
    "bytes32": {
      "type": "string",
      "pattern": "^0x[0-9a-f]{64}$"
    },
    "account": {
      "type": "string",
      "pattern": "^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}:[-.%a-zA-Z0-9]{1,128}$",
      "description": "CAIP-10 account identifier."
    },
    "decimal": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
      "description": "A non-negative decimal written as a string. Records carry no floating-point numbers."
    },
    "integer": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]*)$"
    },
    "time": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
    },
    "undeclared": {
      "const": "undeclared"
    }
  }
}
