{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:orbiplex:schema:panel-input-statement.local:v1",
  "title": "panel-input-statement.local.v1",
  "x-dia-status": "draft",
  "x-dia-workflow": "project",
  "x-dia-basis": [
    "doc/project/40-proposals/051-swarm-membership-and-reputation-bootstrap.md"
  ],
  "description": "Explicit synthetic local candidate input. Signature and publication do not grant admission; host binding, input owner, test allowlist and CAS remain mandatory.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "statement": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schema": {
          "const": "panel-input-statement.local.v1"
        },
        "record/id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "revision": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "host/id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^node:did:key:z[1-9A-HJ-NP-Za-km-z]+$"
        },
        "host/incarnation": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "issuer/id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^participant:did:key:z[1-9A-HJ-NP-Za-km-z]+$"
        },
        "panel-policy": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "revision": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "digest": {
              "type": "string",
              "pattern": "^sha256:[A-Za-z0-9_-]{43}$"
            }
          },
          "required": [
            "id",
            "revision",
            "digest"
          ]
        },
        "profile": {
          "const": "local-panel.tai-fixtures.v1"
        },
        "issued-at": {
          "type": "string",
          "format": "date-time",
          "maxLength": 64
        },
        "input": {
          "oneOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "eligibility"
                },
                "node/id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "pattern": "^node:did:key:z[1-9A-HJ-NP-Za-km-z]+$"
                },
                "subject/id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "pattern": "^participant:did:key:z[1-9A-HJ-NP-Za-km-z]+$"
                },
                "valid-from": {
                  "type": "string",
                  "format": "date-time",
                  "maxLength": 64
                },
                "valid-until": {
                  "type": "string",
                  "format": "date-time",
                  "maxLength": 64
                },
                "method": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "value": {
                  "allOf": [
                    {
                      "$ref": "panel-eligibility-fact.local.v1.schema.json#/properties/value"
                    },
                    {
                      "not": {
                        "properties": {
                          "kind": {
                            "const": "membership"
                          }
                        },
                        "required": [
                          "kind"
                        ]
                      }
                    }
                  ]
                }
              },
              "required": [
                "kind",
                "node/id",
                "subject/id",
                "valid-from",
                "valid-until",
                "method",
                "value"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "heartbeat"
                },
                "record": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991
                    },
                    "digest": {
                      "type": "string",
                      "pattern": "^sha256:[A-Za-z0-9_-]{43}$"
                    }
                  },
                  "required": [
                    "id",
                    "revision",
                    "digest"
                  ]
                },
                "content": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "schema": {
                      "const": "local-heartbeat.fixture.v1"
                    },
                    "record/id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "issuer/id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "pattern": "^participant:did:key:z[1-9A-HJ-NP-Za-km-z]+$"
                    },
                    "issued-at": {
                      "type": "string",
                      "format": "date-time",
                      "maxLength": 64
                    },
                    "sequence": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "schema",
                    "record/id",
                    "issuer/id",
                    "issued-at",
                    "sequence"
                  ]
                },
                "heartbeat/class": {
                  "const": "local-heartbeat"
                },
                "cutoff-at": {
                  "type": "string",
                  "format": "date-time",
                  "maxLength": 64
                },
                "valid-until": {
                  "type": "string",
                  "format": "date-time",
                  "maxLength": 64
                }
              },
              "required": [
                "kind",
                "record",
                "content",
                "heartbeat/class",
                "cutoff-at",
                "valid-until"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "certificate"
                },
                "certificate": {
                  "$ref": "panel-vrf-certificate.local.v1.schema.json"
                }
              },
              "required": [
                "kind",
                "certificate"
              ]
            }
          ]
        }
      },
      "required": [
        "schema",
        "record/id",
        "revision",
        "host/id",
        "host/incarnation",
        "issuer/id",
        "panel-policy",
        "profile",
        "issued-at",
        "input"
      ]
    },
    "algorithm": {
      "const": "ed25519+domain-v1"
    },
    "signature": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{86}$"
    }
  },
  "required": [
    "statement",
    "algorithm",
    "signature"
  ]
}
