{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/prereason-com/json-schema/prereason-com-metric-late-release-schema.json",
  "title": "MetricLateRelease",
  "description": "The newest stored reading of a series whose release is late (past its usual day plus a grace): the reading, its date and its source, with the late release named. No signal, confidence, trend or context is served until the release is stored.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/prereason-com-openapi.json#/components/schemas/MetricLateRelease",
  "type": "object",
  "properties": {
    "metric": {
      "type": "string",
      "description": "The series' public name, as MetricData carries it."
    },
    "name": {
      "type": "string",
      "description": "Equal to `metric`, as MetricData carries it."
    },
    "stored_name": {
      "type": "string",
      "description": "The identifier PreReason stores the series under. It names no source; the series' source is in `source`."
    },
    "display_name": {
      "type": "string"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The stored reading's own date."
    },
    "reading": {
      "type": "string",
      "description": "The value in its unit, as the full answer's sentence prints it."
    },
    "release_clause": {
      "type": "string",
      "description": "The source's own statement of the reading, when it has one (Korea Customs' clause)."
    },
    "source": {
      "type": "string"
    },
    "display": {
      "type": "string",
      "enum": [
        "yes",
        "notice",
        "no"
      ],
      "description": "Whether a Business plan's display licence covers showing this figure to your users, as MetricLatestReading's display."
    },
    "data_quality": {
      "$ref": "#/$defs/DataQuality"
    },
    "release_late": {
      "type": "object",
      "description": "The late release.",
      "properties": {
        "stored_window": {
          "type": "string",
          "description": "The newest window stored (YYYY-MM)."
        },
        "late_window": {
          "type": "string",
          "description": "The first window after it whose release is overdue (YYYY-MM)."
        },
        "late_count": {
          "type": "integer",
          "description": "How many windows after the stored one are overdue."
        },
        "expected_about": {
          "type": "string",
          "format": "date",
          "description": "The day the late window's release usually comes."
        },
        "late_since": {
          "type": "string",
          "format": "date-time",
          "description": "The instant from which it counts as late (that day plus the grace, 00:00 UTC)."
        },
        "text": {
          "type": "string",
          "description": "One sentence naming the late release, the same on every surface that serves the series."
        }
      }
    },
    "withheld": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The fields of MetricData this answer leaves out, by name."
    },
    "note": {
      "type": "string",
      "description": "Why the interpretation, trend and context are withheld."
    }
  },
  "$defs": {
    "DataQuality": {
      "type": "object",
      "properties": {
        "age_hours": {
          "type": "number"
        },
        "stale": {
          "type": "boolean"
        },
        "status": {
          "type": "string",
          "enum": [
            "fresh",
            "warning",
            "stale"
          ]
        }
      }
    }
  }
}