{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Quest system state for cross-device sync (dismissals, nudge timing, visited routes). One record per game season (rkey: self before the 2027 season, and the season id, e.g. 2027, from then on), overwritten via putRecord. Client-written (no backend signing). Distinct from net.anisota.chronicle.fieldwork (immutable, backend-signed completion records).",
      "key": "any",
      "record": {
        "properties": {
          "baselines": {
            "description": "Object mapping quest ids to the canonical JSON of the setting each one reads, taken on the season's first pass. Such a quest counts as done only once the setting differs from it, so settings made last season don't complete it. Season records only.",
            "type": "unknown"
          },
          "counters": {
            "description": "Reserved for future quest progress counters. Object mapping counter ids to values.",
            "type": "unknown"
          },
          "dismissed": {
            "description": "Object mapping dismissed quest ids to the ISO datetime they were dismissed. Dismissed quests are excluded from recommendations and nudges until undismissed.",
            "type": "unknown"
          },
          "lastNudgeAt": {
            "description": "When a quest nudge was last shown (nudges are spaced at least a day apart)",
            "format": "datetime",
            "type": "string"
          },
          "lastNudgeQuestId": {
            "description": "Which quest the most recent nudge was about",
            "type": "string"
          },
          "pinnedQuestId": {
            "description": "Quest the player has pinned to keep in view",
            "type": "string"
          },
          "retroSweepAt": {
            "description": "When the retroactive completion sweep last ran (throttles the sweep to once per day)",
            "format": "datetime",
            "type": "string"
          },
          "retroSweepVersion": {
            "description": "Version of the retroactive sweep that armed retroSweepAt. When it doesn't match the client's current sweep version the throttle is treated as stale and the sweep runs once more, so a throttle armed by an earlier (buggy) sweep can't lock out backfill.",
            "type": "integer"
          },
          "season": {
            "description": "The game season this record counts toward, e.g. 2027. Absent: before the 2027 season.",
            "maxLength": 8,
            "type": "string"
          },
          "snoozedUntil": {
            "description": "Suppress quest nudges until this time",
            "format": "datetime",
            "type": "string"
          },
          "updatedAt": {
            "description": "When this state snapshot was taken",
            "format": "datetime",
            "type": "string"
          },
          "visitedRoutes": {
            "description": "Object mapping visited app routes (e.g. '/chronicle') to the ISO datetime of the first tracked visit. Drives route-based quest detection.",
            "type": "unknown"
          }
        },
        "required": [
          "updatedAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "net.anisota.fieldwork.state",
  "lexicon": 1
}
