{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "observation": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "description": "Resource identifier returned by the operation."
        },
        "workspace_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "description": "Workspace that owns this record."
        },
        "project_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "description": "Project that owns this record."
        },
        "epoch_id": {
          "type": "string"
        },
        "cell_id": {
          "type": "string"
        },
        "run_index": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "engine_identity": {
          "type": "string"
        },
        "engine": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "provider_model_version": {
          "type": "string"
        },
        "prompt_sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "content_sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "local_evidence_sha256": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "ingest_cli_version": {
          "type": "string"
        },
        "byte_length": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "observed_at": {
          "type": "string",
          "description": "UTC timestamp of the observation used here."
        },
        "created_at": {
          "type": "string",
          "description": "UTC timestamp when the record was created."
        },
        "expires_at": {
          "type": "string"
        },
        "evidence_status": {
          "type": "string",
          "enum": [
            "retained",
            "expired"
          ]
        },
        "screenshot": {
          "type": "object",
          "properties": {
            "reference": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120,
                  "pattern": "^[A-Za-z0-9_.-]+$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "sha256": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "retained": {
              "type": "boolean",
              "const": false
            }
          },
          "required": [
            "reference",
            "sha256",
            "retained"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "workspace_id",
        "project_id",
        "epoch_id",
        "cell_id",
        "run_index",
        "engine_identity",
        "engine",
        "provider",
        "model",
        "provider_model_version",
        "prompt_sha256",
        "content_sha256",
        "local_evidence_sha256",
        "ingest_cli_version",
        "byte_length",
        "observed_at",
        "created_at",
        "expires_at",
        "evidence_status",
        "screenshot"
      ],
      "additionalProperties": false
    },
    "envelopeJson": {
      "type": "string"
    },
    "integrity": {
      "type": "object",
      "properties": {
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "verified": {
          "type": "boolean",
          "const": true
        }
      },
      "required": [
        "sha256",
        "verified"
      ],
      "additionalProperties": false
    },
    "screenshot": {
      "type": "object",
      "properties": {
        "reference": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 120,
              "pattern": "^[A-Za-z0-9_.-]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "sha256": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "retained": {
          "type": "boolean",
          "const": false
        }
      },
      "required": [
        "reference",
        "sha256",
        "retained"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "observation",
    "envelopeJson",
    "integrity",
    "screenshot"
  ],
  "additionalProperties": {}
}
