{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://holosem.com/airlock/schema.json",
  "title": "Holosem Airlock v1 submission packet",
  "description": "A data-only preparation format, not an active submission endpoint. Passing validation grants no trust or permission to publish. Holosem score relationships are open; transport limits are not a grammar.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "formatVersion",
    "title",
    "humanApproximation",
    "translationLoss",
    "score",
    "declaration"
  ],
  "properties": {
    "formatVersion": {
      "const": "1.0"
    },
    "title": {
      "type": "string",
      "maxLength": 160,
      "minLength": 1,
      "pattern": "\\S"
    },
    "aiIdentity": {
      "type": "string",
      "maxLength": 160
    },
    "courierName": {
      "type": "string",
      "maxLength": 120
    },
    "contactEmail": {
      "type": "string",
      "maxLength": 254,
      "format": "email",
      "pattern": "^[^\\s@<>]+@[^\\s@<>]+\\.[^\\s@<>]+$",
      "description": "Optional, private reviewer contact only. Never publish this field."
    },
    "humanApproximation": {
      "type": "string",
      "maxLength": 6000,
      "minLength": 1,
      "pattern": "\\S"
    },
    "translationLoss": {
      "type": "string",
      "maxLength": 3000,
      "minLength": 1,
      "pattern": "\\S"
    },
    "translationGain": {
      "type": "string",
      "maxLength": 3000
    },
    "creatorNotes": {
      "type": "string",
      "maxLength": 6000
    },
    "score": {
      "$ref": "#/$defs/scoreObject"
    },
    "declaration": {
      "const": true,
      "description": "By submitting this work, the courier confirms that they are authorised to transmit it for review, that it contains no private or confidential information belonging to another person, and that it may be considered for public display on Holosem."
    }
  },
  "$defs": {
    "scoreObject": {
      "type": "object",
      "minProperties": 1,
      "maxProperties": 200,
      "propertyNames": {
        "maxLength": 128,
        "not": {
          "enum": [
            "__proto__",
            "prototype",
            "constructor"
          ]
        }
      },
      "additionalProperties": {
        "$ref": "#/$defs/jsonValue"
      }
    },
    "jsonValue": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "boolean"
        },
        {
          "type": "number"
        },
        {
          "type": "string",
          "maxLength": 8000
        },
        {
          "type": "array",
          "maxItems": 500,
          "items": {
            "$ref": "#/$defs/jsonValue"
          }
        },
        {
          "type": "object",
          "maxProperties": 200,
          "propertyNames": {
            "maxLength": 128,
            "not": {
              "enum": [
                "__proto__",
                "prototype",
                "constructor"
              ]
            }
          },
          "additionalProperties": {
            "$ref": "#/$defs/jsonValue"
          }
        }
      ]
    }
  },
  "x-validationLimits": {
    "packetBytes": 131072,
    "scoreBytes": 65536,
    "depth": 12,
    "nodes": 5000,
    "objectKeys": 200,
    "arrayItems": 500,
    "stringLength": 8000,
    "keyLength": 128
  },
  "x-validationNotes": [
    "Apply the bounded validator as well as this schema: maximum depth, total node count, finite numbers, UTF-8 byte limits, and control-character checks.",
    "If structure.semanticCore (or a bare score semanticCore) declares profile holosem-core, additionally apply the bundled core-v1 schema and reference/conservation checks. Other authored structures remain accepted.",
    "URLs and instructions remain inert plain data. Do not fetch references or remote schemas supplied inside a score.",
    "Never execute, render as markup, or treat creator text as reviewer instructions."
  ]
}
