# dev.knotless.label

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

✓ This is the authoritative definition for this NSID.

## Description

The labels one account puts on a pull or issue, from those its repository defines.

## Links

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

## Definitions

### `dev.knotless.label#entry`

**Type**: `object`

A label set, or taken off, at a time.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes | The label, by its name among the repository's `labels`. |
| `removed` | `boolean` | No | Taken off, rather than set. |
| `setAt` | `string` (datetime) | Yes | When it was set or taken off. Readers pass over one later than their own clock by more than a few minutes, until it is not. |

### `dev.knotless.label#judgment`

**Type**: `object`

What a triager judged in choosing its labels, so it judges again only when that changes.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | No | The version of the pull or issue it read. |
| `model` | `string` | No | What chose them, as a model's name and version. |
| `reason` | `string` | No | Why, in a sentence or two, for those who check its work. |

### `dev.knotless.label`

**Type**: `record`

Kept in the account of whoever labels, one per pull or issue, keyed `<repo key>.<hash of the subject's URI>` and rewritten as they change; for a private repository, in their repo inside its space. Readers honor it from the repository's owner and collaborators, and from its triagers for the scopes named, and only for labels the repository defines. Each label stands as the latest of everyone's entries for it says, by `setAt`; of a scope's exclusive labels, only the latest set stands.

**Key**: `any`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdAt` | `string` (datetime) | Yes |  |
| `judged` | `ref` → `#judgment` | No | For labels a triager chose, what it judged and how. |
| `labels` | `array` | Yes | One entry per label this account has set or taken off, the latest of each. |
| `repo` | `ref` → `dev.knotless.defs#repoRef` | Yes | The repository the pull or issue is on. |
| `subject` | `string` (at-uri) | Yes | The dev.knotless.pull or dev.knotless.issue labelled. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "entry": {
      "description": "A label set, or taken off, at a time.",
      "properties": {
        "name": {
          "description": "The label, by its name among the repository's `labels`.",
          "maxGraphemes": 50,
          "maxLength": 100,
          "type": "string"
        },
        "removed": {
          "description": "Taken off, rather than set.",
          "type": "boolean"
        },
        "setAt": {
          "description": "When it was set or taken off. Readers pass over one later than their own clock by more than a few minutes, until it is not.",
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "name",
        "setAt"
      ],
      "type": "object"
    },
    "judgment": {
      "description": "What a triager judged in choosing its labels, so it judges again only when that changes.",
      "properties": {
        "cid": {
          "description": "The version of the pull or issue it read.",
          "format": "cid",
          "type": "string"
        },
        "model": {
          "description": "What chose them, as a model's name and version.",
          "maxLength": 200,
          "type": "string"
        },
        "reason": {
          "description": "Why, in a sentence or two, for those who check its work.",
          "maxGraphemes": 500,
          "maxLength": 2000,
          "type": "string"
        }
      },
      "type": "object"
    },
    "main": {
      "description": "Kept in the account of whoever labels, one per pull or issue, keyed `<repo key>.<hash of the subject's URI>` and rewritten as they change; for a private repository, in their repo inside its space. Readers honor it from the repository's owner and collaborators, and from its triagers for the scopes named, and only for labels the repository defines. Each label stands as the latest of everyone's entries for it says, by `setAt`; of a scope's exclusive labels, only the latest set stands.",
      "key": "any",
      "record": {
        "properties": {
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "judged": {
            "description": "For labels a triager chose, what it judged and how.",
            "ref": "#judgment",
            "type": "ref"
          },
          "labels": {
            "description": "One entry per label this account has set or taken off, the latest of each.",
            "items": {
              "ref": "#entry",
              "type": "ref"
            },
            "maxLength": 200,
            "type": "array"
          },
          "repo": {
            "description": "The repository the pull or issue is on.",
            "ref": "dev.knotless.defs#repoRef",
            "type": "ref"
          },
          "subject": {
            "description": "The dev.knotless.pull or dev.knotless.issue labelled.",
            "format": "at-uri",
            "type": "string"
          }
        },
        "required": [
          "repo",
          "subject",
          "labels",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "description": "The labels one account puts on a pull or issue, from those its repository defines.",
  "id": "dev.knotless.label",
  "lexicon": 1
}
```
