{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Refined Math executable adapter profile",
  "description": "An importable profile binding a registered runtime. Customer-program tasks can carry bounded SDK instructions; raw native binaries and arbitrary host code are not accepted.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "format",
    "schemaVersion",
    "adapterId",
    "version",
    "name",
    "description",
    "help",
    "runtime",
    "inputSchema",
    "contract",
    "defaultTask",
    "samples"
  ],
  "properties": {
    "format": {
      "const": "refined.math.adapter"
    },
    "schemaVersion": {
      "const": 1
    },
    "adapterId": {
      "type": "string",
      "minLength": 1
    },
    "version": {
      "type": "string"
    },
    "name": {
      "$ref": "#/$defs/localized"
    },
    "description": {
      "$ref": "#/$defs/localized"
    },
    "help": {
      "$ref": "#/$defs/localized"
    },
    "runtime": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "binding",
        "coreRevision",
        "inputKey"
      ],
      "properties": {
        "binding": {
          "type": "string",
          "minLength": 1
        },
        "coreRevision": {
          "type": "string",
          "pattern": "^[0-9a-f]{40}$"
        },
        "inputKey": {
          "enum": [
            "input",
            "model",
            "symbolic"
          ]
        }
      }
    },
    "inputSchema": {
      "type": "object"
    },
    "contract": {
      "type": "object"
    },
    "defaultTask": {
      "$ref": "task.schema.json"
    },
    "samples": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "expected",
          "task"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "$ref": "#/$defs/localized"
          },
          "expected": {
            "$ref": "#/$defs/localized"
          },
          "task": {
            "$ref": "task.schema.json"
          }
        }
      }
    }
  },
  "$defs": {
    "localized": {
      "type": "object",
      "required": [
        "en",
        "sk"
      ],
      "additionalProperties": false,
      "properties": {
        "en": {
          "type": "string",
          "minLength": 1
        },
        "sk": {
          "type": "string",
          "minLength": 1
        }
      }
    }
  }
}
