{
"id": "app.starrysky.streak.checkin",
"defs": {
"main": {
"key": "tid",
"type": "record",
"record": {
"type": "object",
"required": [
"originService",
"policy",
"subject",
"streakSequence",
"streakDate",
"createdAt"
],
"properties": {
"note": {
"type": "string",
"maxLength": 300,
"description": "A short note or comment about this check-in (e.g. 'Ran 5km')."
},
"prev": {
"type": "string",
"format": "cid",
"description": "CID of the previous check-in record in the sequence."
},
"value": {
"type": "integer",
"description": "An optional numeric metric associated with this check-in (e.g. distance, weight, count)."
},
"policy": {
"type": "string",
"format": "at-uri",
"description": "The URI of the policy governing this streak."
},
"subject": {
"type": "string",
"maxLength": 100,
"description": "The name of the habit (e.g., 'Daily Coding', 'Morning Run')."
},
"witness": {
"ref": "lex:app.starrysky.streak.checkin#witness",
"type": "ref",
"description": "Optional third-party attestation of the event."
},
"createdAt": {
"type": "string",
"format": "datetime",
"description": "Timestamp when this check-in record was created."
},
"streakDate": {
"type": "string",
"format": "datetime",
"description": "The explicit date this check-in is for (YYYY-MM-DD). Useful for handling timezone boundaries manually."
},
"freezeDates": {
"type": "array",
"items": {
"type": "string",
"format": "datetime"
},
"description": "Explicit dates (YYYY-MM-DD) being covered by streak freezes in this check-in."
},
"inventoryRef": {
"type": "string",
"format": "cid",
"description": "CID of the inventory record associated with this check-in."
},
"originService": {
"type": "string",
"description": "The NSID of the service where the streak event occurred."
},
"streakSequence": {
"type": "integer",
"minimum": 1,
"description": "The current total count of successful intervals/days in this specific streak."
},
"checkinsInInterval": {
"type": "integer",
"default": 1,
"description": "Progress within the current cadence interval (e.g., 2 if this is the second check-in of the week)."
}
}
},
"description": "A verifiable check-in event for a specific service streak."
},
"witness": {
"type": "object",
"required": [
"did",
"sig",
"subject"
],
"properties": {
"did": {
"type": "string",
"format": "did",
"description": "The DID of the witness service."
},
"sig": {
"type": "bytes",
"description": "The cryptographic signature of the witness."
},
"subject": {
"type": "string",
"format": "cid",
"description": "The CID of the record being witnessed."
}
},
"description": "A cryptographic attestation from a third-party service."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}