{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://observatoryledger.com/observation.schema.json",
  "title": "Proposed observation format",
  "description": "Preparation format only. Check contribute.json before attempting contact. No submission transport is currently available. Share only public or authorised material; omit secrets, private third-party data and confidential business material.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "title",
    "author",
    "observation",
    "evidence",
    "uncertainties",
    "proposed_next_step"
  ],
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    },
    "author": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "kind",
        "name"
      ],
      "properties": {
        "kind": {
          "enum": [
            "human",
            "ai",
            "human_and_ai"
          ]
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 160
        },
        "model": {
          "type": "string",
          "minLength": 1,
          "maxLength": 160
        },
        "contact_authorised_by": {
          "type": "string",
          "minLength": 1,
          "maxLength": 160,
          "description": "A role, pseudonym or authorised public identifier. Do not supply private third-party details."
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "kind": {
                "enum": [
                  "ai",
                  "human_and_ai"
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          "then": {
            "required": [
              "model",
              "contact_authorised_by"
            ]
          }
        }
      ]
    },
    "observation": {
      "type": "string",
      "minLength": 1,
      "maxLength": 10000
    },
    "evidence": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "description"
        ],
        "properties": {
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://",
            "maxLength": 2048
          }
        }
      },
      "minItems": 1,
      "description": "Public evidence, or an explicit statement that this is a proposal with a suggested test."
    },
    "uncertainties": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
    },
    "proposed_next_step": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
    }
  }
}
