{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codex-reset-com/json-schema/codex-reset-com-feed-schema.json",
  "title": "Feed",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codex-reset-com-openapi.yml#/components/schemas/Feed",
  "type": "object",
  "required": [
    "fetched_at",
    "source",
    "stale",
    "tweets",
    "radar_context",
    "banked_observations",
    "events"
  ],
  "properties": {
    "fetched_at": {
      "type": "string",
      "format": "date-time"
    },
    "source": {
      "type": "string"
    },
    "stale": {
      "type": "boolean"
    },
    "newest_post_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "tweets": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FeedPost"
      }
    },
    "radar_context": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "$ref": "#/$defs/RadarContextPost"
      },
      "description": "Newest posts of the last 14 days that no reset lane claims; tweets ∪ radar_context sorted by at is the raw recent timeline."
    },
    "banked_observations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BankedObservation"
      },
      "description": "Newest first; always an array."
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TimelineEvent"
      },
      "description": "The same rows as /api/timeline events."
    }
  },
  "$defs": {
    "BankedObservation": {
      "type": "object",
      "description": "A banked grant the site's own monitoring saw land.",
      "required": [
        "id",
        "kind",
        "source",
        "banked_state",
        "at",
        "after_announcement",
        "title",
        "text"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The Event id, not a post id."
        },
        "kind": {
          "const": "banked"
        },
        "source": {
          "const": "observed"
        },
        "banked_state": {
          "const": "available"
        },
        "at": {
          "type": "string",
          "format": "date-time",
          "description": "Grant time."
        },
        "after_announcement": {
          "type": "boolean"
        },
        "title": {
          "type": "string"
        },
        "text": {
          "type": "string",
          "description": "The channel sentence, English."
        }
      }
    },
    "FeedPost": {
      "type": "object",
      "description": "One of Tibo's posts that a reset lane claims.",
      "required": [
        "id",
        "text",
        "at",
        "url",
        "is_reply",
        "tibo_lane",
        "explicit_reset_claim"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[0-9]{5,25}$",
          "description": "X post id."
        },
        "text": {
          "type": "string"
        },
        "at": {
          "type": "string",
          "format": "date-time"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "is_reply": {
          "type": "boolean"
        },
        "replying_to": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "tibo_lane": {
          "type": "string",
          "enum": [
            "reset_announcement",
            "reset_related"
          ]
        },
        "explicit_reset_claim": {
          "type": "boolean"
        },
        "banked_state": {
          "type": "string",
          "enum": [
            "announced",
            "arriving",
            "available",
            "unknown"
          ]
        },
        "separate_grant": {
          "type": "boolean",
          "description": "A banked row the site files as a grant of its own; never merge it with banked_observations."
        },
        "replies": {
          "type": "integer"
        },
        "reposts": {
          "type": "integer"
        },
        "likes": {
          "type": "integer"
        }
      }
    },
    "RadarContextPost": {
      "type": "object",
      "description": "A recent post no reset lane claims. Display-only: never an alert, reset or forecast input.",
      "required": [
        "id",
        "text",
        "at",
        "url",
        "display_kind",
        "visibility_only"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[0-9]{5,25}$",
          "description": "X post id."
        },
        "text": {
          "type": "string"
        },
        "at": {
          "type": "string",
          "format": "date-time"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "display_kind": {
          "const": "context"
        },
        "visibility_only": {
          "const": true
        }
      }
    },
    "TimelineEvent": {
      "type": "object",
      "required": [
        "id",
        "date",
        "type",
        "group",
        "summary",
        "announced_at"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "date": {
          "type": "string",
          "format": "date"
        },
        "type": {
          "type": "string"
        },
        "group": {
          "type": "string",
          "enum": [
            "reset",
            "credits",
            "boost",
            "unlock"
          ],
          "description": "credits = a banked grant or its update. /api/timeline returns only reset and credits; /api/feed events may still carry boost and unlock rows."
        },
        "summary": {
          "type": "string",
          "description": "≤180-character excerpt, or the site's own summary for an observed row."
        },
        "text": {
          "type": "string",
          "description": "Credits rows: the full post."
        },
        "localized_summary": {
          "type": "string"
        },
        "localized_text": {
          "type": "string"
        },
        "url": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        },
        "announced_at": {
          "type": "string",
          "format": "date-time"
        },
        "announcement_state": {
          "type": "string",
          "description": "announced = ✅ for an ordinary reset."
        },
        "banked_state": {
          "type": "string",
          "enum": [
            "announced",
            "arriving",
            "available",
            "unknown"
          ]
        },
        "source": {
          "type": "string"
        },
        "observed_variant": {
          "type": "string"
        },
        "preview": {
          "type": "boolean"
        },
        "confirmed": {
          "type": "boolean",
          "description": "A reset row counts as a verified global reset; banked rows are true."
        },
        "banked_grant": {
          "type": "boolean",
          "description": "true on the row that is a banked grant; false on a grant's later updates."
        }
      }
    }
  }
}