# app.thesocialwire.readStateDefs

> Published by [samclemente.me](https://lexicon.garden/identity/did:plc:qy5pluw2bsuq2x6albsgkvx3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:qy5pluw2bsuq2x6albsgkvx3/app.thesocialwire.readStateDefs)
- [Documentation](https://lexicon.garden/lexicon/did:plc:qy5pluw2bsuq2x6albsgkvx3/app.thesocialwire.readStateDefs/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:qy5pluw2bsuq2x6albsgkvx3/app.thesocialwire.readStateDefs/examples)

## Definitions

### `app.thesocialwire.readStateDefs#boundary`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdAt` | `string` (datetime) | Yes |  |
| `entryId` | `string` | No |  |
| `scope` | `ref` → `#scope` | Yes |  |

### `app.thesocialwire.readStateDefs#calendar`

**Type**: `object`

Exact age selection audit metadata. Reference date is YYYY-MM-DD in the IANA timezone; cutoff is resolved UTC. Matching uses exact subject IDs, not recomputed calendar dates.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cutoff` | `string` (datetime) | Yes |  |
| `referenceDate` | `string` | Yes |  |
| `timeZone` | `string` | Yes |  |

### `app.thesocialwire.readStateDefs#fragment`

**Type**: `object`

Surviving semantic fragment with its original whole-intent digest. Device identity/counter must appear together; otherwise a matching finite legacy receipt is required.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `actedAt` | `string` (datetime) | Yes |  |
| `actionId` | `string` | Yes |  |
| `boundaries` | `array` | No |  |
| `calendar` | `ref` → `#calendar` | No |  |
| `deviceCounter` | `integer` | No |  |
| `deviceId` | `string` | No |  |
| `fragment` | `boolean` | Yes |  |
| `intentHash` | `string` | Yes |  |
| `selection` | `string` | Yes |  |
| `sequence` | `integer` | Yes |  |
| `state` | `string` | Yes |  |
| `subjectUris` | `array` | No |  |

### `app.thesocialwire.readStateDefs#operation`

**Type**: `object`

Public read-history operation. Exactly one nonempty boundaries or subjectUris array must match selection. Sequence is allocated using manifest CAS, never device time. Splits of one action share sequence, actionId, state and actedAt.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `actedAt` | `string` (datetime) | Yes |  |
| `actionId` | `string` | Yes |  |
| `boundaries` | `array` | No |  |
| `calendar` | `ref` → `#calendar` | No |  |
| `selection` | `string` | Yes |  |
| `sequence` | `integer` | Yes |  |
| `state` | `string` | Yes |  |
| `subjectUris` | `array` | No |  |

### `app.thesocialwire.readStateDefs#receipt`

**Type**: `object`

A devices chunk requires deviceId, committedCounter and prefixHash only. A legacyReceipts chunk requires actionId, originalSequence and originalIntentHash only. Version-aware clients and projectors enforce the complete disjoint shape. Receipts never execute read actions.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `actionId` | `string` | No |  |
| `committedCounter` | `integer` | No |  |
| `deviceId` | `string` | No |  |
| `originalIntentHash` | `string` | No |  |
| `originalSequence` | `integer` | No |  |
| `prefixHash` | `string` | No |  |

### `app.thesocialwire.readStateDefs#scope`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `authorDid` | `string` (did) | Yes |  |
| `publicationId` | `string` | Yes |  |
| `publicationSiteKeys` | `array` | Yes |  |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "boundary": {
      "properties": {
        "createdAt": {
          "format": "datetime",
          "maxLength": 2048,
          "type": "string"
        },
        "entryId": {
          "maxLength": 2048,
          "type": "string"
        },
        "scope": {
          "ref": "#scope",
          "type": "ref"
        }
      },
      "required": [
        "scope",
        "createdAt"
      ],
      "type": "object"
    },
    "calendar": {
      "description": "Exact age selection audit metadata. Reference date is YYYY-MM-DD in the IANA timezone; cutoff is resolved UTC. Matching uses exact subject IDs, not recomputed calendar dates.",
      "properties": {
        "cutoff": {
          "format": "datetime",
          "type": "string"
        },
        "referenceDate": {
          "maxLength": 10,
          "type": "string"
        },
        "timeZone": {
          "maxLength": 128,
          "type": "string"
        }
      },
      "required": [
        "cutoff",
        "timeZone",
        "referenceDate"
      ],
      "type": "object"
    },
    "fragment": {
      "description": "Surviving semantic fragment with its original whole-intent digest. Device identity/counter must appear together; otherwise a matching finite legacy receipt is required.",
      "properties": {
        "actedAt": {
          "format": "datetime",
          "maxLength": 2048,
          "type": "string"
        },
        "actionId": {
          "maxLength": 128,
          "type": "string"
        },
        "boundaries": {
          "items": {
            "ref": "#boundary",
            "type": "ref"
          },
          "maxLength": 128,
          "type": "array"
        },
        "calendar": {
          "ref": "#calendar",
          "type": "ref"
        },
        "deviceCounter": {
          "maximum": 9007199254740991,
          "minimum": 1,
          "type": "integer"
        },
        "deviceId": {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        },
        "fragment": {
          "const": true,
          "type": "boolean"
        },
        "intentHash": {
          "maxLength": 64,
          "minLength": 64,
          "type": "string"
        },
        "selection": {
          "enum": [
            "boundaries",
            "exact"
          ],
          "maxLength": 10,
          "type": "string"
        },
        "sequence": {
          "maximum": 9007199254740991,
          "minimum": 1,
          "type": "integer"
        },
        "state": {
          "enum": [
            "read",
            "unread"
          ],
          "maxLength": 6,
          "type": "string"
        },
        "subjectUris": {
          "items": {
            "maxLength": 2048,
            "type": "string"
          },
          "maxLength": 256,
          "type": "array"
        }
      },
      "required": [
        "actionId",
        "sequence",
        "state",
        "actedAt",
        "selection",
        "fragment",
        "intentHash"
      ],
      "type": "object"
    },
    "operation": {
      "description": "Public read-history operation. Exactly one nonempty boundaries or subjectUris array must match selection. Sequence is allocated using manifest CAS, never device time. Splits of one action share sequence, actionId, state and actedAt.",
      "properties": {
        "actedAt": {
          "format": "datetime",
          "maxLength": 2048,
          "type": "string"
        },
        "actionId": {
          "maxLength": 128,
          "type": "string"
        },
        "boundaries": {
          "items": {
            "ref": "#boundary",
            "type": "ref"
          },
          "maxLength": 128,
          "type": "array"
        },
        "calendar": {
          "ref": "#calendar",
          "type": "ref"
        },
        "selection": {
          "enum": [
            "boundaries",
            "exact"
          ],
          "maxLength": 10,
          "type": "string"
        },
        "sequence": {
          "maximum": 9007199254740991,
          "minimum": 1,
          "type": "integer"
        },
        "state": {
          "enum": [
            "read",
            "unread"
          ],
          "maxLength": 6,
          "type": "string"
        },
        "subjectUris": {
          "items": {
            "maxLength": 2048,
            "type": "string"
          },
          "maxLength": 256,
          "type": "array"
        }
      },
      "required": [
        "actionId",
        "sequence",
        "state",
        "actedAt",
        "selection"
      ],
      "type": "object"
    },
    "receipt": {
      "description": "A devices chunk requires deviceId, committedCounter and prefixHash only. A legacyReceipts chunk requires actionId, originalSequence and originalIntentHash only. Version-aware clients and projectors enforce the complete disjoint shape. Receipts never execute read actions.",
      "properties": {
        "actionId": {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        },
        "committedCounter": {
          "maximum": 9007199254740991,
          "minimum": 0,
          "type": "integer"
        },
        "deviceId": {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        },
        "originalIntentHash": {
          "maxLength": 64,
          "minLength": 64,
          "type": "string"
        },
        "originalSequence": {
          "maximum": 9007199254740991,
          "minimum": 1,
          "type": "integer"
        },
        "prefixHash": {
          "maxLength": 64,
          "minLength": 64,
          "type": "string"
        }
      },
      "type": "object"
    },
    "scope": {
      "properties": {
        "authorDid": {
          "format": "did",
          "maxLength": 2048,
          "type": "string"
        },
        "publicationId": {
          "maxLength": 2048,
          "type": "string"
        },
        "publicationSiteKeys": {
          "items": {
            "maxLength": 2048,
            "type": "string"
          },
          "maxLength": 128,
          "type": "array"
        }
      },
      "required": [
        "publicationId",
        "authorDid",
        "publicationSiteKeys"
      ],
      "type": "object"
    }
  },
  "id": "app.thesocialwire.readStateDefs",
  "lexicon": 1
}
```
