# bzh.herve.atmot.stats

> Published by [jeremy.herve.bzh](https://lexicon.garden/identity/did:plc:4i6hvdii3km3kbnj3losmwnt)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:4i6hvdii3km3kbnj3losmwnt/bzh.herve.atmot.stats)
- [Documentation](https://lexicon.garden/lexicon/did:plc:4i6hvdii3km3kbnj3losmwnt/bzh.herve.atmot.stats/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:4i6hvdii3km3kbnj3losmwnt/bzh.herve.atmot.stats/examples)

## Definitions

### `bzh.herve.atmot.stats`

**Type**: `record`

A single, mutable per-account streak/stats record, edited in place like a profile. It also doubles as AT Mot's declaration / signaling record: its presence signals that an account plays AT Mot, and its deletion signals opt-out. Listing this one collection across the network enumerates every AT Mot player, so it is created on first play even before any stats accrue.

**Key**: `literal:self`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `byLang` | `array` | No | Per-language statistics. Optional and possibly empty (e.g. on the first declaration write before any game completes). |
| `updatedAt` | `string` (datetime) | Yes | When this record was last updated. |

### `bzh.herve.atmot.stats#langStats`

**Type**: `object`

Streak and aggregate statistics for one language series.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `lang` | `string` (language) | Yes | BCP-47 language this block describes. |
| `gamesWon` | `integer` | No | Total puzzles solved in this language. |
| `maxStreak` | `integer` | No | Longest streak ever achieved in this language. |
| `gamesPlayed` | `integer` | No | Total puzzles completed (won or lost) in this language. |
| `currentStreak` | `integer` | No | Consecutive solved puzzles up to the most recent played puzzle. |
| `lastPuzzleNumber` | `integer` | No | Puzzle number of the most recent completed puzzle, used to detect streak breaks. |
| `guessDistribution` | `array` | No | Histogram of winning guess counts. Each element is an object (not a bare integer) so context can be added later without a schema V2. |

### `bzh.herve.atmot.stats#guessBucket`

**Type**: `object`

One bucket of the guess-count histogram.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `count` | `integer` | Yes | How many wins used exactly this many guesses. |
| `guesses` | `integer` | Yes | Number of guesses it took to win (1–6). |

## Raw Schema

```json
{
  "id": "bzh.herve.atmot.stats",
  "defs": {
    "main": {
      "key": "literal:self",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "updatedAt"
        ],
        "properties": {
          "byLang": {
            "type": "array",
            "items": {
              "ref": "#langStats",
              "type": "ref"
            },
            "description": "Per-language statistics. Optional and possibly empty (e.g. on the first declaration write before any game completes)."
          },
          "updatedAt": {
            "type": "string",
            "format": "datetime",
            "description": "When this record was last updated."
          }
        }
      },
      "description": "A single, mutable per-account streak/stats record, edited in place like a profile. It also doubles as AT Mot's declaration / signaling record: its presence signals that an account plays AT Mot, and its deletion signals opt-out. Listing this one collection across the network enumerates every AT Mot player, so it is created on first play even before any stats accrue."
    },
    "langStats": {
      "type": "object",
      "required": [
        "lang"
      ],
      "properties": {
        "lang": {
          "type": "string",
          "format": "language",
          "description": "BCP-47 language this block describes."
        },
        "gamesWon": {
          "type": "integer",
          "minimum": 0,
          "description": "Total puzzles solved in this language."
        },
        "maxStreak": {
          "type": "integer",
          "minimum": 0,
          "description": "Longest streak ever achieved in this language."
        },
        "gamesPlayed": {
          "type": "integer",
          "minimum": 0,
          "description": "Total puzzles completed (won or lost) in this language."
        },
        "currentStreak": {
          "type": "integer",
          "minimum": 0,
          "description": "Consecutive solved puzzles up to the most recent played puzzle."
        },
        "lastPuzzleNumber": {
          "type": "integer",
          "minimum": 1,
          "description": "Puzzle number of the most recent completed puzzle, used to detect streak breaks."
        },
        "guessDistribution": {
          "type": "array",
          "items": {
            "ref": "#guessBucket",
            "type": "ref"
          },
          "maxLength": 6,
          "description": "Histogram of winning guess counts. Each element is an object (not a bare integer) so context can be added later without a schema V2."
        }
      },
      "description": "Streak and aggregate statistics for one language series."
    },
    "guessBucket": {
      "type": "object",
      "required": [
        "guesses",
        "count"
      ],
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0,
          "description": "How many wins used exactly this many guesses."
        },
        "guesses": {
          "type": "integer",
          "maximum": 6,
          "minimum": 1,
          "description": "Number of guesses it took to win (1–6)."
        }
      },
      "description": "One bucket of the guess-count histogram."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
