# app.starrysky.streak.checkin

> 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.checkin)
- [Documentation](https://lexicon.garden/lexicon/did:plc:pdftantb2wpnczkhusrixbpy/app.starrysky.streak.checkin/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:pdftantb2wpnczkhusrixbpy/app.starrysky.streak.checkin/examples)

## Definitions

### `app.starrysky.streak.checkin`

**Type**: `record`

A verifiable check-in event for a specific service streak.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `note` | `string` | No | A short note or comment about this check-in (e.g. 'Ran 5km'). |
| `prev` | `string` (cid) | No | CID of the previous check-in record in the sequence. |
| `value` | `integer` | No | An optional numeric metric associated with this check-in (e.g. distance, weight, count). |
| `policy` | `string` (at-uri) | Yes | The URI of the policy governing this streak. |
| `subject` | `string` | Yes | The name of the habit (e.g., 'Daily Coding', 'Morning Run'). |
| `witness` | `ref` → `lex:app.starrysky.streak.checkin#witness` | No | Optional third-party attestation of the event. |
| `createdAt` | `string` (datetime) | Yes | Timestamp when this check-in record was created. |
| `streakDate` | `string` (datetime) | Yes | The explicit date this check-in is for (YYYY-MM-DD). Useful for handling timezone boundaries manually. |
| `freezeDates` | `array` | No | Explicit dates (YYYY-MM-DD) being covered by streak freezes in this check-in. |
| `inventoryRef` | `string` (cid) | No | CID of the inventory record associated with this check-in. |
| `originService` | `string` | Yes | The NSID of the service where the streak event occurred. |
| `streakSequence` | `integer` | Yes | The current total count of successful intervals/days in this specific streak. |
| `checkinsInInterval` | `integer` | No | Progress within the current cadence interval (e.g., 2 if this is the second check-in of the week). |

### `app.starrysky.streak.checkin#witness`

**Type**: `object`

A cryptographic attestation from a third-party service.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | The DID of the witness service. |
| `sig` | `bytes` | Yes | The cryptographic signature of the witness. |
| `subject` | `string` (cid) | Yes | The CID of the record being witnessed. |

## Raw Schema

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