# dev.knotless.pack

> 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.

- Kind: record
- Record key: any
- Authority: knotless.dev
- Lexicon: 1
- Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.pack)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.pack/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.pack/analytics)

## Record (`dev.knotless.pack`)

Type: record · key any

### Properties

- `bases` (array): Hex object IDs of objects the pack's history needs and does not hold.
  - `items` (string)
    - Constraints: minLength: 40, maxLength: 64
- `createdAt` (string · datetime, required)
- `data` (bytes): 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.
  - Constraints: maxLength: 262144
- `objects` (integer, required): Objects in the pack.
  - Constraints: minimum: 1
- `parts` (array): The pack, split over blobs in order.
  - `items` (blob)
    - Constraints: accept: application/x-git-packed-objects
- `repo` (string · tid, required): The `key` of the dev.knotless.repo this pack belongs to.
- `size` (integer, required): Bytes in the pack.
  - Constraints: minimum: 12
- `supersedes` (array): Record keys of the dev.knotless.pack records this one replaced.
  - `items` (string · record-key)
- `tips` (array, required): Hex object IDs the pack holds everything reachable from, short of `bases`.
  - `items` (string)
    - Constraints: minLength: 40, maxLength: 64

## 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
}
```
