# dev.knotless.repo

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

✓ This is the authoritative definition for this NSID.

## Description

A git repository hosted in this account: in its public repo, or, for a private repository, in a dev.knotless.space space keyed by the name.

## Links

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

## Definitions

### `dev.knotless.repo#agent`

**Type**: `object`

An account whose pulls are checked as they move, as code no one vouches for.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |

### `dev.knotless.repo#appview`

**Type**: `object`

An appview the owner lets keep an index of a private repository.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | The appview's service DID, as did:web:knotless.dev. |

### `dev.knotless.repo#collaborator`

**Type**: `object`

An account that may push to the repository.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |

### `dev.knotless.repo#label`

**Type**: `object`

A label pulls and issues may carry.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `color` | `string` | No | A hex color, as #d73a4a. |
| `description` | `string` | No | What the label means, for those who put it on. |
| `exclusive` | `boolean` | No | At most one of its scope's exclusive labels stands at a time, as priority/high and priority/low: setting one takes the others off. |
| `name` | `string` | Yes | Unique among the repository's labels. Up to its last `/`, if it has one, it names the label's scope, as kind/bug's is kind. |

### `dev.knotless.repo`

**Type**: `record`

Keyed by the repository's name, so a clone URL resolves with one getRecord. `key` prefixes the record keys of everything the repository holds; a rename writes a record under the new name with the same key, deletes the old one and leaves a dev.knotless.redirect under the old name.

**Key**: `any`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `agents` | `array` | No | Accounts, such as a coding agent, whose pulls the repository's runners check as they move, as they do a collaborator's, but as code no one vouches for: given no secrets, reading caches apart, and keeping nothing they write. An account named here counts as an agent even if it is a collaborator too. |
| `appviews` | `array` | No | Deprecated, and no longer read: knotless.dev indexes every private repository its members read there, named here or not. Was, for a private repository, the appviews its owner let keep an index of it. |
| `collaborators` | `array` | No | Accounts that may push. They push through a gateway the owner has delegated writes to, which checks this list. |
| `createdAt` | `string` (datetime) | Yes |  |
| `defaultBranch` | `string` | No | The branch HEAD points at, without refs/heads/. |
| `description` | `string` | No |  |
| `forkOf` | `ref` → `dev.knotless.defs#repoRef` | No | The repository this one was forked from. |
| `gateway` | `string` (did) | No | A gateway the owner has delegated writes to. Collaborators push and commit through it; it batches concurrent commits to a branch into one write. |
| `key` | `string` (tid) | Yes | Minted when the repository is created; never reused. The `repo` of its dev.knotless.ref, dev.knotless.claim and dev.knotless.pack records. |
| `labels` | `array` | No | The labels its pulls and issues may carry. The owner and collaborators put them on with dev.knotless.label records; readers show none but these. |
| `links` | `array` | No | Links shown on the repository's pages, in display order: its website first. |
| `name` | `string` | Yes | Equal to the record key. |
| `readers` | `array` | No | For a private repository, the accounts it is shared with to read but not to push: members of its space. An appview takes this as the owner's word that they may hear of what is said there. |
| `rules` | `array` | No | Protected branches. The gateway holds collaborators to them; the owner, who writes these records directly, is held only by their own client. |
| `runners` | `array` | No | Accounts that run the repository's workflows. Readers show the dev.knotless.check records these accounts write about the repository, and no one else's. |
| `transfer` | `ref` → `dev.knotless.defs#repoRef` | No | Where the owner has offered to move the repository: a record in another account, named before it exists. Once that account holds a dev.knotless.repo there whose `transferredFrom` names this one, the repository has moved, and readers follow. |
| `transferredFrom` | `ref` → `dev.knotless.defs#repoRef` | No | The repository this one was moved from. Readers count records naming that one as naming this one, if its owner agreed: its `transfer`, or the redirect left in its place, leads here. |
| `triagers` | `array` | No | Accounts, such as a triage bot, whose dev.knotless.label records readers honor for the scopes named, and below anyone's who labels as the owner or a collaborator. |

### `dev.knotless.repo#reader`

**Type**: `object`

An account a private repository is shared with to read.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |

### `dev.knotless.repo#reviews`

**Type**: `object`

The reviews a protected branch asks of a pull before it merges, counted from those who may write to the repository: its owner and collaborators. A review is a dev.knotless.comment with a verdict, and each reviewer's newest one stands. A standing request for changes from one of them blocks the merge. A reader that finds a field here it does not know merges into the branch only once it knows it, so a rule is never held more loosely than it was written.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `approvals` | `integer` | No | How many approvals the pull needs, from accounts other than its author. Absent is 0. |
| `codeOwners` | `boolean` | No | Each path the pull changes that the CODEOWNERS file on the target branch gives owners needs an approval from one of them. Absent is false. |
| `dismissStale` | `boolean` | No | Only an approval of the pull's head as it is now counts: one of an earlier head no longer does. Absent is false, and any standing approval counts. |

### `dev.knotless.repo#rule`

**Type**: `object`

