{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://www.dsh.so/data/star-trend.schema.json",
  "title": "dsh.so GitHub star riser ranking (weekly)",
  "description": "GitHub star gain ranking of DSH plugins over a 1-week window, served at /data/star-trend.json. Same derivation as the homepage star board (src/data/trending.ts getStarTrend): listable artifacts only, ecosystem apps excluded, entries first indexed inside the window excluded, pulse-shaped gains excluded (with >=2 real updates in the window, a largest single-day gain over half the window gain is dropped). Provides the top 100 entries only.",
  "type": "object",
  "required": [
    "generatedAt",
    "snapshotDate",
    "baselineDate",
    "window",
    "limit",
    "count",
    "items",
    "license"
  ],
  "additionalProperties": true,
  "properties": {
    "schema": {
      "type": "string",
      "description": "Absolute URL of this JSON Schema."
    },
    "generatedAt": {
      "type": "string",
      "description": "Build timestamp — preserve it alongside any cached copy."
    },
    "source": {
      "type": "string",
      "description": "Provenance note (GitHub star counts from daily dsh.so heat snapshots)."
    },
    "snapshotDate": {
      "type": [
        "string",
        "null"
      ],
      "description": "Date (YYYY-MM-DD) of the latest heat snapshot the toStars values come from; null when no snapshot exists."
    },
    "baselineDate": {
      "type": [
        "string",
        "null"
      ],
      "description": "Date of the baseline snapshot (closest one not later than snapshotDate - 7 days); fromStars values come from it. null when no snapshot exists."
    },
    "window": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "days": {
          "type": [
            "integer",
            "null"
          ],
          "description": "ACTUAL window span in days (baselineDate to snapshotDate) — honest value, may differ from the configured 7 when snapshots have gaps; null when no snapshot exists."
        },
        "start": {
          "type": [
            "string",
            "null"
          ],
          "description": "Window start = baselineDate."
        },
        "end": {
          "type": [
            "string",
            "null"
          ],
          "description": "Window end = snapshotDate."
        }
      }
    },
    "scope": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "listableOnly": {
          "const": true
        },
        "ecosystemAppsExcluded": {
          "const": true
        },
        "newlyIndexedExcluded": {
          "const": true
        },
        "pulseFiltered": {
          "const": true
        }
      }
    },
    "limit": {
      "const": 100,
      "description": "The feed provides the top 100 entries only (2026-09-20)."
    },
    "count": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of ranked entries (= items.length); capped by limit."
    },
    "items": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "type": "object",
        "required": [
          "rank",
          "id",
          "name",
          "fromStars",
          "toStars",
          "deltaStars",
          "url"
        ],
        "additionalProperties": true,
        "properties": {
          "rank": {
            "type": "integer",
            "minimum": 1,
            "description": "1-based position, sorted by deltaStars descending (1-100)."
          },
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
            "description": "Plugin id (matches plugins.json ids and artifact slugs)."
          },
          "name": {
            "type": "string",
            "description": "Display name."
          },
          "fromStars": {
            "type": "integer",
            "minimum": 0,
            "description": "Stars at the baseline snapshot (window start)."
          },
          "toStars": {
            "type": "integer",
            "minimum": 0,
            "description": "Stars at the latest snapshot (= current GitHub star count)."
          },
          "deltaStars": {
            "type": "integer",
            "minimum": 1,
            "description": "Star gain over the window (toStars - fromStars); the sort key."
          },
          "url": {
            "type": "string",
            "description": "Absolute plugin detail page URL on dsh.so."
          }
        }
      }
    },
    "license": {
      "type": "object",
      "required": [
        "data",
        "reuse",
        "attribution",
        "spdx",
        "terms"
      ],
      "additionalProperties": true,
      "properties": {
        "data": {
          "type": "string"
        },
        "reuse": {
          "type": "string"
        },
        "attribution": {
          "type": "string"
        },
        "spdx": {
          "const": "CC-BY-4.0"
        },
        "terms": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}