{
  "lexicon": 1,
  "id": "net.bisks.kolpelor.roster",
  "defs": {
    "main": {
      "type": "record",
      "description": "A kolpelor player's current state: their bound party of pelora (each with its battle-driven evolution stage and equipped gear), how far up the gymnasion ladder they've climbed, Zeus's fortune (dug-up gold and unequipped gear), and (optionally) which homeland they last had open. One record per player, rkey always \"self\" (create-or-update via com.atproto.repo.putRecord — the same upsert-on-rkey pattern as sites/catspace's net.bisks.catspace.profile). Written by the player to their own repo on every party change, every gymnasion result, every dig, and every Wilds region switch. Read by kolpelor (https://kolpelor.bisks.net) two ways: the player's own client on load, to restore state across devices in place of (or alongside) localStorage; and, publicly and without auth, by any other player's client scanning their own SimCluster for moots' `region` — the Wilds panel's Ἴχνη (tracks) feature (see public/lib/records.js's getPublicRoster and public/app.js). PvP still re-derives an opponent's live battle team from their current SimCluster rather than trusting the `party` snapshot here — this record is durable personal state plus a lightweight, opt-in-by-playing presence signal, not a matchmaking index.",
      "key": "literal:self",
      "record": {
        "type": "object",
        "required": ["party", "wins", "losses", "ladderRank", "updatedAt"],
        "properties": {
          "party": {
            "type": "array",
            "maxLength": 6,
            "description": "The player's bound pelora, in party order. Each entry is a full snapshot (not just a DID) so the record is self-contained.",
            "items": {
              "type": "object",
              "required": ["did", "handle", "type", "species", "rarity", "hp", "atk", "def", "spd"],
              "properties": {
                "did": { "type": "string", "format": "did", "description": "DID of the Bluesky account this pelor was bound from." },
                "handle": { "type": "string" },
                "avatar": { "type": "string", "format": "uri" },
                "type": { "type": "string", "description": "One of the five mythic powers — see TYPES in public/lib/pelora.js (fire, water, mountain, wood, city)." },
                "species": { "type": "string" },
                "rarity": { "type": "string" },
                "hp": { "type": "integer" },
                "atk": { "type": "integer" },
                "def": { "type": "integer" },
                "spd": { "type": "integer" },
                "evoStage": { "type": "integer", "description": "0/1/2 evolution stage this pelor has climbed to via battle wins — see registerVictory in public/lib/roster.js. Optional; absent means \"whatever its rarity started at.\"" },
                "wins": { "type": "integer", "description": "Battles this specific pelor has fought in and survived on the winning side — every third evolves it a stage. Optional." },
                "equipped": { "type": "string", "description": "id of the enchanted gear item (see GEAR in public/lib/treasure.js) currently equipped on this pelor, if any. Optional." }
              }
            }
          },
          "wins": { "type": "integer", "description": "Total gymnasion + PvP wins." },
          "losses": { "type": "integer" },
          "ladderRank": { "type": "integer", "description": "Index into the gymnasion trainer ladder (public/lib/trainers.js) of the highest trainer beaten so far; 0 if none." },
          "aristos": { "type": "boolean", "description": "True once the full gymnasion ladder has been cleared — \"best of all,\" the Iliad 6.208 line the build brief quoted." },
          "region": { "type": "string", "description": "id of the homeland (see REGIONS in public/lib/pelora.js: wood/water/fire/mountain/city) the player last had the Wilds panel open on. Optional — absent for players who signed in before this field existed, or who have never opened Wilds signed in." },
          "gold": { "type": "integer", "description": "χρυσός earned from battle wins, dug up from the earth, sold at the merchants' stall, or begged from citizens (or lost to Zeus's doom) — see public/lib/treasure.js and app.js's endBattle/sellGear/begAlms. Optional; absent means 0." },
          "gear": { "type": "array", "items": { "type": "string" }, "description": "Unequipped enchanted gear item ids sitting in the player's inventory, dug up but not yet worn by any bound pelor. Optional." },
          "updatedAt": { "type": "string", "format": "datetime" }
        }
      }
    }
  }
}