A protected branch: through a gateway it only moves forward and is never deleted, and, as its rule says, takes no merge commits, takes pulls only through the merge queue, or takes a pull only once it is reviewed.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `branch` | `string` | Yes | The branch, without refs/heads/. |
| `history` | `string` | No | `linear`: the branch takes no merge commits, so pulls merge into it by squashing. `merges`: it takes them. Absent, or a value a reader does not know, is read as `linear`, so a rule is never held more loosely than it was written. |
| `queue` | `boolean` | No | Pulls into this branch land only through the merge queue: a merge queues them instead, unless the owner forces it, and through a gateway the branch moves for no one but the owner and the runner that lands the queue. Absent is false. |
| `reviews` | `ref` → `#reviews` | No | The reviews a pull needs before it merges into this branch. Absent, none. |

### `dev.knotless.repo#runner`

**Type**: `object`

An account whose dev.knotless.check records about the repository readers trust.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |

### `dev.knotless.repo#scope`

**Type**: `object`

A scope of labels a triager may put on.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes | As kind is kind/bug's: a label's name up to its last `/`. |

### `dev.knotless.repo#triager`

**Type**: `object`

An account that puts labels of some scopes on pulls and issues. Its labels give way to the owner's and collaborators', whenever they were set; an account named here counts as a triager even if it is a collaborator too.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `scopes` | `array` | No | The scopes of the labels it may put on. None, when absent. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "agent": {
      "description": "An account whose pulls are checked as they move, as code no one vouches for.",
      "properties": {
        "did": {
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    },
    "appview": {
      "description": "An appview the owner lets keep an index of a private repository.",
      "properties": {
        "did": {
          "description": "The appview's service DID, as did:web:knotless.dev.",
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    },
    "collaborator": {
      "description": "An account that may push to the repository.",
      "properties": {
        "did": {
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    },
    "label": {
      "description": "A label pulls and issues may carry.",
      "properties": {
        "color": {
          "description": "A hex color, as #d73a4a.",
          "maxLength": 7,
          "type": "string"
        },
        "description": {
          "description": "What the label means, for those who put it on.",
          "maxGraphemes": 200,
          "maxLength": 1000,
          "type": "string"
        },
        "exclusive": {
          "description": "At most one of its scope's exclusive labels stands at a time, as priority/high and priority/low: setting one takes the others off.",
          "type": "boolean"
        },
        "name": {
          "description": "Unique among the repository's labels. Up to its last `/`, if it has one, it names the label's scope, as kind/bug's is kind.",
          "maxGraphemes": 50,
          "maxLength": 100,
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "main": {
      "description": "Keyed by the repository's name, so a clone URL resolves with one getRecord. `key` prefixes the record keys of everything the repository holds; a rename writes a record under the new name with the same key, deletes the old one and leaves a dev.knotless.redirect under the old name.",
      "key": "any",
      "record": {
        "properties": {
          "agents": {
            "description": "Accounts, such as a coding agent, whose pulls the repository's runners check as they move, as they do a collaborator's, but as code no one vouches for: given no secrets, reading caches apart, and keeping nothing they write. An account named here counts as an agent even if it is a collaborator too.",
            "items": {
              "ref": "#agent",
              "type": "ref"
            },
            "maxLength": 32,
            "type": "array"
          },
          "appviews": {
            "description": "Deprecated, and no longer read: knotless.dev indexes every private repository its members read there, named here or not. Was, for a private repository, the appviews its owner let keep an index of it.",
            "items": {
              "ref": "#appview",
              "type": "ref"
            },
            "maxLength": 32,
            "type": "array"
          },
          "collaborators": {
            "description": "Accounts that may push. They push through a gateway the owner has delegated writes to, which checks this list.",
            "items": {
              "ref": "#collaborator",
              "type": "ref"
            },
            "maxLength": 1000,
            "type": "array"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "defaultBranch": {
            "description": "The branch HEAD points at, without refs/heads/.",
            "maxLength": 255,
            "type": "string"
          },
          "description": {
            "maxGraphemes": 300,
            "maxLength": 3000,
            "type": "string"
          },
          "forkOf": {
            "description": "The repository this one was forked from.",
            "ref": "dev.knotless.defs#repoRef",
            "type": "ref"
          },
          "gateway": {
            "description": "A gateway the owner has delegated writes to. Collaborators push and commit through it; it batches concurrent commits to a branch into one write.",
            "format": "did",
            "type": "string"
          },
          "key": {
            "description": "Minted when the repository is created; never reused. The `repo` of its dev.knotless.ref, dev.knotless.claim and dev.knotless.pack records.",
            "format": "tid",
            "type": "string"
          },
          "labels": {
            "description": "The labels its pulls and issues may carry. The owner and collaborators put them on with dev.knotless.label records; readers show none but these.",
            "items": {
              "ref": "#label",
              "type": "ref"
            },
            "maxLength": 200,
            "type": "array"
          },
          "links": {
            "description": "Links shown on the repository's pages, in display order: its website first.",
            "items": {
              "ref": "dev.knotless.defs#link",
              "type": "ref"
            },
            "maxLength": 5,
            "type": "array"
          },
          "name": {
            "description": "Equal to the record key.",
            "maxLength": 100,
            "type": "string"
          },
          "readers": {
            "description": "For a private repository, the accounts it is shared with to read but not to push: members of its space. An appview takes this as the owner's word that they may hear of what is said there.",
            "items": {
              "ref": "#reader",
              "type": "ref"
            },
            "maxLength": 1000,
            "type": "array"
          },
          "rules": {
            "description": "Protected branches. The gateway holds collaborators to them; the owner, who writes these records directly, is held only by their own client.",
            "items": {
              "ref": "#rule",
              "type": "ref"
            },
            "maxLength": 100,
            "type": "array"
          },
          "runners": {
            "description": "Accounts that run the repository's workflows. Readers show the dev.knotless.check records these accounts write about the repository, and no one else's.",
            "items": {
              "ref": "#runner",
              "type": "ref"
            },
            "maxLength": 32,
            "type": "array"
          },
          "transfer": {
            "description": "Where the owner has offered to move the repository: a record in another account, named before it exists. Once that account holds a dev.knotless.repo there whose `transferredFrom` names this one, the repository has moved, and readers follow.",
            "ref": "dev.knotless.defs#repoRef",
            "type": "ref"
          },
          "transferredFrom": {
            "description": "The repository this one was moved from. Readers count records naming that one as naming this one, if its owner agreed: its `transfer`, or the redirect left in its place, leads here.",
            "ref": "dev.knotless.defs#repoRef",
            "type": "ref"
          },
          "triagers": {
            "description": "Accounts, such as a triage bot, whose dev.knotless.label records readers honor for the scopes named, and below anyone's who labels as the owner or a collaborator.",
            "items": {
              "ref": "#triager",
              "type": "ref"
            },
            "maxLength": 32,
            "type": "array"
          }
        },
        "required": [
          "key",
          "name",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "reader": {
      "description": "An account a private repository is shared with to read.",
      "properties": {
        "did": {
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    },
    "reviews": {
      "description": "The reviews a protected branch asks of a pull before it merges, counted from those who may write to the repository: its owner and collaborators. A review is a dev.knotless.comment with a verdict, and each reviewer's newest one stands. A standing request for changes from one of them blocks the merge. A reader that finds a field here it does not know merges into the branch only once it knows it, so a rule is never held more loosely than it was written.",
      "properties": {
        "approvals": {
          "description": "How many approvals the pull needs, from accounts other than its author. Absent is 0.",
          "maximum": 10,
          "minimum": 0,
          "type": "integer"
        },
        "codeOwners": {
          "description": "Each path the pull changes that the CODEOWNERS file on the target branch gives owners needs an approval from one of them. Absent is false.",
          "type": "boolean"
        },
        "dismissStale": {
          "description": "Only an approval of the pull's head as it is now counts: one of an earlier head no longer does. Absent is false, and any standing approval counts.",
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "rule": {
      "description": "A protected branch: through a gateway it only moves forward and is never deleted, and, as its rule says, takes no merge commits, takes pulls only through the merge queue, or takes a pull only once it is reviewed.",
      "properties": {
        "branch": {
          "description": "The branch, without refs/heads/.",
          "maxLength": 255,
          "type": "string"
        },
        "history": {
          "description": "`linear`: the branch takes no merge commits, so pulls merge into it by squashing. `merges`: it takes them. Absent, or a value a reader does not know, is read as `linear`, so a rule is never held more loosely than it was written.",
          "knownValues": [
            "linear",
            "merges"
          ],
          "maxLength": 64,
          "type": "string"
        },
        "queue": {
          "description": "Pulls into this branch land only through the merge queue: a merge queues them instead, unless the owner forces it, and through a gateway the branch moves for no one but the owner and the runner that lands the queue. Absent is false.",
          "type": "boolean"
        },
        "reviews": {
          "description": "The reviews a pull needs before it merges into this branch. Absent, none.",
          "ref": "#reviews",
          "type": "ref"
        }
      },
      "required": [
        "branch"
      ],
      "type": "object"
    },
    "runner": {
      "description": "An account whose dev.knotless.check records about the repository readers trust.",
      "properties": {
        "did": {
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    },
    "scope": {
      "description": "A scope of labels a triager may put on.",
      "properties": {
        "name": {
          "description": "As kind is kind/bug's: a label's name up to its last `/`.",
          "maxLength": 100,
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "triager": {
      "description": "An account that puts labels of some scopes on pulls and issues. Its labels give way to the owner's and collaborators', whenever they were set; an account named here counts as a triager even if it is a collaborator too.",
      "properties": {
        "did": {
          "format": "did",
          "type": "string"
        },
        "scopes": {
          "description": "The scopes of the labels it may put on. None, when absent.",
          "items": {
            "ref": "#scope",
            "type": "ref"
          },
          "maxLength": 50,
          "type": "array"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    }
  },
  "description": "A git repository hosted in this account: in its public repo, or, for a private repository, in a dev.knotless.space space keyed by the name.",
  "id": "dev.knotless.repo",
  "lexicon": 1
}
```
