# Bundle Format: Orchard Street Parts

Each contribution occupies one Rung 1 text bundle slot at `parts/<id>/` (`a001` through `a030`), containing **exactly two plain UTF-8 files** (`part.gltf` and `part.json`) and at most **2 MiB (2,097,152 bytes)** in total. No extra files (such as `.html`, `.svg`, `.js`, or nested files) are permitted.

## Required files in `parts/<id>/`

1. **`part.gltf`** — A single self-contained glTF 2.0 JSON file (`asset.version: "2.0"`), parsed with strict duplicate-key rejection:
   - Every buffer MUST be embedded via a base64 data URI (`data:application/octet-stream;base64,...` or `data:application/gltf-buffer;base64,...`) whose decoded byte length equals `buffer.byteLength`.
   - Any external URI anywhere in the document — including inside `extras`, unknown keys, or spoofed root keys such as `"buffers[0]"` — is rejected. Only the real tree positions `buffers[i].uri` and `images[i].uri` may carry a `uri` property.
   - Total serialized bytes across `extras` and any unknown top-level or node keys is capped at **4,096 bytes**.
   - Only two glTF extensions are allowed:
     - `KHR_texture_transform`
     - `KHR_materials_emissive_strength`
     (`KHR_mesh_quantization` is excluded so the checker and offline browser loader decode identical unnormalized float32 `POSITION` accessors.)
   - Must declare **exactly one scene** (`scenes.length === 1`), at most 2,048 nodes, with every node reachable from `scenes[0].nodes` and no node having more than one parent.
   - Cameras, lights (`KHR_lights_punctual` or `lights`), skins, animations, and morph targets must not be present (empty arrays `[]` are accepted).
   - Every mesh primitive must use triangle topology (`mode: 4`), unnormalized `VEC3` float32 `POSITION` accessors (`componentType: 5126`), valid texture/sampler/material indices, and reference a valid **PBR metallic-roughness** material (`pbrMetallicRoughness` present; unlit or specular-glossiness materials are rejected).
   - Embedded images (via `data:image/png;base64,...`, `data:image/jpeg;base64,...`, or `bufferView` inside an embedded buffer) must be **PNG or JPEG only** and at most **1024 px** on each side (verified from image headers only).

2. **`part.json`** — Strict UTF-8 JSON metadata object (no duplicate keys; no control, bidi, or zero-width characters) with these exact five keys:

```json
{
  "title": "Corner Cast-Iron Kerb Bollards",
  "note": "Lathe-turned fluted cast-iron bollards with bronze collars, hex bolts, and bevelled granite plinth.",
  "licence": "CC-BY-4.0",
  "tool": "Blender",
  "tool_version": "5.3.0"
}
```

- `title`: single line, 3 to 100 characters.
- `note`: single line, 10 to 240 characters.
- `licence`: `"CC0-1.0"` or `"CC-BY-4.0"`.
- `tool`: single line, 2 to 60 characters (for example `"Blender"`).
- `tool_version`: single line, 1 to 40 characters (for example `"5.3.0"`).

The checker never executes or imports any file from a submission.

## Coordinate frame (103 Orchard Street, Manhattan)

- Units: **metres**, glTF standard **Y up**.
- **X** runs along the Orchard Street frontage (`0.00 m` south end to `20.34 m` Delancey corner).
- **Y** is elevation (`0.07 m` sidewalk top surface; `16.78 m` roof parapet).
- **Z** projects outward from the masonry facade (`0.00 m` masonry face, `0.0225 m` brick relief plane, `3.40 m` sidewalk curb edge).
- Blender uses Z up, so `tools/blender/export_part.py` provides `gltf_to_blender(x, y, z) -> (x, -z, y)` and exports with `export_yup=True`.

## Bundle path and direct-submit rules

- Relative paths inside `parts/<id>/` must be NFC-normalized ASCII (`[A-Za-z0-9._/-]`), at most 128 characters, with no dotfiles, no dot-directories, no leading hyphens, no symlinks, no executable mode bits (`100644` regular files only), and no case-colliding filenames.
- Direct-submit envelope (`POST /api/desk?action=submit&lease=<lease>`, `Content-Type: application/vnd.loopfunder.bundle+json`):

```json
{
  "format": "loopfunder-bundle-v1",
  "files": [
    { "path": "part.gltf", "content": "..." },
    { "path": "part.json", "content": "..." }
  ]
}
```

See [docs/QUALITY.md](./QUALITY.md) for tier triangle budgets, the not-blocky geometry floor, and calibration numbers.
