{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/craftingeventfinder-com/json-schema/craftingeventfinder-com-ingest-run-detail-schema.json",
  "title": "IngestRunDetail",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/craftingeventfinder-com-openapi.yml#/components/schemas/IngestRunDetail",
  "allOf": [
    {
      "$ref": "#/$defs/IngestRun"
    },
    {
      "type": "object",
      "properties": {
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "candidate",
                  "active",
                  "paused",
                  "rejected"
                ]
              },
              "consecutiveFailures": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "name",
              "status",
              "consecutiveFailures"
            ]
          },
          "description": "Every source the run's errors and warnings name, as it stands now (a deleted source is absent)"
        },
        "updatesMerged": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Updates auto-merged onto published events; null while the run is still running"
        },
        "duplicatesSettled": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Duplicates auto-settled onto published events; null while the run is still running"
        },
        "details": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "fetched": {
              "type": "integer"
            },
            "filled": {
              "type": "integer"
            },
            "skipped": {
              "type": "object",
              "properties": {
                "budget": {
                  "type": "integer"
                },
                "robots": {
                  "type": "integer"
                },
                "errors": {
                  "type": "integer"
                }
              },
              "required": [
                "budget",
                "robots",
                "errors"
              ]
            }
          },
          "required": [
            "fetched",
            "filled",
            "skipped"
          ],
          "description": "Detail pages read, events filled and events skipped; null when none qualified or the run is still running"
        },
        "missingHidden": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Events auto-hidden as no longer listed on their source; null while the run is still running"
        },
        "missingReturned": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Events brought back once their source listed them again; null while the run is still running"
        },
        "secondOpinion": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "checked": {
              "type": "integer"
            },
            "confirmed": {
              "type": "integer"
            },
            "closed": {
              "type": "integer"
            },
            "forYou": {
              "type": "integer"
            }
          },
          "required": [
            "checked",
            "confirmed",
            "closed",
            "forYou"
          ],
          "description": "Unsure events read again by the second opinion: checked, confirmed, closed on their own and left for review; null when none was checked or the run is still running"
        },
        "judge": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "published": {
              "type": "integer"
            },
            "merged": {
              "type": "integer"
            },
            "rejected": {
              "type": "integer"
            },
            "closed": {
              "type": "integer"
            },
            "left": {
              "type": "integer"
            }
          },
          "required": [
            "published",
            "merged",
            "rejected",
            "closed",
            "left"
          ],
          "description": "Waiting items the judge decided at the end of the run: published, merged, rejected, closed and left for review; null when it decided nothing or the run is still running"
        },
        "reread": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "checked": {
              "type": "integer"
            },
            "confirmed": {
              "type": "integer"
            },
            "fixed": {
              "type": "integer"
            },
            "cancelled": {
              "type": "integer"
            },
            "forYou": {
              "type": "integer"
            }
          },
          "required": [
            "checked",
            "confirmed",
            "fixed",
            "cancelled",
            "forYou"
          ],
          "description": "Live listings the daily re-read checked against their own page: confirmed, dates fixed, cancelled and sent to you as cards; null when it checked none or the run is still running"
        },
        "years": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "confirmed": {
              "type": "integer"
            },
            "held": {
              "type": "integer"
            }
          },
          "required": [
            "confirmed",
            "held"
          ],
          "description": "Extracted events whose year their own page confirmed, and events held for a check because the page didn't show it; null when the run extracted none or is still running"
        },
        "intake": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "unchanged": {
              "type": "integer"
            },
            "waiting": {
              "type": "integer"
            },
            "past": {
              "type": "integer"
            },
            "failed": {
              "type": "integer"
            }
          },
          "required": [
            "unchanged",
            "waiting",
            "past",
            "failed"
          ],
          "description": "Extracted events that weren't sent on: already listed with nothing new, matching an item already waiting for review, already over, or refused; null when there were none or the run is still running"
        },
        "pages": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "vps": {
              "type": "integer"
            },
            "cloud": {
              "type": "integer"
            },
            "healthFailed": {
              "type": "boolean"
            }
          },
          "required": [
            "vps",
            "cloud",
            "healthFailed"
          ],
          "description": "Pages fetched from our own page server (the VPS) and from Firecrawl cloud, and whether the run's VPS health check failed; null when the VPS isn't configured, the run fetched no pages or it is still running"
        },
        "previousRunId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The run that started just before this one"
        },
        "nextRunId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The run that started just after this one"
        }
      },
      "required": [
        "sources",
        "updatesMerged",
        "duplicatesSettled",
        "details",
        "missingHidden",
        "missingReturned",
        "secondOpinion",
        "judge",
        "reread",
        "years",
        "intake",
        "pages",
        "previousRunId",
        "nextRunId"
      ]
    }
  ],
  "$defs": {
    "IngestRun": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "startedAt": {
          "type": "string"
        },
        "finishedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "trigger": {
          "type": "string",
          "enum": [
            "cli",
            "api",
            "cron"
          ]
        },
        "sourcesAttempted": {
          "type": "integer"
        },
        "pagesChanged": {
          "type": "integer"
        },
        "eventsExtracted": {
          "type": "integer"
        },
        "eventsQueued": {
          "type": "integer"
        },
        "eventsAutoPublished": {
          "type": "integer"
        },
        "inputTokens": {
          "type": "integer"
        },
        "outputTokens": {
          "type": "integer"
        },
        "errors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "sourceId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "message": {
                "type": "string"
              },
              "level": {
                "type": "string",
                "enum": [
                  "error",
                  "warning"
                ]
              }
            },
            "required": [
              "sourceId",
              "message",
              "level"
            ]
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "running",
            "ok",
            "partial",
            "failed"
          ]
        }
      },
      "required": [
        "id",
        "startedAt",
        "finishedAt",
        "trigger",
        "sourcesAttempted",
        "pagesChanged",
        "eventsExtracted",
        "eventsQueued",
        "eventsAutoPublished",
        "inputTokens",
        "outputTokens",
        "errors",
        "status"
      ]
    }
  }
}