# com.tomplanche.atkuzu.stats

> Published by [tomplanche.com](https://lexicon.garden/identity/did:plc:ybx6os5vaaksppbxwvqqciaf)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:ybx6os5vaaksppbxwvqqciaf/com.tomplanche.atkuzu.stats)
- [Documentation](https://lexicon.garden/lexicon/did:plc:ybx6os5vaaksppbxwvqqciaf/com.tomplanche.atkuzu.stats/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:ybx6os5vaaksppbxwvqqciaf/com.tomplanche.atkuzu.stats/examples)

## Definitions

### `com.tomplanche.atkuzu.stats`

**Type**: `record`

A single, mutable per-account streak/stats record, edited in place like a profile. It also doubles as atkuzu's declaration / signaling record: its presence signals that an account plays atkuzu, and its deletion signals opt-out. Created on first play, even before any stats accrue.

**Key**: `literal:self`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `currentStreak` | `integer` | No | Consecutive solved puzzles up to the most recent played puzzle. |
| `gamesPlayed` | `integer` | No | Total puzzles completed (solved or not). |
| `gamesWon` | `integer` | No | Total puzzles solved. |
| `lastPuzzleNumber` | `integer` | No | Puzzle number of the most recent completed puzzle, used to detect streak breaks. |
| `maxStreak` | `integer` | No | Longest streak ever achieved. |
| `test` | `boolean` | No | True if the current values reflect test writes only, not real completions. Since this record is a singleton (`self`), a real write always overwrites a test one and omits this field. |
| `updatedAt` | `string` (datetime) | Yes | When this record was last updated. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A single, mutable per-account streak/stats record, edited in place like a profile. It also doubles as atkuzu's declaration / signaling record: its presence signals that an account plays atkuzu, and its deletion signals opt-out. Created on first play, even before any stats accrue.",
      "key": "literal:self",
      "record": {
        "properties": {
          "currentStreak": {
            "description": "Consecutive solved puzzles up to the most recent played puzzle.",
            "minimum": 0,
            "type": "integer"
          },
          "gamesPlayed": {
            "description": "Total puzzles completed (solved or not).",
            "minimum": 0,
            "type": "integer"
          },
          "gamesWon": {
            "description": "Total puzzles solved.",
            "minimum": 0,
            "type": "integer"
          },
          "lastPuzzleNumber": {
            "description": "Puzzle number of the most recent completed puzzle, used to detect streak breaks.",
            "minimum": 1,
            "type": "integer"
          },
          "maxStreak": {
            "description": "Longest streak ever achieved.",
            "minimum": 0,
            "type": "integer"
          },
          "test": {
            "description": "True if the current values reflect test writes only, not real completions. Since this record is a singleton (`self`), a real write always overwrites a test one and omits this field.",
            "type": "boolean"
          },
          "updatedAt": {
            "description": "When this record was last updated.",
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "updatedAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "com.tomplanche.atkuzu.stats",
  "lexicon": 1
}
```
