{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/narrareach-com/json-schema/narrareach-com-article-brief-schema.json",
  "title": "ArticleBrief",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/narrareach-com-openapi.json#/components/schemas/ArticleBrief",
  "type": "object",
  "required": [
    "id",
    "batchId",
    "source",
    "title",
    "question",
    "whyNow",
    "pillar",
    "outline",
    "evidence",
    "status",
    "draftId",
    "draftUrl",
    "failureCode",
    "createdAt",
    "expiresAt"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "batchId": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "enum": [
        "topics",
        "profile",
        "own"
      ]
    },
    "title": {
      "type": "string"
    },
    "question": {
      "type": "string",
      "description": "The question the article answers for the reader."
    },
    "whyNow": {
      "type": "string"
    },
    "pillar": {
      "type": [
        "string",
        "null"
      ]
    },
    "outline": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "heading",
          "note"
        ],
        "properties": {
          "heading": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      }
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "title",
          "url",
          "outlet",
          "publishedAt"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "outlet": {
            "type": [
              "string",
              "null"
            ]
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "status": {
      "type": "string",
      "enum": [
        "IDEA",
        "QUEUED",
        "WRITING",
        "READY",
        "FAILED"
      ]
    },
    "draftId": {
      "type": [
        "string",
        "null"
      ]
    },
    "draftUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "Opens the draft in Narrareach once status is READY."
    },
    "failureCode": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "GENERATION_FAILED",
        "QUALITY_FAILED",
        "SAVE_FAILED",
        "STALLED",
        null
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}