{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/past-dev/json-schema/past-dev-ingestion-diagnosis-schema.json",
  "title": "IngestionDiagnosis",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/past-dev-openapi.json#/components/schemas/IngestionDiagnosis",
  "type": "object",
  "required": [
    "next"
  ],
  "additionalProperties": false,
  "properties": {
    "ingestionId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Null for a call refused before a send existed."
    },
    "requestId": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The status the call answered, while the log holds it."
    },
    "errorCode": {
      "type": [
        "string",
        "null"
      ]
    },
    "acceptedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "settledAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "phase": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "queued",
        "preparing",
        "prepared",
        "processing",
        "captured",
        "indexed",
        "failed",
        "nothing-changed",
        null
      ]
    },
    "failure": {
      "oneOf": [
        {
          "$ref": "#/$defs/IngestionStop"
        },
        {
          "type": "null"
        }
      ],
      "description": "Present only when the phase is failed."
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/IngestionDiagnosisItem"
      },
      "description": "The first 100 data points the send carried."
    },
    "itemsOmitted": {
      "type": "integer"
    },
    "credits": {
      "type": "number"
    },
    "next": {
      "type": "string",
      "description": "One sentence naming the step to take."
    }
  },
  "$defs": {
    "IngestionDiagnosisItem": {
      "type": "object",
      "required": [
        "dataPointId",
        "revision",
        "status",
        "searchable",
        "memories",
        "sourceId"
      ],
      "additionalProperties": false,
      "properties": {
        "dataPointId": {
          "type": "string"
        },
        "revision": {
          "type": "integer"
        },
        "status": {
          "type": "string",
          "enum": [
            "created",
            "updated",
            "unchanged"
          ]
        },
        "searchable": {
          "type": "boolean",
          "description": "Whether the text you sent can be recalled yet."
        },
        "memories": {
          "type": "integer",
          "description": "The memories drawn from this revision that are current and searchable."
        },
        "sourceId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "The id the lineage read takes as a root."
        }
      }
    },
    "IngestionStop": {
      "type": "object",
      "required": [
        "code",
        "message",
        "retryable"
      ],
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "model-unavailable",
            "model-response-unreadable",
            "index-unavailable",
            "content-rejected",
            "internal"
          ]
        },
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean",
          "description": "False only for content-rejected: the content has to change first."
        }
      }
    }
  }
}