{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zeronoise-ai/json-schema/zeronoise-ai-brief-schema.json",
  "title": "Brief",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zeronoise-ai-openapi.yaml#/components/schemas/Brief",
  "allOf": [
    {
      "$ref": "#/$defs/BriefSummary"
    },
    {
      "type": "object",
      "required": [
        "state",
        "content",
        "links"
      ],
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "current",
            "superseded"
          ],
          "description": "superseded: a regenerated brief for the same period replaced this historical generation, which stays readable. Deleted briefs return 404."
        },
        "superseded_by": {
          "type": "object",
          "required": [
            "object",
            "id"
          ],
          "description": "Present when state is superseded; the brief that replaced this one, which may itself be superseded.",
          "properties": {
            "object": {
              "type": "string",
              "enum": [
                "brief"
              ]
            },
            "id": {
              "$ref": "#/$defs/OpaqueId"
            }
          }
        },
        "content": {
          "type": "string",
          "description": "Public Markdown with opaque [[citation:<id>]] references"
        },
        "operation_id": {
          "$ref": "#/$defs/OpaqueId"
        },
        "links": {
          "$ref": "#/$defs/Links"
        }
      }
    }
  ],
  "$defs": {
    "BriefSummary": {
      "type": "object",
      "required": [
        "id",
        "object",
        "agent_id",
        "organization_id",
        "title",
        "description",
        "period",
        "published_at"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/OpaqueId"
        },
        "object": {
          "type": "string",
          "enum": [
            "brief"
          ]
        },
        "agent_id": {
          "$ref": "#/$defs/OpaqueId"
        },
        "organization_id": {
          "allOf": [
            {
              "$ref": "#/$defs/OpaqueId"
            }
          ],
          "description": "The Agent's organization, which may differ from the credential's."
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "period": {
          "type": "object",
          "description": "Window of source content this brief covers, start inclusive and end exclusive. Scheduled briefs close shortly before the Agent's scheduled time (currently one hour) so Sources can finish syncing; requested briefs cover the requested window. Date briefs by this period.",
          "required": [
            "start_at",
            "end_at"
          ],
          "properties": {
            "start_at": {
              "$ref": "#/$defs/Timestamp"
            },
            "end_at": {
              "$ref": "#/$defs/Timestamp"
            }
          }
        },
        "published_at": {
          "allOf": [
            {
              "$ref": "#/$defs/Timestamp"
            }
          ],
          "description": "When the brief became available, which the since filter uses. Backfilled or regenerated briefs are published after their period, so do not date briefs by this time."
        },
        "links": {
          "allOf": [
            {
              "$ref": "#/$defs/Links"
            }
          ],
          "description": "`web` is the brief's page in the ZeroNoise web app, as an absolute URL to show people."
        }
      }
    },
    "Link": {
      "type": "object",
      "required": [
        "href"
      ],
      "properties": {
        "href": {
          "type": "string"
        }
      }
    },
    "Links": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/Link"
      }
    },
    "OpaqueId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Opaque identifier; clients must not parse its format."
    },
    "Timestamp": {
      "type": "string",
      "format": "date-time"
    }
  }
}