{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://law.arxo.io/schema/conformance-descriptor.schema.json",
  "title": "Arxo Core 0.1 implementation conformance descriptor",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "implementation": {
      "type": "string",
      "minLength": 1
    },
    "languageVersions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true,
      "minItems": 1
    },
    "profiles": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "features": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "interopAdapters": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "direction": {
            "enum": [
              "import",
              "export",
              "round_trip"
            ]
          }
        },
        "required": [
          "name",
          "version",
          "direction"
        ]
      }
    },
    "resourceLimits": {
      "type": "object",
      "additionalProperties": {
        "oneOf": [
          {
            "type": "integer",
            "minimum": 0
          },
          {
            "type": "string"
          },
          {
            "type": "boolean"
          }
        ]
      }
    },
    "proofCapabilities": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "descriptorHash": {
      "$ref": "#/$defs/Digest"
    },
    "semanticLayer": {
      "enum": [
        "L0",
        "L1",
        "L2",
        "L3"
      ],
      "description": "The layer the implementation claims: claiming `L1` means all conformance checks of layers L0–L1 pass, and violators are diagnosed. Semantic layer of the implementation. The field is named `semanticLayer`, not `layer`, because the short name is taken by the package profile of ontological packages. The layer is a ceiling: declaring higher than derived is allowed, lower is rejected (LDC-E8101).",
      "$comment": "Layer spec §2.6; layer model; DECISION-0007"
    },
    "deferred": {
      "description": "Deferred claim items: analyses, conformance checks, and platforms that the implementation DELIBERATELY does not confirm. A layer claim must disclose here every unexecuted check of its layer — otherwise it hides a gap.",
      "$comment": "SPEC §197; WP-27",
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "item",
          "kind",
          "reason"
        ],
        "properties": {
          "item": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "enum": [
              "vector",
              "analysis",
              "platform",
              "profile"
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    }
  },
  "required": [
    "implementation",
    "languageVersions",
    "profiles",
    "features",
    "interopAdapters",
    "resourceLimits",
    "proofCapabilities",
    "descriptorHash"
  ],
  "$defs": {
    "Digest": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]+:[A-Fa-f0-9]+$"
    }
  }
}
