{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:orbiplex:schema:sensorium-brainflow-instance:v1",
  "title": "sensorium-brainflow-instance.v1",
  "description": "Durable instance intent, separate from admitted, resolved and active views. Opaque host-private binding refs contain no selectors. Desired running state alone does not launch or authorize acquisition; every launch requires current host admission and independently allocated identity, home and auth bindings. This admitted intent view references a separate source declaration artifact; declaration/ref is not a self-digest. Synthetic uses a null physical binding. Desired eligibility is disabled/enabled; explicit operator stop and current acquisition authority remain separate facts.",
  "x-dia-workflow": "project",
  "x-dia-status": "draft",
  "x-dia-basis": [
    "doc/project/40-proposals/096-sensorium-brainflow-connector.md"
  ],
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "schema/v",
    "instance/ref",
    "declaration/ref",
    "package/ref",
    "profile/ref",
    "mode/id",
    "desired/state",
    "binding/ref",
    "budgets/ref",
    "restart/policy",
    "capture/desired",
    "publication/desired"
  ],
  "properties": {
    "schema": {
      "const": "sensorium-brainflow-instance.v1"
    },
    "schema/v": {
      "const": 1
    },
    "instance/ref": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "revision"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
        },
        "revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        }
      }
    },
    "declaration/ref": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "revision",
        "digest"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
        },
        "revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        }
      }
    },
    "package/ref": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "revision",
        "digest"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
        },
        "revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        }
      }
    },
    "profile/ref": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "revision",
        "digest"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
        },
        "revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        }
      }
    },
    "mode/id": {
      "enum": [
        "synthetic",
        "p21",
        "p51"
      ]
    },
    "desired/state": {
      "enum": [
        "disabled",
        "enabled"
      ]
    },
    "binding/ref": {
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "id",
            "revision"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
            },
            "revision": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "budgets/ref": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "revision",
        "digest"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
        },
        "revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        }
      }
    },
    "restart/policy": {
      "const": "manual"
    },
    "capture/desired": {
      "const": "off"
    },
    "publication/desired": {
      "const": "off"
    }
  }
}
