{
"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
}