# dev.knotless.claim

> Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk)

✓ This is the authoritative definition for this NSID.

## Description

The move of a ref off one generation: its key is the compare-and-swap, its body the reflog entry.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.claim)
- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.claim/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.claim/examples)

## Definitions

### `dev.knotless.claim`

**Type**: `record`

Keyed `<repo key>.<ref hash>.<generation moved from>`. Two writers that read the same generation both try to create the same key, and the PDS accepts only the first; the dev.knotless.ref update travelling with it in the same applyWrites is refused along with it. Never updated.

**Key**: `any`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdAt` | `string` (datetime) | Yes |  |
| `from` | `string` | No | The hex object ID the ref pointed at before; absent when the ref is new. |
| `generation` | `integer` | Yes | The generation the ref moved from. |
| `name` | `string` | Yes | The full ref name, such as refs/heads/main. |
| `pack` | `string` (record-key) | No | The record key of the dev.knotless.pack written with the move, if any. |
| `pusher` | `string` (did) | No | The account that moved the ref, when not the repository's owner: a collaborator or runner pushing through the gateway, which sets it from the caller's verified service token. Readers credit it only while the repository names it among its collaborators or runners. |
| `repo` | `string` (tid) | Yes | The `key` of the dev.knotless.repo the ref belongs to. |
| `to` | `string` | No | The hex object ID the ref points at after; absent when the ref is deleted. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Keyed `<repo key>.<ref hash>.<generation moved from>`. Two writers that read the same generation both try to create the same key, and the PDS accepts only the first; the dev.knotless.ref update travelling with it in the same applyWrites is refused along with it. Never updated.",
      "key": "any",
      "record": {
        "properties": {
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "from": {
            "description": "The hex object ID the ref pointed at before; absent when the ref is new.",
            "maxLength": 64,
            "minLength": 40,
            "type": "string"
          },
          "generation": {
            "description": "The generation the ref moved from.",
            "minimum": 0,
            "type": "integer"
          },
          "name": {
            "description": "The full ref name, such as refs/heads/main.",
            "maxLength": 1024,
            "type": "string"
          },
          "pack": {
            "description": "The record key of the dev.knotless.pack written with the move, if any.",
            "format": "record-key",
            "type": "string"
          },
          "pusher": {
            "description": "The account that moved the ref, when not the repository's owner: a collaborator or runner pushing through the gateway, which sets it from the caller's verified service token. Readers credit it only while the repository names it among its collaborators or runners.",
            "format": "did",
            "type": "string"
          },
          "repo": {
            "description": "The `key` of the dev.knotless.repo the ref belongs to.",
            "format": "tid",
            "type": "string"
          },
          "to": {
            "description": "The hex object ID the ref points at after; absent when the ref is deleted.",
            "maxLength": 64,
            "minLength": 40,
            "type": "string"
          }
        },
        "required": [
          "repo",
          "name",
          "generation",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "description": "The move of a ref off one generation: its key is the compare-and-swap, its body the reflog entry.",
  "id": "dev.knotless.claim",
  "lexicon": 1
}
```
