# email.atmos.messageStateRevision

> ALPHA. Immutable create-only causal revision for one logical Comail message. Writers reference every observed head and atomically create a deterministic email.atmos.messageStateOperation claim. Reducers validate a commit-bound complete graph, resolve independent fields by revision height then unsigned UTF-8 operation-ID order, and treat tombstone as irreversible.

- Kind: record
- Record key: any
- Authority: atmos.email
- Lexicon: 1
- Published by [comail.at](https://lexicon.garden/identity/did:plc:yu6rmwoemqfnmsdkljyvmuhg), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:yu6rmwoemqfnmsdkljyvmuhg/email.atmos.messageStateRevision)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:yu6rmwoemqfnmsdkljyvmuhg/email.atmos.messageStateRevision/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:yu6rmwoemqfnmsdkljyvmuhg/email.atmos.messageStateRevision/analytics)

## Record (`email.atmos.messageStateRevision`)

Type: record · key any

### Properties

- `createdAt` (string · datetime, required): Audit metadata only. Reducers never use client time for conflict ordering.
- `deletePending` (boolean): Per-field assignment for IMAP Deleted state before expunge. This is distinct from the irreversible canonical tombstone.
- `keywords` (array)
  - Constraints: maxLength: 128
  - `items` (ref)
    - Reference: `#keywordAssignment`
- `logicalMessageId` (string, required)
  - Constraints: minLength: 71, maxLength: 71
- `mailboxIds` (array)
  - Constraints: minLength: 1, maxLength: 32
  - `items` (string)
    - Constraints: minLength: 71, maxLength: 71
- `merge` (boolean): True only for a parent-only causal-head join with no field assignments.
- `operationId` (string, required)
  - Constraints: minLength: 1, maxLength: 128
- `parents` (array, required)
  - Constraints: maxLength: 64
  - `items` (string)
    - Constraints: minLength: 70, maxLength: 70
- `revision` (integer, required)
  - Constraints: minimum: 1, maximum: 9007199254740991
- `tombstone` (boolean): Grow-only irreversible logical deletion. False and resurrection are rejected by the authority reducer.
- `version` (string): Selected immutable email.atmos.message record key for this logical message.
  - Constraints: minLength: 71, maxLength: 71

## #keywordAssignment (`email.atmos.messageStateRevision#keywordAssignment`)

Type: object

### Properties

- `name` (string, required)
  - Constraints: minLength: 1, maxLength: 255
- `present` (boolean, required)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "keywordAssignment": {
      "properties": {
        "name": {
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "present": {
          "type": "boolean"
        }
      },
      "required": [
        "name",
        "present"
      ],
      "type": "object"
    },
    "main": {
      "description": "ALPHA. Immutable create-only causal revision for one logical Comail message. Writers reference every observed head and atomically create a deterministic email.atmos.messageStateOperation claim. Reducers validate a commit-bound complete graph, resolve independent fields by revision height then unsigned UTF-8 operation-ID order, and treat tombstone as irreversible.",
      "key": "any",
      "record": {
        "properties": {
          "createdAt": {
            "description": "Audit metadata only. Reducers never use client time for conflict ordering.",
            "format": "datetime",
            "type": "string"
          },
          "deletePending": {
            "description": "Per-field assignment for IMAP Deleted state before expunge. This is distinct from the irreversible canonical tombstone.",
            "type": "boolean"
          },
          "keywords": {
            "items": {
              "ref": "#keywordAssignment",
              "type": "ref"
            },
            "maxLength": 128,
            "type": "array"
          },
          "logicalMessageId": {
            "maxLength": 71,
            "minLength": 71,
            "type": "string"
          },
          "mailboxIds": {
            "items": {
              "maxLength": 71,
              "minLength": 71,
              "type": "string"
            },
            "maxLength": 32,
            "minLength": 1,
            "type": "array"
          },
          "merge": {
            "description": "True only for a parent-only causal-head join with no field assignments.",
            "type": "boolean"
          },
          "operationId": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "parents": {
            "items": {
              "maxLength": 70,
              "minLength": 70,
              "type": "string"
            },
            "maxLength": 64,
            "type": "array"
          },
          "revision": {
            "maximum": 9007199254740991,
            "minimum": 1,
            "type": "integer"
          },
          "tombstone": {
            "description": "Grow-only irreversible logical deletion. False and resurrection are rejected by the authority reducer.",
            "type": "boolean"
          },
          "version": {
            "description": "Selected immutable email.atmos.message record key for this logical message.",
            "maxLength": 71,
            "minLength": 71,
            "type": "string"
          }
        },
        "required": [
          "logicalMessageId",
          "operationId",
          "parents",
          "revision",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "email.atmos.messageStateRevision",
  "lexicon": 1
}
```
