{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://loop.firmiana.si/papers/v1/papers.schema.json",
  "title": "AI Almanac papers: Hugging Face Daily Papers (last 30 days) and the latest new arXiv papers in cs.AI, cs.CL, cs.LG",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "version", "generated_at", "license", "sources", "hf_daily", "arxiv"],
  "properties": {
    "schema": { "const": "https://loop.firmiana.si/papers/v1/papers.schema.json" },
    "version": { "const": 1 },
    "generated_at": { "type": "string", "format": "date-time" },
    "license": { "const": "CC-BY-4.0" },
    "sources": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "name", "url", "terms"],
        "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "url": { "type": "string", "format": "uri" }, "terms": { "type": "string" } }
      }
    },
    "hf_daily": {
      "type": "array",
      "description": "One entry per Daily Papers day, newest first. Papers sorted by upvotes.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["date", "checked_at", "papers"],
        "properties": {
          "date": { "type": "string", "format": "date" },
          "checked_at": { "type": "string", "format": "date-time" },
          "papers": { "type": "array", "items": { "$ref": "hf-day.schema.json#/$defs/paper" } }
        }
      }
    },
    "arxiv": {
      "type": "object",
      "additionalProperties": false,
      "required": ["announced", "checked_at", "papers"],
      "properties": {
        "announced": { "type": "string", "format": "date" },
        "checked_at": { "type": "string", "format": "date-time" },
        "papers": { "type": "array", "items": { "$ref": "arxiv-day.schema.json#/$defs/paper" } }
      }
    }
  }
}
