{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.runlocal.ai/schemas/v1/validation.json",
  "title": "Validation report",
  "description": "A runlocal.validation/4.0 report. It separates resolved meaning, node validity, backend support, source equivalence, replacement equivalence, and structural readiness. When a client attaches one to an upload, its digests must match; the server retains it as untrusted client data and also produces its own report.",
  "type": "object",
  "required": [
    "kind",
    "protocol_version",
    "input_digest",
    "revision_digest",
    "contract_digest",
    "example_digests",
    "validator",
    "capabilities",
    "backend_profile",
    "checks",
    "submitted_evidence",
    "diagnostics",
    "operators",
    "quantization",
    "extensions",
    "provision",
    "scopes"
  ],
  "properties": {
    "kind": {
      "description": "The document kind.",
      "type": "string",
      "const": "runlocal.validation"
    },
    "protocol_version": {
      "description": "The report version.",
      "type": "string",
      "const": "4.0"
    },
    "input_digest": {
      "description": "SHA-256 of the validated input bytes, or null.",
      "anyOf": [
        {
          "$ref": "#/$defs/Digest"
        },
        {
          "type": "null"
        }
      ]
    },
    "revision_digest": {
      "description": "The revision digest the validator computed, or null.",
      "anyOf": [
        {
          "$ref": "#/$defs/Digest"
        },
        {
          "type": "null"
        }
      ]
    },
    "contract_digest": {
      "description": "The contract digest the validator computed, or null.",
      "anyOf": [
        {
          "$ref": "#/$defs/Digest"
        },
        {
          "type": "null"
        }
      ]
    },
    "example_digests": {
      "description": "The example digests the validator computed, by example name.",
      "type": "object",
      "propertyNames": {
        "$ref": "#/$defs/Id"
      },
      "additionalProperties": {
        "$ref": "#/$defs/Digest"
      }
    },
    "validator": {
      "$ref": "#/$defs/Producer"
    },
    "capabilities": {
      "$ref": "#/$defs/Capabilities"
    },
    "backend_profile": {
      "description": "The pinned backend capability profile used by this report, or null.",
      "anyOf": [
        {
          "$ref": "#/$defs/BackendProfile"
        },
        {
          "type": "null"
        }
      ]
    },
    "checks": {
      "description": "Server check outcomes in execution order.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/CheckResult"
      }
    },
    "submitted_evidence": {
      "description": "Claims and evidence submitted in the request, separate from server checks.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/SubmittedEvidence"
      }
    },
    "diagnostics": {
      "description": "Findings.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/Diagnostic"
      }
    },
    "operators": {
      "description": "Per-operator assessments in request registry order.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/OperatorAssessment"
      }
    },
    "quantization": {
      "description": "Function-overlay quantization assessments.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/QuantizationAssessment"
      }
    },
    "extensions": {
      "description": "Exact extension assessments.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/ExtensionAssessment"
      }
    },
    "provision": {
      "$ref": "#/$defs/ProvisionCatalog"
    },
    "scopes": {
      "description": "Per-scope assessments.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/ScopeAssessment"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "BackendProfile": {
      "title": "BackendProfile",
      "description": "The pinned backend capability profile used for support results. null means backend support was not assessed.",
      "type": "object",
      "required": [
        "name",
        "version",
        "digest"
      ],
      "properties": {
        "name": {
          "description": "The backend capability profile name.",
          "type": "string",
          "minLength": 1
        },
        "version": {
          "description": "The exact backend capability profile version.",
          "type": "string",
          "minLength": 1
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        }
      },
      "additionalProperties": false
    },
    "Capabilities": {
      "title": "Capabilities",
      "description": "What the validator can assess. A restricted validator still preserves explicit knowledge, source coverage, weight identity, file roles, and content identity.",
      "type": "object",
      "required": [
        "package_version",
        "request_versions",
        "authoring_versions",
        "response_versions",
        "native",
        "checks",
        "supported_extensions"
      ],
      "properties": {
        "package_version": {
          "description": "The validator package version.",
          "type": "string"
        },
        "request_versions": {
          "description": "Request protocol versions the validator accepts.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "authoring_versions": {
          "description": "Authoring formats the validator accepts.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "response_versions": {
          "description": "Report versions the validator emits.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "native": {
          "description": "Native formats the validator decodes.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/NativeCapability"
          }
        },
        "checks": {
          "description": "The checks the validator implements, in order.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "supported_extensions": {
          "description": "Extensions the validator interprets.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "CheckResult": {
      "title": "CheckResult",
      "description": "The outcome of one check.",
      "type": "object",
      "required": [
        "check",
        "status"
      ],
      "properties": {
        "check": {
          "description": "The check name.",
          "type": "string"
        },
        "status": {
          "description": "Invalid, incomplete, and unsupported are distinct outcomes and are never combined into one success Boolean.",
          "type": "string",
          "enum": [
            "passed",
            "failed",
            "incomplete",
            "unsupported",
            "skipped"
          ]
        }
      },
      "additionalProperties": false
    },
    "DefinitionAssessment": {
      "title": "DefinitionAssessment",
      "description": "Whether the operator meaning is resolved and where that meaning comes from.",
      "type": "object",
      "required": [
        "status",
        "authority",
        "reference",
        "detail"
      ],
      "properties": {
        "status": {
          "description": "Whether the operator's authoritative definition was found and its dependencies resolve.",
          "type": "string",
          "enum": [
            "resolved",
            "unresolved",
            "invalid",
            "not_assessed"
          ]
        },
        "authority": {
          "description": "The declared source of meaning. A link is never an authority.",
          "type": "string",
          "enum": [
            "onnx",
            "local_function",
            "extension",
            "unknown",
            "torch_api",
            "torch_module",
            "torch_source"
          ]
        },
        "reference": {
          "description": "The catalog entry or bundled document pointer, or null.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "detail": {
          "description": "A short reason for this status, or null.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "Diagnostic": {
      "title": "Diagnostic",
      "description": "One finding with a stable code, exact subject and contract pointer, related names, and affected scopes.",
      "type": "object",
      "required": [
        "code",
        "kind",
        "severity",
        "message",
        "pointer",
        "subject",
        "repair",
        "unknown",
        "related_names",
        "targets",
        "examples",
        "source"
      ],
      "properties": {
        "code": {
          "description": "The stable diagnostic code.",
          "type": "string",
          "enum": [
            "WIRE.INVALID",
            "CONTENT.MISMATCH",
            "OBJECTS.MISSING",
            "REFERENCE.INVALID",
            "SEMANTICS.CONFLICT",
            "SEMANTICS.REQUIRED",
            "BINDING.INVALID",
            "EFFECT.UNORDERED",
            "DOMAIN.VIOLATION",
            "CENSUS.MISMATCH",
            "SOURCE.INCOMPLETE",
            "CAPABILITY.UNSUPPORTED",
            "EVIDENCE.INSUFFICIENT",
            "EVIDENCE.MISMATCH",
            "RESOURCE.EXHAUSTED",
            "AUTHORING.INVALID",
            "IO.ERROR",
            "LINKS.URL_INVALID",
            "LINKS.CREDENTIALS_PRESENT",
            "LINKS.ACCESS_TOKEN_PRESENT",
            "LINKS.SCOPE_NOT_FOUND",
            "FILES.BYTES_NOT_STATED",
            "FILES.CONTENT_NOT_PERMITTED",
            "FILES.CONSTANT_ROLE_INVALID",
            "FILES.CONSTANT_SIZE_MISMATCH",
            "FILES.LOCATION_UNSUPPORTED",
            "ENVIRONMENTS.TORCH_REQUIRED",
            "ENVIRONMENTS.PACKAGE_NAME_INVALID",
            "FUNCTIONS.INPUT_BINDING_INVALID",
            "FUNCTIONS.OUTPUT_BINDING_INVALID",
            "FUNCTIONS.STATE_BINDING_INVALID",
            "FUNCTIONS.STATE_PAIR_INVALID",
            "FUNCTIONS.STATE_DOMAIN_MISMATCH",
            "FUNCTIONS.STATE_INITIAL_TYPE_MISMATCH",
            "FUNCTIONS.ALIAS_PAIR_INVALID",
            "FUNCTIONS.STATE_READ_REUSED",
            "FUNCTIONS.INPUT_NOT_FOUND",
            "FUNCTIONS.STEP_NOT_FOUND",
            "FUNCTIONS.OUTPUT_NOT_FOUND",
            "FUNCTIONS.STEP_CYCLE",
            "FUNCTIONS.CALL_CYCLE",
            "FUNCTIONS.VALUE_POLICY_MISMATCH",
            "QUANTIZATION.WEIGHT_NOT_FOUND",
            "QUANTIZATION.VALUE_NOT_FOUND",
            "QUANTIZATION.VALUE_BODY_INVALID",
            "QUANTIZATION.TARGET_NESTED",
            "QUANTIZATION.TARGET_OVERLAP",
            "QUANTIZATION.TARGET_TYPE_INVALID",
            "QUANTIZATION.SCHEME_REQUIRED",
            "QUANTIZATION.SCHEMA_INVALID",
            "QUANTIZATION.TYPE_INVALID",
            "QUANTIZATION.SHAPE_INVALID",
            "QUANTIZATION.DYNAMIC_INVALID",
            "QUANTIZATION.STORAGE_INVALID",
            "QUANTIZATION.FILE_INVALID",
            "QUANTIZATION.VALUE_INVALID",
            "QUANTIZATION.BINDING_CONFLICT",
            "QUANTIZATION.SOURCE_INVALID",
            "FUNCTIONS.STEP_TYPE_MISMATCH",
            "FUNCTIONS.STEP_TYPE_UNPROVED",
            "VALUES.DOMAIN_INVALID",
            "WEIGHTS.PORT_BINDING_INVALID",
            "WEIGHTS.PORT_NOT_FOUND",
            "WEIGHTS.PORT_CONTRACT_MISMATCH",
            "WEIGHTS.PORT_DIMENSION_INVALID",
            "WEIGHTS.LIFT_INVALID",
            "FUNCTIONS.DIMENSION_RANGE_INVALID",
            "FUNCTIONS.DIMENSION_NOT_FOUND",
            "FUNCTIONS.DIMENSION_CYCLE",
            "FUNCTIONS.DIMENSION_RELATION_INVALID",
            "EXAMPLES.INPUT_BINDING_INVALID",
            "EXAMPLES.STATE_BINDING_INVALID",
            "EXAMPLES.OUTPUT_BINDING_INVALID",
            "CONSTRAINTS.SYNTAX_INVALID",
            "CONSTRAINTS.REFERENCE_INVALID",
            "CONSTRAINTS.VIOLATION",
            "CONSTRAINTS.UNPROVED",
            "EXAMPLES.COUNT_TERM_INVALID",
            "EXAMPLES.COUNT_VALUE_MISMATCH",
            "EXAMPLES.SOURCE_FILE_INVALID",
            "EXAMPLES.SOURCE_PRIVATE",
            "EXAMPLES.SOURCE_TYPE_MISMATCH",
            "EXAMPLES.SOURCE_STATISTICS_INVALID",
            "EXAMPLES.SOURCE_GENERATOR_INVALID",
            "EXAMPLES.SOURCE_VALUE_MISMATCH",
            "EXAMPLES.PIN_IDENTITY_REQUIRED",
            "EXAMPLES.WEIGHT_BINDING_DUPLICATE",
            "EXAMPLES.WEIGHT_SOURCE_INVALID",
            "EXAMPLES.DIMENSION_NOT_FOUND",
            "EXAMPLES.DIMENSION_RANGE_INVALID",
            "EXAMPLES.DIMENSION_RELATION_INVALID",
            "EXAMPLES.DIMENSION_COUNT_MISMATCH",
            "KNOWLEDGE.REFERENCE_INVALID",
            "KNOWLEDGE.RESULT_INVALID",
            "KNOWLEDGE.ARTIFACT_ROLE_INVALID",
            "KNOWLEDGE.SUBJECT_NOT_FOUND",
            "KNOWLEDGE.CONTENT_MISMATCH",
            "KNOWLEDGE.DEPENDENCY_CYCLE",
            "KNOWLEDGE.FIDELITY_REQUIRED",
            "KNOWLEDGE.CURRENT_CONTRACT_MISMATCH",
            "KNOWLEDGE.BASELINE_MISMATCH",
            "KNOWLEDGE.FIDELITY_INTERFACE_MISMATCH",
            "KNOWLEDGE.SOURCE_REFUTED",
            "WEIGHTS.GRAPH_BINDING_INVALID",
            "WEIGHTS.GRAPH_TYPE_MISMATCH",
            "WEIGHTS.DEFAULT_NOT_ALLOWED",
            "GRAPH.LOCAL_FUNCTION_DUPLICATE",
            "GRAPH.ATTRIBUTE_REFERENCE_INVALID",
            "GRAPH.FUNCTION_ATTRIBUTES_INVALID",
            "GRAPH.CALL_ATTRIBUTES_INVALID",
            "GRAPH.SPARSE_SHAPE_INVALID",
            "WEIGHTS.REFERENCE_NOT_FOUND",
            "WEIGHTS.TIED_CONTRACT_MISMATCH",
            "GRAPH.NAME_DUPLICATE",
            "FUNCTIONS.GRAPH_TYPE_UNRESOLVED",
            "FUNCTIONS.GRAPH_BINDING_INVALID",
            "FILES.EXTERNAL_DATA_MISMATCH",
            "FILES.EXTERNAL_DATA_FILE_INVALID",
            "GRAPH.FILE_INVALID",
            "GRAPH.SOURCE_INVALID",
            "FUNCTIONS.GRAPH_TYPE_MISMATCH",
            "GRAPH.TENSOR_COUNT_MISMATCH",
            "GRAPH.TENSOR_DATA_REQUIRED",
            "GRAPH.TENSOR_DATA_CONFLICT",
            "GRAPH.TENSOR_VALUE_INVALID",
            "GRAPH.TENSOR_BYTE_SIZE_MISMATCH",
            "GRAPH.TENSOR_EXTERNAL_RANGE_INVALID",
            "GRAPH.TENSOR_SHAPE_INVALID",
            "GRAPH.VALUE_REDEFINED",
            "GRAPH.TYPE_CONFLICT",
            "GRAPH.VALUE_NOT_FOUND",
            "GRAPH.CYCLE",
            "WEIGHTS.TENSOR_NOT_FOUND",
            "OPERATORS.NOT_REGISTERED",
            "OPERATORS.LOCAL_FUNCTION_NOT_FOUND",
            "OPERATORS.SEMANTICS_INVALID",
            "OPERATORS.SYSTEM_INVALID",
            "OPERATORS.TORCH_STATE_INVALID",
            "OPERATORS.DUPLICATE",
            "OPERATORS.COUNT_MISMATCH",
            "OPERATORS.OPSET_UNSUPPORTED",
            "OPERATORS.SCHEMA_NOT_FOUND",
            "OPERATORS.INPUTS_INVALID",
            "OPERATORS.OUTPUTS_INVALID",
            "OPERATORS.ATTRIBUTES_INVALID",
            "OPERATORS.DEFINITION_INVALID",
            "OPERATORS.NODE_INVALID",
            "OPERATORS.LOCAL_FUNCTION_CYCLE",
            "EXTENSIONS.FILE_INVALID",
            "EXTENSIONS.SCHEMA_INVALID",
            "EXTENSIONS.PAYLOAD_INVALID",
            "EXTENSIONS.SLOT_INVALID",
            "EXTENSIONS.DEPENDENCY_CYCLE",
            "OPTIMIZE.NOT_CONVEX",
            "OPTIMIZE.PATH_NOT_FOUND",
            "OPTIMIZE.BODY_KIND_INVALID",
            "OPTIMIZE.SELECTION_NOT_FOUND",
            "OPTIMIZE.WORK_UNKNOWN",
            "OPTIMIZE.WORK_UNAVAILABLE"
          ]
        },
        "kind": {
          "description": "invalid: an established contradiction. incomplete: an explicit missing fact. unsupported: a known profile the validator cannot interpret. unproved: an implication not established under current premises or effort. operational: a tool failure.",
          "type": "string",
          "enum": [
            "invalid",
            "incomplete",
            "unsupported",
            "unproved",
            "operational"
          ]
        },
        "severity": {
          "description": "The severity.",
          "type": "string",
          "enum": [
            "error",
            "warning"
          ]
        },
        "message": {
          "description": "A human-readable explanation.",
          "type": "string"
        },
        "pointer": {
          "description": "The contract location the finding is about.",
          "$ref": "#/$defs/Pointer"
        },
        "subject": {
          "description": "The exact subject of the finding.",
          "$ref": "#/$defs/Pointer"
        },
        "repair": {
          "description": "What would resolve the finding.",
          "type": "string"
        },
        "unknown": {
          "description": "The unknown for an explicit input gap, or null.",
          "anyOf": [
            {
              "$ref": "#/$defs/Id"
            },
            {
              "type": "null"
            }
          ]
        },
        "related_names": {
          "description": "Related names.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "targets": {
          "description": "Affected targets under optimize.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Id"
          }
        },
        "examples": {
          "description": "Affected examples.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Id"
          }
        },
        "source": {
          "description": "The local source location, or null.",
          "anyOf": [
            {
              "$ref": "#/$defs/SourceLocation"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "Digest": {
      "title": "Digest",
      "description": "\"sha256:\" followed by 64 lowercase hexadecimal digits.",
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "EvidenceAssessment": {
      "title": "EvidenceAssessment",
      "description": "Evidence for one kind of equivalence. Finite tests are evidence, not proof for every input.",
      "type": "object",
      "required": [
        "status",
        "knowledge"
      ],
      "properties": {
        "status": {
          "description": "The outcomes of matching knowledge. Unknown questions make the assessment inconclusive.",
          "type": "string",
          "enum": [
            "supporting",
            "refuting",
            "mixed",
            "inconclusive",
            "absent",
            "not_assessed"
          ]
        },
        "knowledge": {
          "description": "Knowledge entries used for this result.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Id"
          }
        }
      },
      "additionalProperties": false
    },
    "ExampleProvision": {
      "title": "ExampleProvision",
      "description": "Provision rows grouped by example.",
      "type": "object",
      "required": [
        "example",
        "rows"
      ],
      "properties": {
        "example": {
          "$ref": "#/$defs/Id"
        },
        "rows": {
          "description": "Provision rows for this example.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProvisionRow"
          }
        }
      },
      "additionalProperties": false
    },
    "ExtensionAssessment": {
      "title": "ExtensionAssessment",
      "description": "Definition, payload, and support results for one exact extension identity.",
      "type": "object",
      "required": [
        "identity",
        "definition_status",
        "payload_status",
        "support_status",
        "uses",
        "dependencies"
      ],
      "properties": {
        "identity": {
          "$ref": "#/$defs/ExtensionIdentity"
        },
        "definition_status": {
          "description": "Whether both bundled definition files resolve.",
          "type": "string",
          "enum": [
            "resolved",
            "unresolved",
            "invalid",
            "not_assessed"
          ]
        },
        "payload_status": {
          "description": "Whether every payload use follows the bundled schema.",
          "type": "string",
          "enum": [
            "valid",
            "invalid",
            "not_used",
            "not_assessed"
          ]
        },
        "support_status": {
          "description": "Consumer or backend support, separate from definition validity.",
          "type": "string",
          "enum": [
            "supported",
            "unsupported",
            "not_assessed"
          ]
        },
        "uses": {
          "description": "Request pointers that use this extension.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Pointer"
          }
        },
        "dependencies": {
          "description": "Extension definitions this one depends on.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Id"
          }
        }
      },
      "additionalProperties": false
    },
    "ExtensionIdentity": {
      "title": "ExtensionIdentity",
      "description": "The exact extension identity, including both bundled document digests.",
      "type": "object",
      "required": [
        "key",
        "slot",
        "name",
        "version",
        "schema_digest",
        "specification_digest"
      ],
      "properties": {
        "key": {
          "$ref": "#/$defs/Id"
        },
        "slot": {
          "description": "The extension slot.",
          "type": "string",
          "enum": [
            "body",
            "operator",
            "type",
            "constant",
            "constraint",
            "layout",
            "state",
            "numerics",
            "quantization",
            "reference",
            "observe",
            "target"
          ]
        },
        "name": {
          "description": "The extension name.",
          "type": "string"
        },
        "version": {
          "description": "The exact extension version.",
          "type": "string"
        },
        "schema_digest": {
          "$ref": "#/$defs/Digest"
        },
        "specification_digest": {
          "$ref": "#/$defs/Digest"
        }
      },
      "additionalProperties": false
    },
    "Id": {
      "title": "Id",
      "description": "A name from the request.",
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9_.-]{0,127}$"
    },
    "NativeCapability": {
      "title": "NativeCapability",
      "description": "A native format the validator can decode.",
      "type": "object",
      "required": [
        "format",
        "schema_version",
        "ir_version",
        "maximum_standard_opset"
      ],
      "properties": {
        "format": {
          "description": "Always \"onnx\". Selects this alternative.",
          "type": "string",
          "const": "onnx"
        },
        "schema_version": {
          "description": "The ONNX release whose protobuf schema the validator parses.",
          "type": "string"
        },
        "ir_version": {
          "description": "The highest supported ONNX IR version.",
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "maximum_standard_opset": {
          "description": "The highest supported standard opset.",
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "additionalProperties": false
    },
    "OnnxOperatorIdentity": {
      "title": "OnnxOperatorIdentity",
      "description": "The resolved ONNX operator identity.",
      "type": "object",
      "required": [
        "kind",
        "domain",
        "op_type",
        "overload",
        "opset"
      ],
      "properties": {
        "kind": {
          "description": "Always \"onnx\". Selects this alternative.",
          "type": "string",
          "const": "onnx"
        },
        "domain": {
          "description": "The operator domain.",
          "type": "string"
        },
        "op_type": {
          "description": "The operator type name.",
          "type": "string"
        },
        "overload": {
          "description": "The overload, or an empty string.",
          "type": "string"
        },
        "opset": {
          "description": "The imported opset version.",
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "additionalProperties": false
    },
    "OperatorAssessment": {
      "title": "OperatorAssessment",
      "description": "The definition, node validation, and backend support result for one request operator entry.",
      "type": "object",
      "required": [
        "name",
        "identity",
        "definition",
        "node_validation",
        "support",
        "runner_support",
        "nodes",
        "dependencies"
      ],
      "properties": {
        "name": {
          "$ref": "#/$defs/Id"
        },
        "identity": {
          "$ref": "#/$defs/OperatorIdentity"
        },
        "definition": {
          "$ref": "#/$defs/DefinitionAssessment"
        },
        "node_validation": {
          "description": "Whether each known node follows the resolved signature and constraints.",
          "type": "string",
          "enum": [
            "passed",
            "failed",
            "incomplete",
            "not_assessed"
          ]
        },
        "support": {
          "description": "Whether the selected backend profile supports this operator.",
          "type": "string",
          "enum": [
            "supported",
            "unsupported",
            "not_assessed"
          ]
        },
        "runner_support": {
          "description": "Whether a declared reference adapter uses a local runner profile this tool supports. This does not say that a comparison ran or passed.",
          "type": "string",
          "enum": [
            "supported",
            "unsupported",
            "not_assessed"
          ]
        },
        "nodes": {
          "description": "Graph node pointers that apply this operator.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Pointer"
          }
        },
        "dependencies": {
          "description": "Other operator entries this definition depends on.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Id"
          }
        }
      },
      "additionalProperties": false
    },
    "OperatorIdentity": {
      "title": "OperatorIdentity",
      "description": "The operator identity, tagged by operator system.",
      "oneOf": [
        {
          "$ref": "#/$defs/OnnxOperatorIdentity"
        },
        {
          "$ref": "#/$defs/TorchOperatorIdentity"
        }
      ],
      "discriminator": {
        "mapping": {
          "onnx": "#/$defs/OnnxOperatorIdentity",
          "torch": "#/$defs/TorchOperatorIdentity"
        },
        "propertyName": "kind"
      }
    },
    "Pointer": {
      "title": "Pointer",
      "description": "An RFC 6901 JSON Pointer into the request.",
      "type": "string",
      "pattern": "^(?:/(?:[^~]|~[01])*)*$"
    },
    "Producer": {
      "title": "Producer",
      "description": "The tool that produced the report.",
      "type": "object",
      "required": [
        "name",
        "version"
      ],
      "properties": {
        "name": {
          "description": "The validator's name.",
          "type": "string"
        },
        "version": {
          "description": "The validator's version.",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ProvisionCatalog": {
      "title": "ProvisionCatalog",
      "description": "One top-level catalog of independent provision facts.",
      "type": "object",
      "required": [
        "contract",
        "examples"
      ],
      "properties": {
        "contract": {
          "description": "Input, state, and weight declaration rows.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProvisionRow"
          }
        },
        "examples": {
          "description": "Example binding rows.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExampleProvision"
          }
        }
      },
      "additionalProperties": false
    },
    "ProvisionRow": {
      "title": "ProvisionRow",
      "description": "Independent provision facts for one or more declarations or bindings.",
      "type": "object",
      "required": [
        "subject",
        "pointer",
        "count",
        "source",
        "location",
        "identity",
        "facts",
        "holds",
        "privacy"
      ],
      "properties": {
        "subject": {
          "description": "The declaration or binding kind.",
          "type": "string",
          "enum": [
            "input",
            "state",
            "weight"
          ]
        },
        "pointer": {
          "$ref": "#/$defs/Pointer"
        },
        "count": {
          "description": "The number of subjects this row covers.",
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "source": {
          "description": "The source kind.",
          "type": "string",
          "enum": [
            "none",
            "local",
            "file",
            "generated",
            "constant",
            "extension"
          ]
        },
        "location": {
          "description": "Where exact values are available.",
          "type": "string",
          "enum": [
            "none",
            "local",
            "request",
            "url",
            "stored",
            "generated",
            "extension"
          ]
        },
        "identity": {
          "description": "Whether the exact value is content-identified.",
          "type": "string",
          "enum": [
            "none",
            "content"
          ]
        },
        "facts": {
          "description": "Independent available fact kinds.",
          "type": "array",
          "items": {
            "description": "An available fact kind.",
            "type": "string",
            "enum": [
              "type",
              "domain",
              "statistics",
              "values"
            ]
          }
        },
        "holds": {
          "description": "How long the source value holds.",
          "type": "string",
          "enum": [
            "none",
            "example",
            "every_run"
          ]
        },
        "privacy": {
          "description": "The receiving declaration's privacy.",
          "type": "string",
          "enum": [
            "private",
            "public"
          ]
        }
      },
      "additionalProperties": false
    },
    "QuantizationAssessment": {
      "title": "QuantizationAssessment",
      "description": "One quantization fact derived only from a function overlay.",
      "type": "object",
      "required": [
        "function",
        "target_kind",
        "target_name",
        "logical_type",
        "code_type",
        "granularity",
        "parameter_source",
        "storage_extension",
        "validation_status"
      ],
      "properties": {
        "function": {
          "$ref": "#/$defs/Id"
        },
        "target_kind": {
          "description": "The overlay target kind.",
          "type": "string",
          "enum": [
            "weight",
            "value"
          ]
        },
        "target_name": {
          "description": "The logical weight port or main-graph value name.",
          "type": "string",
          "minLength": 1
        },
        "logical_type": {
          "description": "The logical floating-point tensor type, or null when it could not be resolved.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "code_type": {
          "description": "The code type.",
          "type": "string",
          "enum": [
            "int2",
            "uint2",
            "int4",
            "uint4",
            "int8",
            "uint8",
            "int16",
            "uint16",
            "float8e4m3fn"
          ]
        },
        "granularity": {
          "$ref": "#/$defs/QuantizationGranularityAssessment"
        },
        "parameter_source": {
          "description": "Where codes and affine parameters come from.",
          "type": "string",
          "enum": [
            "local",
            "file",
            "mixed",
            "dynamic"
          ]
        },
        "storage_extension": {
          "description": "The quantization storage extension name, or null.",
          "anyOf": [
            {
              "$ref": "#/$defs/Id"
            },
            {
              "type": "null"
            }
          ]
        },
        "validation_status": {
          "description": "validated: public values and structure passed. invalid: a contradiction was found. unchecked: private local values were not read. not_assessed: required public content was absent.",
          "type": "string",
          "enum": [
            "validated",
            "invalid",
            "unchecked",
            "not_assessed"
          ]
        }
      },
      "additionalProperties": false
    },
    "QuantizationGranularityAssessment": {
      "title": "QuantizationGranularityAssessment",
      "description": "The granularity derived from a function quantization overlay.",
      "type": "object",
      "required": [
        "kind",
        "axis",
        "block_size"
      ],
      "properties": {
        "kind": {
          "description": "How scale and zero point apply.",
          "type": "string",
          "enum": [
            "per_tensor",
            "per_axis",
            "blocked"
          ]
        },
        "axis": {
          "description": "The quantized axis, or null for per-tensor quantization.",
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "block_size": {
          "description": "The block size, or null when the scheme is not blocked.",
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ScopeAssessment": {
      "title": "ScopeAssessment",
      "description": "Definition, node validation, backend support, reference-runner support, source evidence, replacement evidence, structural readiness, and the work menu are reported separately for each scope.",
      "type": "object",
      "required": [
        "kind",
        "name",
        "validity",
        "completeness",
        "definition",
        "node_validation",
        "support",
        "runner_support",
        "source_equivalence",
        "replacement_equivalence",
        "baseline_fidelity",
        "structural_readiness",
        "dependencies",
        "operators",
        "quantization",
        "extensions",
        "unknowns",
        "boundary"
      ],
      "properties": {
        "kind": {
          "description": "The scope kind. model: the whole request. When optimize is empty, the request asks for every entrypoint with its whole body, and the model scope is the assessment of that default. target: one entry of optimize.",
          "type": "string",
          "enum": [
            "model",
            "example",
            "target"
          ]
        },
        "name": {
          "description": "The example or target name, or null for the model.",
          "anyOf": [
            {
              "$ref": "#/$defs/Id"
            },
            {
              "type": "null"
            }
          ]
        },
        "validity": {
          "description": "Whether the scope contradicts the specification.",
          "type": "string",
          "enum": [
            "valid",
            "invalid",
            "unchecked"
          ]
        },
        "completeness": {
          "description": "Whether the scope has explicit missing facts.",
          "type": "string",
          "enum": [
            "complete",
            "incomplete"
          ]
        },
        "definition": {
          "description": "The aggregate operator-definition result for this scope.",
          "type": "string",
          "enum": [
            "resolved",
            "unresolved",
            "invalid",
            "not_assessed"
          ]
        },
        "node_validation": {
          "description": "The aggregate node-validation result for this scope.",
          "type": "string",
          "enum": [
            "passed",
            "failed",
            "incomplete",
            "not_assessed"
          ]
        },
        "support": {
          "description": "Backend support for this scope.",
          "type": "string",
          "enum": [
            "supported",
            "unsupported",
            "not_assessed"
          ]
        },
        "runner_support": {
          "description": "Local reference-runner profile support for this scope. Comparison evidence is reported separately.",
          "type": "string",
          "enum": [
            "supported",
            "unsupported",
            "not_assessed"
          ]
        },
        "source_equivalence": {
          "$ref": "#/$defs/EvidenceAssessment"
        },
        "replacement_equivalence": {
          "$ref": "#/$defs/EvidenceAssessment"
        },
        "baseline_fidelity": {
          "$ref": "#/$defs/EvidenceAssessment"
        },
        "structural_readiness": {
          "description": "ready only when the computation is complete, every required definition resolves, and every affected node passes validation. Backend support and evidence do not change readiness.",
          "type": "string",
          "enum": [
            "ready",
            "blocked",
            "not_assessed"
          ]
        },
        "dependencies": {
          "description": "The scope's dependency closure.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Pointer"
          }
        },
        "operators": {
          "description": "Operator entries in the scope's dependency closure.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Id"
          }
        },
        "quantization": {
          "description": "Indexes of relevant entries in the report quantization list.",
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "extensions": {
          "description": "Relevant extension keys.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Id"
          }
        },
        "unknowns": {
          "description": "Unknowns the scope depends on.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Id"
          }
        },
        "boundary": {
          "description": "The derived target boundary, or null.",
          "anyOf": [
            {
              "$ref": "#/$defs/TargetBoundary"
            },
            {
              "type": "null"
            }
          ]
        },
        "work": {
          "description": "The work menu: one entry for each kind of work, in the order of the published table. A report from an older validator does not have it.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/WorkAssessment"
          }
        }
      },
      "additionalProperties": false
    },
    "SourceLocation": {
      "title": "SourceLocation",
      "description": "Where in a local authoring input a diagnostic arose.",
      "type": "object",
      "required": [
        "file",
        "line",
        "column",
        "pointer"
      ],
      "properties": {
        "file": {
          "description": "The local file the diagnostic refers to.",
          "type": "string"
        },
        "line": {
          "description": "A zero-based line, or null.",
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "column": {
          "description": "A zero-based column, or null.",
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "pointer": {
          "description": "The location within that file.",
          "$ref": "#/$defs/Pointer"
        }
      },
      "additionalProperties": false
    },
    "SubmittedEvidence": {
      "title": "SubmittedEvidence",
      "description": "One submitted evidence entry. The server checks its shape, subjects, and content binding but does not treat its claim as a server check.",
      "type": "object",
      "required": [
        "knowledge",
        "method",
        "purpose",
        "outcome",
        "contract_digest",
        "subjects"
      ],
      "properties": {
        "knowledge": {
          "$ref": "#/$defs/Id"
        },
        "method": {
          "description": "The method stated by the submitting tool.",
          "type": "string",
          "enum": [
            "claimed",
            "observed",
            "tested",
            "proved"
          ]
        },
        "purpose": {
          "description": "Why the submitted evidence exists.",
          "type": "string",
          "enum": [
            "fact",
            "source_equivalence",
            "replacement_equivalence",
            "baseline_fidelity",
            "other"
          ]
        },
        "outcome": {
          "description": "The outcome stated by the submitting tool.",
          "type": "string",
          "enum": [
            "supports",
            "refutes",
            "inconclusive"
          ]
        },
        "contract_digest": {
          "description": "The assessed computation's contract digest, or null for an unbound claim.",
          "anyOf": [
            {
              "$ref": "#/$defs/Digest"
            },
            {
              "type": "null"
            }
          ]
        },
        "subjects": {
          "description": "Resolved request or graph subjects.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Pointer"
          }
        }
      },
      "additionalProperties": false
    },
    "TargetBoundary": {
      "title": "TargetBoundary",
      "description": "The boundary the validator derived for a target from the authoritative document.",
      "type": "object",
      "required": [
        "function",
        "values_in",
        "values_out",
        "control_in",
        "control_out",
        "state",
        "constraints",
        "dependencies"
      ],
      "properties": {
        "function": {
          "description": "The owning function.",
          "$ref": "#/$defs/Id"
        },
        "values_in": {
          "description": "Values entering the selection, with their binding identities.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Pointer"
          }
        },
        "values_out": {
          "description": "Results used outside the selection or required by an observable.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Pointer"
          }
        },
        "control_in": {
          "description": "Control dependencies entering the selection.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Pointer"
          }
        },
        "control_out": {
          "description": "Control dependencies leaving the selection.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Pointer"
          }
        },
        "state": {
          "description": "Session-state pairs and black-box effects, including transitive calls.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Pointer"
          }
        },
        "constraints": {
          "description": "Constraints and path conditions that apply to the selected executions.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Pointer"
          }
        },
        "dependencies": {
          "description": "Constants, extensions, and unknown facts these boundary facts depend on.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Pointer"
          }
        }
      },
      "additionalProperties": false
    },
    "TorchOperatorIdentity": {
      "title": "TorchOperatorIdentity",
      "description": "The Torch operator identity in this request.",
      "type": "object",
      "required": [
        "kind",
        "environment",
        "definition_kind",
        "callable"
      ],
      "properties": {
        "kind": {
          "description": "Always \"torch\". Selects this alternative.",
          "type": "string",
          "const": "torch"
        },
        "environment": {
          "$ref": "#/$defs/Id"
        },
        "definition_kind": {
          "description": "The Torch definition form.",
          "type": "string",
          "enum": [
            "api",
            "module",
            "source"
          ]
        },
        "callable": {
          "description": "The public or inline Python callable.",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "WorkAssessment": {
      "title": "WorkAssessment",
      "description": "Whether the provided information permits one kind of work for this scope. A kind of work is a class of changes that the service can make to a model. The structure of the computation is the minimum, and each other kind depends on more information: shape extents, weight values, and input or state values or statistics. No kind is required. The service owns the table of kinds, and it is not a rule of the request.",
      "type": "object",
      "required": [
        "kind",
        "group",
        "meaning",
        "status",
        "examples",
        "detail",
        "needs",
        "without",
        "missing",
        "missing_count"
      ],
      "properties": {
        "kind": {
          "description": "The kind of work, from the published work table. GET /api/v1/work publishes the table, with its version.",
          "type": "string",
          "enum": [
            "structure",
            "correctness",
            "shape",
            "input_values",
            "state_values",
            "weight_values"
          ]
        },
        "group": {
          "description": "The block of the menu that shows this kind, from the published work table, or null. The values block has one line for each of inputs, state, and weights.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "meaning": {
          "description": "What this kind of work is: the changes that the service can make with this information. It is the meaning of the kind in the work table.",
          "type": "string"
        },
        "status": {
          "description": "available: the provided information is sufficient for this kind of work. limited: it is sufficient for a part of it. not_available: it is not sufficient. not_applicable: the scope has no subject for this kind. This is not a promise of a result, and it never changes whether the request is valid.",
          "type": "string",
          "enum": [
            "available",
            "limited",
            "not_available",
            "not_applicable"
          ]
        },
        "examples": {
          "description": "The examples that give the basis.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Id"
          }
        },
        "detail": {
          "description": "The derived basis of the status.",
          "type": "string"
        },
        "needs": {
          "description": "What this kind needs that the request does not state, or null when the status is available or not_applicable. It is a statement of fact. It is not a request: no kind is required.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "without": {
          "description": "What holds for the work of the service on this scope while the kind is limited or not available, or null. For example, with no weight value each change stays near bit-exact.",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "missing": {
          "description": "The places in the request where that information is missing. At most 12 pointers.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Pointer"
          }
        },
        "missing_count": {
          "description": "The number of places where that information is missing. It can exceed the length of missing.",
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "additionalProperties": false
    }
  }
}
