# dev.knotless.pack

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

✓ This is the authoritative definition for this NSID.

## Description

A self-contained git packfile: every object reachable from `tips` and not from `bases`.

## Links

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

## Definitions

### `dev.knotless.pack`

**Type**: `record`

Keyed `<repo key>.<tid>`, so a newest-first listing from the cursor `<repo key>/` walks one repository's packs in push order. Never updated; compaction writes one pack superseding many and deletes them in the same applyWrites.

**Key**: `any`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `bases` | `array` | No | Hex object IDs of objects the pack's history needs and does not hold. |
| `createdAt` | `string` (datetime) | Yes |  |
| `data` | `bytes` | No | The pack itself, when small. Exactly one of data and parts is present. Inline so small pushes cost no blob uploads, which hosts rate-limit far more tightly than record writes. |
| `objects` | `integer` | Yes | Objects in the pack. |
| `parts` | `array` | No | The pack, split over blobs in order. |
| `repo` | `string` (tid) | Yes | The `key` of the dev.knotless.repo this pack belongs to. |
| `size` | `integer` | Yes | Bytes in the pack. |
| `supersedes` | `array` | No | Record keys of the dev.knotless.pack records this one replaced. |
| `tips` | `array` | Yes | Hex object IDs the pack holds everything reachable from, short of `bases`. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Keyed `<repo key>.<tid>`, so a newest-first listing from the cursor `<repo key>/` walks one repository's packs in push order. Never updated; compaction writes one pack superseding many and deletes them in the same applyWrites.",
      "key": "any",
      "record": {
        "properties": {
          "bases": {
            "description": "Hex object IDs of objects the pack's history needs and does not hold.",
            "items": {
              "maxLength": 64,
              "minLength": 40,
              "type": "string"
            },
            "type": "array"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "data": {
            "description": "The pack itself, when small. Exactly one of data and parts is present. Inline so small pushes cost no blob uploads, which hosts rate-limit far more tightly than record writes.",
            "maxLength": 262144,
            "type": "bytes"
          },
          "objects": {
            "description": "Objects in the pack.",
            "minimum": 1,
            "type": "integer"
          },
          "parts": {
            "description": "The pack, split over blobs in order.",
            "items": {
              "accept": [
                "application/x-git-packed-objects"
              ],
              "type": "blob"
            },
            "type": "array"
          },
          "repo": {
            "description": "The `key` of the dev.knotless.repo this pack belongs to.",
            "format": "tid",
            "type": "string"
          },
          "size": {
            "description": "Bytes in the pack.",
            "minimum": 12,
            "type": "integer"
          },
          "supersedes": {
            "description": "Record keys of the dev.knotless.pack records this one replaced.",
            "items": {
              "format": "record-key",
              "type": "string"
            },
            "type": "array"
          },
          "tips": {
            "description": "Hex object IDs the pack holds everything reachable from, short of `bases`.",
            "items": {
              "maxLength": 64,
              "minLength": 40,
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "repo",
          "tips",
          "size",
          "objects",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "description": "A self-contained git packfile: every object reachable from `tips` and not from `bases`.",
  "id": "dev.knotless.pack",
  "lexicon": 1
}
```
