{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gda.group/schemas/brief-1.schema.json",
  "title": "brief/1 — GDA Capital's morning brief, one document per calendar date",
  "description": "The machine-readable output of the daily-office morning-brief liturgy (scripts/morning-brief.mjs). Objectives and the research digest are derived facts — measured from devlog.fragment.json and delivery.fragment.json — never invented business news. socialPosts are linted against voice.config.json before publication; a draft that fails the lint is never published as passing.",
  "type": "object",
  "required": ["contract", "date", "generated", "objectives", "socialPosts", "researchDigest", "contentIdeas"],
  "additionalProperties": false,
  "properties": {
    "contract": { "const": "brief/1" },
    "date": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
    "generated": { "type": "string", "format": "date-time" },
    "objectives": {
      "type": "array",
      "description": "Derived facts stated plainly, e.g. 'N devlog entries since yesterday: <titles>'. Never a fabricated business goal.",
      "items": { "type": "string", "minLength": 1 }
    },
    "socialPosts": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["channel", "copy", "voiceChecked"],
        "additionalProperties": false,
        "properties": {
          "channel": { "type": "string", "minLength": 1 },
          "copy": { "type": "string", "minLength": 1 },
          "voiceChecked": {
            "type": "object",
            "required": ["ok"],
            "additionalProperties": false,
            "properties": {
              "ok": { "type": "boolean" },
              "violations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["type", "detail"],
                  "properties": {
                    "type": { "enum": ["banned-word", "too-long", "too-short"] },
                    "detail": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "researchDigest": {
      "type": "array",
      "description": "Plain strings. Honest by construction — when no live external source is wired, this carries exactly one entry saying so, never a fabricated headline.",
      "items": { "type": "string", "minLength": 1 }
    },
    "contentIdeas": {
      "type": "array",
      "items": { "type": "string", "minLength": 1 }
    },
    "sourceCounts": {
      "type": "object",
      "description": "How many real devlog/delivery entries this brief was derived from — the measurement this brief is honest about, stated as a number rather than implied.",
      "additionalProperties": false,
      "properties": {
        "devlogEntries": { "type": "integer", "minimum": 0 },
        "deliveryOpenItems": { "type": "integer", "minimum": 0 },
        "deliveryRegressions": { "type": "integer", "minimum": 0 }
      }
    }
  }
}
