{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/upriver-ai/json-schema/upriver-ai-private-feed-response-schema.json",
  "title": "PrivateFeedResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/upriver-ai-breakout-feeds-api-openapi.yml#/components/schemas/PrivateFeedResponse",
  "properties": {
    "feed": {
      "$ref": "#/$defs/PrivateFeedSummary"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Generated At"
    },
    "lookback_days": {
      "type": "integer",
      "title": "Lookback Days"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/PrivateFeedItem"
      },
      "type": "array",
      "title": "Items"
    }
  },
  "type": "object",
  "required": [
    "feed",
    "generated_at",
    "lookback_days",
    "items"
  ],
  "$defs": {
    "FormationIdentityState": {
      "type": "string",
      "enum": [
        "provisional",
        "canonical"
      ],
      "title": "FormationIdentityState",
      "description": "Whether identity is still run-local or maintained across observations."
    },
    "FormationKind": {
      "type": "string",
      "enum": [
        "story",
        "theme",
        "topic",
        "trend",
        "entity"
      ],
      "title": "FormationKind",
      "description": "What an observed formation represents."
    },
    "FormationProjectionItemType": {
      "type": "string",
      "enum": [
        "evidence",
        "formation"
      ],
      "title": "FormationProjectionItemType",
      "description": "Whether a projection row points at evidence or a formation."
    },
    "PrivateFeedEvidence": {
      "properties": {
        "evidence_id": {
          "type": "string",
          "title": "Evidence Id",
          "description": "Stable source evidence identifier."
        },
        "source_type": {
          "type": "string",
          "title": "Source Type",
          "description": "Kind of source containing the evidence."
        },
        "source_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Url",
          "description": "Link to the evidence."
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title",
          "description": "Evidence title when present."
        },
        "excerpt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Excerpt",
          "description": "Short evidence excerpt."
        },
        "author_handle": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Author Handle",
          "description": "Public author handle when present."
        },
        "community": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Community",
          "description": "Community containing the evidence."
        },
        "published_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Published At",
          "description": "When the evidence was published."
        },
        "claims": {
          "items": {
            "$ref": "#/$defs/PrivateFeedEvidenceClaim"
          },
          "type": "array",
          "title": "Claims",
          "description": "Numbers this evidence states about its own subject, quoted from its text. Empty when it states none, when the figures could not be established, or when the text changed after they were read."
        }
      },
      "type": "object",
      "required": [
        "evidence_id",
        "source_type"
      ],
      "title": "PrivateFeedEvidence"
    },
    "PrivateFeedEvidenceClaim": {
      "properties": {
        "quantity": {
          "type": "string",
          "title": "Quantity",
          "description": "The figure exactly as the evidence states it."
        },
        "subject": {
          "type": "string",
          "title": "Subject",
          "description": "What the figure refers to, in the evidence's own words."
        }
      },
      "type": "object",
      "required": [
        "quantity",
        "subject"
      ],
      "title": "PrivateFeedEvidenceClaim"
    },
    "PrivateFeedEvidenceSummary": {
      "properties": {
        "total": {
          "type": "integer",
          "title": "Total"
        },
        "shown": {
          "type": "integer",
          "title": "Shown"
        },
        "source_type_count": {
          "type": "integer",
          "title": "Source Type Count"
        },
        "latest_shown_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Latest Shown At"
        }
      },
      "type": "object",
      "required": [
        "total",
        "shown",
        "source_type_count"
      ],
      "title": "PrivateFeedEvidenceSummary"
    },
    "PrivateFeedFacet": {
      "properties": {
        "slug": {
          "type": "string",
          "title": "Slug",
          "description": "Stable feed facet identifier."
        },
        "label": {
          "type": "string",
          "title": "Label",
          "description": "Human-readable facet label."
        }
      },
      "type": "object",
      "required": [
        "slug",
        "label"
      ],
      "title": "PrivateFeedFacet"
    },
    "PrivateFeedFormation": {
      "properties": {
        "formation_id": {
          "type": "string",
          "title": "Formation Id"
        },
        "kind": {
          "$ref": "#/$defs/FormationKind"
        },
        "identity_state": {
          "$ref": "#/$defs/FormationIdentityState"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "summary": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Summary"
        },
        "maturity": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "watchlist",
                "established"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Maturity"
        },
        "entities": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Entities"
        },
        "first_seen": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "First Seen"
        },
        "last_seen": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Seen"
        },
        "evidence": {
          "items": {
            "$ref": "#/$defs/PrivateFeedEvidence"
          },
          "type": "array",
          "title": "Evidence"
        },
        "observations": {
          "items": {
            "$ref": "#/$defs/PrivateFeedObservation"
          },
          "type": "array",
          "title": "Observations"
        }
      },
      "type": "object",
      "required": [
        "formation_id",
        "kind",
        "identity_state",
        "title",
        "entities",
        "evidence",
        "observations"
      ],
      "title": "PrivateFeedFormation"
    },
    "PrivateFeedItem": {
      "properties": {
        "item_id": {
          "type": "string",
          "title": "Item Id"
        },
        "parent_item_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Parent Item Id"
        },
        "item_type": {
          "$ref": "#/$defs/FormationProjectionItemType"
        },
        "facet": {
          "type": "string",
          "title": "Facet"
        },
        "facet_label": {
          "type": "string",
          "title": "Facet Label"
        },
        "headline": {
          "type": "string",
          "title": "Headline"
        },
        "why_relevant": {
          "type": "string",
          "title": "Why Relevant"
        },
        "why_now": {
          "type": "string",
          "title": "Why Now"
        },
        "overall_rank": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Overall Rank"
        },
        "facet_rank": {
          "type": "integer",
          "title": "Facet Rank"
        },
        "earliest_evidence_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Earliest Evidence At",
          "description": "Earliest publication time among known dated evidence supporting this result; a proxy for when the underlying activity began."
        },
        "evidence_summary": {
          "$ref": "#/$defs/PrivateFeedEvidenceSummary"
        },
        "evidence": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrivateFeedEvidence"
            },
            {
              "type": "null"
            }
          ]
        },
        "formation": {
          "anyOf": [
            {
              "$ref": "#/$defs/PrivateFeedFormation"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "item_id",
        "item_type",
        "facet",
        "facet_label",
        "headline",
        "why_relevant",
        "why_now",
        "facet_rank",
        "evidence_summary"
      ],
      "title": "PrivateFeedItem"
    },
    "PrivateFeedObservation": {
      "properties": {
        "observed_at": {
          "type": "string",
          "format": "date-time",
          "title": "Observed At",
          "description": "When this measurement was made."
        },
        "evidence_count": {
          "type": "integer",
          "title": "Evidence Count",
          "description": "Evidence count at this observation."
        },
        "source_type_count": {
          "type": "integer",
          "title": "Source Type Count",
          "description": "Distinct source-type count."
        },
        "momentum_ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Momentum Ratio",
          "description": "Recent activity relative to its baseline."
        },
        "trajectory": {
          "type": "string",
          "title": "Trajectory",
          "description": "Observed direction of activity."
        }
      },
      "type": "object",
      "required": [
        "observed_at",
        "evidence_count",
        "source_type_count",
        "trajectory"
      ],
      "title": "PrivateFeedObservation"
    },
    "PrivateFeedSummary": {
      "properties": {
        "slug": {
          "type": "string",
          "title": "Slug",
          "description": "Stable private-feed identifier."
        },
        "label": {
          "type": "string",
          "title": "Label",
          "description": "Human-readable private-feed label."
        },
        "facets": {
          "items": {
            "$ref": "#/$defs/PrivateFeedFacet"
          },
          "type": "array",
          "title": "Facets",
          "description": "Available feed facets."
        },
        "presentation_source": {
          "type": "string",
          "enum": [
            "curated",
            "breakout"
          ],
          "title": "Presentation Source",
          "description": "Content source used to present this feed."
        },
        "breakout_vertical": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Breakout Vertical",
          "description": "Breakout vertical used when this feed presents Breakout content."
        }
      },
      "type": "object",
      "required": [
        "slug",
        "label",
        "facets",
        "presentation_source"
      ],
      "title": "PrivateFeedSummary"
    }
  }
}