# app.starrysky.streak.policy

> Published by [starrysky.app](https://lexicon.garden/identity/did:plc:pdftantb2wpnczkhusrixbpy)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:pdftantb2wpnczkhusrixbpy/app.starrysky.streak.policy)
- [Documentation](https://lexicon.garden/lexicon/did:plc:pdftantb2wpnczkhusrixbpy/app.starrysky.streak.policy/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:pdftantb2wpnczkhusrixbpy/app.starrysky.streak.policy/examples)

## Definitions

### `app.starrysky.streak.policy`

**Type**: `record`

The authority record defining the rules for a Starrysky verified streak.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes | Human-readable name for this streak (e.g., 'Daily Coding'). |
| `cadence` | `object` | Yes |  |
| `createdAt` | `string` (datetime) | Yes | Timestamp when this policy record was created. |
| `maxFreezes` | `integer` | No | The maximum number of freezes a user can bank at one time. |
| `milestones` | `array` | No | Explicit streak counts that trigger a celebration or reward. |
| `originService` | `string` | No | Optional: The NSID of the service being tracked for automated check-ins (e.g., app.bsky.feed.post). |
| `allowedGranters` | `array` | No | An array of DIDs authorized to grant extra streak freezes to the user. |
| `startingFreezes` | `integer` | No | Number of freezes granted to the user when they first start the streak. |
| `allowedWitnesses` | `array` | No | An array of DIDs authorized to sign attestations for this policy. Required if witnessed. |
| `verificationType` | `string` | Yes | Whether this streak requires a third-party cryptographic signature. |
| `gracePeriodIntervals` | `integer` | No | The number of intervals a user can skip before needing to use a freeze or breaking their streak. |
| `intervalsToEarnFreeze` | `integer` | Yes | Number of successful intervals required to earn 1 freeze. |
| `includeFreezesInStreak` | `boolean` | No | If true, frozen intervals are included in the streak sequence count. |
| `freezesGrantedAtMilestone` | `integer` | No | Number of freezes to grant when reaching a milestone (explicit or recurring). |
| `recurringMilestoneInterval` | `integer` | No | Interval for repeating milestones (e.g., every 100 days) after explicit milestones are passed. |

## Raw Schema

```json
{
  "id": "app.starrysky.streak.policy",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "name",
          "verificationType",
          "cadence",
          "intervalsToEarnFreeze",
          "createdAt"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "description": "Human-readable name for this streak (e.g., 'Daily Coding')."
          },
          "cadence": {
            "type": "object",
            "required": [
              "type",
              "requiredCheckinsPerInterval"
            ],
            "properties": {
              "type": {
                "type": "string",
                "description": "The time window during which the required check-ins must occur.",
                "knownValues": [
                  "daily",
                  "weekly",
                  "monthly",
                  "quarterly",
                  "yearly"
                ]
              },
              "intervalResetDay": {
                "type": "integer",
                "description": "For weekly: 0-6 (Sun-Sat). For monthly: 1-31. Defines when the window rolls over."
              },
              "requiredCheckinsPerInterval": {
                "type": "integer",
                "default": 1,
                "description": "Number of check-ins required within the interval to maintain the streak."
              }
            }
          },
          "createdAt": {
            "type": "string",
            "format": "datetime",
            "description": "Timestamp when this policy record was created."
          },
          "maxFreezes": {
            "type": "integer",
            "default": 3,
            "description": "The maximum number of freezes a user can bank at one time."
          },
          "milestones": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Explicit streak counts that trigger a celebration or reward."
          },
          "originService": {
            "type": "string",
            "description": "Optional: The NSID of the service being tracked for automated check-ins (e.g., app.bsky.feed.post)."
          },
          "allowedGranters": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "did"
            },
            "description": "An array of DIDs authorized to grant extra streak freezes to the user."
          },
          "startingFreezes": {
            "type": "integer",
            "default": 0,
            "description": "Number of freezes granted to the user when they first start the streak."
          },
          "allowedWitnesses": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "did"
            },
            "description": "An array of DIDs authorized to sign attestations for this policy. Required if witnessed."
          },
          "verificationType": {
            "type": "string",
            "description": "Whether this streak requires a third-party cryptographic signature.",
            "knownValues": [
              "self-reported",
              "witnessed"
            ]
          },
          "gracePeriodIntervals": {
            "type": "integer",
            "default": 0,
            "description": "The number of intervals a user can skip before needing to use a freeze or breaking their streak."
          },
          "intervalsToEarnFreeze": {
            "type": "integer",
            "description": "Number of successful intervals required to earn 1 freeze."
          },
          "includeFreezesInStreak": {
            "type": "boolean",
            "default": false,
            "description": "If true, frozen intervals are included in the streak sequence count."
          },
          "freezesGrantedAtMilestone": {
            "type": "integer",
            "default": 0,
            "description": "Number of freezes to grant when reaching a milestone (explicit or recurring)."
          },
          "recurringMilestoneInterval": {
            "type": "integer",
            "description": "Interval for repeating milestones (e.g., every 100 days) after explicit milestones are passed."
          }
        }
      },
      "description": "The authority record defining the rules for a Starrysky verified streak."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
