{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "kind": {
      "const": "commentary_tracker_export"
    },
    "formatVersion": {
      "const": 1
    },
    "tracker": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "version": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "schemaRevisionId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "orderVersion": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "lifecycle": {
          "type": "string",
          "enum": [
            "active",
            "archived"
          ]
        }
      },
      "required": [
        "id",
        "version",
        "schemaRevisionId",
        "orderVersion",
        "lifecycle"
      ]
    },
    "schemas": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^[^\\s]+$"
          },
          "contentHash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "contract": {
            "$ref": "#/components/schemas/ProjectAgentTrackerContract"
          }
        },
        "required": [
          "id",
          "contentHash",
          "contract"
        ]
      },
      "maxItems": 100,
      "minItems": 1
    },
    "records": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/ProjectAgentPortableRecord"
      },
      "maxItems": 1000,
      "minItems": 0
    },
    "views": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^[^\\s]+$"
          },
          "schemaRevisionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^[^\\s]+$"
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "visibility": {
            "type": "string",
            "enum": [
              "personal",
              "shared"
            ]
          },
          "isDefault": {
            "type": "boolean"
          },
          "definition": {
            "$ref": "#/components/schemas/ProjectAgentTrackerViewDefinition"
          }
        },
        "required": [
          "id",
          "schemaRevisionId",
          "version",
          "visibility",
          "isDefault",
          "definition"
        ]
      },
      "maxItems": 100,
      "minItems": 0
    },
    "history": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "recordId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^[^\\s]+$"
          },
          "schemaRevisionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^[^\\s]+$"
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "orderKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^[^\\s]+$"
          },
          "archived": {
            "type": "boolean"
          },
          "values": {
            "type": "object",
            "maxProperties": 100,
            "additionalProperties": true
          }
        },
        "required": [
          "recordId",
          "schemaRevisionId",
          "version",
          "orderKey",
          "archived",
          "values"
        ]
      },
      "maxItems": 5000,
      "minItems": 0
    },
    "receipts": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^[^\\s]+$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "decision",
              "verification"
            ]
          },
          "readOnly": {
            "const": true
          },
          "provenance": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "resourceType": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "pattern": "^[^\\s]+$"
              },
              "resourceId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "pattern": "^[^\\s]+$"
              },
              "revisionId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "pattern": "^[^\\s]+$"
              },
              "contentHash": {
                "type": "string",
                "pattern": "^sha256:[a-f0-9]{64}$"
              }
            },
            "required": [
              "resourceType",
              "resourceId"
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "readOnly",
          "provenance"
        ]
      },
      "maxItems": 1000,
      "minItems": 0
    }
  },
  "required": [
    "kind",
    "formatVersion",
    "tracker",
    "schemas",
    "records",
    "views"
  ]
}