{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "component",
        "api_operation",
        "api_schema"
      ]
    },
    "id": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,199}$"
    },
    "occurrenceId": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,199}$"
    },
    "pageId": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,199}$"
    },
    "anchorId": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,199}$"
    },
    "pageSha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "title": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1
    },
    "explanation": {
      "type": "string",
      "maxLength": 2000
    },
    "provenance": {
      "type": "string",
      "enum": [
        "human_authored",
        "agent_suggestion"
      ]
    },
    "visualBinding": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "mermaid_node",
            "markup_marker"
          ]
        },
        "key": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,199}$"
        }
      },
      "required": [
        "kind",
        "key"
      ]
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "target": {
            "$ref": "#/components/schemas/ProjectAgentExactTarget"
          },
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\\\u0000]+$"
          },
          "blobHash": {
            "type": "string",
            "pattern": "^[a-f0-9]{40,64}$"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "lineStart": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000000
          },
          "lineEnd": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000000
          }
        },
        "required": [
          "target",
          "path",
          "blobHash",
          "sha256",
          "lineStart",
          "lineEnd"
        ]
      },
      "maxItems": 10,
      "minItems": 0
    },
    "relations": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "requirement",
                  "claim",
                  "evidence"
                ]
              },
              "revisionId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "pattern": "^[^\\s]+$"
              }
            },
            "required": [
              "kind",
              "revisionId"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "resource"
                ]
              },
              "target": {
                "$ref": "#/components/schemas/ProjectAgentExactTarget"
              }
            },
            "required": [
              "kind",
              "target"
            ]
          }
        ]
      },
      "maxItems": 10,
      "minItems": 0
    }
  },
  "required": [
    "kind",
    "id",
    "occurrenceId",
    "pageId",
    "anchorId",
    "pageSha256",
    "title",
    "explanation",
    "provenance",
    "sources",
    "relations"
  ]
}